/** * @return string */ public function findComposer() { $currentPath = realpath(getcwd()); $finder = new ExecutableFinder(); $finder->addSuffix('phar'); $binary = $finder->find('composer', null, explode(DIRECTORY_SEPARATOR, $currentPath)); if ($binary === null) { $binary = $this->installComposer(); } if ($binary === null) { throw new \RuntimeException('Cannot find composer'); } return $binary; }