Skip to content

Commit

Permalink
Merge pull request #17 from samsonasik/bump-dep
Browse files Browse the repository at this point in the history
Bump to CI 4.5.1
  • Loading branch information
samsonasik authored May 2, 2024
2 parents 8fd88b3 + 0921f8d commit b94c3ba
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 47 deletions.
5 changes: 1 addition & 4 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
*/

use App\Controllers\BaseController;
use Config\Paths;

require __DIR__ . '/vendor/codeigniter4/framework/app/Config/Paths.php';
$paths = new Paths();
require __DIR__ . '/vendor/codeigniter4/framework/system/bootstrap.php';
require __DIR__ . '/vendor/codeigniter4/framework/system/Test/bootstrap.php';

// with this check, the class is loaded
class_exists(BaseController::class);
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
},
"conflict": {
"codeigniter4/framework": "<4.3.6"
"codeigniter4/framework": "<4.5.1"
},
"require-dev": {
"codeigniter/coding-standard": "^1.0",
"codeigniter4/framework": "^4.3.6",
"phpstan/phpstan": "^1.7.2",
"phpunit/phpunit": "^10.5",
"codeigniter/coding-standard": "^1.7.15",
"codeigniter4/framework": "^4.5.1",
"phpstan/phpstan": "^1.10.67",
"phpunit/phpunit": "^10.5.20",
"rector/rector": "dev-main"
},
"config": {
Expand Down
45 changes: 19 additions & 26 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,26 @@
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::CODE_QUALITY,
LevelSetList::UP_TO_PHP_81,
SetList::DEAD_CODE,
SetList::TYPE_DECLARATION,
SetList::PRIVATIZATION,
SetList::NAMING,
SetList::CODING_STYLE
]);

$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/test', __DIR__ . '/rector.php', __DIR__ . '/bootstrap.php']);

$rectorConfig->importNames();
$rectorConfig->skip([
return RectorConfig::configure()
->withPreparedSets(
codeQuality: true,
deadCode: true,
typeDeclarations: true,
privatization: true,
naming: true,
codingStyle: true
)
->withPhpSets(php81: true)
->withPaths([__DIR__ . '/src', __DIR__ . '/test'])
->withRootFiles()
->withImportNames()
->withSkip([
// make error on controller load view
StringClassNameToClassConstantRector::class,
// conflict with cs fix
NewlineAfterStatementRector::class,
FinalizeClassesWithoutChildrenRector::class => [
__DIR__ . '/src/Domain/Exception/DuplicatedRecordException.php',
__DIR__ . '/src/Domain/Exception/RecordNotFoundException.php',
],
]);

$rectorConfig->bootstrapFiles([__DIR__ . '/bootstrap.php']);

$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
$rectorConfig->parallel();
};
])
->withBootstrapFiles(
[__DIR__ . '/bootstrap.php']
)
->withPHPStanConfigs([__DIR__ . '/phpstan.neon']);
2 changes: 1 addition & 1 deletion src/Domain/Album/Album.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
final class Album extends Entity
{
/**
* @var array<string, null>|string[]
* @var array<string, null>|list<string>
*/
protected $attributes = [
'id' => null,
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Track/Track.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
final class Track extends Entity
{
/**
* @var array<string, null>|string[]
* @var array<string, null>|list<string>
*/
protected $attributes = [
'id' => null,
Expand Down
2 changes: 1 addition & 1 deletion src/Models/AlbumModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class AlbumModel extends Model
protected $returnType = Album::class;

/**
* @var string[]
* @var list<string>
*/
protected $allowedFields = [
'artist',
Expand Down
2 changes: 1 addition & 1 deletion src/Models/TrackModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class TrackModel extends Model
protected $returnType = Track::class;

/**
* @var string[]
* @var list<string>
*/
protected $allowedFields = [
'album_id',
Expand Down
2 changes: 1 addition & 1 deletion test/Controller/AlbumTrackSummaryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class AlbumTrackSummaryTest extends CIUnitTestCase
protected $namespace = 'Album';

/**
* @var class-string[]
* @var list<class-string>
*/
protected $seed = [
AlbumSeeder::class,
Expand Down
2 changes: 1 addition & 1 deletion test/Controller/TrackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class TrackTest extends CIUnitTestCase
protected $namespace = 'Album';

/**
* @var class-string[]
* @var list<class-string>
*/
protected $seed = [
AlbumSeeder::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testFindAlbumOfIdWithFoundIdInDatabase(): void
}

/**
* @return array<string, mixed[]>
* @return array<string, list<mixed>>
*/
public static function invalidData(): array
{
Expand All @@ -91,7 +91,7 @@ public static function invalidData(): array
}

/**
* @param mixed[]|null $data
* @param list<mixed>|null $data
*/
#[DataProvider('invalidData')]
public function testSaveInvalidData(?array $data): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class SQLAlbumTrackSummaryRepositoryTest extends CIUnitTestCase
protected $namespace = 'Album';

/**
* @var class-string[]
* @var list<class-string>
*/
protected $seed = [
AlbumSeeder::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class SQLTrackRepositoryTest extends CIUnitTestCase
protected $namespace = 'Album';

/**
* @var class-string[]
* @var list<class-string>
*/
protected $seed = [
AlbumSeeder::class,
Expand Down Expand Up @@ -89,7 +89,7 @@ public function testFindTrackOfIdWithFoundIdInDatabase(): void
}

/**
* @return array<string, mixed[]>
* @return array<string, list<mixed>>
*/
public static function invalidData(): array
{
Expand All @@ -104,7 +104,7 @@ public static function invalidData(): array
}

/**
* @param mixed[]|null $data
* @param list<mixed>|null $data
*/
#[DataProvider('invalidData')]
public function testSaveInvalidData(?array $data): void
Expand Down

0 comments on commit b94c3ba

Please sign in to comment.