mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-19 21:11:38 +02:00
fix booklist remove function
This commit is contained in:
@@ -25,7 +25,7 @@ class BookList implements \Countable
|
||||
|
||||
public function removeBook(Book $bookToRemove)
|
||||
{
|
||||
foreach ($this as $key => $book) {
|
||||
foreach ($this->books as $key => $book) {
|
||||
/** @var Book $book */
|
||||
if ($book->getAuthorAndTitle() === $bookToRemove->getAuthorAndTitle()) {
|
||||
unset($this->books[$key]);
|
||||
|
Reference in New Issue
Block a user