mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-13 13:46:13 +00:00
refactored code
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
17
src/Id/Concerns/MagicProperties.php
Normal file
17
src/Id/Concerns/MagicProperties.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\Concerns;
|
||||
|
||||
use stdClass;
|
||||
|
||||
trait MagicProperties
|
||||
{
|
||||
protected function setMagicProperties(stdClass $data): void
|
||||
{
|
||||
foreach ($data as $key => $value) {
|
||||
if (property_exists($this, $key)) {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user