baseFileContainsPharExtension($path)) { return true; } throw new Exception( sprintf( 'Unexpected file extension in "%s"', $path ), 1535198703 ); } /** * @param string $path * @return bool */ private function baseFileContainsPharExtension($path) { $baseFile = Helper::determineBaseFile($path); if ($baseFile === null) { return false; } $fileExtension = pathinfo($baseFile, PATHINFO_EXTENSION); return strtolower($fileExtension) === 'phar'; } }