Skip to content
Permalink
Browse files

deprecated support for addDirectory($array) and excludeDirectory($array)

  • Loading branch information...
dg committed Mar 8, 2019
1 parent 44ed959 commit 0712a0e39ae7956d6a94c0ab6ad41aa842544b5c
Showing with 14 additions and 6 deletions.
  1. +14 −6 src/RobotLoader/RobotLoader.php
@@ -118,11 +118,15 @@ public function tryLoad(string $type): void
/**
* Add path or paths to list.
* @param string|string[] $path absolute path
* @param string ...$paths absolute path
*/
public function addDirectory($path): self
public function addDirectory(...$paths): self
{
$this->scanPaths = array_merge($this->scanPaths, (array) $path);
if (is_array($paths[0])) {
trigger_error(__METHOD__ . '() use variadics ...$paths to add an array of paths.', E_USER_WARNING);
$paths = $paths[0];
}
$this->scanPaths = array_merge($this->scanPaths, $paths);
return $this;
}
@@ -136,11 +140,15 @@ public function reportParseErrors(bool $on = true): self
/**
* Excludes path or paths from list.
* @param string|string[] $path absolute path
* @param string ...$paths absolute path
*/
public function excludeDirectory($path): self
public function excludeDirectory(...$paths): self
{
$this->excludeDirs = array_merge($this->excludeDirs, (array) $path);
if (is_array($paths[0])) {
trigger_error(__METHOD__ . '() use variadics ...$paths to add an array of paths.', E_USER_WARNING);
$paths = $paths[0];
}
$this->excludeDirs = array_merge($this->excludeDirs, $paths);
return $this;
}

0 comments on commit 0712a0e

Please sign in to comment.
You can’t perform that action at this time.