fix modules inter-dependencies on phpstan
This commit is contained in:
parent
a4e2b855ce
commit
589313f4ad
3 changed files with 19 additions and 3 deletions
|
@ -282,12 +282,14 @@ class phpstan extends Action
|
||||||
'%MODULE_ROOT%',
|
'%MODULE_ROOT%',
|
||||||
'%DC_ROOT%',
|
'%DC_ROOT%',
|
||||||
'%BOOTSTRAP_ROOT%',
|
'%BOOTSTRAP_ROOT%',
|
||||||
|
'%SCAN_DIRECTORIES%'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
$this->run_level,
|
$this->run_level,
|
||||||
(string) Path::real($this->module->get('root'), false),
|
(string) Path::real($this->module->get('root'), false),
|
||||||
(string) Path::real(DC_ROOT, false),
|
(string) Path::real(DC_ROOT, false),
|
||||||
(string) Path::real(__DIR__ . '/phpstan', false),
|
(string) Path::real(__DIR__ . '/phpstan', false),
|
||||||
|
$this->getScanDirectories(),
|
||||||
],
|
],
|
||||||
(string) file_get_contents(__DIR__ . '/phpstan/phpstan.rules.' . $full . 'conf')
|
(string) file_get_contents(__DIR__ . '/phpstan/phpstan.rules.' . $full . 'conf')
|
||||||
);
|
);
|
||||||
|
@ -306,4 +308,19 @@ class phpstan extends Action
|
||||||
|
|
||||||
return (bool) file_put_contents(DC_VAR . '/phpstan.neon', $content);
|
return (bool) file_put_contents(DC_VAR . '/phpstan.neon', $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getScanDirectories()
|
||||||
|
{
|
||||||
|
$ret = '';
|
||||||
|
if ($this->module->get('type') == 'plugin') {
|
||||||
|
$paths = explode(PATH_SEPARATOR, DC_PLUGINS_ROOT);
|
||||||
|
foreach($paths as $path) {
|
||||||
|
$path = Path::real($path, false);
|
||||||
|
if ($path !== false && $path != Path::real(DC_ROOT . DIRECTORY_SEPARATOR . 'plugins', false)) {
|
||||||
|
$ret .= ' - ' . $path . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ parameters:
|
||||||
|
|
||||||
scanDirectories:
|
scanDirectories:
|
||||||
- %DC_ROOT%
|
- %DC_ROOT%
|
||||||
|
%SCAN_DIRECTORIES%
|
||||||
|
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- %MODULE_ROOT%/*/libs/*
|
- %MODULE_ROOT%/*/libs/*
|
||||||
|
|
|
@ -9,6 +9,7 @@ parameters:
|
||||||
|
|
||||||
scanDirectories:
|
scanDirectories:
|
||||||
- %DC_ROOT%
|
- %DC_ROOT%
|
||||||
|
%SCAN_DIRECTORIES%
|
||||||
|
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- %MODULE_ROOT%/*/libs/*
|
- %MODULE_ROOT%/*/libs/*
|
||||||
|
@ -120,9 +121,6 @@ parameters:
|
||||||
# dbStruct object and auto properties
|
# dbStruct object and auto properties
|
||||||
- message : '#Access to an undefined property dbStruct::#'
|
- message : '#Access to an undefined property dbStruct::#'
|
||||||
|
|
||||||
# fileItem object and auto properties
|
|
||||||
- message : '#Access to an undefined property fileItem::#'
|
|
||||||
|
|
||||||
# cursor object and auto properties
|
# cursor object and auto properties
|
||||||
- message : '#Access to an undefined property cursor::#'
|
- message : '#Access to an undefined property cursor::#'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue