| @@ 72-81 (lines=10) @@ | ||
| 69 | /** |
|
| 70 | * @param array $attributes |
|
| 71 | */ |
|
| 72 | public function __construct(array $attributes) |
|
| 73 | { |
|
| 74 | foreach ($attributes as $key => $value) { |
|
| 75 | $prop = camel_case($key); |
|
| 76 | ||
| 77 | if (property_exists($this, $prop)) { |
|
| 78 | $this->{$prop} = $value; |
|
| 79 | } |
|
| 80 | } |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * @param int $lifetime |
|
| @@ 27-36 (lines=10) @@ | ||
| 24 | /** |
|
| 25 | * @param array $attributes |
|
| 26 | */ |
|
| 27 | public function __construct(array $attributes = []) |
|
| 28 | { |
|
| 29 | foreach ($attributes as $key => $value) { |
|
| 30 | $camelCase = camel_case($key); |
|
| 31 | ||
| 32 | if (property_exists($this, $camelCase)) { |
|
| 33 | $this->{$camelCase} = $value; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * @return float |
|