| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function find($tool) |
||
| 28 | { |
||
| 29 | if (isset($this->installedPackages[$this->tools[$tool]])) { |
||
| 30 | $package = $this->installedPackages[$this->tools[$tool]]; |
||
| 31 | foreach ($package['bin'] as $bin) { |
||
| 32 | if (preg_match("#${tool}$#", $bin)) { |
||
| 33 | return __DIR__.self::COMPOSER_VENDOR_DIR.$package['name'].DIRECTORY_SEPARATOR.$bin; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | $binToolPath = 'bin' . DIRECTORY_SEPARATOR . $tool; |
||
| 39 | if (is_dir('bin')) { |
||
| 40 | return $binToolPath; |
||
| 41 | } |
||
| 42 | |||
| 43 | return 'vendor' . DIRECTORY_SEPARATOR . $binToolPath; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |