Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW Use symfony/finder to perform file lookups in checks (#10)
* NEW Use symfony/finder to perform file lookups in checks * Allow doc or docs for documentation folder name, add test for class * Support code and src for PHP source
- Loading branch information
1 parent
fd6eda7
commit 7847da4
Showing
19 changed files
with
259 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace SilverStripe\ModuleRatings\Check; | ||
|
||
use SilverStripe\ModuleRatings\Check; | ||
use Symfony\Component\Finder\Finder; | ||
|
||
/** | ||
* Provides a base class for checks that rely on filesystem checks to extend, giving access to a | ||
* Symfony finder component | ||
*/ | ||
abstract class AbstractFileCheck extends Check | ||
{ | ||
/** | ||
* @var Finder | ||
*/ | ||
protected $finder; | ||
|
||
/** | ||
* Get the file finder component | ||
* | ||
* @return Finder | ||
*/ | ||
public function getFinder() | ||
{ | ||
if (!$this->finder) { | ||
$this->finder = new Finder(); | ||
} | ||
return $this->finder; | ||
} | ||
|
||
/** | ||
* Set the finder component to use | ||
* | ||
* @param Finder $finder | ||
* @return $this | ||
*/ | ||
public function setFinder(Finder $finder) | ||
{ | ||
$this->finder = $finder; | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.