I am trying to refactor a subset of my code as practice and since I am new at Sonata
. I am making a silly mistake but I am stuck at reconciling my mistake:
public function getIsActiveThisYear(EndDate $endDate,StartDate $startDate): bool
{
return $this->$endDate == $date->isCurrentYear() || $this->$startDate == $date->isCurrentYear();
}
I am receiving the following error: No arguments passed
. Keep in mind while answering this question I could be making an obvious mistake or doing it all wrong; a good description will help me learn. Thanks!
This is the full error
1) App\Tests\Entity\ProjectTest::testProjectEndsSameYearIsActiveThisYear
ArgumentCountError: Too few arguments to function App\Entity\Project::getIsActiveThisYear(), 0 passed in /media/dmogaka/CENTOS/LivegeneBackend/livegene_backend/tests/Entity/ProjectTest.php on line 83 and exactly 2 expected