Upgrade to 3.8.0
This commit is contained in:
@@ -23,10 +23,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function indexOf($collection = null): int
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->indexOf($this);
|
||||
}
|
||||
|
||||
@@ -39,10 +36,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function next($collection = null)
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->nth($this->indexOf($collection) + 1);
|
||||
}
|
||||
|
||||
@@ -55,10 +49,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function nextAll($collection = null)
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->slice($this->indexOf($collection) + 1);
|
||||
}
|
||||
|
||||
@@ -71,10 +62,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function prev($collection = null)
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->nth($this->indexOf($collection) - 1);
|
||||
}
|
||||
|
||||
@@ -87,10 +75,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function prevAll($collection = null)
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->slice(0, $this->indexOf($collection));
|
||||
}
|
||||
|
||||
@@ -144,10 +129,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function isFirst($collection = null): bool
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->first()->is($this);
|
||||
}
|
||||
|
||||
@@ -160,10 +142,7 @@ trait HasSiblings
|
||||
*/
|
||||
public function isLast($collection = null): bool
|
||||
{
|
||||
if ($collection === null) {
|
||||
$collection = $this->siblingsCollection();
|
||||
}
|
||||
|
||||
$collection ??= $this->siblingsCollection();
|
||||
return $collection->last()->is($this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user