Skip to content

Commit

Permalink
Merge pull request #19 from samsonasik/bump-php82
Browse files Browse the repository at this point in the history
Bump php requirement to php 8.2, add php 8.4 support
  • Loading branch information
samsonasik authored Jan 20, 2025
2 parents a2ac6ad + e71e6c8 commit e1d3cef
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2']
php-versions: ['8.2', '8.3', '8.4']
steps:
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
"php": "~8.2.0 || ~8.3.0 || ~8.4.0"
},
"conflict": {
"codeigniter4/framework": "<4.5.1"
"codeigniter4/framework": "<4.6"
},
"require-dev": {
"codeigniter/coding-standard": "^1.7.15",
"codeigniter4/framework": "^4.5.1",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.5.20",
"codeigniter/coding-standard": "^1.8.2",
"codeigniter4/framework": "^4.6",
"phpstan/phpstan": "^2.0.4",
"phpunit/phpunit": "^11.5.2",
"rector/rector": "dev-main"
},
"config": {
Expand Down
3 changes: 2 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
naming: true,
codingStyle: true
)
->withPhpSets(php81: true)
->withPhpSets(php82: true)
->withComposerBased(phpunit: true)
->withPaths([__DIR__ . '/src', __DIR__ . '/test'])
->withRootFiles()
->withImportNames(removeUnusedImports: true)
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function albumTrackSummary(bool $getShared = true): SQLAlbumTrackS

return new SQLAlbumTrackSummaryRepository(
model(AlbumModel::class),
model(TrackModel::class)
model(TrackModel::class),
);
}
}
2 changes: 1 addition & 1 deletion src/Domain/Album/AlbumNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function forAlbumDoesnotExistOfId(int $id): self
{
return new self(sprintf(
'The album with album ID %d you requested does not exist.',
$id
$id,
));
}
}
2 changes: 1 addition & 1 deletion src/Domain/Track/TrackDuplicatedRectorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function forDuplicatedTitle(int $id): self
{
return new self(sprintf(
'The track with album id %d has duplicated title.',
$id
$id,
));
}
}
2 changes: 1 addition & 1 deletion src/Domain/Track/TrackNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function forAlbumTrackDoesnotExistOfId(int $id): self
{
return new self(sprintf(
'The album track with track ID %d you requested does not exist.',
$id
$id,
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Album\Infrastructure\Persistence\DMLPersistence;
use Album\Models\AlbumModel;

final class SQLAlbumRepository implements AlbumRepository
final readonly class SQLAlbumRepository implements AlbumRepository
{
use DMLPersistence;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
use Album\Models\AlbumModel;
use Album\Models\TrackModel;

final class SQLAlbumTrackSummaryRepository implements AlbumTrackSummaryRepository
final readonly class SQLAlbumTrackSummaryRepository implements AlbumTrackSummaryRepository
{
public function __construct(private readonly AlbumModel $albumModel, private readonly TrackModel $trackModel)
public function __construct(private AlbumModel $albumModel, private TrackModel $trackModel)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Album\Models\TrackModel;
use Config\Services;

final class SQLTrackRepository implements TrackRepository
final readonly class SQLTrackRepository implements TrackRepository
{
use DMLPersistence {
save as saveData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function testSaveDuplicateDataInsert(): void
'album_id' => 1,
'title' => 'Sahabat Sejati',
'author' => 'Erros Chandra',
]
],
));

$this->expectException(DuplicatedRecordException::class);
Expand All @@ -174,7 +174,7 @@ public function testSaveDuplicateDataInsert(): void
'album_id' => 1,
'title' => 'Sahabat Sejati',
'author' => 'Erros Chandra',
]
],
);
}

Expand All @@ -185,15 +185,15 @@ public function testSaveDuplicateDataUpdate(): void
'album_id' => 1,
'title' => 'Sahabat Sejati',
'author' => 'Erros Chandra',
]
],
));

$this->assertTrue($this->repository->save(
[
'album_id' => 1,
'title' => 'Temani Aku',
'author' => 'Erros Chandra',
]
],
));

$lastId = Database::connect()->insertID();
Expand All @@ -205,7 +205,7 @@ public function testSaveDuplicateDataUpdate(): void
'album_id' => 1,
'title' => 'Sahabat Sejati',
'author' => 'Erros Chandra',
]
],
);
}
}
2 changes: 1 addition & 1 deletion test/unit/Domain/Album/AlbumNotFoundExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testInstantiateforAlbumDoesnotExistOfId(): void
{
$this->assertInstanceOf(
AlbumNotFoundException::class,
AlbumNotFoundException::forAlbumDoesnotExistOfId(1)
AlbumNotFoundException::forAlbumDoesnotExistOfId(1),
);
}
}
2 changes: 1 addition & 1 deletion test/unit/Domain/Track/TrackNotFoundExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testInstantiateforAlbumTrackDoesnotExistOfId(): void
{
$this->assertInstanceOf(
TrackNotFoundException::class,
TrackNotFoundException::forAlbumTrackDoesnotExistOfId(1)
TrackNotFoundException::forAlbumTrackDoesnotExistOfId(1),
);
}
}

0 comments on commit e1d3cef

Please sign in to comment.