Skip to content

Commit

Permalink
chore: fix coding style (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
deguif authored Dec 14, 2023
1 parent 3056270 commit 995a503
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/APYDataGridExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/GridExtensionPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Grid/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public function getPrimaryColumn()
/**
* @return int
*/
public function count():int
public function count(): int
{
return count($this->columns);
}
Expand Down
2 changes: 2 additions & 0 deletions Grid/Export/ExcelExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace APY\DataGridBundle\Grid\Export;

use APY\DataGridBundle\Grid\Grid;

/**
* Excel (This export produces a warning with new Office Excel).
*/
Expand Down
7 changes: 2 additions & 5 deletions Grid/Export/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions Grid/Export/JSONExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace APY\DataGridBundle\Grid\Export;

use APY\DataGridBundle\Grid\Grid;

/**
* JSON.
*/
Expand Down
2 changes: 2 additions & 0 deletions Grid/Export/PHPExcel5Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace APY\DataGridBundle\Grid\Export;

use APY\DataGridBundle\Grid\Grid;

/**
* PHPExcel 5 Export (97-2003) (.xls)
* 52 columns maximum.
Expand Down
1 change: 1 addition & 0 deletions Grid/Export/XMLExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 7 additions & 11 deletions Grid/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -109,9 +108,6 @@ class Grid implements GridInterface
*/
protected $routeParameters;

/**
* @var \APY\DataGridBundle\Grid\Source\Source
*/
protected ?Source $source = null;

/**
Expand Down Expand Up @@ -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 = [];

Expand Down Expand Up @@ -205,7 +201,7 @@ class Grid implements GridInterface
protected $noResultMessage;

/**
* @var \APY\DataGridBundle\Grid\Export\Export[]
* @var Export[]
*/
protected $exports = [];

Expand Down
5 changes: 3 additions & 2 deletions Grid/GridBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Grid/GridFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion Grid/GridManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;


class GridManager implements IteratorAggregate, Countable
{
protected $container;
Expand Down
2 changes: 1 addition & 1 deletion Grid/Helper/ColumnsIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion Grid/Mapping/Metadata/DriverHeap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Grid/Rows.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function addRow(Row $row)
*
* @see Countable::count()
*/
public function count():int
public function count(): int
{
return $this->rows->count();
}
Expand Down

0 comments on commit 995a503

Please sign in to comment.