Skip to content

Commit

Permalink
Update phpstan to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and emahorvat52 committed Jan 18, 2023
1 parent 5324a36 commit 3252cea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Composer/Console/Application.php
Expand Up @@ -135,7 +135,8 @@ public function doRun(InputInterface $input, OutputInterface $output): int
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
$this->disableScriptsByDefault = $input->hasParameterOption('--no-scripts');

if (Platform::getEnv('COMPOSER_NO_INTERACTION') || !Platform::isTty(defined('STDIN') ? STDIN : fopen('php://stdin', 'r'))) {
$stdin = defined('STDIN') ? STDIN : fopen('php://stdin', 'r');
if (Platform::getEnv('COMPOSER_NO_INTERACTION') || $stdin === false || !Platform::isTty($stdin)) {
$input->setInteractive(false);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Composer/DependencyResolver/RuleSetIterator.php
Expand Up @@ -75,7 +75,7 @@ public function next(): void
}

$this->currentType = $this->types[$this->currentTypeOffset];
} while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType]));
} while (0 === \count($this->rules[$this->currentType]));
}
}

Expand All @@ -95,7 +95,7 @@ public function rewind(): void
}

$this->currentType = $this->types[$this->currentTypeOffset];
} while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType]));
} while (0 === \count($this->rules[$this->currentType]));
}

public function valid(): bool
Expand Down
1 change: 0 additions & 1 deletion src/Composer/Package/BasePackage.php
Expand Up @@ -53,7 +53,6 @@ abstract class BasePackage implements PackageInterface
* READ-ONLY: The package id, public for fast access in dependency solver
* @var int
* @internal
* @readonly
*/
public $id;
/** @var string */
Expand Down
3 changes: 3 additions & 0 deletions src/Composer/Util/Platform.php
Expand Up @@ -201,6 +201,9 @@ public static function isTty($fd = null): bool
{
if ($fd === null) {
$fd = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');
if ($fd === false) {
return false;
}
}

// detect msysgit/mingw and assume this is a tty because detection
Expand Down

0 comments on commit 3252cea

Please sign in to comment.