diff --git a/DataSource/Extension/Configuration/EventSubscriber/ConfigurationBuilder.php b/DataSource/Extension/Configuration/EventSubscriber/ConfigurationBuilder.php index bcf12ca..54e682e 100644 --- a/DataSource/Extension/Configuration/EventSubscriber/ConfigurationBuilder.php +++ b/DataSource/Extension/Configuration/EventSubscriber/ConfigurationBuilder.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DataSource\Extension\Configuration\EventSubscriber; use FSi\Component\DataSource\DataSourceInterface; diff --git a/DataSource/Extension/Symfony/Core/CoreExtension.php b/DataSource/Extension/Symfony/Core/CoreExtension.php index 41d40e8..c053b3d 100644 --- a/DataSource/Extension/Symfony/Core/CoreExtension.php +++ b/DataSource/Extension/Symfony/Core/CoreExtension.php @@ -7,14 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\Core; use FSi\Component\DataSource\DataSourceAbstractExtension; -/** - * Main extension for all Symfony based extensions. Its main purpose is to - * replace binded Request object into array. - */ class CoreExtension extends DataSourceAbstractExtension { public function loadSubscribers() diff --git a/DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php b/DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php index d8540c2..a86f278 100644 --- a/DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php +++ b/DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\Core\EventSubscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/DataSource/Extension/Symfony/DependencyInjection/Driver/DriverExtension.php b/DataSource/Extension/Symfony/DependencyInjection/Driver/DriverExtension.php index edd6830..820c6e2 100644 --- a/DataSource/Extension/Symfony/DependencyInjection/Driver/DriverExtension.php +++ b/DataSource/Extension/Symfony/DependencyInjection/Driver/DriverExtension.php @@ -7,16 +7,16 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver; use FSi\Component\DataSource\Driver\DriverExtensionInterface; use FSi\Component\DataSource\Field\FieldExtensionInterface; use FSi\Component\DataSource\Field\FieldTypeInterface; +use InvalidArgumentException; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -/** - * DependencyInjection extension loads various types of extensions from Symfony's service container. - */ class DriverExtension implements DriverExtensionInterface { /** @@ -49,7 +49,7 @@ public function __construct(string $driverType, array $fieldTypes, array $fieldE foreach ($fieldExtensions as $fieldExtension) { foreach ($fieldExtension->getExtendedFieldTypes() as $extendedFieldType) { - if (!array_key_exists($extendedFieldType, $this->fieldExtensions)) { + if (false === array_key_exists($extendedFieldType, $this->fieldExtensions)) { $this->fieldExtensions[$extendedFieldType] = []; } @@ -72,8 +72,8 @@ public function hasFieldType($type) public function getFieldType($type) { - if (!array_key_exists($type, $this->fieldTypes)) { - throw new \InvalidArgumentException(sprintf('The field type "%s" is not registered within the service container.', $type)); + if (false === array_key_exists($type, $this->fieldTypes)) { + throw new InvalidArgumentException(sprintf('The field type "%s" is not registered within the service container.', $type)); } return $this->fieldTypes[$type]; @@ -86,7 +86,7 @@ public function hasFieldTypeExtensions($type) public function getFieldTypeExtensions($type) { - if (!array_key_exists($type, $this->fieldExtensions)) { + if (false === array_key_exists($type, $this->fieldExtensions)) { return []; } diff --git a/DataSourceBundle.php b/DataSourceBundle.php index 90261e6..6f1664e 100644 --- a/DataSourceBundle.php +++ b/DataSourceBundle.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; diff --git a/DependencyInjection/Compiler/DataSourcePass.php b/DependencyInjection/Compiler/DataSourcePass.php index 4b35c30..17a1550 100644 --- a/DependencyInjection/Compiler/DataSourcePass.php +++ b/DependencyInjection/Compiler/DataSourcePass.php @@ -7,17 +7,19 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Reference; -class DataSourcePass implements CompilerPassInterface +final class DataSourcePass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('datasource.extension')) { + if (false === $container->hasDefinition('datasource.extension')) { return; } diff --git a/DependencyInjection/Compiler/TemplatePathPass.php b/DependencyInjection/Compiler/TemplatePathPass.php index 6afd069..cf13d1a 100644 --- a/DependencyInjection/Compiler/TemplatePathPass.php +++ b/DependencyInjection/Compiler/TemplatePathPass.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DependencyInjection\Compiler; use FSi\Bundle\DataSourceBundle\DataSourceBundle; @@ -14,7 +16,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; -class TemplatePathPass implements CompilerPassInterface +final class TemplatePathPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 65f86a9..890babb 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; diff --git a/DependencyInjection/FSIDataSourceExtension.php b/DependencyInjection/FSIDataSourceExtension.php index 205e55f..7b3cb9d 100644 --- a/DependencyInjection/FSIDataSourceExtension.php +++ b/DependencyInjection/FSIDataSourceExtension.php @@ -7,11 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\DataSourceBundle\DependencyInjection; -use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Collection\EventSubscriberInterface; -use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Collection\FieldEventSubscriberInterface; -use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Doctrine\DBAL\EventSubscriberInterface; +use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Collection; +use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Doctrine\DBAL; use FSi\Bundle\DataSourceBundle\DataSource\Extension\Symfony\DependencyInjection\Driver\Doctrine\ORM; use FSi\Component\DataSource\Driver\Collection\CollectionAbstractField; use FSi\Component\DataSource\Driver\Doctrine\DBAL\DBALAbstractField; @@ -66,10 +67,10 @@ private function registerForAutoconfiguration(ContainerBuilder $container): void $container->registerForAutoconfiguration(DriverFactoryInterface::class)->addTag('datasource.driver.factory'); $container->registerForAutoconfiguration(DriverExtensionInterface::class)->addTag('datasource.driver.extension'); $container->registerForAutoconfiguration(CollectionAbstractField::class)->addTag('datasource.driver.collection.field'); - $container->registerForAutoconfiguration(FieldEventSubscriberInterface::class) + $container->registerForAutoconfiguration(Collection\FieldEventSubscriberInterface::class) ->addTag('datasource.driver.collection.field.subscriber') ; - $container->registerForAutoconfiguration(EventSubscriberInterface::class) + $container->registerForAutoconfiguration(Collection\EventSubscriberInterface::class) ->addTag('datasource.driver.collection.subscriber') ; $container->registerForAutoconfiguration(DoctrineAbstractField::class)