Skip to content

Commit 598cbd3

Browse files
authored
Merge pull request #6 from mediact/feature/compatibility-phpcs-33
2.0.3 Compatibility fixes for PHPCS 3.3
2 parents 123ce9c + cb771dc commit 598cbd3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^5.4.0 || ^7.0",
14-
"squizlabs/php_codesniffer": "^3.3",
14+
"squizlabs/php_codesniffer": "~3.3.0",
1515
"phpmd/phpmd": "^2.0"
1616
},
1717
"require-dev": {

src/MediactCommon/Sniffs/Php7/ReturnTypeSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,6 @@ protected function findActualReturnType(
170170
$functionStart
171171
) {
172172
$properties = $file->getMethodProperties($functionStart);
173-
return $properties['return_type'];
173+
return ltrim($properties['return_type'], '?');
174174
}
175175
}

src/MediactCommon/ruleset.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<exclude name="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"/>
2121
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/>
2222
<exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed"/>
23+
<exclude name="Squiz.Arrays.ArrayDeclaration.NoComma"/>
24+
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/>
2325
</rule>
2426

2527
<!-- Code analysis -->
@@ -39,6 +41,8 @@
3941
<exclude name="Generic.Commenting.DocComment.ContentBeforeClose"/>
4042
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
4143
<exclude name="Generic.Commenting.DocComment.SpacingBeforeTags"/>
44+
<exclude name="Generic.Commenting.DocComment.ParamNotFirst" />
45+
<exclude name="Generic.Commenting.DocComment.TagValueIndent" />
4246
</rule>
4347
<rule ref="Squiz.Commenting.FunctionComment">
4448
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>

0 commit comments

Comments
 (0)