[FEATURE] add phpcs using PSR2

This commit is contained in:
Marco Stoll 2019-06-26 11:45:44 +02:00
parent e0842f17f0
commit ca2eea08e3
17 changed files with 22 additions and 19 deletions

3
bin/phpcs.bat Normal file
View File

@ -0,0 +1,3 @@
@ECHO OFF
SET PROJECT_HOME=C:\dev\ffe\fastforward\Factories
vendor\bin\phpcs --report=xml --report-file="%PROJECT_HOME%\logs\phpcs\report.xml" --standard=PSR2 %PROJECT_HOME%\src %PROJECT_HOME%\tests -p

View File

@ -18,6 +18,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8",
"squizlabs/php_codesniffer": "^3",
"theseer/phpdox": "*"
},
"repositories": [

View File

@ -85,11 +85,9 @@
</source>
<!-- PHP Code Sniffer findings -->
<!--
<source type="phpcs">
<file name="logs/phpcs.xml" />
<file name="../logs/phpcs/report.xml" />
</source>
-->
<!-- PHPMessDetector -->
<!--

View File

@ -10,7 +10,6 @@ declare(strict_types=1);
namespace FF\Factories;
/**
* Class AbstractSingletonFactory
*

View File

@ -60,7 +60,9 @@ class NamespaceClassLocator implements ClassLocatorInterface
{
foreach ($this->namespaces as $ns) {
$fqClassname = $this->buildFqClassName($ns, $classIdentifier);
if (!class_exists($fqClassname)) continue;
if (!class_exists($fqClassname)) {
continue;
}
return $fqClassname;
}