mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 15:04:32 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
eef26f7ae6
commit
639829f5c5
97 changed files with 305 additions and 185 deletions
|
@ -27,6 +27,7 @@ use App\Entity\Base\AbstractDBElement;
|
|||
use App\Entity\UserSystem\User;
|
||||
use App\Events\SecurityEvents;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\HttpFoundation\IpUtils;
|
||||
|
||||
/**
|
||||
|
@ -60,7 +61,7 @@ class SecurityEventLogEntry extends AbstractLogEntry
|
|||
public function setTargetElement(?AbstractDBElement $element): AbstractLogEntry
|
||||
{
|
||||
if (!$element instanceof User) {
|
||||
throw new \InvalidArgumentException('Target element must be a User object!');
|
||||
throw new InvalidArgumentException('Target element must be a User object!');
|
||||
}
|
||||
|
||||
return parent::setTargetElement($element);
|
||||
|
@ -75,7 +76,7 @@ class SecurityEventLogEntry extends AbstractLogEntry
|
|||
{
|
||||
$key = array_search($type, static::SECURITY_TYPE_MAPPING, true);
|
||||
if (false === $key) {
|
||||
throw new \InvalidArgumentException('Given event type is not existing!');
|
||||
throw new InvalidArgumentException('Given event type is not existing!');
|
||||
}
|
||||
$this->extra['e'] = $key;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue