diff --git a/.travis.yml b/.travis.yml index e9d5f80d..e76f07a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,6 +97,7 @@ before_script: script: - composer validate --strict + - composer analyse - bin/phpstan analyse -c phpstan.neon -l max src/ - bin/ecs check src/ spec/ tests/Behat/ diff --git a/composer.json b/composer.json index 20e07287..532ebcbc 100644 --- a/composer.json +++ b/composer.json @@ -34,14 +34,16 @@ "friends-of-behat/variadic-extension": "^1.0", "lakion/mink-debug-extension": "^1.2.3", "phpspec/phpspec": "^5.0", - "phpstan/phpstan-symfony": "^0.10.0", - "phpstan/phpstan-webmozart-assert": "^0.10.0", + "phpstan/phpstan-webmozart-assert": "^0.11.1", + "phpstan/phpstan-symfony": "^0.11.2", + "phpstan/phpstan-doctrine": "^0.11.2", + "phpstan/phpstan-shim": "^0.11.4", "phpunit/phpunit": "^5.6", "portphp/csv": "^1.1.0", "portphp/spreadsheet": "^1.0.0-alpha", "predis/predis": "^1.1", "se/selenium-server-standalone": "^2.52", - "sylius-labs/coding-standard": "^2.0", + "sylius-labs/coding-standard": "^3.0", "symplify/easy-coding-standard": "^4.5" }, "prefer-stable": true, @@ -61,6 +63,12 @@ "conflict": { "sonata-project/core-bundle": ">=3.12 <3.13.4" }, + "scripts": { + "analyse": [ + "bin/phpstan analyse -c phpstan.neon -l max src/", + "bin/ecs check src/ spec/" + ] + }, "extra": { "branch-alias": { "dev-master": "1.0-dev" diff --git a/features/export/cli/exporting_countries_to_csv_via_cli.feature b/features/export/cli/exporting_countries_to_csv_via_cli.feature index 0b8dd0b4..253fac17 100644 --- a/features/export/cli/exporting_countries_to_csv_via_cli.feature +++ b/features/export/cli/exporting_countries_to_csv_via_cli.feature @@ -1,13 +1,13 @@ @managing_countries -Feature: exporting countries to csv-file - In order to have my countries exported to an external target - As a developer - I want to be able to export country data to csv file from the commandline +Feature: Exporting countries to csv-file + In order to have my countries exported to an external target + As a developer + I want to be able to export country data to csv file from the commandline - Background: - Given I have a working command-line interface + Background: + Given I have a working command-line interface - @cli_importer_exporter - Scenario: Exporting countries to csv-file - When I export "country" data as "csv" to the file "countries_export.csv" with the cli-command - Then I should see "Exported" in the output + @cli_importer_exporter + Scenario: Exporting countries to csv-file + When I export "country" data as "csv" to the file "countries_export.csv" with the cli-command + Then I should see "Exported" in the output diff --git a/features/export/cli/exporting_countries_to_json_via_cli.feature b/features/export/cli/exporting_countries_to_json_via_cli.feature index fe43e0e1..325d2850 100644 --- a/features/export/cli/exporting_countries_to_json_via_cli.feature +++ b/features/export/cli/exporting_countries_to_json_via_cli.feature @@ -1,13 +1,13 @@ @managing_countries -Feature: exporting countries to json-file - In order to have my countries exported to an external target - As a developer - I want to be able to export country data to json file from the commandline +Feature: Exporting countries to json-file + In order to have my countries exported to an external target + As a developer + I want to be able to export country data to json file from the commandline - Background: - Given I have a working command-line interface + Background: + Given I have a working command-line interface - @cli_importer_exporter - Scenario: Exporting countries to json-file - When I export "country" data as "json" to the file "countries_export.json" with the cli-command - Then I should see "Exported" in the output + @cli_importer_exporter + Scenario: Exporting countries to json-file + When I export "country" data as "json" to the file "countries_export.json" with the cli-command + Then I should see "Exported" in the output diff --git a/features/export/cli/exporting_countries_to_xlsx_via_cli.feature b/features/export/cli/exporting_countries_to_xlsx_via_cli.feature index 7ca7a7ff..1e26a604 100644 --- a/features/export/cli/exporting_countries_to_xlsx_via_cli.feature +++ b/features/export/cli/exporting_countries_to_xlsx_via_cli.feature @@ -1,13 +1,13 @@ @managing_countries -Feature: exporting countries to xlsx-file - In order to have my countries exported to an external target - As a Developer - I want to be able to export country data to xlsx file from the commandline +Feature: Exporting countries to xlsx-file + In order to have my countries exported to an external target + As a Developer + I want to be able to export country data to xlsx file from the commandline - Background: - Given I have a working command-line interface + Background: + Given I have a working command-line interface - @cli_importer_exporter - Scenario: Exporting countries to xlsx-file - When I export "country" data as "xlsx" to the file "countries_export.xlsx" with the cli-command - Then I should see "Exported" in the output + @cli_importer_exporter + Scenario: Exporting countries to xlsx-file + When I export "country" data as "xlsx" to the file "countries_export.xlsx" with the cli-command + Then I should see "Exported" in the output diff --git a/features/export/cli/exporting_customers_to_csv_via_cli.feature b/features/export/cli/exporting_customers_to_csv_via_cli.feature index c5fe535b..720720f3 100644 --- a/features/export/cli/exporting_customers_to_csv_via_cli.feature +++ b/features/export/cli/exporting_customers_to_csv_via_cli.feature @@ -1,13 +1,13 @@ @managing_customers -Feature: exporting customers to csv-file - In order to have my customers exported to an external target - As a Developer - I want to be able to export customer data to csv file from the commandline +Feature: Exporting customers to csv-file + In order to have my customers exported to an external target + As a Developer + I want to be able to export customer data to csv file from the commandline - Background: - Given I have a working command-line interface + Background: + Given I have a working command-line interface - @cli_importer_exporter - Scenario: Exporting customers to csv-file - When I export "customer" data as "csv" to the file "customers_export.csv" with the cli-command - Then I should see "Exported" in the output + @cli_importer_exporter + Scenario: Exporting customers to csv-file + When I export "customer" data as "csv" to the file "customers_export.csv" with the cli-command + Then I should see "Exported" in the output diff --git a/features/export/cli/exporting_orders_to_csv_via_cli.feature b/features/export/cli/exporting_orders_to_csv_via_cli.feature index 681af8d9..6ee5475b 100644 --- a/features/export/cli/exporting_orders_to_csv_via_cli.feature +++ b/features/export/cli/exporting_orders_to_csv_via_cli.feature @@ -1,13 +1,13 @@ @managing_orders -Feature: exporting orders to csv-file - In order to have my orders exported to an external target - As a Developer - I want to be able to export order data to csv file from the commandline +Feature: Exporting orders to csv-file + In order to have my orders exported to an external target + As a Developer + I want to be able to export order data to csv file from the commandline - Background: - Given I have a working command-line interface + Background: + Given I have a working command-line interface - @cli_importer_exporter - Scenario: Exporting orders to csv-file - When I export "order" data as "csv" to the file "orders_export.csv" with the cli-command - Then I should see "Exported" in the output + @cli_importer_exporter + Scenario: Exporting orders to csv-file + When I export "order" data as "csv" to the file "orders_export.csv" with the cli-command + Then I should see "Exported" in the output diff --git a/features/export/cli/exporting_tax_categories_via_cli.feature b/features/export/cli/exporting_tax_categories_via_cli.feature index 6365ee64..d0811eba 100644 --- a/features/export/cli/exporting_tax_categories_via_cli.feature +++ b/features/export/cli/exporting_tax_categories_via_cli.feature @@ -1,19 +1,19 @@ @managing_tax_categories Feature: exporting tax categories to csv-file - In order to have my tax categories exported to an external target - As a Developer - I want to be able to export tax categories data to csv file from the commandline + In order to have my tax categories exported to an external target + As a Developer + I want to be able to export tax categories data to csv file from the commandline - Background: - Given I have a working command-line interface - And the store has a tax category "cloth" - And this tax category name is "Cloth" - And this tax category description is "Shirts and Jeans" + Background: + Given I have a working command-line interface + And the store has a tax category "cloth" + And this tax category name is "Cloth" + And this tax category description is "Shirts and Jeans" - @cli_importer_exporter - Scenario: Exporting tax categories to csv-file - When I export "tax_category" data as "csv" to the file "tax_categories_export.csv" with the cli-command - Then I should see "Exported" in the output - And I should see in the file: - | Code | Name | Description | - | cloth | Cloth | Shirts and Jeans | + @cli_importer_exporter + Scenario: Exporting tax categories to csv-file + When I export "tax_category" data as "csv" to the file "tax_categories_export.csv" with the cli-command + Then I should see "Exported" in the output + And I should see in the file: + | Code | Name | Description | + | cloth | Cloth | Shirts and Jeans | diff --git a/phpstan.neon b/phpstan.neon index a933d7a7..a8f06941 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,11 +1,4 @@ -includes: - - vendor/phpstan/phpstan-symfony/extension.neon - - vendor/phpstan/phpstan-webmozart-assert/extension.neon - parameters: - symfony: - container_xml_path: tests/Application/var/cache/dev/appDevDebugProjectContainer.xml - excludes_analyse: # Makes PHPStan crash - 'src/DependencyInjection/Configuration.php' @@ -17,4 +10,8 @@ parameters: ignoreErrors: - '/Parameter #1 $configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration() expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface|null given./' - '/Parameter #1 $iterator of function iterator_to_array expects Traversable, array|Traversable given./' - - '#does not call parent constructor from#' + - '/does not call parent constructor from/' + - '/Return type \(void\) of method FriendsOfSylius\\SyliusImportExportPlugin\\Command\\ImportDataFromMessageQueueCommand::execute\(\) should be compatible with return type \(int\|null\) of method Symfony\\Component\\Console\\Command\\Command::execute\(\)/' + - '/Return type \(void\) of method FriendsOfSylius\\SyliusImportExportPlugin\\Command\\ExportDataCommand::execute\(\) should be compatible with return type \(int\|null\) of method Symfony\\Component\\Console\\Command\\Command::execute\(\)/' + - '/Return type \(void\) of method FriendsOfSylius\\SyliusImportExportPlugin\\Command\\ExportDataToMessageQueueCommand::execute\(\) should be compatible with return type \(int\|null\) of method Symfony\\Component\\Console\\Command\\Command::execute\(\)/' + - '/Return type \(void\) of method FriendsOfSylius\\SyliusImportExportPlugin\\Command\\ImportDataCommand::execute\(\) should be compatible with return type \(int\|null\) of method Symfony\\Component\\Console\\Command\\Command::execute\(\)/' diff --git a/src/Command/ExportDataCommand.php b/src/Command/ExportDataCommand.php index 95f5dc04..6ffc0603 100644 --- a/src/Command/ExportDataCommand.php +++ b/src/Command/ExportDataCommand.php @@ -20,9 +20,7 @@ final class ExportDataCommand extends Command { use ContainerAwareTrait; - /** - * @var ExporterRegistry - */ + /** @var ExporterRegistry */ private $exporterRegistry; public function __construct(ExporterRegistry $exporterRegistry) diff --git a/src/Command/ExportDataToMessageQueueCommand.php b/src/Command/ExportDataToMessageQueueCommand.php index b86780b6..a6013636 100644 --- a/src/Command/ExportDataToMessageQueueCommand.php +++ b/src/Command/ExportDataToMessageQueueCommand.php @@ -20,9 +20,7 @@ final class ExportDataToMessageQueueCommand extends Command { use ContainerAwareTrait; - /** - * @var ExporterRegistry - */ + /** @var ExporterRegistry */ private $exporterRegistry; public function __construct(ExporterRegistry $exporterRegistry) diff --git a/src/Command/ImportDataCommand.php b/src/Command/ImportDataCommand.php index b3370370..879de632 100644 --- a/src/Command/ImportDataCommand.php +++ b/src/Command/ImportDataCommand.php @@ -15,9 +15,7 @@ final class ImportDataCommand extends Command { - /** - * @var ImporterRegistry - */ + /** @var ImporterRegistry */ private $importerRegistry; public function __construct(ImporterRegistry $importerRegistry) diff --git a/src/Command/ImportDataFromMessageQueueCommand.php b/src/Command/ImportDataFromMessageQueueCommand.php index 2c4a8651..1fc60bf5 100644 --- a/src/Command/ImportDataFromMessageQueueCommand.php +++ b/src/Command/ImportDataFromMessageQueueCommand.php @@ -19,9 +19,7 @@ final class ImportDataFromMessageQueueCommand extends Command { use ContainerAwareTrait; - /** - * @var ImporterRegistry - */ + /** @var ImporterRegistry */ private $importerRegistry; public function __construct(ImporterRegistry $importerRegistry) diff --git a/src/Controller/ExportDataController.php b/src/Controller/ExportDataController.php index 6ff68f53..2656a453 100644 --- a/src/Controller/ExportDataController.php +++ b/src/Controller/ExportDataController.php @@ -23,19 +23,13 @@ final class ExportDataController extends Controller { - /** - * @var ServiceRegistryInterface - */ + /** @var ServiceRegistryInterface */ private $registry; - /** - * @var RequestConfigurationFactoryInterface - */ + /** @var RequestConfigurationFactoryInterface */ private $requestConfigurationFactory; - /** - * @var ResourcesCollectionProviderInterface - */ + /** @var ResourcesCollectionProviderInterface */ private $resourcesCollectionProvider; public function __construct( diff --git a/src/Controller/ImportDataController.php b/src/Controller/ImportDataController.php index 07ab4609..b55006a8 100644 --- a/src/Controller/ImportDataController.php +++ b/src/Controller/ImportDataController.php @@ -19,24 +19,16 @@ final class ImportDataController { - /** - * @var ServiceRegistry - */ + /** @var ServiceRegistry */ private $registry; - /** - * @var Session - */ + /** @var Session */ private $session; - /** - * @var FormFactoryInterface - */ + /** @var FormFactoryInterface */ private $formFactory; - /** - * @var \Twig_Environment - */ + /** @var \Twig_Environment */ private $twig; public function __construct( diff --git a/src/DependencyInjection/Compiler/MessageQueuePass.php b/src/DependencyInjection/Compiler/MessageQueuePass.php index 21e9fd05..96802fb4 100644 --- a/src/DependencyInjection/Compiler/MessageQueuePass.php +++ b/src/DependencyInjection/Compiler/MessageQueuePass.php @@ -13,7 +13,7 @@ final class MessageQueuePass implements CompilerPassInterface /** * {@inheritdoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $config = $container->getParameter('sylius.message_queue'); diff --git a/src/DependencyInjection/Compiler/RegisterExporterPass.php b/src/DependencyInjection/Compiler/RegisterExporterPass.php index 3feefe6d..90ecbe62 100644 --- a/src/DependencyInjection/Compiler/RegisterExporterPass.php +++ b/src/DependencyInjection/Compiler/RegisterExporterPass.php @@ -17,15 +17,13 @@ final class RegisterExporterPass implements CompilerPassInterface private const CLASS_CSV_WRITER = CsvWriter::class; private const CLASS_SPREADSHEET_WRITER = SpreadsheetWriter::class; - /** - * @var array - */ + /** @var array */ private $typesAndFormats = []; /** * {@inheritdoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $serviceId = 'sylius.exporters_registry'; if ($container->has($serviceId) == false) { diff --git a/src/DependencyInjection/Compiler/RegisterImporterPass.php b/src/DependencyInjection/Compiler/RegisterImporterPass.php index 0cd9449c..90e3430c 100644 --- a/src/DependencyInjection/Compiler/RegisterImporterPass.php +++ b/src/DependencyInjection/Compiler/RegisterImporterPass.php @@ -15,7 +15,7 @@ final class RegisterImporterPass implements CompilerPassInterface /** * {@inheritdoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $serviceId = 'sylius.importers_registry'; if ($container->has($serviceId) == false) { diff --git a/src/DependencyInjection/FOSSyliusImportExportExtension.php b/src/DependencyInjection/FOSSyliusImportExportExtension.php index 45455351..22a390cc 100644 --- a/src/DependencyInjection/FOSSyliusImportExportExtension.php +++ b/src/DependencyInjection/FOSSyliusImportExportExtension.php @@ -24,7 +24,7 @@ class FOSSyliusImportExportExtension extends Extension /** * {@inheritdoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs); diff --git a/src/Exporter/ExporterRegistry.php b/src/Exporter/ExporterRegistry.php index de782f09..29d19491 100644 --- a/src/Exporter/ExporterRegistry.php +++ b/src/Exporter/ExporterRegistry.php @@ -8,7 +8,7 @@ final class ExporterRegistry extends ServiceRegistry { - const EVENT_HOOK_NAME_PREFIX_GRID_BUTTONS = 'app.grid_event_listener.admin.crud'; + public const EVENT_HOOK_NAME_PREFIX_GRID_BUTTONS = 'app.grid_event_listener.admin.crud'; public static function buildServiceName(string $type, string $format): string { diff --git a/src/Exporter/JsonResourceExporter.php b/src/Exporter/JsonResourceExporter.php index 7ecde63b..f23d19bb 100644 --- a/src/Exporter/JsonResourceExporter.php +++ b/src/Exporter/JsonResourceExporter.php @@ -11,9 +11,7 @@ final class JsonResourceExporter extends ResourceExporter { private $data = []; - /** - * @var string - */ + /** @var string */ private $filename; /** diff --git a/src/Exporter/MqItemWriter.php b/src/Exporter/MqItemWriter.php index fd4384bc..535fd7ac 100644 --- a/src/Exporter/MqItemWriter.php +++ b/src/Exporter/MqItemWriter.php @@ -11,24 +11,16 @@ class MqItemWriter implements ItemWriterInterface { - /** - * @var PsrConnectionFactory - */ + /** @var PsrConnectionFactory */ private $psrConnectionFactory; - /** - * @var PsrContext - */ + /** @var PsrContext */ private $context; - /** - * @var PsrQueue - */ + /** @var PsrQueue */ private $queue; - /** - * @var PsrConsumer - */ + /** @var PsrConsumer */ private $consumer; public function __construct(PsrConnectionFactory $psrConnectionFactory) diff --git a/src/Exporter/ORM/Hydrator/OrderHydrator.php b/src/Exporter/ORM/Hydrator/OrderHydrator.php index bca0bda2..26162790 100644 --- a/src/Exporter/ORM/Hydrator/OrderHydrator.php +++ b/src/Exporter/ORM/Hydrator/OrderHydrator.php @@ -12,9 +12,7 @@ final class OrderHydrator implements HydratorInterface { - /** - * @var RepositoryInterface - */ + /** @var RepositoryInterface */ private $repository; public function __construct( diff --git a/src/Exporter/Plugin/OrderResourcePlugin.php b/src/Exporter/Plugin/OrderResourcePlugin.php index 54d0a5a6..265f7c03 100644 --- a/src/Exporter/Plugin/OrderResourcePlugin.php +++ b/src/Exporter/Plugin/OrderResourcePlugin.php @@ -17,14 +17,10 @@ class OrderResourcePlugin extends ResourcePlugin { - /** - * @var AddressConcatenationInterface - */ + /** @var AddressConcatenationInterface */ private $addressConcatenation; - /** - * @var HydratorInterface - */ + /** @var HydratorInterface */ private $orderHydrator; public function __construct( diff --git a/src/Exporter/Plugin/PluginPool.php b/src/Exporter/Plugin/PluginPool.php index bf706a94..e6447b40 100644 --- a/src/Exporter/Plugin/PluginPool.php +++ b/src/Exporter/Plugin/PluginPool.php @@ -6,24 +6,16 @@ class PluginPool implements PluginPoolInterface { - /** - * @var PluginInterface[] - */ + /** @var PluginInterface[] */ private $plugins; - /** - * @var array - */ + /** @var array */ private $exportKeys; - /** - * @var array - */ + /** @var array */ private $exportKeysNotFound; - /** - * @var array - */ + /** @var array */ private $exportKeysAvailable = []; /** diff --git a/src/Exporter/Plugin/ResourcePlugin.php b/src/Exporter/Plugin/ResourcePlugin.php index 0172ada7..cff00fda 100644 --- a/src/Exporter/Plugin/ResourcePlugin.php +++ b/src/Exporter/Plugin/ResourcePlugin.php @@ -11,34 +11,22 @@ class ResourcePlugin implements PluginInterface { - /** - * @var array - */ + /** @var array */ protected $fieldNames = []; - /** - * @var RepositoryInterface - */ + /** @var RepositoryInterface */ protected $repository; - /** - * @var PropertyAccessorInterface - */ + /** @var PropertyAccessorInterface */ protected $propertyAccessor; - /** - * @var EntityManagerInterface - */ + /** @var EntityManagerInterface */ protected $entityManager; - /** - * @var array - */ + /** @var array */ protected $data; - /** - * @var ResourceInterface[] - */ + /** @var ResourceInterface[] */ protected $resources; public function __construct( diff --git a/src/Exporter/ResourceExporter.php b/src/Exporter/ResourceExporter.php index a830bd87..3a1f06da 100644 --- a/src/Exporter/ResourceExporter.php +++ b/src/Exporter/ResourceExporter.php @@ -10,24 +10,16 @@ class ResourceExporter implements ResourceExporterInterface { - /** - * @var string[] - */ + /** @var string[] */ protected $resourceKeys; - /** - * @var WriterInterface - */ + /** @var WriterInterface */ protected $writer; - /** - * @var PluginPoolInterface - */ + /** @var PluginPoolInterface */ protected $pluginPool; - /** - * @var TransformerPoolInterface|null - */ + /** @var TransformerPoolInterface|null */ protected $transformerPool; /** diff --git a/src/Exporter/Transformer/Handler.php b/src/Exporter/Transformer/Handler.php index bfd15282..ff43a521 100644 --- a/src/Exporter/Transformer/Handler.php +++ b/src/Exporter/Transformer/Handler.php @@ -6,9 +6,7 @@ abstract class Handler implements HandlerInterface { - /** - * @var HandlerInterface - */ + /** @var HandlerInterface */ private $successor; /** diff --git a/src/Exporter/Transformer/Handler/DateTimeToStringHandler.php b/src/Exporter/Transformer/Handler/DateTimeToStringHandler.php index b49f6ff4..e4bc48c7 100644 --- a/src/Exporter/Transformer/Handler/DateTimeToStringHandler.php +++ b/src/Exporter/Transformer/Handler/DateTimeToStringHandler.php @@ -8,9 +8,7 @@ final class DateTimeToStringHandler extends Handler { - /** - * @var string - */ + /** @var string */ private $format; public function __construct(string $format = 'Y-m-d') diff --git a/src/Exporter/Transformer/Handler/IntegerToMoneyFormatHandler.php b/src/Exporter/Transformer/Handler/IntegerToMoneyFormatHandler.php index 1684b37b..280ac674 100644 --- a/src/Exporter/Transformer/Handler/IntegerToMoneyFormatHandler.php +++ b/src/Exporter/Transformer/Handler/IntegerToMoneyFormatHandler.php @@ -8,14 +8,10 @@ final class IntegerToMoneyFormatHandler extends Handler { - /** - * @var array - */ + /** @var array */ private $keys; - /** - * @var string - */ + /** @var string */ private $format; /** @@ -30,7 +26,7 @@ public function __construct(array $allowedKeys, string $format = '%.2n') /** * {@inheritdoc} */ - protected function process($key, $value) + protected function process($key, $value): ?string { return money_format($this->format, $value / 100); } diff --git a/src/Exporter/Transformer/HandlerInterface.php b/src/Exporter/Transformer/HandlerInterface.php index 03be8f20..cc4fd9bd 100644 --- a/src/Exporter/Transformer/HandlerInterface.php +++ b/src/Exporter/Transformer/HandlerInterface.php @@ -15,9 +15,6 @@ public function setSuccessor(self $handler): void; /** * Loops through handlers until it gets satisfying result - * - * - * @return string */ public function handle($key, $value); } diff --git a/src/Exporter/Transformer/Pool.php b/src/Exporter/Transformer/Pool.php index 935df565..c5cadf2b 100644 --- a/src/Exporter/Transformer/Pool.php +++ b/src/Exporter/Transformer/Pool.php @@ -6,14 +6,10 @@ final class Pool implements TransformerPoolInterface { - /** - * @var HandlerInterface - */ + /** @var HandlerInterface */ private $handler; - /** - * @var \IteratorAggregate - */ + /** @var \IteratorAggregate */ private $generator; public function __construct(\IteratorAggregate $generator) diff --git a/src/FOSSyliusImportExportPlugin.php b/src/FOSSyliusImportExportPlugin.php index 25b8111f..d611c657 100644 --- a/src/FOSSyliusImportExportPlugin.php +++ b/src/FOSSyliusImportExportPlugin.php @@ -18,7 +18,7 @@ final class FOSSyliusImportExportPlugin extends Bundle /** * {@inheritdoc} */ - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { parent::build($container); $container->addCompilerPass(new RegisterImporterPass()); diff --git a/src/Form/ExportType.php b/src/Form/ExportType.php index befe9d2f..6e3d11d5 100644 --- a/src/Form/ExportType.php +++ b/src/Form/ExportType.php @@ -13,7 +13,7 @@ class ExportType extends AbstractType /** * {@inheritdoc} */ - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('format', ChoiceType::class, [ diff --git a/src/Form/ImportType.php b/src/Form/ImportType.php index 72d6c33e..b304c725 100644 --- a/src/Form/ImportType.php +++ b/src/Form/ImportType.php @@ -13,9 +13,7 @@ class ImportType extends AbstractType { - /** - * @var ImporterRegistry - */ + /** @var ImporterRegistry */ private $importerRegistry; public function __construct(ImporterRegistry $importerRegistry) @@ -23,13 +21,13 @@ public function __construct(ImporterRegistry $importerRegistry) $this->importerRegistry = $importerRegistry; } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired('importer_type'); $resolver->setAllowedTypes('importer_type', 'string'); } - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('format', ChoiceType::class, [ diff --git a/src/Importer/ImporterRegistry.php b/src/Importer/ImporterRegistry.php index c827b46e..e1718e76 100644 --- a/src/Importer/ImporterRegistry.php +++ b/src/Importer/ImporterRegistry.php @@ -8,7 +8,7 @@ class ImporterRegistry extends ServiceRegistry { - const EVENT_HOOK_NAME_PREFIX_ADMIN_CRUD_AFTER_CONTENT = 'app.block_event_listener.admin.crud.after_content'; + public const EVENT_HOOK_NAME_PREFIX_ADMIN_CRUD_AFTER_CONTENT = 'app.block_event_listener.admin.crud.after_content'; public static function buildServiceName(string $type, string $format): string { diff --git a/src/Importer/ImporterResult.php b/src/Importer/ImporterResult.php index f049706d..0d60363c 100644 --- a/src/Importer/ImporterResult.php +++ b/src/Importer/ImporterResult.php @@ -9,29 +9,19 @@ final class ImporterResult implements ImporterResultInterface { - /** - * @var Stopwatch - */ + /** @var Stopwatch */ private $stopwatch; - /** - * @var int[] - */ + /** @var int[] */ private $success = []; - /** - * @var int[] - */ + /** @var int[] */ private $skipped = []; - /** - * @var int[] - */ + /** @var int[] */ private $failed = []; - /** - * @var StopwatchEvent - */ + /** @var StopwatchEvent */ private $stopWatchEvent; public function __construct(Stopwatch $stopwatch) diff --git a/src/Importer/MqItemReader.php b/src/Importer/MqItemReader.php index a0820da3..367eaf72 100644 --- a/src/Importer/MqItemReader.php +++ b/src/Importer/MqItemReader.php @@ -12,29 +12,19 @@ class MqItemReader implements ItemReaderInterface { - /** - * @var PsrContext - */ + /** @var PsrContext */ private $context; - /** - * @var PsrQueue - */ + /** @var PsrQueue */ private $queue; - /** - * @var PsrConnectionFactory - */ + /** @var PsrConnectionFactory */ private $psrConnectionFactory; - /** - * @var int - */ + /** @var int */ private $messagesImportedCount; - /** - * @var int - */ + /** @var int */ private $messagesSkippedCount; public function __construct(PsrConnectionFactory $psrConnectionFactory) diff --git a/src/Importer/ResourceImporter.php b/src/Importer/ResourceImporter.php index 4389afed..18910701 100644 --- a/src/Importer/ResourceImporter.php +++ b/src/Importer/ResourceImporter.php @@ -12,44 +12,28 @@ class ResourceImporter implements ImporterInterface { - /** - * @var ReaderFactory - */ + /** @var ReaderFactory */ private $readerFactory; - /** - * @var ObjectManager - */ + /** @var ObjectManager */ protected $objectManager; - /** - * @var ResourceProcessorInterface - */ + /** @var ResourceProcessorInterface */ protected $resourceProcessor; - /** - * @var ImporterResultInterface - */ + /** @var ImporterResultInterface */ protected $result; - /** - * @var int - */ + /** @var int */ protected $batchSize; - /** - * @var bool - */ + /** @var bool */ protected $failOnIncomplete; - /** - * @var bool - */ + /** @var bool */ protected $stopOnFailure; - /** - * @var int - */ + /** @var int */ protected $batchCount = 0; public function __construct( diff --git a/src/Listener/ExportButtonGridListener.php b/src/Listener/ExportButtonGridListener.php index 4f4e2b0a..bdb83efa 100644 --- a/src/Listener/ExportButtonGridListener.php +++ b/src/Listener/ExportButtonGridListener.php @@ -11,19 +11,13 @@ final class ExportButtonGridListener { - /** - * @var RequestStack - */ + /** @var RequestStack */ private $requestStack; - /** - * @var string - */ + /** @var string */ private $resource; - /** - * @var string[] - */ + /** @var string[] */ private $formats; /** @@ -35,12 +29,12 @@ public function __construct(string $resource, array $formats) $this->formats = $formats; } - public function setRequest(RequestStack $requestStack) + public function setRequest(RequestStack $requestStack): void { $this->requestStack = $requestStack; } - public function onSyliusGridAdmin(GridDefinitionConverterEvent $event) + public function onSyliusGridAdmin(GridDefinitionConverterEvent $event): void { $grid = $event->getGrid(); diff --git a/src/Processor/PaymentMethodProcessor.php b/src/Processor/PaymentMethodProcessor.php index a951f95b..07836a18 100644 --- a/src/Processor/PaymentMethodProcessor.php +++ b/src/Processor/PaymentMethodProcessor.php @@ -13,29 +13,19 @@ final class PaymentMethodProcessor implements ResourceProcessorInterface { - /** - * @var PaymentMethodFactoryInterface - */ + /** @var PaymentMethodFactoryInterface */ private $resourceFactory; - /** - * @var RepositoryInterface - */ + /** @var RepositoryInterface */ private $resourceRepository; - /** - * @var MetadataValidatorInterface - */ + /** @var MetadataValidatorInterface */ private $metadataValidator; - /** - * @var EntityManagerInterface - */ + /** @var EntityManagerInterface */ private $entityManager; - /** - * @var string[] - */ + /** @var string[] */ private $headerKeys; /** diff --git a/src/Processor/ResourceProcessor.php b/src/Processor/ResourceProcessor.php index 47de42db..58521d05 100644 --- a/src/Processor/ResourceProcessor.php +++ b/src/Processor/ResourceProcessor.php @@ -13,34 +13,22 @@ final class ResourceProcessor implements ResourceProcessorInterface { - /** - * @var FactoryInterface - */ + /** @var FactoryInterface */ private $resourceFactory; - /** - * @var RepositoryInterface - */ + /** @var RepositoryInterface */ private $resourceRepository; - /** - * @var PropertyAccessorInterface - */ + /** @var PropertyAccessorInterface */ private $propertyAccessor; - /** - * @var MetadataValidatorInterface - */ + /** @var MetadataValidatorInterface */ private $metadataValidator; - /** - * @var EntityManagerInterface - */ + /** @var EntityManagerInterface */ private $entityManager; - /** - * @var string[] - */ + /** @var string[] */ private $headerKeys; /** diff --git a/src/Writer/CsvWriter.php b/src/Writer/CsvWriter.php index 6e58b447..bb054bd7 100644 --- a/src/Writer/CsvWriter.php +++ b/src/Writer/CsvWriter.php @@ -9,9 +9,7 @@ class CsvWriter implements WriterInterface { - /** - * @var PortCsvWriter - */ + /** @var PortCsvWriter */ private $writer; public function __construct(PortCsvWriter $writer) diff --git a/src/Writer/SpreadsheetWriter.php b/src/Writer/SpreadsheetWriter.php index 65233a72..522e66cf 100644 --- a/src/Writer/SpreadsheetWriter.php +++ b/src/Writer/SpreadsheetWriter.php @@ -10,24 +10,16 @@ class SpreadsheetWriter implements WriterInterface { - /** - * @var PortSpreadsheetWriterFactoryInterface - */ + /** @var PortSpreadsheetWriterFactoryInterface */ private $portSpreadsheetWriterFactory; - /** - * @var PortSpreadsheetWriter - */ + /** @var PortSpreadsheetWriter */ private $writer; - /** - * @var string|null - */ + /** @var string|null */ private $filename; - /** - * @var string|null - */ + /** @var string|null */ private $temporaryFolder; public function __construct(PortSpreadsheetWriterFactoryInterface $portSpreadsheetWriterFactory, ?string $temporaryFolder = null) diff --git a/tests/Application/var/.gitkeep b/tests/Application/var/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/Behat/Context/CliBaseContext.php b/tests/Behat/Context/CliBaseContext.php index 134c4ea5..5eda2f46 100644 --- a/tests/Behat/Context/CliBaseContext.php +++ b/tests/Behat/Context/CliBaseContext.php @@ -20,59 +20,37 @@ class CliBaseContext implements Context { - /** - * @var array - */ + /** @var array */ protected $cliArguments = []; - /** - * @var KernelInterface - */ + /** @var KernelInterface */ protected $kernel; - /** - * @var Application - */ + /** @var Application */ protected $application; - /** - * @var CommandTester - */ + /** @var CommandTester */ protected $tester; - /** - * @var Command - */ + /** @var Command */ protected $command; - /** - * @var string - */ + /** @var string */ protected $filePath; - /** - * @var RepositoryInterface - */ + /** @var RepositoryInterface */ protected $repository; - /** - * @var ImporterRegistry - */ + /** @var ImporterRegistry */ private $importerRegistry; - /** - * @var ExporterRegistry - */ + /** @var ExporterRegistry */ private $exporterRegistry; - /** - * @var ContainerInterface - */ + /** @var ContainerInterface */ private $container; - /** - * @var string - */ + /** @var string */ protected $exportFile; public function __construct(