Skip to content

Commit

Permalink
a bit stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
slash3b committed Nov 22, 2021
1 parent fdb22c9 commit 698b3b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions build-conflicts.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ static function (array $components): array {
Shell\execute('cp', [$sourceComposerJsonPath, $targetComposerJsonPath]);
};

/**
* @psalm-suppress MixedAssignment
*/
$commitComposerJson = static function (string $composerJsonPath, array $addedAdvisories): void {
$originalHash = Shell\execute(
'git',
Expand Down Expand Up @@ -224,13 +227,14 @@ static function (array $components): array {
));

$prevComposerJSONFileData = file_get_contents(__DIR__ . '/build/roave-security-advisories/composer.json');

/** @var array $prevComposerDecodedData
*/
$prevComposerDecodedData = json_decode($prevComposerJSONFileData, true);

/** @var array<array-key, string> $oldConflictPackages */
$oldConflictPackages = array_keys($prevComposerDecodedData['conflict']);

// /** @var list<Advisory> $addedAdvisories */
/**
* @psalm-param $addedAdvisories Advisory
*/
$addedAdvisories = [];
foreach ($getAdvisories() as $advisory) {
if (in_array($advisory->package->packageName, $oldConflictPackages, true)) {
Expand Down
2 changes: 2 additions & 0 deletions src/Roave/SecurityAdvisories/Advisory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
/** @psalm-immutable */
final class Advisory
{
/** @var PackageName */
public PackageName $package;

/** @var list<VersionConstraint> */
private array $branchConstraints;

/** @var Source */
public Source $source;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Roave/SecurityAdvisories/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

final class Source
{
/** @var non-empty-string */
/** @var non-empty-string $summary */
public string $summary;

/** @var non-empty-string */
/** @var non-empty-string $uri */
public string $uri;

/**
Expand Down

0 comments on commit 698b3b9

Please sign in to comment.