mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
Improved typing and phpdoc type annotations
This commit is contained in:
parent
3817ba774d
commit
b7c8ca2a48
39 changed files with 189 additions and 129 deletions
|
@ -232,16 +232,17 @@ class TimeTravel
|
|||
{
|
||||
$reflection = new ReflectionClass($element::class);
|
||||
$property = $reflection->getProperty($field);
|
||||
$property->setAccessible(true);
|
||||
|
||||
return $property->getValue($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null|object $new_value
|
||||
*/
|
||||
protected function setField(AbstractDBElement $element, string $field, mixed $new_value): void
|
||||
{
|
||||
$reflection = new ReflectionClass($element::class);
|
||||
$property = $reflection->getProperty($field);
|
||||
$property->setAccessible(true);
|
||||
|
||||
$property->setValue($element, $new_value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue