Skip to content

Commit bf20f2d

Browse files
committed
cs fix
1 parent 1db14f1 commit bf20f2d

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

app/Controllers/Contribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function index()
1717
$data['contributors'][$id] = array_slice($contributors, 0, 12);
1818
}
1919
} catch (ClientExceptionInterface $e) {
20-
log_message('error', '[' . __METHOD__ . '] ' . get_class($e) . ': ' . $e->getMessage());
20+
log_message('error', '[' . __METHOD__ . '] ' . $e::class . ': ' . $e->getMessage());
2121

2222
$data['contributors'] = null;
2323
}

app/Controllers/Download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function index()
1919
'v4link' => end($releases['framework4'])->download_url,
2020
];
2121
} catch (ClientExceptionInterface $e) {
22-
log_message('error', '[' . __METHOD__ . '] ' . get_class($e) . ': ' . $e->getMessage());
22+
log_message('error', '[' . __METHOD__ . '] ' . $e::class . ': ' . $e->getMessage());
2323

2424
$data = [
2525
'v3name' => '<em>unknown</em>',

app/Controllers/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function index()
1818
'forks_count' => number_format($repos['codeigniter4']->forks_count),
1919
];
2020
} catch (ClientExceptionInterface $e) {
21-
log_message('error', '[' . __METHOD__ . '] ' . get_class($e) . ': ' . $e->getMessage());
21+
log_message('error', '[' . __METHOD__ . '] ' . $e::class . ': ' . $e->getMessage());
2222

2323
$data = [
2424
'html_url' => 'https://github.com/codeigniter4/CodeIgniter4',

app/Libraries/GitHub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function getReleases(): array
143143

144144
foreach ($this->config->repos as $id => $segments) {
145145
// We only care about frameworks
146-
if (strpos($id, 'framework') === false) {
146+
if (! str_contains($id, 'framework')) {
147147
continue;
148148
}
149149

tests/entities/ContributorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?php
22

33
use App\Entities\GitHub\Contributor;
4+
use PHPUnit\Framework\Attributes\DataProvider;
45
use Tests\Support\ProjectTestCase;
56

67
/**
78
* @internal
89
*/
910
final class ContributorTest extends ProjectTestCase
1011
{
11-
/**
12-
* @dataProvider provideStars
13-
*/
12+
#[DataProvider('provideStars')]
1413
public function testStars(int $contributions, string $expected)
1514
{
1615
$contributor = new Contributor(['contributions' => $contributions]);

tests/feature/BasicPagesTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@ public function testCanViewHomeWhenConnectException()
2929
$github = $this->getMockBuilder(GitHub::class)
3030
->disableOriginalConstructor()
3131
->disableOriginalClone()
32-
->disableArgumentCloning()
33-
->disallowMockingUnknownTypes()
3432
->onlyMethods(['getRepos'])
3533
->getMock();
3634
$github->method('getRepos')->willThrowException(
3735
new ConnectException(
3836
'cURL error 6: Could not resolve host: api.github.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.github.com/repos/bcit-ci/CodeIgniter',
3937
new Request(
4038
'GET',
41-
'https://api.github.com/repos/bcit-ci/CodeIgniter'
42-
)
43-
)
39+
'https://api.github.com/repos/bcit-ci/CodeIgniter',
40+
),
41+
),
4442
);
4543
Services::injectMock('github', $github);
4644

0 commit comments

Comments
 (0)