Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"php": "^7.1",
"squizlabs/php_codesniffer": "^3.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.2",
"slevomat/coding-standard": "^4.2.1"
"slevomat/coding-standard": "^4.3.0"
},
"extra": {
"branch-alias": {
Expand Down
8 changes: 6 additions & 2 deletions lib/Doctrine/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,14 @@
<!-- Forbid using absolute class name references (except global ones) -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFallbackGlobalConstants" type="boolean" value="false"/>
<property name="allowFallbackGlobalFunctions" type="boolean" value="false"/>
<property name="allowFullyQualifiedGlobalClasses" type="boolean" value="true"/>
<property name="allowFullyQualifiedGlobalFunctions" type="boolean" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" type="boolean" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" type="boolean" value="false"/>
Copy link
Member

@Ocramius Ocramius Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait... Constants too? There is no import syntax for them, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang, didn't remember use const 👍

<property name="allowFullyQualifiedGlobalFunctions" type="boolean" value="false"/>
<property name="allowFullyQualifiedNameForCollidingClasses" type="boolean" value="true"/>
<property name="allowFullyQualifiedNameForCollidingConstants" type="boolean" value="true"/>
<property name="allowFullyQualifiedNameForCollidingFunctions" type="boolean" value="true"/>
</properties>
</rule>
<!-- Forbid unused use statements -->
Expand Down
6 changes: 3 additions & 3 deletions tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PHP CODE SNIFFER REPORT SUMMARY
FILE ERRORS WARNINGS
----------------------------------------------------------------------
tests/input/concatenation_spacing.php 24 0
tests/input/example-class.php 13 0
tests/input/example-class.php 14 0
tests/input/not_spacing.php 7 0
tests/input/return_type_on_closures.php 21 0
tests/input/return_type_on_methods.php 17 0
----------------------------------------------------------------------
A TOTAL OF 82 ERRORS AND 0 WARNINGS WERE FOUND IN 5 FILES
A TOTAL OF 83 ERRORS AND 0 WARNINGS WERE FOUND IN 5 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 72 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 73 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


1 change: 1 addition & 0 deletions tests/fixed/example-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Example;

use Doctrine\Sniffs\Spacing\ControlStructureSniff;
use function assert;
use function strlen;
use function substr;

Expand Down