Skip to content

Commit

Permalink
Update LaravelSetProvider with missing sets (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho authored Jan 14, 2025
1 parent 4778bcd commit f80e95e
Showing 1 changed file with 38 additions and 28 deletions.
66 changes: 38 additions & 28 deletions src/Set/LaravelSetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ final class LaravelSetProvider implements SetProviderInterface
* @var string[]
*/
private const LARAVEL_FIVE = [
LaravelSetList::LARAVEL_50,
LaravelSetList::LARAVEL_51,
LaravelSetList::LARAVEL_52,
LaravelSetList::LARAVEL_53,
LaravelSetList::LARAVEL_54,
LaravelSetList::LARAVEL_55,
LaravelSetList::LARAVEL_56,
LaravelSetList::LARAVEL_57,
LaravelSetList::LARAVEL_58,
LaravelSetList::LARAVEL_57,
LaravelSetList::LARAVEL_56,
LaravelSetList::LARAVEL_55,
LaravelSetList::LARAVEL_54,
LaravelSetList::LARAVEL_53,
LaravelSetList::LARAVEL_52,
LaravelSetList::LARAVEL_51,
LaravelSetList::LARAVEL_50,
];

/**
* @var string[]
*/
private const LARAVEL_POST_FIVE = [
LaravelSetList::LARAVEL_60,
LaravelSetList::LARAVEL_70,
LaravelSetList::LARAVEL_80,
LaravelSetList::LARAVEL_90,
LaravelSetList::LARAVEL_100,
LaravelSetList::LARAVEL_110,
LaravelSetList::LARAVEL_100,
LaravelSetList::LARAVEL_90,
LaravelSetList::LARAVEL_80,
LaravelSetList::LARAVEL_70,
LaravelSetList::LARAVEL_60,
];

/**
Expand All @@ -46,13 +46,18 @@ public function provide(): array
return [
new Set(
self::GROUP_NAME,
'array/str func to static calls',
LaravelSetList::ARRAY_STR_FUNCTIONS_TO_STATIC_CALL
'Code quality',
LaravelSetList::LARAVEL_CODE_QUALITY
),
new Set(
self::GROUP_NAME,
'Code quality',
LaravelSetList::LARAVEL_CODE_QUALITY
'Collection improvements and simplifications',
LaravelSetList::LARAVEL_COLLECTION,
),
new Set(
self::GROUP_NAME,
'Container array access to method calls',
LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL,
),
new Set(
self::GROUP_NAME,
Expand All @@ -61,22 +66,27 @@ public function provide(): array
),
new Set(
self::GROUP_NAME,
'Replaces If statements with helpers',
LaravelSetList::LARAVEL_IF_HELPERS,
'Rename Aliases to FQN Classes',
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
),
new Set(
self::GROUP_NAME,
'Replace facades with service injection',
LaravelSetList::LARAVEL_STATIC_TO_INJECTION,
'Replace array/str functions with static calls',
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL
),
new Set(
self::GROUP_NAME,
'Rename Alias to FQN Classes',
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
'Replace If statements with helpers',
LaravelSetList::LARAVEL_IF_HELPERS,
),
new Set(
self::GROUP_NAME,
'Replace Magic Methods to Query Builder',
'Replace facades with service injection',
LaravelSetList::LARAVEL_STATIC_TO_INJECTION,
),
new Set(
self::GROUP_NAME,
'Replace Magic Methods with Query Builder',
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
),
new Set(
Expand All @@ -100,18 +110,18 @@ private function getLaravelVersions(): array
{
$versions = [];

foreach (self::LARAVEL_FIVE as $index => $version) {
foreach (self::LARAVEL_POST_FIVE as $index => $version) {
$versions[] = new Set(
self::GROUP_NAME,
'Laravel Framework 5.' . $index,
'Laravel Framework ' . ($index + 6) . '.0',
$version,
);
}

foreach (self::LARAVEL_POST_FIVE as $index => $version) {
foreach (self::LARAVEL_FIVE as $index => $version) {
$versions[] = new Set(
self::GROUP_NAME,
'Laravel Framework ' . ($index + 6) . '.0',
'Laravel Framework 5.' . $index,
$version,
);
}
Expand Down

0 comments on commit f80e95e

Please sign in to comment.