add Laravel 58 set

This commit is contained in:
Tomas Votruba 2019-03-04 00:08:52 +01:00
parent 720199d48f
commit 22c833e302
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,48 @@
services:
# https://laravel-news.com/laravel-5-8-deprecates-string-and-array-helpers
# https://github.com/laravel/framework/pull/26898
Rector\Rector\Function_\FunctionToStaticCallRector:
# Arr
array_add: ['Illuminate\Support\Arr', 'add']
array_collapse: ['Illuminate\Support\Arr', 'collapse']
array_divide: ['Illuminate\Support\Arr', 'divide']
array_dot: ['Illuminate\Support\Arr', 'dot']
array_except: ['Illuminate\Support\Arr', 'except']
array_first: ['Illuminate\Support\Arr', 'first']
array_flatten: ['Illuminate\Support\Arr', 'flatten']
array_forget': ['Illuminate\Support\Arr', 'forget']
array_get: ['Illuminate\Support\Arr', 'get']
array_has: ['Illuminate\Support\Arr', 'has']
array_last: ['Illuminate\Support\Arr', 'last']
array_only: ['Illuminate\Support\Arr', 'only']
array_pluck: ['Illuminate\Support\Arr', 'pluck']
array_prepend: ['Illuminate\Support\Arr', 'prepend']
array_pull': ['Illuminate\Support\Arr', 'pull']
array_random: ['Illuminate\Support\Arr', 'random']
array_set': ['Illuminate\Support\Arr', 'set']
array_sort: ['Illuminate\Support\Arr', 'sort']
array_sort_recursive: ['Illuminate\Support\Arr', 'sortRecursive']
array_where: ['Illuminate\Support\Arr', 'where']
array_wrap: ['Illuminate\Support\Arr', 'wrap']
# Str
camel_case: ['Illuminate\Support\Str', 'camel']
ends_with: ['Illuminate\Support\Str', 'endsWith']
kebab_case: ['Illuminate\Support\Str', 'kebab']
snake_case: ['Illuminate\Support\Str', 'snake']
starts_with: ['Illuminate\Support\Str', 'startsWith']
str_after: ['Illuminate\Support\Str', 'after']
str_before: ['Illuminate\Support\Str', 'before']
str_contains: ['Illuminate\Support\Str', 'contains']
str_finish: ['Illuminate\Support\Str', 'finish']
str_is: ['Illuminate\Support\Str', 'is']
str_limit: ['Illuminate\Support\Str', 'limit']
str_plural: ['Illuminate\Support\Str', 'plural']
str_random: ['Illuminate\Support\Str', 'random']
str_replace_array: ['Illuminate\Support\Str', 'replaceArray']
str_replace_first: ['Illuminate\Support\Str', 'replaceFirst']
str_replace_last: ['Illuminate\Support\Str', 'replaceLast']
str_singular: ['Illuminate\Support\Str', 'singular']
str_slug: ['Illuminate\Support\Str', 'slug']
str_start: ['Illuminate\Support\Str', 'start']
studly_case: ['Illuminate\Support\Str', 'studly']
title_case: ['Illuminate\Support\Str', 'title']

View File

@ -69,7 +69,7 @@ final class FacadeStaticCallToConstructorInjectionRector extends AbstractRector
public function getDefinition(): RectorDefinition
{
return new RectorDefinition('Move Illuminate\Support\Facades\Response static calls to constructor injection', [
return new RectorDefinition('Move Illuminate\Support\Facades\* static calls to constructor injection', [
new CodeSample(
<<<'CODE_SAMPLE'
use Illuminate\Support\Facades\Response;