Skip to content

Commit 5b7ffc2

Browse files
committed
rename method
1 parent b72178d commit 5b7ffc2

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,11 @@ public function isEmpty()
554554
}
555555

556556
/**
557-
* Determine if the collection contains a single element.
557+
* Determine if the collection contains a single item.
558558
*
559559
* @return bool
560560
*/
561-
public function isSingle()
561+
public function containsOneItem()
562562
{
563563
return $this->count() === 1;
564564
}

src/Illuminate/Collections/LazyCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,11 @@ public function isEmpty()
557557
}
558558

559559
/**
560-
* Determine if the collection contains a single element.
560+
* Determine if the collection contains a single item.
561561
*
562562
* @return bool
563563
*/
564-
public function isSingle()
564+
public function containsOneItem()
565565
{
566566
return $this->take(2)->count() === 1;
567567
}

tests/Support/SupportCollectionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,11 @@ public function testCountableByWithCallback($collection)
544544
/**
545545
* @dataProvider collectionClassProvider
546546
*/
547-
public function testIsSingle($collection)
547+
public function testContainsOneItem($collection)
548548
{
549-
$this->assertFalse((new $collection([]))->isSingle());
550-
$this->assertTrue((new $collection([1]))->isSingle());
551-
$this->assertFalse((new $collection([1, 2]))->isSingle());
549+
$this->assertFalse((new $collection([]))->containsOneItem());
550+
$this->assertTrue((new $collection([1]))->containsOneItem());
551+
$this->assertFalse((new $collection([1, 2]))->containsOneItem());
552552
}
553553

554554
public function testIterable()

tests/Support/SupportLazyCollectionIsLazyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ public function testIsNotEmptyIsLazy()
484484
});
485485
}
486486

487-
public function testIsSingleIsLazy()
487+
public function testContainsOneItemIsLazy()
488488
{
489489
$this->assertEnumerates(2, function ($collection) {
490-
$collection->isSingle();
490+
$collection->containsOneItem();
491491
});
492492
}
493493

0 commit comments

Comments
 (0)