lib/Finder.php
private function findExecutables(string $directory, string $command): \Generator {
    foreach (array_merge([''], $this->getExtensions()->getArrayCopy()) as $extension) {
      $resolvedPath = Path::makeAbsolute(Path::join($directory, $command).mb_strtolower($extension), getcwd() ?: '.');
      if ($this->isExecutable($resolvedPath)) yield str_replace('/', DIRECTORY_SEPARATOR, $resolvedPath);
    }
  }
private function findExecutables(string $directory, string $command): \Generator {
    foreach (array_merge([''], $this->getExtensions()->getArrayCopy()) as $extension) {
      $resolvedPath = Path::makeAbsolute(Path::join($directory, $command).mb_strtolower($extension), getcwd() ?: '.');
      if ($this->isExecutable($resolvedPath)) yield str_replace('/', DIRECTORY_SEPARATOR, $resolvedPath);
    }
  }
private function findExecutables ( string $ directory , string $ command ) : \ Generator { foreach ( array_merge ( [ '' ] , $ this -> getExtensions ( ) -> getArrayCopy ( ) ) as $ extension ) { $ resolvedPath = Path :: makeAbsolute ( Path :: join ( $ directory , $ command ) . mb_strtolower ( $ extension ) , getcwd ( ) ? : '.' ) ; if ( $ this -> isExecutable ( $ resolvedPath ) ) yield str_replace ( '/' , DIRECTORY_SEPARATOR , $ resolvedPath ) ; } }
Finds the instances of an executable in the specified directory.
@param string $directory The directory path.
@param string $command The command to be resolved.
@return \Generator The paths of the executables found.
Finds the instances of an executable in the specified directory .