5 * Simplifies generating of configuration chanined methods.
6 * You can only define configuration properties and use magic methods to set them.
7 * Methods will be named the same way as properties.
8 * * Boolean properties are switched on/off if no values is provided.
9 * * Array properties can accept non-array values, in this case value will be appended to array.
10 * You should also define phpdoc for methods.
15 * @param string $property
20 public function __call($property, $args)
22 if (!property_exists($this, $property)) {
23 throw new \RuntimeException("Property $property in task ".get_class($this).' does not exists');
26 // toggle boolean values
27 if (!isset($args[0]) and (is_bool($this->$property))) {
28 $this->$property = !$this->$property;
32 // append item to array
33 if (is_array($this->$property)) {
34 if (is_array($args[0])) {
35 $this->$property = $args[0];
37 array_push($this->$property, $args[0]);
42 $this->$property = $args[0];