The expression \DateTime::createFromFor...6F', microtime(true))); of type DateTime|false adds false to the return on line 22 which is incompatible with the return type documented by Smartbox\CoreBundle\Util...Creator::getNowDateTime of type DateTime. It seems like you forgot to handle an error condition.