Skip to content

chore(deps): lock file maintenance #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extensions": [
"bcmath"
],
"ini": [
"memory_limit=-1"
]
}
1 change: 0 additions & 1 deletion bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
$logger
);

/** @psalm-suppress DeprecatedClass */
$application = new Application(Versions::rootPackageName(), Versions::getVersion('laminas/automatic-releases'));

$application->addCommands([
Expand Down
1,579 changes: 923 additions & 656 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
errorLevel="1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedPsalmSuppress="true"
>
<projectFiles>
<directory name="bin"/>
Expand Down
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>laminas/.github:renovate-config"
],
"packageRules": [
{
"matchDepTypes": ["require"],
"rangeStrategy": "bump"
}
]
}
10 changes: 4 additions & 6 deletions src/Changelog/ChangelogReleaseNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public function __construct(
$changelogEntry = clone $changelogEntry;
}

$this->contents = $contents;

/** @psalm-suppress ImpurePropertyAssignment */
$this->contents = $contents;
$this->changelogEntry = $changelogEntry;
}

Expand All @@ -69,6 +67,7 @@ public function contents(): string
return $this->contents;
}

/** @throws RuntimeException if release notes already exist in both merged objects. */
public function merge(self $next): self
{
if ($this->changelogEntry && $next->changelogEntry) {
Expand All @@ -83,9 +82,8 @@ public function merge(self $next): self
$changelogEntry = clone $changelogEntry;
}

$merged = clone $this;
$merged->contents .= self::CONCATENATION_STRING . $next->contents;
/** @psalm-suppress ImpurePropertyAssignment */
$merged = clone $this;
$merged->contents .= self::CONCATENATION_STRING . $next->contents;
$merged->changelogEntry = $changelogEntry;

return $merged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ final class IssueOrPullRequest
/**
* @psalm-param non-empty-string $title
* @psalm-param list<Label> $labels
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
int $number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ final class Label
/**
* @psalm-param non-empty-string $colour
* @psalm-param non-empty-string $name
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
string $colour,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ final class Milestone
* @param array<int, IssueOrPullRequest> $entries
* @psalm-param non-empty-string $title
* @psalm-param list<IssueOrPullRequest> $entries
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
int $number,
Expand Down
33 changes: 33 additions & 0 deletions test/unit/Application/SwitchDefaultBranchToNextMinorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,37 @@ public function testWillNotSwitchDefaultBranchIfNoBranchesExist(): void
$output->fetch()
);
}

public function testWillRefuseToOperateWhenNotGivenAGitWorkingDirectory(): void
{
$workspace = Filesystem\create_temporary_file(Env\temp_dir(), 'workspace');

Filesystem\delete_file($workspace);
Filesystem\create_directory($workspace);

$this->variables->method('githubWorkspacePath')
->willReturn($workspace);

$this->loadEvent->method('__invoke')
->willReturn($this->event);

$this->fetch->expects(self::never())
->method('__invoke');

$this->getMergeTargets->expects(self::never())
->method('__invoke');

$this->push->expects(self::never())
->method('__invoke');

$this->bumpChangelogVersion->expects(self::never())
->method('__invoke');

$this->setDefaultBranch->expects(self::never())
->method('__invoke');

$this->expectExceptionMessage('Workspace is not a GIT repository.');

$this->command->run(new ArrayInput([]), new NullOutput());
}
}
1 change: 0 additions & 1 deletion test/unit/Changelog/ChangelogReleaseNotesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public function testMergeRaisesExceptionIfBothCurrentAndNextInstanceContainChang

$this->expectException(RuntimeException::class);

/** @psalm-suppress UnusedMethodCall */
$original->merge($toMerge);
}

Expand Down
19 changes: 19 additions & 0 deletions test/unit/Github/Api/V3/CreateMilestoneFailedTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Laminas\AutomaticReleases\Test\Unit\Github\Api\V3;

use Laminas\AutomaticReleases\Github\Api\V3\CreateMilestoneFailed;
use PHPUnit\Framework\TestCase;

/** @covers \Laminas\AutomaticReleases\Github\Api\V3\CreateMilestoneFailed */
final class CreateMilestoneFailedTest extends TestCase
{
public function test(): void
{
$exception = CreateMilestoneFailed::forVersion('1.2.3');

self::assertSame('Milestone "1.2.3" creation failed', $exception->getMessage());
}
}