diff --git a/src/Controller/Action/CitySearchAction.php b/src/Controller/Action/CitySearchAction.php index 7e59c88..6f90918 100644 --- a/src/Controller/Action/CitySearchAction.php +++ b/src/Controller/Action/CitySearchAction.php @@ -15,20 +15,11 @@ final class CitySearchAction { - private AddressRepositoryInterface $addressRepository; - - private RepositoryInterface $countryRepository; - - private ConfigurableViewHandlerInterface $viewHandler; - public function __construct( - AddressRepositoryInterface $addressRepository, - RepositoryInterface $countryRepository, - ConfigurableViewHandlerInterface $viewHandler, + private AddressRepositoryInterface $addressRepository, + private RepositoryInterface $countryRepository, + private ConfigurableViewHandlerInterface $viewHandler, ) { - $this->addressRepository = $addressRepository; - $this->countryRepository = $countryRepository; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/PostcodeSearchAction.php b/src/Controller/Action/PostcodeSearchAction.php index 2a15742..e0e8f02 100644 --- a/src/Controller/Action/PostcodeSearchAction.php +++ b/src/Controller/Action/PostcodeSearchAction.php @@ -15,20 +15,11 @@ final class PostcodeSearchAction { - private AddressRepositoryInterface $addressRepository; - - private RepositoryInterface $countryRepository; - - private ConfigurableViewHandlerInterface $viewHandler; - public function __construct( - AddressRepositoryInterface $addressRepository, - RepositoryInterface $countryRepository, - ConfigurableViewHandlerInterface $viewHandler, + private AddressRepositoryInterface $addressRepository, + private RepositoryInterface $countryRepository, + private ConfigurableViewHandlerInterface $viewHandler, ) { - $this->addressRepository = $addressRepository; - $this->countryRepository = $countryRepository; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/ProductSearchAction.php b/src/Controller/Action/ProductSearchAction.php index 7812f64..7c6cf19 100644 --- a/src/Controller/Action/ProductSearchAction.php +++ b/src/Controller/Action/ProductSearchAction.php @@ -14,20 +14,11 @@ final class ProductSearchAction { - private ProductRepositoryInterface $productRepository; - - private LocaleContextInterface $localeContext; - - private ConfigurableViewHandlerInterface $viewHandler; - public function __construct( - ProductRepositoryInterface $productRepository, - LocaleContextInterface $localeContext, - ConfigurableViewHandlerInterface $viewHandler, + private ProductRepositoryInterface $productRepository, + private LocaleContextInterface $localeContext, + private ConfigurableViewHandlerInterface $viewHandler, ) { - $this->productRepository = $productRepository; - $this->localeContext = $localeContext; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/ProvinceSearchAction.php b/src/Controller/Action/ProvinceSearchAction.php index 5ce77f1..af2af27 100644 --- a/src/Controller/Action/ProvinceSearchAction.php +++ b/src/Controller/Action/ProvinceSearchAction.php @@ -16,24 +16,12 @@ final class ProvinceSearchAction { - private AddressRepositoryInterface $addressRepository; - - private RepositoryInterface $provinceRepository; - - private RepositoryInterface $countryRepository; - - private ConfigurableViewHandlerInterface $viewHandler; - public function __construct( - AddressRepositoryInterface $addressRepository, - RepositoryInterface $provinceRepository, - RepositoryInterface $countryRepository, - ConfigurableViewHandlerInterface $viewHandler, + private AddressRepositoryInterface $addressRepository, + private RepositoryInterface $provinceRepository, + private RepositoryInterface $countryRepository, + private ConfigurableViewHandlerInterface $viewHandler, ) { - $this->addressRepository = $addressRepository; - $this->provinceRepository = $provinceRepository; - $this->countryRepository = $countryRepository; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/DataFetcher/BaseDataFetcher.php b/src/DataFetcher/BaseDataFetcher.php index d3e3d68..b0c88ec 100644 --- a/src/DataFetcher/BaseDataFetcher.php +++ b/src/DataFetcher/BaseDataFetcher.php @@ -8,11 +8,9 @@ abstract class BaseDataFetcher implements DataFetcherInterface { - protected QueryFilterInterface $queryFilter; - - public function __construct(QueryFilterInterface $queryFilter) - { - $this->queryFilter = $queryFilter; + public function __construct( + protected QueryFilterInterface $queryFilter, + ) { } /** diff --git a/src/DataFetcher/DelegatingDataFetcher.php b/src/DataFetcher/DelegatingDataFetcher.php index d53b008..4c37fed 100644 --- a/src/DataFetcher/DelegatingDataFetcher.php +++ b/src/DataFetcher/DelegatingDataFetcher.php @@ -9,14 +9,9 @@ class DelegatingDataFetcher implements DelegatingDataFetcherInterface { - /** - * DataFetcher registry. - */ - protected ServiceRegistryInterface $registry; - - public function __construct(ServiceRegistryInterface $registry) - { - $this->registry = $registry; + public function __construct( + protected ServiceRegistryInterface $registry, + ) { } public function fetch(ReportInterface $report, array $configuration = []): Data diff --git a/src/DataFetcher/NumberOfOrdersDataFetcher.php b/src/DataFetcher/NumberOfOrdersDataFetcher.php index f470bb2..66de815 100644 --- a/src/DataFetcher/NumberOfOrdersDataFetcher.php +++ b/src/DataFetcher/NumberOfOrdersDataFetcher.php @@ -11,15 +11,11 @@ class NumberOfOrdersDataFetcher extends TimePeriodDataFetcher { - private string $orderClass; - public function __construct( + private string $orderClass, QueryFilterInterface $queryFilter, - string $orderClass, ) { parent::__construct($queryFilter); - - $this->orderClass = $orderClass; } protected function setupQueryFilter(array $configuration = []): void diff --git a/src/DataFetcher/SalesTotalDataFetcher.php b/src/DataFetcher/SalesTotalDataFetcher.php index 26e0c5d..137aae9 100644 --- a/src/DataFetcher/SalesTotalDataFetcher.php +++ b/src/DataFetcher/SalesTotalDataFetcher.php @@ -11,15 +11,11 @@ class SalesTotalDataFetcher extends TimePeriodDataFetcher { - private string $orderClass; - public function __construct( + private string $orderClass, QueryFilterInterface $queryFilter, - string $orderClass, ) { parent::__construct($queryFilter); - - $this->orderClass = $orderClass; } protected function setupQueryFilter(array $configuration = []): void diff --git a/src/DataFetcher/UserRegistrationDataFetcher.php b/src/DataFetcher/UserRegistrationDataFetcher.php index 77c12e4..86e18c1 100644 --- a/src/DataFetcher/UserRegistrationDataFetcher.php +++ b/src/DataFetcher/UserRegistrationDataFetcher.php @@ -9,15 +9,11 @@ class UserRegistrationDataFetcher extends TimePeriodDataFetcher { - private string $userClass; - public function __construct( + private string $userClass, QueryFilterInterface $queryFilter, - string $userClass, ) { parent::__construct($queryFilter); - - $this->userClass = $userClass; } protected function setupQueryFilter(array $configuration = []): void diff --git a/src/Filter/QueryFilter.php b/src/Filter/QueryFilter.php index 6cd8ffd..4572c80 100644 --- a/src/Filter/QueryFilter.php +++ b/src/Filter/QueryFilter.php @@ -14,17 +14,14 @@ class QueryFilter implements QueryFilterInterface { - protected EntityManager $em; - protected QueryBuilder $qb; protected array $joins = []; - public function __construct(EntityManager $entityManager) - { - $this->em = $entityManager; - - $this->qb = $this->em->createQueryBuilder(); + public function __construct( + protected EntityManager $em, + ) { + $this->qb = $em->createQueryBuilder(); } public function getQueryBuilder(): QueryBuilder @@ -48,7 +45,7 @@ protected function getGroupByParts( array $configuration = [], string $dateField = 'checkoutCompletedAt', ): array { - if (false === strpos($dateField, '.')) { + if (!str_contains($dateField, '.')) { $rootAlias = $qb->getRootAliases()[0]; $dateF = $rootAlias . '.' . $dateField; } else { @@ -62,10 +59,10 @@ protected function getGroupByParts( $selectPeriod .= ', '; $selectGroupBy .= ','; } - $salias = ucfirst(strtolower($groupByElement)) . 'Date'; - $selectPeriod .= $groupByElement . '(' . $dateF . ') as ' . $salias; + $alias = ucfirst(strtolower($groupByElement)) . 'Date'; + $selectPeriod .= $groupByElement . '(' . $dateF . ') as ' . $alias; - $selectGroupBy .= $salias; + $selectGroupBy .= $alias; } return [$selectPeriod, $selectGroupBy]; @@ -87,7 +84,7 @@ public function addTimePeriod( string $dateField = 'checkoutCompletedAt', ?string $rootAlias = null, ): void { - if (false === strpos($dateField, '.')) { + if (!str_contains($dateField, '.')) { if (null === $rootAlias) { $rootAlias = $this->qb->getRootAliases()[0]; } diff --git a/src/Form/Builder/QueryFilterFormBuilder.php b/src/Form/Builder/QueryFilterFormBuilder.php index a449300..1face3c 100644 --- a/src/Form/Builder/QueryFilterFormBuilder.php +++ b/src/Form/Builder/QueryFilterFormBuilder.php @@ -20,28 +20,13 @@ class QueryFilterFormBuilder implements QueryFilterFormBuilderInterface { - protected RepositoryInterface $addressRepository; - - protected TaxonRepositoryInterface $taxonRepository; - - protected ProductRepositoryInterface $productRepository; - - protected ChannelRepositoryInterface $channelRepository; - - protected UrlGeneratorInterface $generator; - public function __construct( - RepositoryInterface $addressRepository, - TaxonRepositoryInterface $taxonRepository, - ProductRepositoryInterface $productRepository, - ChannelRepositoryInterface $channelRepository, - UrlGeneratorInterface $generator, + protected RepositoryInterface $addressRepository, + protected TaxonRepositoryInterface $taxonRepository, + protected ProductRepositoryInterface $productRepository, + protected ChannelRepositoryInterface $channelRepository, + protected UrlGeneratorInterface $generator, ) { - $this->addressRepository = $addressRepository; - $this->taxonRepository = $taxonRepository; - $this->productRepository = $productRepository; - $this->channelRepository = $channelRepository; - $this->generator = $generator; } public function addUserGender(FormBuilderInterface &$builder): void diff --git a/src/Form/EventListener/BuildReportDataFetcherFormSubscriber.php b/src/Form/EventListener/BuildReportDataFetcherFormSubscriber.php index f41b89d..d27a0cf 100644 --- a/src/Form/EventListener/BuildReportDataFetcherFormSubscriber.php +++ b/src/Form/EventListener/BuildReportDataFetcherFormSubscriber.php @@ -17,14 +17,10 @@ class BuildReportDataFetcherFormSubscriber implements EventSubscriberInterface { - private ServiceRegistryInterface $dataFetcherRegistry; - - private FormFactoryInterface $factory; - - public function __construct(ServiceRegistryInterface $dataFetcherRegistry, FormFactoryInterface $factory) - { - $this->dataFetcherRegistry = $dataFetcherRegistry; - $this->factory = $factory; + public function __construct( + private ServiceRegistryInterface $dataFetcherRegistry, + private FormFactoryInterface $factory, + ) { } public static function getSubscribedEvents(): array diff --git a/src/Form/EventListener/BuildReportRendererFormSubscriber.php b/src/Form/EventListener/BuildReportRendererFormSubscriber.php index ef33837..7bb5ff7 100644 --- a/src/Form/EventListener/BuildReportRendererFormSubscriber.php +++ b/src/Form/EventListener/BuildReportRendererFormSubscriber.php @@ -17,14 +17,10 @@ class BuildReportRendererFormSubscriber implements EventSubscriberInterface { - private ServiceRegistryInterface $rendererRegistry; - - private FormFactoryInterface $factory; - - public function __construct(ServiceRegistryInterface $rendererRegistry, FormFactoryInterface $factory) - { - $this->rendererRegistry = $rendererRegistry; - $this->factory = $factory; + public function __construct( + private ServiceRegistryInterface $rendererRegistry, + private FormFactoryInterface $factory, + ) { } public static function getSubscribedEvents(): array diff --git a/src/Form/Type/DataFetcher/BaseDataFetcherType.php b/src/Form/Type/DataFetcher/BaseDataFetcherType.php index 8b98c5c..88b1fc1 100644 --- a/src/Form/Type/DataFetcher/BaseDataFetcherType.php +++ b/src/Form/Type/DataFetcher/BaseDataFetcherType.php @@ -9,10 +9,8 @@ abstract class BaseDataFetcherType extends AbstractType { - protected QueryFilterFormBuilderInterface $queryFilterFormBuilder; - - public function __construct(QueryFilterFormBuilderInterface $queryFilterFormBuilder) - { - $this->queryFilterFormBuilder = $queryFilterFormBuilder; + public function __construct( + protected QueryFilterFormBuilderInterface $queryFilterFormBuilder, + ) { } } diff --git a/src/Form/Type/DataFetcher/DataFetcherChoiceType.php b/src/Form/Type/DataFetcher/DataFetcherChoiceType.php index fe846ba..2121dc1 100644 --- a/src/Form/Type/DataFetcher/DataFetcherChoiceType.php +++ b/src/Form/Type/DataFetcher/DataFetcherChoiceType.php @@ -10,13 +10,9 @@ class DataFetcherChoiceType extends AbstractType { - protected array $dataFetchers; - - public function __construct(array $dataFetchers) - { - /** - * @phpstan-ignore-next-line - */ + public function __construct( + protected array $dataFetchers, + ) { $this->dataFetchers = array_combine(array_values($dataFetchers), array_keys($dataFetchers)); } diff --git a/src/Form/Type/Renderer/RendererChoiceType.php b/src/Form/Type/Renderer/RendererChoiceType.php index 6013122..97e0081 100644 --- a/src/Form/Type/Renderer/RendererChoiceType.php +++ b/src/Form/Type/Renderer/RendererChoiceType.php @@ -10,13 +10,9 @@ class RendererChoiceType extends AbstractType { - protected array $renderers; - - public function __construct(array $renderers) - { - /** - * @phpstan-ignore-next-line - */ + public function __construct( + protected array $renderers, + ) { $this->renderers = array_combine(array_values($renderers), array_keys($renderers)); } diff --git a/src/Form/Type/ReportDataFetcherConfigurationType.php b/src/Form/Type/ReportDataFetcherConfigurationType.php index 1ff477c..5fec8f8 100644 --- a/src/Form/Type/ReportDataFetcherConfigurationType.php +++ b/src/Form/Type/ReportDataFetcherConfigurationType.php @@ -11,18 +11,12 @@ class ReportDataFetcherConfigurationType extends AbstractResourceType { - protected DelegatingDataFetcherInterface $delegatingDataFetcher; - - protected string $dataFetcherConfigurationTemplate; - public function __construct( + protected DelegatingDataFetcherInterface $delegatingDataFetcher, string $dataClass, array $validationGroups, - DelegatingDataFetcherInterface $delegatingDataFetcher, ) { parent::__construct($dataClass, $validationGroups); - - $this->delegatingDataFetcher = $delegatingDataFetcher; } public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Form/Type/ReportType.php b/src/Form/Type/ReportType.php index 72c20f5..ec225c7 100644 --- a/src/Form/Type/ReportType.php +++ b/src/Form/Type/ReportType.php @@ -22,28 +22,15 @@ class ReportType extends AbstractResourceType { - protected ServiceRegistryInterface $rendererRegistry; - - protected ServiceRegistryInterface $dataFetcherRegistry; - - protected string $rendererConfigurationTemplate; - - protected string $dataFetcherConfigurationTemplate; - public function __construct( string $dataClass, array $validationGroups, - ServiceRegistryInterface $rendererRegistry, - ServiceRegistryInterface $dataFetcherRegistry, - string $rendererConfigurationTemplate, - string $dataFetcherConfigurationTemplate, + protected ServiceRegistryInterface $rendererRegistry, + protected ServiceRegistryInterface $dataFetcherRegistry, + protected string $rendererConfigurationTemplate, + protected string $dataFetcherConfigurationTemplate, ) { parent::__construct($dataClass, $validationGroups); - - $this->rendererRegistry = $rendererRegistry; - $this->dataFetcherRegistry = $dataFetcherRegistry; - $this->rendererConfigurationTemplate = $rendererConfigurationTemplate; - $this->dataFetcherConfigurationTemplate = $dataFetcherConfigurationTemplate; } public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Renderer/ChartRenderer.php b/src/Renderer/ChartRenderer.php index 26a24ce..af9c724 100644 --- a/src/Renderer/ChartRenderer.php +++ b/src/Renderer/ChartRenderer.php @@ -23,11 +23,9 @@ class ChartRenderer implements RendererInterface public const DOUGHNUT_CHART = 'doughnut'; - private Environment $templating; - - public function __construct(Environment $templating) - { - $this->templating = $templating; + public function __construct( + private Environment $templating, + ) { } public function render(ReportInterface $report, Data $data): string diff --git a/src/Renderer/DelegatingRenderer.php b/src/Renderer/DelegatingRenderer.php index 82a1125..d11f98b 100644 --- a/src/Renderer/DelegatingRenderer.php +++ b/src/Renderer/DelegatingRenderer.php @@ -10,11 +10,9 @@ class DelegatingRenderer implements DelegatingRendererInterface { - protected ServiceRegistryInterface $registry; - - public function __construct(ServiceRegistryInterface $registry) - { - $this->registry = $registry; + public function __construct( + protected ServiceRegistryInterface $registry, + ) { } public function render(ReportInterface $report, Data $data): string diff --git a/src/Renderer/TableRenderer.php b/src/Renderer/TableRenderer.php index caf0a95..8d9cf1f 100644 --- a/src/Renderer/TableRenderer.php +++ b/src/Renderer/TableRenderer.php @@ -11,11 +11,9 @@ class TableRenderer implements RendererInterface { - private Environment $templating; - - public function __construct(Environment $templating) - { - $this->templating = $templating; + public function __construct( + private Environment $templating, + ) { } public function render(ReportInterface $report, Data $data): string diff --git a/src/Resources/config/services/data_fetcher.yaml b/src/Resources/config/services/data_fetcher.yaml index bfafc19..8dc15e9 100755 --- a/src/Resources/config/services/data_fetcher.yaml +++ b/src/Resources/config/services/data_fetcher.yaml @@ -2,22 +2,29 @@ services: odiseo_sylius_report_plugin.data_fetcher: class: Odiseo\SyliusReportPlugin\DataFetcher\DelegatingDataFetcher public: true - arguments: ['@odiseo_sylius_report_plugin.registry.data_fetcher'] + arguments: + - '@odiseo_sylius_report_plugin.registry.data_fetcher' odiseo_sylius_report_plugin.data_fetcher.user_registration: class: Odiseo\SyliusReportPlugin\DataFetcher\UserRegistrationDataFetcher - arguments: ['@odiseo_sylius_report_plugin.filter.query_filter', '%sylius.model.shop_user.class%'] + arguments: + - '%sylius.model.shop_user.class%' + - '@odiseo_sylius_report_plugin.filter.query_filter' tags: - { name: odiseo_sylius_report_plugin.data_fetcher, fetcher: odiseo_sylius_report_plugin_data_fetcher_user_registration, label: "odiseo_sylius_report_plugin.data_fetcher.user_registration" } odiseo_sylius_report_plugin.data_fetcher.sales_total: class: Odiseo\SyliusReportPlugin\DataFetcher\SalesTotalDataFetcher - arguments: ['@odiseo_sylius_report_plugin.filter.query_filter', '%sylius.model.order.class%'] + arguments: + - '%sylius.model.order.class%' + - '@odiseo_sylius_report_plugin.filter.query_filter' tags: - { name: odiseo_sylius_report_plugin.data_fetcher, fetcher: odiseo_sylius_report_plugin_data_fetcher_sales_total, label: "odiseo_sylius_report_plugin.data_fetcher.sales_total" } odiseo_sylius_report_plugin.data_fetcher.number_of_orders: class: Odiseo\SyliusReportPlugin\DataFetcher\NumberOfOrdersDataFetcher - arguments: ['@odiseo_sylius_report_plugin.filter.query_filter', '%sylius.model.order.class%'] + arguments: + - '%sylius.model.order.class%' + - '@odiseo_sylius_report_plugin.filter.query_filter' tags: - { name: odiseo_sylius_report_plugin.data_fetcher, fetcher: odiseo_sylius_report_plugin_data_fetcher_number_of_orders, label: "odiseo_sylius_report_plugin.data_fetcher.number_of_orders" } diff --git a/src/Resources/config/services/filter.yaml b/src/Resources/config/services/filter.yaml index ab288ea..e8383ce 100644 --- a/src/Resources/config/services/filter.yaml +++ b/src/Resources/config/services/filter.yaml @@ -1,4 +1,5 @@ services: odiseo_sylius_report_plugin.filter.query_filter: class: Odiseo\SyliusReportPlugin\Filter\QueryFilter - arguments: ["@doctrine.orm.entity_manager"] + arguments: + - "@doctrine.orm.entity_manager" diff --git a/src/Resources/config/services/form.yaml b/src/Resources/config/services/form.yaml index a568316..9ffdfd2 100755 --- a/src/Resources/config/services/form.yaml +++ b/src/Resources/config/services/form.yaml @@ -10,44 +10,54 @@ services: odiseo_sylius_report_plugin.form.type.data_fetcher_choice: class: Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\DataFetcherChoiceType - arguments: ['%odiseo_sylius_report_plugin.data_fetchers%'] + arguments: + - '%odiseo_sylius_report_plugin.data_fetchers%' tags: - { name: form.type, alias: odiseo_sylius_report_data_fetcher_choice } odiseo_sylius_report_plugin.form.type.renderer_choice: class: Odiseo\SyliusReportPlugin\Form\Type\Renderer\RendererChoiceType - arguments: ['%odiseo_sylius_report_plugin.renderers%'] + arguments: + - '%odiseo_sylius_report_plugin.renderers%' tags: - { name: form.type, alias: odiseo_sylius_report_renderer_choice } odiseo_sylius_report_plugin.form.type.report: class: Odiseo\SyliusReportPlugin\Form\Type\ReportType - arguments: ['%odiseo_sylius_report_plugin.model.report.class%', ['odiseo']] + arguments: + - '%odiseo_sylius_report_plugin.model.report.class%' + - ['odiseo'] tags: - { name: form.type, alias: odiseo_sylius_report } odiseo_sylius_report_plugin.form.type.report_data_fetcher_configuration: class: Odiseo\SyliusReportPlugin\Form\Type\ReportDataFetcherConfigurationType - arguments: ['%odiseo_sylius_report_plugin.model.report.class%', ['odiseo'], '@odiseo_sylius_report_plugin.data_fetcher'] + arguments: + - '@odiseo_sylius_report_plugin.data_fetcher' + - '%odiseo_sylius_report_plugin.model.report.class%' + - ['odiseo'] tags: - { name: form.type, alias: odiseo_sylius_report } #REPORT DATAFETCHER CONFIGURATION TYPES odiseo_sylius_report_plugin.form.type.data_fetcher.user_registration: class: Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\UserRegistrationType - arguments: ['@odiseo_sylius_report_plugin.form_builder.query_filter'] + arguments: + - '@odiseo_sylius_report_plugin.form_builder.query_filter' tags: - { name: form.type, alias: odiseo_sylius_report_plugin_data_fetcher_user_registration } odiseo_sylius_report_plugin.form.type.data_fetcher.sales_total: class: Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\SalesTotalType - arguments: ['@odiseo_sylius_report_plugin.form_builder.query_filter'] + arguments: + - '@odiseo_sylius_report_plugin.form_builder.query_filter' tags: - { name: form.type, alias: odiseo_sylius_report_plugin_data_fetcher_sales_total } odiseo_sylius_report_plugin.form.type.data_fetcher.number_of_orders: class: Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\NumberOfOrdersType - arguments: ['@odiseo_sylius_report_plugin.form_builder.query_filter'] + arguments: + - '@odiseo_sylius_report_plugin.form_builder.query_filter' tags: - { name: form.type, alias: odiseo_sylius_report_plugin_data_fetcher_number_of_orders } diff --git a/src/Resources/config/services/registry.yaml b/src/Resources/config/services/registry.yaml index 5ec51e5..1e645bc 100644 --- a/src/Resources/config/services/registry.yaml +++ b/src/Resources/config/services/registry.yaml @@ -1,8 +1,12 @@ services: odiseo_sylius_report_plugin.registry.data_fetcher: class: Sylius\Component\Registry\ServiceRegistry - arguments: ['Odiseo\SyliusReportPlugin\DataFetcher\DataFetcherInterface', 'data fetcher'] + arguments: + - 'Odiseo\SyliusReportPlugin\DataFetcher\DataFetcherInterface' + - 'data fetcher' odiseo_sylius_report_plugin.registry.renderer: class: Sylius\Component\Registry\ServiceRegistry - arguments: ['Odiseo\SyliusReportPlugin\Renderer\RendererInterface', 'renderer'] + arguments: + - 'Odiseo\SyliusReportPlugin\Renderer\RendererInterface' + - 'renderer' diff --git a/src/Resources/config/services/renderer.yaml b/src/Resources/config/services/renderer.yaml index 21584f6..12907c1 100755 --- a/src/Resources/config/services/renderer.yaml +++ b/src/Resources/config/services/renderer.yaml @@ -2,16 +2,19 @@ services: odiseo_sylius_report_plugin.renderer: class: Odiseo\SyliusReportPlugin\Renderer\DelegatingRenderer public: true - arguments: ['@odiseo_sylius_report_plugin.registry.renderer'] + arguments: + - '@odiseo_sylius_report_plugin.registry.renderer' odiseo_sylius_report_plugin.renderer.chart: class: Odiseo\SyliusReportPlugin\Renderer\ChartRenderer - arguments: ['@twig'] + arguments: + - '@twig' tags: - { name: odiseo_sylius_report_plugin.renderer, renderer: odiseo_sylius_report_plugin_renderer_chart, label: "odiseo_sylius_report_plugin.renderer.chart" } odiseo_sylius_report_plugin.renderer.table: class: Odiseo\SyliusReportPlugin\Renderer\TableRenderer - arguments: ['@twig'] + arguments: + - '@twig' tags: - { name: odiseo_sylius_report_plugin.renderer, renderer: odiseo_sylius_report_plugin_renderer_table, label: "odiseo_sylius_report_plugin.renderer.table" } diff --git a/src/Response/CsvResponse.php b/src/Response/CsvResponse.php index 2de4e65..b334158 100644 --- a/src/Response/CsvResponse.php +++ b/src/Response/CsvResponse.php @@ -13,8 +13,11 @@ class CsvResponse extends Response protected string $filename = 'export.csv'; - public function __construct(Data $data, int $status = 200, array $headers = []) - { + public function __construct( + Data $data, + int $status = 200, + array $headers = [], + ) { parent::__construct('', $status, $headers); $this->setData($data);