Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Commit

Permalink
Make setters fluent
Browse files Browse the repository at this point in the history
  • Loading branch information
mloberg committed Jan 1, 2016
1 parent 8fa0e03 commit 38402d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,30 @@ public function getDirectories()
* Set directories
*
* @param array $directories
*
* @return FileLoader
*/
public function setDirectories(array $directories)
{
$this->directories = $directories;

return $this;
}

/**
* Add directory
*
* @param string $directory
*
* @return FileLoader
*/
public function addDirectory($directory)
{
if (!in_array($directory, $this->directories)) {
$this->directories[] = $directory;
}

return $this;
}

/**
Expand All @@ -101,10 +109,14 @@ public function getCacheDirectory()
* Set cache directory
*
* @param string $cacheDirectory
*
* @return FileLoader
*/
public function setCacheDirectory($cacheDirectory)
{
$this->cacheDirectory = $cacheDirectory;

return $this;
}

/**
Expand Down

0 comments on commit 38402d1

Please sign in to comment.