Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

[5.4] Reduce the number of helpers #194

@garygreen

Description

@garygreen

It's been spoken about a few times but I think the number of helpers in Laravel is pretty large at the moment. How about a rule is created where if a helper isn't much shorter than just calling the method directly, then get rid of the helper. If people like the helper and would like to use it in their own app, they can create their own alias - we can create an exception to some 'commonly used' helpers.

Some suspects:

array_add -> Arr:add
array_collapse -> Arr:collapse
array_divide -> Arr:divide
array_dot -> Arr:dot
array_except -> Arr::except
array_first -> Arr::first
array_flatten -> Arr::flatten
array_forget -> Arr::forget
array_get -> Arr::get
array_has -> Arr::has
array_last -> Arr::last
array_only -> Arr::only
array_pluck -> Arr::pluck
array_prepend -> Arr::prepend
array_pull -> Arr::pull
array_set -> Arr::set
array_sort -> Arr::sort
array_sort_recursive -> Arr::array_sort_recursive
array_where -> Arr::array_where

camel_case -> Str::camel
snake_case -> Str::snake
starts_with -> Str::startsWith
ends_with -> Str::endsWith
str_contains -> Str::contains
str_finish -> Str::finish
str_is -> Str::is
str_limit -> Str::limit
str_plural -> Str::plural
str_random -> Str::random
str_replace_array -> Str::replaceArray
str_replace_first -> Str::replaceFirst
str_replace_last -> Str::replaceLast
str_singular -> Str::singular
str_slug -> Str::slug
studly_case -> Str::studly
title_case -> Str::title

validator -> Validator::make

info -> Log::info

head -> reset

last -> end

resolve -> app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions