Skip to content
Permalink
Browse files

[5.8] Deprecate useless Arr and Str global helper methods/aliases (#2…

  • Loading branch information...
X-Coder264 authored and taylorotwell committed Dec 19, 2018
1 parent fa3ac1e commit 837e6c588a99829a0de61022d3c0b3a64b2fc2a5
@@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Testing\Concerns;
use Illuminate\Support\Arr;
use Illuminate\Console\OutputStyle;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Testing\PendingCommand;
@@ -44,11 +45,11 @@ public function artisan($command, $parameters = [])
$this->beforeApplicationDestroyed(function () {
if (count($this->expectedQuestions)) {
$this->fail('Question "'.array_first($this->expectedQuestions)[0].'" was not asked.');
$this->fail('Question "'.Arr::first($this->expectedQuestions)[0].'" was not asked.');
}
if (count($this->expectedOutput)) {
$this->fail('Output "'.array_first($this->expectedOutput).'" was not printed.');
$this->fail('Output "'.Arr::first($this->expectedOutput).'" was not printed.');
}
});
@@ -38,6 +38,8 @@ function append_config(array $array)
* @param string $key
* @param mixed $value
* @return array
*
* @deprecated Arr::add() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_add($array, $key, $value)
{
@@ -51,6 +53,8 @@ function array_add($array, $key, $value)
*
* @param array $array
* @return array
*
* @deprecated Arr::collapse() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_collapse($array)
{
@@ -64,6 +68,8 @@ function array_collapse($array)
*
* @param array $array
* @return array
*
* @deprecated Arr::divide() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_divide($array)
{
@@ -78,6 +84,8 @@ function array_divide($array)
* @param array $array
* @param string $prepend
* @return array
*
* @deprecated Arr::dot() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_dot($array, $prepend = '')
{
@@ -92,6 +100,8 @@ function array_dot($array, $prepend = '')
* @param array $array
* @param array|string $keys
* @return array
*
* @deprecated Arr::except() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_except($array, $keys)
{
@@ -107,6 +117,8 @@ function array_except($array, $keys)
* @param callable|null $callback
* @param mixed $default
* @return mixed
*
* @deprecated Arr::first() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_first($array, callable $callback = null, $default = null)
{
@@ -121,6 +133,8 @@ function array_first($array, callable $callback = null, $default = null)
* @param array $array
* @param int $depth
* @return array
*
* @deprecated Arr::flatten() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_flatten($array, $depth = INF)
{
@@ -135,6 +149,8 @@ function array_flatten($array, $depth = INF)
* @param array $array
* @param array|string $keys
* @return void
*
* @deprecated Arr::forget() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_forget(&$array, $keys)
{
@@ -150,6 +166,8 @@ function array_forget(&$array, $keys)
* @param string $key
* @param mixed $default
* @return mixed
*
* @deprecated Arr::get() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_get($array, $key, $default = null)
{
@@ -164,6 +182,8 @@ function array_get($array, $key, $default = null)
* @param \ArrayAccess|array $array
* @param string|array $keys
* @return bool
*
* @deprecated Arr::has() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_has($array, $keys)
{
@@ -179,6 +199,8 @@ function array_has($array, $keys)
* @param callable|null $callback
* @param mixed $default
* @return mixed
*
* @deprecated Arr::last() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_last($array, callable $callback = null, $default = null)
{
@@ -193,6 +215,8 @@ function array_last($array, callable $callback = null, $default = null)
* @param array $array
* @param array|string $keys
* @return array
*
* @deprecated Arr::only() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_only($array, $keys)
{
@@ -208,6 +232,8 @@ function array_only($array, $keys)
* @param string|array $value
* @param string|array|null $key
* @return array
*
* @deprecated Arr::pluck() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_pluck($array, $value, $key = null)
{
@@ -223,6 +249,8 @@ function array_pluck($array, $value, $key = null)
* @param mixed $value
* @param mixed $key
* @return array
*
* @deprecated Arr::prepend() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_prepend($array, $value, $key = null)
{
@@ -238,6 +266,8 @@ function array_prepend($array, $value, $key = null)
* @param string $key
* @param mixed $default
* @return mixed
*
* @deprecated Arr::pull() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_pull(&$array, $key, $default = null)
{
@@ -252,6 +282,8 @@ function array_pull(&$array, $key, $default = null)
* @param array $array
* @param int|null $num
* @return mixed
*
* @deprecated Arr::random() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_random($array, $num = null)
{
@@ -269,6 +301,8 @@ function array_random($array, $num = null)
* @param string $key
* @param mixed $value
* @return array
*
* @deprecated Arr::set() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_set(&$array, $key, $value)
{
@@ -283,6 +317,8 @@ function array_set(&$array, $key, $value)
* @param array $array
* @param callable|string|null $callback
* @return array
*
* @deprecated Arr::sort() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_sort($array, $callback = null)
{
@@ -296,6 +332,8 @@ function array_sort($array, $callback = null)
*
* @param array $array
* @return array
*
* @deprecated Arr::sortRecursive() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_sort_recursive($array)
{
@@ -310,6 +348,8 @@ function array_sort_recursive($array)
* @param array $array
* @param callable $callback
* @return array
*
* @deprecated Arr::where() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_where($array, callable $callback)
{
@@ -323,6 +363,8 @@ function array_where($array, callable $callback)
*
* @param mixed $value
* @return array
*
* @deprecated Arr::wrap() should be used directly instead. Will be removed in Laravel 5.9.
*/
function array_wrap($value)
{
@@ -365,6 +407,8 @@ function blank($value)
*
* @param string $value
* @return string
*
* @deprecated Str::camel() should be used directly instead. Will be removed in Laravel 5.9.
*/
function camel_case($value)
{
@@ -572,6 +616,8 @@ function e($value, $doubleEncode = true)
* @param string $haystack
* @param string|array $needles
* @return bool
*
* @deprecated Str::endsWith() should be used directly instead. Will be removed in Laravel 5.9.
*/
function ends_with($haystack, $needles)
{
@@ -650,6 +696,8 @@ function head($array)
*
* @param string $value
* @return string
*
* @deprecated Str::kebab() should be used directly instead. Will be removed in Laravel 5.9.
*/
function kebab_case($value)
{
@@ -778,6 +826,8 @@ function retry($times, callable $callback, $sleep = 0)
* @param string $value
* @param string $delimiter
* @return string
*
* @deprecated Str::snake() should be used directly instead. Will be removed in Laravel 5.9.
*/
function snake_case($value, $delimiter = '_')
{
@@ -792,6 +842,8 @@ function snake_case($value, $delimiter = '_')
* @param string $haystack
* @param string|array $needles
* @return bool
*
* @deprecated Str::startsWith() should be used directly instead. Will be removed in Laravel 5.9.
*/
function starts_with($haystack, $needles)
{
@@ -806,6 +858,8 @@ function starts_with($haystack, $needles)
* @param string $subject
* @param string $search
* @return string
*
* @deprecated Str::after() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_after($subject, $search)
{
@@ -820,6 +874,8 @@ function str_after($subject, $search)
* @param string $subject
* @param string $search
* @return string
*
* @deprecated Str::before() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_before($subject, $search)
{
@@ -834,6 +890,8 @@ function str_before($subject, $search)
* @param string $haystack
* @param string|array $needles
* @return bool
*
* @deprecated Str::contains() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_contains($haystack, $needles)
{
@@ -848,6 +906,8 @@ function str_contains($haystack, $needles)
* @param string $value
* @param string $cap
* @return string
*
* @deprecated Str::finish() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_finish($value, $cap)
{
@@ -862,6 +922,8 @@ function str_finish($value, $cap)
* @param string|array $pattern
* @param string $value
* @return bool
*
* @deprecated Str::is() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_is($pattern, $value)
{
@@ -877,6 +939,8 @@ function str_is($pattern, $value)
* @param int $limit
* @param string $end
* @return string
*
* @deprecated Str::limit() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_limit($value, $limit = 100, $end = '...')
{
@@ -891,6 +955,8 @@ function str_limit($value, $limit = 100, $end = '...')
* @param string $value
* @param int $count
* @return string
*
* @deprecated Str::plural() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_plural($value, $count = 2)
{
@@ -906,6 +972,8 @@ function str_plural($value, $count = 2)
* @return string
*
* @throws \RuntimeException
*
* @deprecated Str::random() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_random($length = 16)
{
@@ -921,6 +989,8 @@ function str_random($length = 16)
* @param array $replace
* @param string $subject
* @return string
*
* @deprecated Str::replaceArray() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_replace_array($search, array $replace, $subject)
{
@@ -936,6 +1006,8 @@ function str_replace_array($search, array $replace, $subject)
* @param string $replace
* @param string $subject
* @return string
*
* @deprecated Str::replaceFirst() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_replace_first($search, $replace, $subject)
{
@@ -951,6 +1023,8 @@ function str_replace_first($search, $replace, $subject)
* @param string $replace
* @param string $subject
* @return string
*
* @deprecated Str::replaceLast() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_replace_last($search, $replace, $subject)
{
@@ -964,6 +1038,8 @@ function str_replace_last($search, $replace, $subject)
*
* @param string $value
* @return string
*
* @deprecated Str::singular() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_singular($value)
{
@@ -979,6 +1055,8 @@ function str_singular($value)
* @param string $separator
* @param string $language
* @return string
*
* @deprecated Str::slug() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_slug($title, $separator = '-', $language = 'en')
{
@@ -993,6 +1071,8 @@ function str_slug($title, $separator = '-', $language = 'en')
* @param string $value
* @param string $prefix
* @return string
*
* @deprecated Str::start() should be used directly instead. Will be removed in Laravel 5.9.
*/
function str_start($value, $prefix)
{
@@ -1006,6 +1086,8 @@ function str_start($value, $prefix)
*
* @param string $value
* @return string
*
* @deprecated Str::studly() should be used directly instead. Will be removed in Laravel 5.9.
*/
function studly_case($value)
{
@@ -1080,6 +1162,8 @@ function throw_unless($condition, $exception, ...$parameters)
*
* @param string $value
* @return string
*
* @deprecated Str::title() should be used directly instead. Will be removed in Laravel 5.9.
*/
function title_case($value)
{

0 comments on commit 837e6c5

Please sign in to comment.
You can’t perform that action at this time.