| 1 | <?php |
||
| 15 | class ScanStrategy extends DirStrategy |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $scanDir; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $scanDir dir to scan |
||
| 24 | * |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | 6 | public function setScanDir($scanDir) |
|
| 28 | { |
||
| 29 | // if we are vendorized we will search all vendor paths |
||
| 30 | 6 | if (strpos($scanDir, 'vendor/graviton/graviton')) { |
|
| 31 | $scanDir .= '/../../'; |
||
| 32 | } |
||
| 33 | 6 | $this->scanDir = $scanDir; |
|
| 34 | 6 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * may the strategy handle this input |
||
| 38 | * |
||
| 39 | * @param string|null $input input from command |
||
| 40 | * |
||
| 41 | * @return boolean |
||
| 42 | */ |
||
| 43 | 2 | public function supports($input) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @param mixed $input Input from command |
||
| 50 | * @return Finder |
||
| 51 | */ |
||
| 52 | 2 | protected function getFinder($input) |
|
| 62 | } |
||
| 63 |