mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
Fixed some PHPStan level 5 issues
This commit is contained in:
parent
74051c5649
commit
19530a9102
35 changed files with 95 additions and 63 deletions
|
@ -79,7 +79,7 @@ class TimeTravel
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function revertEntityToTimestamp(AbstractDBElement $element, DateTime $timestamp, array $reverted_elements = []): void
|
||||
public function revertEntityToTimestamp(AbstractDBElement $element, \DateTimeInterface $timestamp, array $reverted_elements = []): void
|
||||
{
|
||||
if (!$element instanceof TimeStampableInterface) {
|
||||
throw new InvalidArgumentException('$element must have a Timestamp!');
|
||||
|
@ -228,7 +228,7 @@ class TimeTravel
|
|||
$this->setField($element, 'lastModified', $logEntry->getTimestamp());
|
||||
}
|
||||
|
||||
protected function getField(AbstractDBElement $element, string $field)
|
||||
protected function getField(AbstractDBElement $element, string $field): mixed
|
||||
{
|
||||
$reflection = new ReflectionClass($element::class);
|
||||
$property = $reflection->getProperty($field);
|
||||
|
@ -237,7 +237,7 @@ class TimeTravel
|
|||
return $property->getValue($element);
|
||||
}
|
||||
|
||||
protected function setField(AbstractDBElement $element, string $field, \DateTime|int|null $new_value): void
|
||||
protected function setField(AbstractDBElement $element, string $field, mixed $new_value): void
|
||||
{
|
||||
$reflection = new ReflectionClass($element::class);
|
||||
$property = $reflection->getProperty($field);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue