Since $date->format("Y") gives me a string the later comparisons inside Yasumi failed
if ($year === 2017)
I see three ways solvings this:
1) TypeHinting. My prefered solution
2) Casting / Validating inside the create function (that what type hinting is for)
3) changing the === to type unaware == (Not a solution at all :) )
I saw the documentation states integer as $year but I imagine this to be a stupid trap you can walk into unaware and php offers a nice solution for it.
I ran into the problem, that I call
create
(orcreateByISO3166_2
in my case) like this:Since
$date->format("Y")
gives me a string the later comparisons inside Yasumi failedI see three ways solvings this: 1) TypeHinting. My prefered solution 2) Casting / Validating inside the create function (that what type hinting is for) 3) changing the
===
to type unaware==
(Not a solution at all :) )I saw the documentation states integer as
$year
but I imagine this to be a stupid trap you can walk into unaware and php offers a nice solution for it.