Skip to content

Commit

Permalink
deprecated support for addDirectory($array) and excludeDirectory($array)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 8, 2019
1 parent 44ed959 commit 0712a0e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/RobotLoader/RobotLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 0712a0e

Please sign in to comment.