Skip to content

Commit

Permalink
Fix #935 - allow Phar to run without composer files
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Apr 20, 2019
1 parent 764678d commit 79ae72d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ public static function getInstance()
/**
* @return void
*/
public function setComposerClassLoader(ClassLoader $loader)
public function setComposerClassLoader(ClassLoader $loader = null)
{
$this->composer_class_loader = $loader;
}
Expand Down
4 changes: 2 additions & 2 deletions src/command_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @psalm-suppress MixedInferred
*
* @return \Composer\Autoload\ClassLoader
* @return ?\Composer\Autoload\ClassLoader
*/
function requireAutoloaders($current_dir, $has_explicit_root, $vendor_dir)
{
Expand Down Expand Up @@ -86,7 +86,7 @@ function requireAutoloaders($current_dir, $has_explicit_root, $vendor_dir)
}
}

if ($first_autoloader === null) {
if ($first_autoloader === null && !$in_phar) {
if (!$autoload_files) {
echo 'Failed to find a valid Composer autoloader' . "\n";
} else {
Expand Down

0 comments on commit 79ae72d

Please sign in to comment.