do not scan deprecated definitions
This commit is contained in:
parent
348beb0c44
commit
3dba5ba085
1 changed files with 18 additions and 1 deletions
|
@ -31,6 +31,9 @@ class DcDeprecated extends Task
|
||||||
/** @var array Deprecated functions [filetype [pattern, deprecated, replacement, version, help link]] */
|
/** @var array Deprecated functions [filetype [pattern, deprecated, replacement, version, help link]] */
|
||||||
private $deprecated = ['php' => [], 'js' => []];
|
private $deprecated = ['php' => [], 'js' => []];
|
||||||
|
|
||||||
|
/** @var boolean Stop parsing files */
|
||||||
|
private $stop_scan = false;
|
||||||
|
|
||||||
protected function getProperties(): TaskDescriptor
|
protected function getProperties(): TaskDescriptor
|
||||||
{
|
{
|
||||||
return new TaskDescriptor(
|
return new TaskDescriptor(
|
||||||
|
@ -72,9 +75,23 @@ class DcDeprecated extends Task
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function openDirectory(): ?bool
|
||||||
|
{
|
||||||
|
$skipped = $this->stop_scan;
|
||||||
|
$this->stop_scan = false;
|
||||||
|
if (preg_match('/\/(dcdeprecated)(\/.*?|)$/', $this->path_full)) {
|
||||||
|
if (!$skipped) {
|
||||||
|
$this->success->add(__('Skip directory'));
|
||||||
|
}
|
||||||
|
$this->stop_scan = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function readFile(&$content): ?bool
|
public function readFile(&$content): ?bool
|
||||||
{
|
{
|
||||||
if (!in_array($this->path_extension, array_keys($this->deprecated))) {
|
if ($this->stop_scan || !in_array($this->path_extension, array_keys($this->deprecated))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
foreach ($this->deprecated[$this->path_extension] as $d) {
|
foreach ($this->deprecated[$this->path_extension] as $d) {
|
||||||
|
|
Loading…
Reference in a new issue