Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Thumbs.db
.phpunit.result.cache
.direnv
.envrc
.devenv
.devenv.serena/
36 changes: 0 additions & 36 deletions src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,42 +168,6 @@ function array_fetch($array, $key)
}
}

if ( ! function_exists('array_first'))
{
/**
* Return the first element in an array passing a given truth test.
*
* @param array $array
* @param \Closure $callback
* @param mixed $default
* @return mixed
*
* @deprecated Use \Illuminate\Support\Arr::first() instead.
*/
function array_first($array, $callback, $default = null)
{
return Arr::first($array, $callback, $default);
}
}

if ( ! function_exists('array_last'))
{
/**
* Return the last element in an array passing a given truth test.
*
* @param array $array
* @param \Closure $callback
* @param mixed $default
* @return mixed
*
* @deprecated Use \Illuminate\Support\Arr::last() instead.
*/
function array_last($array, $callback, $default = null)
{
return Arr::last($array, $callback, $default);
}
}

if ( ! function_exists('array_flatten'))
{
/**
Expand Down
13 changes: 0 additions & 13 deletions tests/Support/SupportHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@ public function testArrayDivide()
}


public function testArrayFirst()
{
$array = ['name' => 'taylor', 'otherDeveloper' => 'dayle'];
$this->assertEquals('dayle', array_first($array, function($value, $key) { return $value == 'dayle'; }));
}

public function testArrayLast()
{
$array = [100, 250, 290, 320, 500, 560, 670];
$this->assertEquals(670, array_last($array, function($value, $key) { return $value > 320; }));
}


public function testArrayFetch()
{
$data = [
Expand Down
Loading