Compare commits
2 Commits
d48f24ed98
...
eff0b86762
Author | SHA1 | Date | |
---|---|---|---|
eff0b86762 | |||
39a1f9d85a |
@ -25,9 +25,15 @@ class Neuron {
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param object|array $data
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(array|object $data = []) {
|
||||
public function __construct(...$data) {
|
||||
if (count($data) === 1 &&
|
||||
isset($data[0]) &&
|
||||
(is_array($data[0]) ||
|
||||
is_object($data[0])))
|
||||
$data = $data[0];
|
||||
|
||||
foreach($data as $key => $value)
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
@ -38,9 +44,8 @@ class Neuron {
|
||||
* @param string $index
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get(string $index) {
|
||||
return (isset($this->{$index}) &&
|
||||
$this->{$index} != '') ? $this->{$index} : null;
|
||||
public function __get(string $index) : mixed {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user