Skip to content

Commit

Permalink
chore: update static analysis of verbosity values
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Apr 27, 2024
1 parent 7459c07 commit 235808c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LibraryStarterKit/Setup.php
Expand Up @@ -13,6 +13,7 @@

use Composer\Script\Event;
use Ramsey\Dev\LibraryStarterKit\Task\Build;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Process;
Expand All @@ -30,8 +31,13 @@ class Setup
private Filesystem $filesystem;
private Finder $finder;
private Project $project;

/** @phpstan-var OutputInterface::VERBOSITY_* */
private int $verbosity;

/**
* @phpstan-param OutputInterface::VERBOSITY_* $verbosity
*/
public function __construct(
Project $project,
Event $event,
Expand Down Expand Up @@ -96,6 +102,8 @@ public function getProject(): Project

/**
* Returns the verbosity level
*
* @return OutputInterface::VERBOSITY_*
*/
public function getVerbosity(): int
{
Expand Down
4 changes: 4 additions & 0 deletions src/LibraryStarterKit/Wizard.php
Expand Up @@ -78,6 +78,7 @@ public function getSetup(): Setup

public function getAnswersFile(): string
{
/** @psalm-suppress RiskyTruthyFalsyComparison */
return getenv('STARTER_KIT_ANSWERS_FILE') ?: $this->setup->path(self::ANSWERS_FILE);
}

Expand Down Expand Up @@ -270,6 +271,9 @@ public static function start(Event $event): void
$application->run(new StringInput(''));
}

/**
* @return OutputInterface::VERBOSITY_*
*/
public static function determineVerbosityLevel(Event $event): int
{
if ($event->getIO()->isDebug()) {
Expand Down

0 comments on commit 235808c

Please sign in to comment.