Skip to content

Commit

Permalink
Merge pull request #596 from Roave/dependabot/composer/doctrine/codin…
Browse files Browse the repository at this point in the history
…g-standard-10.0.0

Bump doctrine/coding-standard from 9.0.0 to 10.0.0
  • Loading branch information
Ocramius authored Aug 29, 2022
2 parents 02ba1c5 + 13cec01 commit 10abd71
Show file tree
Hide file tree
Showing 182 changed files with 766 additions and 1,082 deletions.
126 changes: 63 additions & 63 deletions bin/roave-backward-compatibility-check.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require-dev": {
"doctrine/coding-standard": "^9.0.0",
"doctrine/coding-standard": "^10.0.0",
"php-standard-library/psalm-plugin": "^1.1.5",
"phpunit/phpunit": "^9.5.23",
"psalm/plugin-phpunit": "^0.17.0",
Expand Down
46 changes: 23 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/Change.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ private function __construct(
private string $modificationType,
public string $description,
private bool $isBcBreak,
public ?string $file = null,
public ?int $line = null,
public ?int $column = null
public string|null $file = null,
public int|null $line = null,
public int|null $column = null,
) {
}

Expand Down Expand Up @@ -73,9 +73,9 @@ public function isSkipped(): bool

/** @internal */
public function withFilePositionsIfNotAlreadySet(
?string $file,
string|null $file,
int $line,
?int $column
int|null $column,
): self {
$instance = clone $this;

Expand All @@ -86,7 +86,7 @@ public function withFilePositionsIfNotAlreadySet(
return $instance;
}

public function onFile(?string $file): self
public function onFile(string|null $file): self
{
$instance = clone $this;

Expand All @@ -104,7 +104,7 @@ public function onLine(int $line): self
return $instance;
}

public function onColumn(?int $column): self
public function onColumn(int|null $column): self
{
$instance = clone $this;

Expand All @@ -119,7 +119,7 @@ public function __toString(): string
'%s%s: %s',
$this->isBcBreak ? '[BC] ' : ' ',
Str\uppercase($this->modificationType),
$this->description
$this->description,
);
}
}
12 changes: 3 additions & 9 deletions src/Changes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@

use function array_values;

/**
* @implements IteratorAggregate<int, Change>
*/
/** @implements IteratorAggregate<int, Change> */
final class Changes implements IteratorAggregate, Countable
{
/** @var list<Change> */
private array $bufferedChanges;

/** @var iterable<int, Change>|null */
private ?iterable $unBufferedChanges = null;
private iterable|null $unBufferedChanges = null;

/** @param list<Change> $bufferedChanges */
private function __construct(array $bufferedChanges)
private function __construct(private array $bufferedChanges)
{
$this->bufferedChanges = $bufferedChanges;
}

public static function empty(): self
Expand Down
42 changes: 17 additions & 25 deletions src/Command/AssertBackwardsCompatible.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,20 @@

final class AssertBackwardsCompatible extends Command
{
/**
* @throws LogicException
*/
/** @throws LogicException */
public function __construct(
private PerformCheckoutOfRevision $git,
private ComposerInstallationReflectorFactory $makeComposerInstallationReflector,
private ParseRevision $parseRevision,
private GetVersionCollection $getVersions,
private PickVersionFromVersionCollection $pickFromVersion,
private LocateDependencies $locateDependencies,
private CompareApi $compareApi
private CompareApi $compareApi,
) {
parent::__construct();
}

/**
* @throws InvalidArgumentException
*/
/** @throws InvalidArgumentException */
protected function configure(): void
{
$this
Expand All @@ -60,27 +56,27 @@ protected function configure(): void
'from',
null,
InputOption::VALUE_OPTIONAL,
'Git reference for the base version of the library, which is considered "stable"'
'Git reference for the base version of the library, which is considered "stable"',
)
->addOption(
'to',
null,
InputOption::VALUE_REQUIRED,
'Git reference for the new version of the library, which is verified against "from" for BC breaks',
'HEAD'
'HEAD',
)
->addOption(
'format',
null,
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Currently supports "console", "markdown" or "github-actions"',
['console']
['console'],
)
->addOption(
'install-development-dependencies',
null,
InputOption::VALUE_NONE,
'Whether to also install "require-dev" dependencies too'
'Whether to also install "require-dev" dependencies too',
)
->addUsage(
<<<'USAGE'
Expand All @@ -104,13 +100,11 @@ protected function configure(): void
If you want to produce `STDOUT` output, then please use the
`--format` flag.
USAGE
USAGE,
);
}

/**
* @throws InvalidArgumentException
*/
/** @throws InvalidArgumentException */
public function execute(InputInterface $input, OutputInterface $output): int
{
$output = Type\object(ConsoleOutputInterface::class)->assert($output);
Expand All @@ -132,7 +126,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
$stdErr->writeln(Str\format(
'Comparing from %s to %s...',
Type\string()->coerce($fromRevision),
Type\string()->coerce($toRevision)
Type\string()->coerce($toRevision),
));

$fromPath = $this->git->checkout($sourceRepo, $fromRevision);
Expand All @@ -142,16 +136,16 @@ public function execute(InputInterface $input, OutputInterface $output): int
$changes = ($this->compareApi)(
($this->makeComposerInstallationReflector)(
$fromPath->__toString(),
new AggregateSourceLocator() // no dependencies
new AggregateSourceLocator(), // no dependencies
),
($this->makeComposerInstallationReflector)(
$fromPath->__toString(),
($this->locateDependencies)($fromPath->__toString(), $includeDevelopmentDependencies)
($this->locateDependencies)($fromPath->__toString(), $includeDevelopmentDependencies),
),
($this->makeComposerInstallationReflector)(
$toPath->__toString(),
($this->locateDependencies)($toPath->__toString(), $includeDevelopmentDependencies)
)
($this->locateDependencies)($toPath->__toString(), $includeDevelopmentDependencies),
),
);

$formatters = [
Expand Down Expand Up @@ -190,9 +184,7 @@ private function printOutcomeAndExit(Changes $changes, OutputInterface $stdErr):
return $hasBcBreaks ? 3 : 0;
}

/**
* @throws InvalidArgumentException
*/
/** @throws InvalidArgumentException */
private function parseRevisionFromInput(InputInterface $input, CheckedOutRepository $repository): Revision
{
$from = Type\string()->coerce($input->getOption('from'));
Expand All @@ -202,7 +194,7 @@ private function parseRevisionFromInput(InputInterface $input, CheckedOutReposit

private function determineFromRevisionFromRepository(
CheckedOutRepository $repository,
OutputInterface $output
OutputInterface $output,
): Revision {
$versions = $this->getVersions->fromRepository($repository);

Expand All @@ -214,7 +206,7 @@ private function determineFromRevisionFromRepository(

return $this->parseRevision->fromStringForRepository(
$versionString,
$repository
$repository,
);
}
}
2 changes: 1 addition & 1 deletion src/CompareApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ interface CompareApi
public function __invoke(
Reflector $definedSymbols,
Reflector $pastSourcesWithDependencies,
Reflector $newSourcesWithDependencies
Reflector $newSourcesWithDependencies,
): Changes;
}
Loading

0 comments on commit 10abd71

Please sign in to comment.