Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit a9f18ef

Browse files
authored
Merge pull request #984 from webstacknl/php-cs-fixer-3
deps: Updated php-cs-fixer to ^3.6
2 parents dfd8a4c + cd8846d commit a9f18ef

17 files changed

+62
-98
lines changed

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
->append([__DIR__.'/php-cs-fixer'])
1616
;
1717

18-
$config = PhpCsFixer\Config::create()
18+
return (new PhpCsFixer\Config())
1919
->setRiskyAllowed(true)
2020
->setRules([
21-
'@PHP56Migration' => true,
2221
'@PhpCsFixer' => true,
2322
'@PhpCsFixer:risky' => true,
2423
'@PHPUnit60Migration:risky' => true,
@@ -31,7 +30,4 @@
3130
'no_useless_return' => true,
3231
'not_operator_with_successor_space' => true,
3332
])
34-
->setFinder($finder)
35-
;
36-
37-
return $config;
33+
->setFinder($finder);

Datatable/AbstractDatatable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ public function __construct(
168168
$this->authorizationChecker = $authorizationChecker;
169169
$this->securityToken = $securityToken;
170170

171-
if (!($translator instanceof LegacyTranslatorInterface) && !($translator instanceof TranslatorInterface)) {
172-
throw new \InvalidArgumentException(sprintf('The $translator argument of %s must be an instance of %s or %s, a %s was given.', static::class, LegacyTranslatorInterface::class, TranslatorInterface::class, get_class($translator)));
171+
if (! ($translator instanceof LegacyTranslatorInterface) && ! ($translator instanceof TranslatorInterface)) {
172+
throw new \InvalidArgumentException(sprintf('The $translator argument of %s must be an instance of %s or %s, a %s was given.', static::class, LegacyTranslatorInterface::class, TranslatorInterface::class, \get_class($translator)));
173173
}
174174
$this->translator = $translator;
175175
$this->router = $router;

Datatable/Action/Action.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020

2121
class Action
2222
{
23-
use OptionsTrait;
24-
25-
// Render an Action only if conditions are TRUE.
26-
use RenderIfTrait;
27-
2823
/*
2924
* An Action has a 'start_html' and a 'end_html' option.
3025
* <startHtml>action</endHtml>
3126
*/
3227
use HtmlContainerTrait;
3328

29+
use OptionsTrait;
30+
31+
// Render an Action only if conditions are TRUE.
32+
use RenderIfTrait;
33+
3434
/**
3535
* The name of the Action route.
3636
* Default: null.

Datatable/Column/AbstractColumn.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,34 @@
2323

2424
abstract class AbstractColumn implements ColumnInterface
2525
{
26-
use OptionsTrait;
27-
2826
// Use an 'add_if' option to check in ColumnBuilder if the Column can be added.
2927
use AddIfTrait;
3028

29+
use OptionsTrait;
30+
3131
//-------------------------------------------------
3232
// Column Types
3333
//-------------------------------------------------
3434

3535
/**
3636
* Identifies a Data Column.
3737
*/
38-
const DATA_COLUMN = 'data';
38+
public const DATA_COLUMN = 'data';
3939

4040
/**
4141
* Identifies an Action Column.
4242
*/
43-
const ACTION_COLUMN = 'action';
43+
public const ACTION_COLUMN = 'action';
4444

4545
/**
4646
* Identifies a Multiselect Column.
4747
*/
48-
const MULTISELECT_COLUMN = 'multiselect';
48+
public const MULTISELECT_COLUMN = 'multiselect';
4949

5050
/**
5151
* Identifies a Virtual Column.
5252
*/
53-
const VIRTUAL_COLUMN = 'virtual';
53+
public const VIRTUAL_COLUMN = 'virtual';
5454

5555
//--------------------------------------------------------------------------------------------------
5656
// DataTables - Columns Options

Datatable/Column/BooleanColumn.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class BooleanColumn extends AbstractColumn
2626
/**
2727
* @internal
2828
*/
29-
const RENDER_TRUE_VALUE = 'true';
29+
public const RENDER_TRUE_VALUE = 'true';
3030

3131
/**
3232
* @internal
3333
*/
34-
const RENDER_FALSE_VALUE = 'false';
34+
public const RENDER_FALSE_VALUE = 'false';
3535

3636
/**
3737
* The icon for a value that is true.

Datatable/Column/ColumnInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ColumnInterface
1919
/**
2020
* @var int
2121
*/
22-
const LAST_POSITION = -1;
22+
public const LAST_POSITION = -1;
2323

2424
/**
2525
* Validates $dql. Normally a non-empty string is expected.

Datatable/Column/NumberColumn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getFormatter()
149149
/**
150150
* @return $this
151151
*/
152-
public function setFormatter(\NumberFormatter $formatter)
152+
public function setFormatter(\NumberFormatter $formatter)
153153
{
154154
$this->formatter = $formatter;
155155

Datatable/DatatableFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public function __construct(
7575
$this->authorizationChecker = $authorizationChecker;
7676
$this->securityToken = $securityToken;
7777

78-
if (!($translator instanceof LegacyTranslatorInterface) && !($translator instanceof TranslatorInterface)) {
79-
throw new \InvalidArgumentException(sprintf('The $translator argument of %s must be an instance of %s or %s, a %s was given.', static::class, LegacyTranslatorInterface::class, TranslatorInterface::class, get_class($translator)));
78+
if (! ($translator instanceof LegacyTranslatorInterface) && ! ($translator instanceof TranslatorInterface)) {
79+
throw new \InvalidArgumentException(sprintf('The $translator argument of %s must be an instance of %s or %s, a %s was given.', static::class, LegacyTranslatorInterface::class, TranslatorInterface::class, \get_class($translator)));
8080
}
8181
$this->translator = $translator;
8282
$this->router = $router;

Datatable/DatatableInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
interface DatatableInterface
2121
{
22-
const NAME_REGEX = '/^[a-zA-Z0-9\-\_]+$/';
22+
public const NAME_REGEX = '/^[a-zA-Z0-9\-\_]+$/';
2323

2424
/**
2525
* Builds the datatable.

Datatable/Extension/Responsive.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ public function setDetails($details)
7676
if (\is_array($details)) {
7777
foreach ($details as $key => $value) {
7878
if (false === \in_array($key, ['type', 'target', 'renderer', 'display'], true)) {
79-
throw new Exception(
80-
"Responsive::setDetails(): {$key} is not an valid option."
81-
);
79+
throw new Exception("Responsive::setDetails(): {$key} is not an valid option.");
8280
}
8381
}
8482

0 commit comments

Comments
 (0)