yohang / CalendR

The missing PHP 5.3+ calendar management library.
http:/yohan.giarel.li/CalendR
MIT License
465 stars 65 forks source link

Clone Period Dates #34

Closed zanbaldwin closed 8 years ago

zanbaldwin commented 10 years ago

For a time period, the getBegin() and getEnd() 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.

SpacefulSpecies commented 9 years ago

bump. Came here for the same reason. Period should be immutable.

yohang commented 8 years ago

Hi,

the plans are to use DateTimeImmutable and DateTimeInterface, but it'll move the PHP version requirement to PHP >= 5.5

yohang commented 8 years ago

But you fix do the job atm. Thanks.