Skip to content

Commit 5e2f01d

Browse files
committed
Enable strict type checking
1 parent 02b640a commit 5e2f01d

File tree

73 files changed

+137
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+137
-4
lines changed

Diff for: Magento2/Helpers/Commenting/PHPDocFormattingValidator.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento2\Helpers\Commenting;
810

911
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Helpers/Tokenizer/AbstractTokenizer.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Helpers\Tokenizer;
79

810
/**

Diff for: Magento2/Helpers/Tokenizer/Parameter.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Helpers\Tokenizer;
79

810
/**

Diff for: Magento2/Helpers/Tokenizer/Variable.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Helpers\Tokenizer;
89

Diff for: Magento2/Sniffs/Classes/AbstractApiSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Classes;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Classes/DiscouragedDependenciesSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Classes;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/CodeAnalysis/EmptyBlockSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\CodeAnalysis;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento2\Sniffs\Commenting;
810

911
use Magento2\Helpers\Commenting\PHPDocFormattingValidator;

Diff for: Magento2/Sniffs/Commenting/ConstantsPHPDocFormattingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Commenting;
79

810
use Magento2\Helpers\Commenting\PHPDocFormattingValidator;

Diff for: Magento2/Sniffs/Exceptions/DirectThrowSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Exceptions;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Exceptions/ThrowCatchSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Exceptions;
89

Diff for: Magento2/Sniffs/Exceptions/TryProcessSystemResourcesSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Exceptions;
79

810
use function array_slice;

Diff for: Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Functions;
79

810
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff;

Diff for: Magento2/Sniffs/Functions/StaticFunctionSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Functions;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/GraphQL/AbstractGraphQLSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\GraphQL;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/GraphQL/ValidArgumentNameSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\GraphQL;
89

Diff for: Magento2/Sniffs/GraphQL/ValidEnumValueSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\GraphQL;
89

Diff for: Magento2/Sniffs/GraphQL/ValidFieldNameSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\GraphQL;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/GraphQL/ValidTopLevelFieldNameSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\GraphQL;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/GraphQL/ValidTypeNameSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\GraphQL;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/Html/HtmlBindingSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Html;
89

Diff for: Magento2/Sniffs/Html/HtmlCollapsibleAttributeSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Html;
89

Diff for: Magento2/Sniffs/Legacy/DiConfigSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Legacy;
89

Diff for: Magento2/Sniffs/Legacy/EmailTemplateSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Legacy;
89

Diff for: Magento2/Sniffs/Legacy/MageEntitySniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Legacy;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Legacy/ModuleXMLSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Legacy;
89

Diff for: Magento2/Sniffs/Legacy/ObsoleteAclSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Legacy;
79

810
use DOMDocument;

Diff for: Magento2/Sniffs/Legacy/ObsoleteConfigNodesSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
78

89
namespace Magento2\Sniffs\Legacy;
910

Diff for: Magento2/Sniffs/Legacy/ObsoleteMenuSniff.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Legacy;
79

810
use DOMDocument;
@@ -15,7 +17,7 @@
1517
class ObsoleteMenuSniff implements Sniff
1618
{
1719
private const WARNING_OBSOLETE_MENU_STRUCTURE = 'ObsoleteMenuStructure';
18-
20+
1921
/**
2022
* @var string
2123
*/

Diff for: Magento2/Sniffs/Legacy/ObsoleteSystemConfigurationSniff.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
78

89
namespace Magento2\Sniffs\Legacy;
910

@@ -41,13 +42,13 @@ public function process(File $phpcsFile, $stackPtr)
4142
$this->invalidXML($phpcsFile, $stackPtr);
4243
return;
4344
}
44-
45+
4546
$foundElements = $xml->xpath('/config/tabs|/config/sections');
46-
47+
4748
if ($foundElements === false) {
4849
return;
4950
}
50-
51+
5152
foreach ($foundElements as $element) {
5253
$phpcsFile->addWarning(
5354
"Obsolete system configuration structure detected in file.",

Diff for: Magento2/Sniffs/Legacy/WidgetXMLSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento2\Sniffs\Legacy;
89

Diff for: Magento2/Sniffs/Legacy/_files/restricted_classes.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
/**
89
* Classes that are restricted to use directly.

Diff for: Magento2/Sniffs/Less/AvoidIdSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/BracesFormattingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/ClassNamingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/ColonSpacingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/ColourDefinitionSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/CombinatorIndentationSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/CommentLevelsSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Files\File;

Diff for: Magento2/Sniffs/Less/ImportantPropertySniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/IndentationSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/PropertiesLineBreakSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

Diff for: Magento2/Sniffs/Less/PropertiesSortingSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento2\Sniffs\Less;
79

810
use PHP_CodeSniffer\Sniffs\Sniff;

0 commit comments

Comments
 (0)