Skip to content

Commit ac788bf

Browse files
committed
[#2106] Updated to PHPCS v4 and Coder 9.
- Updated `drupal/coder` from ^8.3.31 to ^9@alpha in `.vortex/tests/composer.json` and `.vortex/installer/composer.json` - Updated `squizlabs/php_codesniffer` from ^3.13.4 to ^4.0 in `.vortex/tests/composer.json` - Updated `drevops/phpcs-standard` from 0.2.0 to 0.6.0 in root `composer.json` (supports both PHPCS v3 and v4) - Added audit configuration to disable security advisory blocking in root `composer.json` - Fixed code style violations in `.vortex/installer/tests/Unit/` files using phpcbf
1 parent 75a3548 commit ac788bf

8 files changed

Lines changed: 102 additions & 91 deletions

File tree

.vortex/installer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"bamarni/composer-bin-plugin": "^1.8.2",
3838
"dealerdirect/phpcodesniffer-composer-installer": "^1.2.0",
3939
"drevops/phpcs-standard": "^0.6",
40-
"drupal/coder": "^8.3.31",
40+
"drupal/coder": "^9@alpha",
4141
"ergebnis/composer-normalize": "^2.48.2",
4242
"laravel/serializable-closure": "^2.0.6",
4343
"mockery/mockery": "^1.6.12",

.vortex/installer/composer.lock

Lines changed: 34 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vortex/installer/tests/Unit/Downloader/DownloaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testParseUri(string $src, ?string $expected_repo = NULL, ?string
3838

3939
public function testDownloadWithMockedArchiver(): void {
4040
$mock_http_client = $this->createMockHttpClient();
41-
/** @var \PHPUnit\Framework\MockObject\MockObject&ArchiverInterface $mock_archiver */
41+
/** @var \PHPUnit\Framework\MockObject\MockObject&\DrevOps\VortexInstaller\Downloader\ArchiverInterface $mock_archiver */
4242
$mock_archiver = $this->createMockArchiver();
4343
$mock_archiver->expects($this->once())->method('validate');
4444
$mock_archiver->expects($this->once())->method('extract');
@@ -222,7 +222,7 @@ public function testDownloadFromLocal(string $ref, string $expectedVersion): voi
222222
$expectedVersion = $ref;
223223
}
224224

225-
/** @var \PHPUnit\Framework\MockObject\MockObject&ArchiverInterface $mock_archiver */
225+
/** @var \PHPUnit\Framework\MockObject\MockObject&\DrevOps\VortexInstaller\Downloader\ArchiverInterface $mock_archiver */
226226
$mock_archiver = $this->createMockArchiverWithExtract();
227227
$downloader = new Downloader(NULL, $mock_archiver);
228228
$version = $downloader->download($temp_repo_dir, $ref, $destination);

.vortex/installer/tests/Unit/GitTest.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GitTest extends UnitTestCase {
2626
* @param bool $with_commits
2727
* Whether to add commits to the repository.
2828
*
29-
* @return array{string, Git}
29+
* @return array{string, \DrevOps\VortexInstaller\Utils\Git}
3030
* Array with temp directory path and Git object.
3131
*/
3232
protected function createTempGitRepo(bool $with_remote = FALSE, bool $with_commits = FALSE): array {
@@ -123,7 +123,8 @@ public function testRun(): void {
123123
// Test with another command.
124124
$result = $repo->run('log', '--oneline', '--max-count=1');
125125
$this->assertInstanceOf(RunnerResult::class, $result);
126-
} finally {
126+
}
127+
finally {
127128
$this->cleanupTempGitRepo($temp_dir);
128129
}
129130
}
@@ -134,7 +135,8 @@ public function testListRemotesEmpty(): void {
134135
try {
135136
$remotes = $repo->listRemotes();
136137
$this->assertEmpty($remotes);
137-
} finally {
138+
}
139+
finally {
138140
$this->cleanupTempGitRepo($temp_dir);
139141
}
140142
}
@@ -148,7 +150,8 @@ public function testListRemotesWithRemotes(): void {
148150
$this->assertArrayHasKey('upstream', $remotes);
149151
$this->assertEquals('https://github.com/owner/repo.git', $remotes['origin']);
150152
$this->assertEquals('https://github.com/upstream/repo.git', $remotes['upstream']);
151-
} finally {
153+
}
154+
finally {
152155
$this->cleanupTempGitRepo($temp_dir);
153156
}
154157
}
@@ -162,7 +165,8 @@ public function testGetTrackedFilesNonGitDirectory(): void {
162165

163166
try {
164167
Git::getTrackedFiles($temp_dir);
165-
} finally {
168+
}
169+
finally {
166170
rmdir($temp_dir);
167171
}
168172
}
@@ -173,7 +177,8 @@ public function testGetTrackedFilesEmptyRepo(): void {
173177
try {
174178
$tracked = Git::getTrackedFiles($temp_dir);
175179
$this->assertEmpty($tracked);
176-
} finally {
180+
}
181+
finally {
177182
$this->cleanupTempGitRepo($temp_dir);
178183
}
179184
}
@@ -186,7 +191,8 @@ public function testGetTrackedFilesWithFiles(): void {
186191
$this->assertCount(2, $tracked);
187192
$this->assertContains($temp_dir . DIRECTORY_SEPARATOR . 'test.txt', $tracked);
188193
$this->assertContains($temp_dir . DIRECTORY_SEPARATOR . 'another.txt', $tracked);
189-
} finally {
194+
}
195+
finally {
190196
$this->cleanupTempGitRepo($temp_dir);
191197
}
192198
}
@@ -198,7 +204,8 @@ public function testGetLastShortCommitId(): void {
198204
$short_id = $repo->getLastShortCommitId();
199205
$this->assertEquals(7, strlen($short_id));
200206
$this->assertMatchesRegularExpression('/^[0-9a-f]{7}$/', $short_id);
201-
} finally {
207+
}
208+
finally {
202209
$this->cleanupTempGitRepo($temp_dir);
203210
}
204211
}

.vortex/installer/tests/Unit/TuiTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public function testBox(
189189

190190
$this->assertSame($expected_clean, $actual_clean);
191191

192-
} finally {
192+
}
193+
finally {
193194
// Restore environment.
194195
if ($original_columns !== FALSE) {
195196
putenv('COLUMNS=' . $original_columns);
@@ -571,7 +572,8 @@ public function testUtfPadding(
571572
$result = $method->invoke(NULL, $char);
572573
$this->assertSame($expected_padding, $result);
573574

574-
} finally {
575+
}
576+
finally {
575577
// Restore original environment variables.
576578
if ($original_terminal_emulator !== FALSE) {
577579
putenv('TERMINAL_EMULATOR=' . $original_terminal_emulator);

.vortex/tests/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"czproject/git-php": "^4.5",
2828
"dealerdirect/phpcodesniffer-composer-installer": "^1.1.2",
2929
"drevops/phpcs-standard": "^0.6",
30-
"drupal/coder": "^8.3.31",
30+
"drupal/coder": "^9@alpha",
3131
"ergebnis/composer-normalize": "^2.48.2",
3232
"phpstan/phpstan": "^2.1.31",
3333
"phpunit/phpunit": "^12.4.2",
3434
"rector/rector": "^2.2.7",
35-
"squizlabs/php_codesniffer": "^3.13.4"
35+
"squizlabs/php_codesniffer": "^4.0"
3636
},
3737
"minimum-stability": "alpha",
3838
"prefer-stable": true,

0 commit comments

Comments
 (0)