Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -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);
}