diff --git a/app/Helpers/Http/RequestHelper.php b/app/Helpers/Http/RequestHelper.php new file mode 100644 index 0000000..759e79c --- /dev/null +++ b/app/Helpers/Http/RequestHelper.php @@ -0,0 +1,38 @@ + + */ + public static function parseStringIntoArray(string $inputString): array + { + return array_filter( + array_map('trim', explode(',', $inputString)), + static fn ($item) => $item !== '' + ); + } + + /** + * @return array + */ + public static function parseStringIntoIntArray(string $inputString): array + { + return array_map( + 'intval', + array_filter( + self::parseStringIntoArray($inputString), + static fn ($item) => is_numeric($item) + ) + ); + } +} diff --git a/composer.lock b/composer.lock index 0e19065..7ca4465 100644 --- a/composer.lock +++ b/composer.lock @@ -2025,16 +2025,16 @@ }, { "name": "laravel/framework", - "version": "v11.35.0", + "version": "v11.35.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f1a7aaa3c1235b7a95ccaa58db90e0cd9d8c3fcc" + "reference": "dcfa130ede1a6fa4343dc113410963e791ad34fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f1a7aaa3c1235b7a95ccaa58db90e0cd9d8c3fcc", - "reference": "f1a7aaa3c1235b7a95ccaa58db90e0cd9d8c3fcc", + "url": "https://api.github.com/repos/laravel/framework/zipball/dcfa130ede1a6fa4343dc113410963e791ad34fb", + "reference": "dcfa130ede1a6fa4343dc113410963e791ad34fb", "shasum": "" }, "require": { @@ -2236,7 +2236,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-12-10T16:09:29+00:00" + "time": "2024-12-12T18:25:58+00:00" }, { "name": "laravel/prompts", @@ -2549,16 +2549,16 @@ }, { "name": "league/csv", - "version": "9.19.0", + "version": "9.20.0", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "f81df48a012a9e86d077e74eaff666fd15bfab88" + "reference": "553579df208641ada6ffb450b3a151e2fcfa4f31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/f81df48a012a9e86d077e74eaff666fd15bfab88", - "reference": "f81df48a012a9e86d077e74eaff666fd15bfab88", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/553579df208641ada6ffb450b3a151e2fcfa4f31", + "reference": "553579df208641ada6ffb450b3a151e2fcfa4f31", "shasum": "" }, "require": { @@ -2632,7 +2632,7 @@ "type": "github" } ], - "time": "2024-12-08T08:09:35+00:00" + "time": "2024-12-13T15:49:27+00:00" }, { "name": "league/flysystem", @@ -7324,12 +7324,12 @@ "source": { "type": "git", "url": "https://github.com/driftingly/rector-laravel.git", - "reference": "80f0fc8099924fca4d6dda6f8fbc8cdd6808c4f2" + "reference": "7de906ae5772c2993ee6baf683d87c90a850ed96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/80f0fc8099924fca4d6dda6f8fbc8cdd6808c4f2", - "reference": "80f0fc8099924fca4d6dda6f8fbc8cdd6808c4f2", + "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/7de906ae5772c2993ee6baf683d87c90a850ed96", + "reference": "7de906ae5772c2993ee6baf683d87c90a850ed96", "shasum": "" }, "require": { @@ -7351,7 +7351,7 @@ "issues": "https://github.com/driftingly/rector-laravel/issues", "source": "https://github.com/driftingly/rector-laravel/tree/2.0.0" }, - "time": "2024-12-12T15:21:22+00:00" + "time": "2024-12-12T22:16:05+00:00" }, { "name": "fakerphp/faker", diff --git a/config/utils/rector.php b/config/utils/rector.php index 05bcc7f..0371f5c 100644 --- a/config/utils/rector.php +++ b/config/utils/rector.php @@ -21,16 +21,16 @@ ]) ->withPhpVersion(PhpVersion::PHP_83) ->withSets([ - // LaravelLevelSetList::UP_TO_LARAVEL_110, + LaravelLevelSetList::UP_TO_LARAVEL_110, LaravelSetList::LARAVEL_110, - // LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL, + LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL, LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL, - // LaravelSetList::LARAVEL_CODE_QUALITY, + LaravelSetList::LARAVEL_CODE_QUALITY, LaravelSetList::LARAVEL_COLLECTION, LaravelSetList::LARAVEL_CONTAINER_STRING_TO_FULLY_QUALIFIED_NAME, LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER, LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES, - // LaravelSetList::LARAVEL_IF_HELPERS, + LaravelSetList::LARAVEL_IF_HELPERS, LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES, LaravelSetList::LARAVEL_STATIC_TO_INJECTION, ])