Skip to content

Commit 0ef7e6e

Browse files
committed
Added support for wikimedia/less.php 5.0
1 parent 99b94a3 commit 0ef7e6e

File tree

20 files changed

+26
-26
lines changed

20 files changed

+26
-26
lines changed

dev/tests/Unit/Console/Command/CompareSourceCommandLessTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function changesDataProvider()
9898
$pathToFixtures . '/removed-import/source-code-after',
9999
[
100100
'/Less \(MAJOR\)/',
101-
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Import with value: \'testimport\'\s*\|\s*A less import-node was removed\s*\|\s*M402/'
101+
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Less_Tree_Import\s*\|\s*A less import-node was removed\s*\|\s*M402/'
102102
],
103103
'Major change is detected.',
104104
],
@@ -107,8 +107,8 @@ public static function changesDataProvider()
107107
$pathToFixtures . '/removed-imports/source-code-after',
108108
[
109109
'/Less \(MAJOR\)/',
110-
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Import with value: \'testimport\'\s*\|\s*A less import-node was removed\s*\|\s*M402/',
111-
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Import with value: \'testimport2\'\s*\|\s*A less import-node was removed\s*\|\s*M402/'
110+
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Less_Tree_Import\s*\|\s*A less import-node was removed\s*\|\s*M402/',
111+
'/view\/frontend\/web\/css\/source\/test.less:0\s*\|\s*Less_Tree_Import\s*\|\s*A less import-node was removed\s*\|\s*M402/'
112112
],
113113
'Major change is detected.',
114114
],

dev/tests/Unit/Console/Command/CompareSourceCommandTest/_files/api-class/new-optional-constructor-parameter-for-extendable/source-code-after/AbstractExtensibleModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class AbstractExtensibleModel
1313
{
14-
public function __construct(\Test\Vcs\TestInterface $a, \Test\Vcs\TestInterface $b = null)
14+
public function __construct(\Test\Vcs\TestInterface $a, ?\Test\Vcs\TestInterface $b = null)
1515
{
1616
}
1717
}

dev/tests/Unit/Console/Command/CompareSourceCommandTest/_files/api-class/new-optional-constructor-parameter/source-code-after/TestClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class TestClass
1313
{
14-
public function __construct(\Test\Vcs\TestInterface $a, \Test\Vcs\TestInterface $b = null)
14+
public function __construct(\Test\Vcs\TestInterface $a, ?\Test\Vcs\TestInterface $b = null)
1515
{
1616
}
1717
}

dev/tests/Unit/Console/Command/CompareSourceCommandTest/_files/non-api-class/new-optional-constructor-parameter/source-code-after/TestClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class TestClass
1010
{
11-
public function __construct(\Test\Vcs\TestInterface $a, \Test\Vcs\TestInterface $b = null)
11+
public function __construct(\Test\Vcs\TestInterface $a, ?\Test\Vcs\TestInterface $b = null)
1212
{
1313
}
1414
}

src/Analyzer/AbstractCodeAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
$context = null,
5252
$fileBefore = null,
5353
$fileAfter = null,
54-
DependencyGraph $dependencyGraph = null
54+
?DependencyGraph $dependencyGraph = null
5555
) {
5656
$this->context = $context;
5757
$this->fileBefore = $fileBefore;

src/Analyzer/ClassLikeApiAnnotationAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
$context = null,
3636
$fileBefore = null,
3737
$fileAfter = null,
38-
DependencyGraph $dependencyGraph = null
38+
?DependencyGraph $dependencyGraph = null
3939
) {
4040
parent::__construct($context, $fileBefore, $fileAfter, $dependencyGraph);
4141
$this->nodeHelper = new Node();

src/Analyzer/Factory/AnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AnalyzerFactory implements AnalyzerFactoryInterface
2525
* @param DependencyGraph|null $dependencyGraph
2626
* @return AnalyzerInterface
2727
*/
28-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
28+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2929
{
3030
$analyzers = [
3131
new ApiClassAnalyzer(null, null, null, $dependencyGraph),

src/Analyzer/Factory/AnalyzerFactoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ interface AnalyzerFactoryInterface
2121
* @param DependencyGraph|null $dependencyGraph
2222
* @return AnalyzerInterface
2323
*/
24-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface;
24+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface;
2525
}

src/Analyzer/Factory/DbSchemaAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DbSchemaAnalyzerFactory implements AnalyzerFactoryInterface
3030
* @param DependencyGraph|null $dependencyGraph
3131
* @return AnalyzerInterface
3232
*/
33-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
33+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
3434
{
3535
$report = new Report();
3636
$analyzers = [

src/Analyzer/Factory/DiAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DiAnalyzerFactory implements AnalyzerFactoryInterface
2424
* @param DependencyGraph|null $dependencyGraph
2525
* @return AnalyzerInterface
2626
*/
27-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
27+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2828
{
2929
$report = new DbSchemaReport();
3030
$analyzers = [

src/Analyzer/Factory/EtSchemaAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class EtSchemaAnalyzerFactory implements AnalyzerFactoryInterface
2424
{
25-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
25+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2626
{
2727
$report = new DbSchemaReport();
2828
$analyzers = [

src/Analyzer/Factory/LayoutAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class LayoutAnalyzerFactory implements AnalyzerFactoryInterface
2424
* @param DependencyGraph|null $dependencyGraph
2525
* @return AnalyzerInterface
2626
*/
27-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
27+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2828
{
2929
$report = new DbSchemaReport();
3030
$analyzers = [

src/Analyzer/Factory/LessAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class LessAnalyzerFactory implements AnalyzerFactoryInterface
2424
* @param DependencyGraph|null $dependencyGraph
2525
* @return AnalyzerInterface
2626
*/
27-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
27+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2828
{
2929
$report = new DbSchemaReport();
3030
$analyzers = [

src/Analyzer/Factory/MftfAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MftfAnalyzerFactory implements AnalyzerFactoryInterface
3030
* @param DependencyGraph|null $dependencyGraph
3131
* @return AnalyzerInterface
3232
*/
33-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
33+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
3434
{
3535
$report = new MftfReport();
3636
$analyzers = [

src/Analyzer/Factory/NonApiAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class NonApiAnalyzerFactory implements AnalyzerFactoryInterface
2525
* @param DependencyGraph|null $dependencyGraph
2626
* @return AnalyzerInterface
2727
*/
28-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
28+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2929
{
3030
$analyzers = [
3131
new ClassAnalyzer(null, null, null, $dependencyGraph),

src/Analyzer/Factory/SystemXmlAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SystemXmlAnalyzerFactory implements AnalyzerFactoryInterface
2424
* @param DependencyGraph|null $dependencyGraph
2525
* @return AnalyzerInterface
2626
*/
27-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
27+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2828
{
2929
$report = new DbSchemaReport();
3030
$analyzers = [

src/Analyzer/Factory/XsdAnalyzerFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class XsdAnalyzerFactory implements AnalyzerFactoryInterface
2424
* @param DependencyGraph|null $dependencyGraph
2525
* @return AnalyzerInterface
2626
*/
27-
public function create(DependencyGraph $dependencyGraph = null): AnalyzerInterface
27+
public function create(?DependencyGraph $dependencyGraph = null): AnalyzerInterface
2828
{
2929
$report = new DbSchemaReport();
3030
$analyzers = [

src/Analyzer/Less/Analyzer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use PHPSemVerChecker\Report\Report;
2121
use Less_Tree;
2222
use Less_Tree_Comment;
23-
use Less_Tree_Rule;
23+
use Less_Tree_Declaration;
2424
use Less_Tree_Mixin_Definition;
2525
use Less_Tree_Import;
2626

@@ -152,7 +152,7 @@ private function reportRemovedNodes(string $file, array $nodes)
152152
{
153153
foreach ($nodes as $nodeName => $node) {
154154
switch (true) {
155-
case $node instanceof Less_Tree_Rule:
155+
case $node instanceof Less_Tree_Declaration:
156156
$this->report->add(self::CONTEXT, new VariableRemoved($file, $nodeName));
157157
break;
158158
case $node instanceof Less_Tree_Mixin_Definition:

src/Scanner/ScannerRegistryFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private function buildFullScanner()
5555
* @return Scanner
5656
*/
5757
private function buildApiScanner(
58-
DependencyGraph $dependencyGraph = null,
59-
DependencyGraph $dependencyGraphCompare = null
58+
?DependencyGraph $dependencyGraph = null,
59+
?DependencyGraph $dependencyGraphCompare = null
6060
) {
6161
$registry = new Registry();
6262
$parser = new Parser(new Emulative());
@@ -80,7 +80,7 @@ private function buildApiScanner(
8080
* @param boolean $mftf
8181
* @return array
8282
*/
83-
public function create(DependencyGraph $dependencyGraph = null, DependencyGraph $dependencyGraphCompare = null)
83+
public function create(?DependencyGraph $dependencyGraph = null, ?DependencyGraph $dependencyGraphCompare = null)
8484
{
8585
$moduleNameResolver = new ModuleNamespaceResolver();
8686

src/Visitor/AbstractApiVisitor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ abstract class AbstractApiVisitor extends NodeVisitorAbstract
4040
public function __construct(
4141
Registry $registry,
4242
NodeHelper $nodeHelper,
43-
DependencyGraph $dependencyGraph = null,
44-
DependencyGraph $dependencyGraphCompare = null
43+
?DependencyGraph $dependencyGraph = null,
44+
?DependencyGraph $dependencyGraphCompare = null
4545
) {
4646
$this->dependencyGraph = $dependencyGraph;
4747
$this->dependencyGraphComapre = $dependencyGraphCompare;

0 commit comments

Comments
 (0)