mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-10 04:59:30 +00:00
Fixed phpstan issues
This commit is contained in:
parent
07db1554c7
commit
1bfea3c48a
6 changed files with 22 additions and 2 deletions
|
|
@ -170,6 +170,7 @@ class EventLoggerListener
|
|||
public function hasFieldRestrictions(AbstractDBElement $element): bool
|
||||
{
|
||||
foreach (array_keys(static::FIELD_BLACKLIST) as $class) {
|
||||
/** @var string $class */
|
||||
if ($element instanceof $class) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -184,6 +185,7 @@ class EventLoggerListener
|
|||
public function shouldFieldBeSaved(AbstractDBElement $element, string $field_name): bool
|
||||
{
|
||||
foreach (static::FIELD_BLACKLIST as $class => $blacklist) {
|
||||
/** @var string $class */
|
||||
if ($element instanceof $class && in_array($field_name, $blacklist, true)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -215,6 +217,7 @@ class EventLoggerListener
|
|||
$mappings = $metadata->getAssociationMappings();
|
||||
//Check if class is whitelisted for CollectionElementDeleted entry
|
||||
foreach (static::TRIGGER_ASSOCIATION_LOG_WHITELIST as $class => $whitelist) {
|
||||
/** @var string $class */
|
||||
if ($entity instanceof $class) {
|
||||
//Check names
|
||||
foreach ($mappings as $field => $mapping) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue