skip to Main Content

PostHog namespace issue – PHP

I installed PostHog in my PHP codebase, and trying to use it by following the tutorial in this link (https://posthog.com/docs/integrate/server/php). I am attempting to call PostHog::init function as a following: PostHog::init($apikey, array('host' => $baseUrl, "debug" => true) ); But I…

VIEW QUESTION

Symfony Translatable Enum – PHP

My supplier entity has enum property notifyType. Any idea how translate the enum this way? {{ supplier.notifyType|trans }} Unfortunately, use __toString method in Enum is not possible. // error - Enum may not include __toString public function __toString(): string {…

VIEW QUESTION

PHPUnit simple method to compare two dates

I'm not familiar with PHPUnit and just want to execute a simple method that return a DateTimeImmutable and compare it with another DateTimeImmutable. public function testGetLunchTimesBeginHour() { $minLunchTime = DateTimeImmutable::createFromFormat('H:i', self::MIN_BEGIN_LUNCH); $maxLunchTime = DateTimeImmutable::createFromFormat('H:i', self::MAX_END_LUNCH); foreach($this->daysOfAppointments as $dayOfAppointments){ $appointments =…

VIEW QUESTION
Back To Top
Search