-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea | ||
.vscode | ||
.phpintel | ||
/vendor/ | ||
out.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Proton\Test; | ||
|
||
use Proton\Http\Request; | ||
|
||
final class ClassOk | ||
{ | ||
use MyTrait; | ||
|
||
/** | ||
* Foo. | ||
* @var array | ||
*/ | ||
protected $foo = []; | ||
|
||
public function __construct(array $config) | ||
{ | ||
$this->foo = $config + [ | ||
'foo' => 'bar', | ||
]; | ||
} | ||
|
||
public function ping(Request $request) | ||
{ | ||
return $request->query->get('test'); | ||
} | ||
|
||
public function foo(string $a, string $b) | ||
{ | ||
$a = $a . 'test'; | ||
|
||
if ( | ||
$a === 'a' | ||
|| $b === 'b' | ||
) { | ||
return $a; | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
PHP CODE SNIFFER REPORT SUMMARY | ||
------------------------------------------------------------------------------------------------ | ||
FILE ERRORS WARNINGS | ||
------------------------------------------------------------------------------------------------ | ||
/Users/Username/dev/Proton/php-coding-standard/tests/wrong/Class1.php 30 0 | ||
/Users/Username/dev/Proton/php-coding-standard/tests/wrong/ClassMetrics.php 4 0 | ||
/Users/Username/dev/Proton/php-coding-standard/tests/wrong/file.php 2 0 | ||
------------------------------------------------------------------------------------------------ | ||
A TOTAL OF 36 ERRORS AND 0 WARNINGS WERE FOUND IN 3 FILES | ||
------------------------------------------------------------------------------------------------ | ||
PHPCBF CAN FIX 28 OF THESE SNIFF VIOLATIONS AUTOMATICALLY | ||
------------------------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Line,Column,Type,Source | ||
4,10,error,PSR2.Files.EndFileNewline.NoneFound | ||
1,1,error,SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing | ||
6,12,warning,Generic.Metrics.NestingLevel.TooHigh | ||
5,20,error,PSR2.Classes.ClassDeclaration.OpenBraceNewLine | ||
21,11,error, found 10" | ||
20,9,warning,Generic.CodeAnalysis.UnconditionalIfStatement.Found | ||
20,9,error,SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn.UselessIfCondition | ||
1,1,error,SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing | ||
8,1,error, found 1." | ||
6,18,error,PSR12.Files.FileHeader.SpacingInsideBlock | ||
40,1,error,PSR2.Files.EndFileNewline.NoneFound | ||
4,1,error, found 2." | ||
38,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
37,13,warning,Squiz.PHP.NonExecutableCode.Unreachable | ||
37,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
36,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
35,9,error,Generic.PHP.LowerCaseKeyword.Found | ||
35,9,error,Squiz.ControlStructures.LowercaseDeclaration.FoundUppercase | ||
35,9,error,Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword | ||
35,12,error,Squiz.NamingConventions.ValidVariableName.NotCamelCaps | ||
35,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
33,9,error,Squiz.NamingConventions.ValidVariableName.NotCamelCaps | ||
33,24,warning,Generic.CodeAnalysis.EmptyPHPStatement.SemicolonWithoutCodeDetected | ||
33,24,error,SlevomatCodingStandard.PHP.UselessSemicolon.UselessSemicolon | ||
33,24,error,Generic.Formatting.DisallowMultipleStatements.SameLine | ||
33,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
31,31,error,Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine | ||
31,13,error,SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod | ||
27,27,error,PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword | ||
24,13,error,SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma | ||
20,19,error,Generic.PHP.BacktickOperator.Found | ||
20,14,error,Generic.PHP.BacktickOperator.Found | ||
16,5,error,PSR12.Traits.UseDeclaration.UseAfterBrace | ||
16,16,error,PSR12.Traits.UseDeclaration.MultipleImport | ||
14,5,warning,PSR12.Properties.ConstantVisibility.NotFound | ||
12,13,error,Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps | ||
12,13,error,SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty | ||
12,1,error,Generic.WhiteSpace.DisallowTabIndent.TabsUsed | ||
10,27,error,SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces.IncorrectEmptyLinesAfterOpeningBrace | ||
10,27,error,PSR2.Classes.ClassDeclaration.OpenBraceNewLine | ||
1,1,error,SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
|
||
namespace Test; | ||
|
||
use Something\Foo; | ||
|
||
use Something\bar; | ||
|
||
abstract final class Test { | ||
|
||
private $unused_field; | ||
|
||
const TEST = 'NOTOK'; | ||
|
||
use MyTrait, MyTrait2; | ||
|
||
public function __construct() | ||
{ | ||
echo `test`; | ||
|
||
|
||
print_r([ | ||
1 | ||
]); | ||
|
||
$this->test = new class() { | ||
}; | ||
} | ||
|
||
private function unused() { | ||
$fooBar = 1; | ||
$foo_bar = '1';; | ||
|
||
IF($foo_bar == '1') { | ||
return true; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Test; | ||
|
||
class ClassMetrics { | ||
public function foo($a, $b, $c, $d, $e, $f) | ||
{ | ||
if ($a) { | ||
if ($b) { | ||
if ($c) { | ||
if ($d) { | ||
if ($e) { | ||
return $f; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (true) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
|
||
/* */ | ||
return []; |