pick-my-talks icon indicating copy to clipboard operation
pick-my-talks copied to clipboard

Objects are constructed in a broken state by default

Open stof opened this issue 10 years ago • 1 comments

Objects used in this package are meant to be constructed through named constructors. However, this is not enforced by making the constructor private. And several objects will be broken if they got instantiated without using the static named constructors (triggering PHP errors, potentially fatal ones).

this affects for instance the PersonalSchedule and the Conference objects

there is 2 ways to fix this. I don't know which one you prefer:

  • adding a constructor to enforce that the object is built with the required informations
  • adding a private constructor to enforce the usage of the named constructors

stof avatar Oct 03 '14 15:10 stof

Very good catch. Yup, private methods will be the way :)

everzet avatar Nov 10 '14 19:11 everzet