mirror of
https://github.com/marcostoll/FF-Factories.git
synced 2025-01-16 22:28:16 +01:00
[FEATURE] add phpmd
This commit is contained in:
parent
709fc817eb
commit
0fbf9a553b
3
bin/phpmd.bat
Normal file
3
bin/phpmd.bat
Normal file
@ -0,0 +1,3 @@
|
||||
@ECHO OFF
|
||||
SET PROJECT_HOME=C:\dev\ffe\fastforward\Factories
|
||||
vendor\bin\phpmd %PROJECT_HOME%\src xml cleancode,codesize,controversial,design,naming,unusedcode --strict --reportfile %PROJECT_HOME%\logs\phpmd\report.xml
|
@ -14,9 +14,10 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"fastforward/utils": "^1.0.0"
|
||||
"fastforward/utils": "^1.1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpmd/phpmd" : "@stable",
|
||||
"phpunit/phpunit": "^8",
|
||||
"squizlabs/php_codesniffer": "^3",
|
||||
"theseer/phpdox": "*"
|
||||
|
@ -90,11 +90,9 @@
|
||||
</source>
|
||||
|
||||
<!-- PHPMessDetector -->
|
||||
<!--
|
||||
<source type="pmd">
|
||||
<file name="pmd.xml" />
|
||||
<file name="../logs/phpmd/report.xml" />
|
||||
</source>
|
||||
-->
|
||||
|
||||
<!-- PHPUnit Coverage XML -->
|
||||
<!-- <source type="phpunit"> -->
|
||||
|
@ -69,12 +69,12 @@ class BaseNamespaceClassLocator extends NamespaceClassLocator
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ns
|
||||
* @param string $namespace
|
||||
* @param string $classIdentifier
|
||||
* @return string
|
||||
*/
|
||||
protected function buildFqClassName(string $ns, string $classIdentifier): string
|
||||
protected function buildFqClassName(string $namespace, string $classIdentifier): string
|
||||
{
|
||||
return parent::buildFqClassName($ns . '\\' . $this->commonSuffix, $classIdentifier);
|
||||
return parent::buildFqClassName($namespace . '\\' . $this->commonSuffix, $classIdentifier);
|
||||
}
|
||||
}
|
||||
|
@ -101,13 +101,13 @@ class NamespaceClassLocator implements ClassLocatorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ns
|
||||
* @param string $namespace
|
||||
* @param string $classIdentifier
|
||||
* @return string
|
||||
*/
|
||||
protected function buildFqClassName(string $ns, string $classIdentifier): string
|
||||
protected function buildFqClassName(string $namespace, string $classIdentifier): string
|
||||
{
|
||||
return $ns . '\\' . $classIdentifier;
|
||||
return $namespace . '\\' . $classIdentifier;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,16 +69,16 @@ class NamespacePrefixedClassLocator extends NamespaceClassLocator
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ns
|
||||
* @param string $namespace
|
||||
* @param string $classIdentifier
|
||||
* @return string
|
||||
*/
|
||||
protected function buildFqClassName(string $ns, string $classIdentifier): string
|
||||
protected function buildFqClassName(string $namespace, string $classIdentifier): string
|
||||
{
|
||||
$classPath = explode('\\', ClassUtils::normalizeNamespace($classIdentifier));
|
||||
$localClassName = array_pop($classPath);
|
||||
$subNs = !empty($classPath) ? implode('\\', $classPath) . '\\' : '';
|
||||
$subNamespace = !empty($classPath) ? implode('\\', $classPath) . '\\' : '';
|
||||
|
||||
return $ns . '\\' . $subNs . $this->prefix . '\\' . $localClassName;
|
||||
return $namespace . '\\' . $subNamespace . $this->prefix . '\\' . $localClassName;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user