From 7ab5eb9508921d84b4b4ec84a59135d536da748e Mon Sep 17 00:00:00 2001 From: adev Date: Mon, 15 May 2017 20:47:59 +0200 Subject: Isolated tests Use https://github.com/dmaicher/doctrine-test-bundle to have test isolation. --- .../CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Wallabag/CoreBundle/Event') diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php index 3b4c4cf9..5e6af8cc 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php @@ -45,9 +45,8 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber public function preRemove(LifecycleEventArgs $args) { $entity = $args->getEntity(); - - if (!$this->doctrine->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver || - !$entity instanceof Entry) { + if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform + || !$entity instanceof Entry) { return; } -- cgit v1.2.3 From f808b01692a835673f328d7221ba8c212caa9b61 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Jul 2017 09:52:38 +0200 Subject: Add a real configuration for CS-Fixer --- .../CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php | 8 ++++---- .../CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php | 2 +- .../CoreBundle/Event/Subscriber/TablePrefixSubscriber.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Wallabag/CoreBundle/Event') diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php index 4ebe837b..1dd0a1a4 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php @@ -2,13 +2,13 @@ namespace Wallabag\CoreBundle\Event\Subscriber; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Doctrine\ORM\EntityManager; use Psr\Log\LoggerInterface; -use Wallabag\CoreBundle\Helper\DownloadImages; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\CoreBundle\Event\EntrySavedEvent; use Wallabag\CoreBundle\Event\EntryDeletedEvent; -use Doctrine\ORM\EntityManager; +use Wallabag\CoreBundle\Event\EntrySavedEvent; +use Wallabag\CoreBundle\Helper\DownloadImages; class DownloadImagesSubscriber implements EventSubscriberInterface { diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php index 5e6af8cc..9c1d8a1d 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php @@ -2,10 +2,10 @@ namespace Wallabag\CoreBundle\Event\Subscriber; +use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LifecycleEventArgs; use Wallabag\CoreBundle\Entity\Entry; -use Doctrine\Bundle\DoctrineBundle\Registry; /** * SQLite doesn't care about cascading remove, so we need to manually remove associated stuf for an Entry. diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 711c3bf8..35902654 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php @@ -39,12 +39,12 @@ class TablePrefixSubscriber implements EventSubscriber return; } - $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]); + $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; - $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix.$mappedTableName; + $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; } } } -- cgit v1.2.3 From 3ef055ced3d6ea0d2f15ba660602545f477e9c3c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 9 Oct 2017 16:47:15 +0200 Subject: CS --- src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/Event') diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 35902654..fb8f225f 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php @@ -42,7 +42,7 @@ class TablePrefixSubscriber implements EventSubscriber $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { - if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { + if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; } -- cgit v1.2.3