diff --git a/DependencyInjection/APYDataGridExtension.php b/DependencyInjection/APYDataGridExtension.php index d2618b3a..7852c952 100644 --- a/DependencyInjection/APYDataGridExtension.php +++ b/DependencyInjection/APYDataGridExtension.php @@ -20,7 +20,7 @@ class APYDataGridExtension extends Extension { - public function load(array $configs, ContainerBuilder $container):void + public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); diff --git a/DependencyInjection/Compiler/GridExtensionPass.php b/DependencyInjection/Compiler/GridExtensionPass.php index b12275b3..baf75bf0 100644 --- a/DependencyInjection/Compiler/GridExtensionPass.php +++ b/DependencyInjection/Compiler/GridExtensionPass.php @@ -18,7 +18,7 @@ class GridExtensionPass implements CompilerPassInterface { - public function process(ContainerBuilder $container):void + public function process(ContainerBuilder $container): void { if (false === $container->hasDefinition('grid')) { return; diff --git a/Grid/Columns.php b/Grid/Columns.php index d64f5cf1..8cb00432 100644 --- a/Grid/Columns.php +++ b/Grid/Columns.php @@ -22,7 +22,7 @@ class Columns implements \IteratorAggregate, \Countable protected $columns = []; protected $extensions = []; - const MISSING_COLUMN_EX_MSG = 'Column with id "%s" doesn\'t exists'; + private const MISSING_COLUMN_EX_MSG = 'Column with id "%s" doesn\'t exists'; /** * @var AuthorizationCheckerInterface @@ -42,7 +42,7 @@ public function __construct(AuthorizationCheckerInterface $authorizationChecker) * * @return ColumnsIterator */ - public function getIterator($showOnlySourceColumns = false):ColumnsIterator + public function getIterator($showOnlySourceColumns = false): ColumnsIterator { return new ColumnsIterator(new \ArrayIterator($this->columns), $showOnlySourceColumns); } @@ -128,7 +128,7 @@ public function getPrimaryColumn() /** * @return int */ - public function count():int + public function count(): int { return count($this->columns); } diff --git a/Grid/Export/ExcelExport.php b/Grid/Export/ExcelExport.php index e4cd6be9..bc54250b 100644 --- a/Grid/Export/ExcelExport.php +++ b/Grid/Export/ExcelExport.php @@ -12,6 +12,8 @@ namespace APY\DataGridBundle\Grid\Export; +use APY\DataGridBundle\Grid\Grid; + /** * Excel (This export produces a warning with new Office Excel). */ diff --git a/Grid/Export/Export.php b/Grid/Export/Export.php index f1dd9423..0729261a 100644 --- a/Grid/Export/Export.php +++ b/Grid/Export/Export.php @@ -61,14 +61,13 @@ abstract class Export implements ExportInterface, ContainerAwareInterface * * @return \APY\DataGridBundle\Grid\Export\Export */ - public function __construct( $title, $fileName = 'export', $params = [], $charset = 'UTF-8', $role = null) + public function __construct($title, $fileName = 'export', $params = [], $charset = 'UTF-8', $role = null) { $this->title = $title; $this->fileName = $fileName; $this->params = $params; $this->charset = $charset; $this->role = $role; - // $this->twig = $twig; } /** @@ -82,14 +81,12 @@ public function setContainer(ContainerInterface $container = null) { $this->container = $container; - - return $this; } public function setTwig(Environment $twig) { - $this->twig=$twig; + $this->twig = $twig; } /** * gets the Container associated with this Controller. diff --git a/Grid/Export/JSONExport.php b/Grid/Export/JSONExport.php index a393b71f..df6e30b7 100644 --- a/Grid/Export/JSONExport.php +++ b/Grid/Export/JSONExport.php @@ -12,6 +12,8 @@ namespace APY\DataGridBundle\Grid\Export; +use APY\DataGridBundle\Grid\Grid; + /** * JSON. */ diff --git a/Grid/Export/PHPExcel5Export.php b/Grid/Export/PHPExcel5Export.php index 57c5625b..9732be7b 100644 --- a/Grid/Export/PHPExcel5Export.php +++ b/Grid/Export/PHPExcel5Export.php @@ -12,6 +12,8 @@ namespace APY\DataGridBundle\Grid\Export; +use APY\DataGridBundle\Grid\Grid; + /** * PHPExcel 5 Export (97-2003) (.xls) * 52 columns maximum. diff --git a/Grid/Export/XMLExport.php b/Grid/Export/XMLExport.php index 803ef895..aad9fef6 100644 --- a/Grid/Export/XMLExport.php +++ b/Grid/Export/XMLExport.php @@ -12,6 +12,7 @@ namespace APY\DataGridBundle\Grid\Export; +use APY\DataGridBundle\Grid\Grid; use Symfony\Component\Serializer\Encoder\XmlEncoder; use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; use Symfony\Component\Serializer\Serializer; diff --git a/Grid/Grid.php b/Grid/Grid.php index db582417..7e707055 100644 --- a/Grid/Grid.php +++ b/Grid/Grid.php @@ -65,7 +65,7 @@ class Grid implements GridInterface public const TWEAK_NOT_DEFINED_EX_MSG = 'Tweak %s is not defined.'; /** - * @var \Symfony\Component\DependencyInjection\Container + * @var Container */ protected $container; @@ -80,11 +80,10 @@ class Grid implements GridInterface protected $session; /** - * @var \Symfony\Component\HttpFoundation\Request + * @var Request */ protected $request; - protected AuthorizationCheckerInterface $securityContext; protected Environment $twig; @@ -109,9 +108,6 @@ class Grid implements GridInterface */ protected $routeParameters; - /** - * @var \APY\DataGridBundle\Grid\Source\Source - */ protected ?Source $source = null; /** @@ -140,22 +136,22 @@ class Grid implements GridInterface protected $limits = []; /** - * @var \APY\DataGridBundle\Grid\Columns|\APY\DataGridBundle\Grid\Column\Column[] + * @var Columns|Column[] */ protected $columns; /** - * @var \APY\DataGridBundle\Grid\Rows + * @var Rows */ protected $rows; /** - * @var \APY\DataGridBundle\Grid\Action\MassAction[] + * @var Action\MassAction[] */ protected $massActions = []; /** - * @var \APY\DataGridBundle\Grid\Action\RowAction[] + * @var Action\RowAction[] */ protected $rowActions = []; @@ -205,7 +201,7 @@ class Grid implements GridInterface protected $noResultMessage; /** - * @var \APY\DataGridBundle\Grid\Export\Export[] + * @var Export[] */ protected $exports = []; diff --git a/Grid/GridBuilder.php b/Grid/GridBuilder.php index 06d0a852..603ad5df 100644 --- a/Grid/GridBuilder.php +++ b/Grid/GridBuilder.php @@ -19,15 +19,16 @@ class GridBuilder extends GridConfigBuilder implements GridBuilderInterface /** * The container. */ - private \Symfony\Component\DependencyInjection\Container $container; + private Container $container; private AuthorizationCheckerInterface $securityContext; private Environment $twig; + /** * The factory. */ - private \APY\DataGridBundle\Grid\GridFactoryInterface $factory; + private GridFactoryInterface $factory; /** * Columns of the grid builder. diff --git a/Grid/GridFactory.php b/Grid/GridFactory.php index 35314e48..c26247df 100644 --- a/Grid/GridFactory.php +++ b/Grid/GridFactory.php @@ -20,13 +20,13 @@ class GridFactory implements GridFactoryInterface /** * The service container. */ - private \Symfony\Component\DependencyInjection\Container $container; + private Container $container; private AuthorizationCheckerInterface $securityContext; private Environment $twig; - private \APY\DataGridBundle\Grid\GridRegistryInterface $registry; + private GridRegistryInterface $registry; /** * Constructor. diff --git a/Grid/GridManager.php b/Grid/GridManager.php index c622fb76..eb3a2cf3 100644 --- a/Grid/GridManager.php +++ b/Grid/GridManager.php @@ -20,7 +20,6 @@ use Symfony\Component\HttpFoundation\Response; use Twig\Environment; - class GridManager implements IteratorAggregate, Countable { protected $container; diff --git a/Grid/Helper/ColumnsIterator.php b/Grid/Helper/ColumnsIterator.php index a0c4a4cd..a541bde6 100644 --- a/Grid/Helper/ColumnsIterator.php +++ b/Grid/Helper/ColumnsIterator.php @@ -28,7 +28,7 @@ public function __construct(\Iterator $iterator, $showOnlySourceColumns) $this->showOnlySourceColumns = $showOnlySourceColumns; } - public function accept():bool + public function accept(): bool { $current = $this->getInnerIterator()->current(); diff --git a/Grid/Mapping/Metadata/DriverHeap.php b/Grid/Mapping/Metadata/DriverHeap.php index a1964205..10d37641 100644 --- a/Grid/Mapping/Metadata/DriverHeap.php +++ b/Grid/Mapping/Metadata/DriverHeap.php @@ -21,7 +21,7 @@ class DriverHeap extends \SplPriorityQueue * * @see SplPriorityQueue::compare() */ - public function compare($priority1, $priority2):int + public function compare($priority1, $priority2): int { if ($priority1 === $priority2) { return 0; diff --git a/Grid/Rows.php b/Grid/Rows.php index d583160f..fbc88dcf 100644 --- a/Grid/Rows.php +++ b/Grid/Rows.php @@ -58,7 +58,7 @@ public function addRow(Row $row) * * @see Countable::count() */ - public function count():int + public function count(): int { return $this->rows->count(); }