Closed zanbaldwin closed 8 years ago
bump. Came here for the same reason. Period should be immutable.
Hi,
the plans are to use DateTimeImmutable
and DateTimeInterface
, but it'll move the PHP version requirement to PHP >= 5.5
But you fix do the job atm. Thanks.
For a time period, the
getBegin()
andgetEnd()
methods should return cloned versions of the periods begin and end times, not the date objects themselves.At present, changing an object returned from either one of these objects changes the time period itself which should be done manually via other methods, or creating a new period via the Factory.