Loading src/Entity/EntityLogEntry.php +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ class EntityLogEntry extends ContentEntityBase implements EntityLogEntryInterfac // Add the owner field. $fields += static::ownerBaseFieldDefinitions($entity_type); $fields['user_id'] $fields['uid'] ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); Loading src/EntityLoggerInstance.php +13 −12 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\entity_logger; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Logger\RfcLogLevel; use Drupal\entity_logger\Entity\EntityLogEntryInterface; /** * Defines an instance class, to log against a specified entity and log channel. Loading Loading @@ -60,46 +61,46 @@ class EntityLoggerInstance implements EntityLoggerInstanceInterface { /** * {@inheritdoc} */ public function addLogWithSeverity(string $message, array $context = [], int $severity = RfcLogLevel::INFO) { public function addLogWithSeverity(string $message, array $context = [], int $severity = RfcLogLevel::INFO): ?EntityLogEntryInterface { if (!$this->entity) { return NULL; } $this->entityLogger->log($this->entity, $message, $context, $severity, $this->channel); return $this->entityLogger->log($this->entity, $message, $context, $severity, $this->channel); } /** * {@inheritdoc} */ public function addLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context); public function addLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context); } /** * {@inheritdoc} */ public function addInfoLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context); public function addInfoLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context); } /** * {@inheritdoc} */ public function addNoticeLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::NOTICE); public function addNoticeLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::NOTICE); } /** * {@inheritdoc} */ public function addWarningLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::WARNING); public function addWarningLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::WARNING); } /** * {@inheritdoc} */ public function addErrorLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::ERROR); public function addErrorLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::ERROR); } } Loading
src/Entity/EntityLogEntry.php +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ class EntityLogEntry extends ContentEntityBase implements EntityLogEntryInterfac // Add the owner field. $fields += static::ownerBaseFieldDefinitions($entity_type); $fields['user_id'] $fields['uid'] ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); Loading
src/EntityLoggerInstance.php +13 −12 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\entity_logger; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Logger\RfcLogLevel; use Drupal\entity_logger\Entity\EntityLogEntryInterface; /** * Defines an instance class, to log against a specified entity and log channel. Loading Loading @@ -60,46 +61,46 @@ class EntityLoggerInstance implements EntityLoggerInstanceInterface { /** * {@inheritdoc} */ public function addLogWithSeverity(string $message, array $context = [], int $severity = RfcLogLevel::INFO) { public function addLogWithSeverity(string $message, array $context = [], int $severity = RfcLogLevel::INFO): ?EntityLogEntryInterface { if (!$this->entity) { return NULL; } $this->entityLogger->log($this->entity, $message, $context, $severity, $this->channel); return $this->entityLogger->log($this->entity, $message, $context, $severity, $this->channel); } /** * {@inheritdoc} */ public function addLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context); public function addLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context); } /** * {@inheritdoc} */ public function addInfoLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context); public function addInfoLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context); } /** * {@inheritdoc} */ public function addNoticeLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::NOTICE); public function addNoticeLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::NOTICE); } /** * {@inheritdoc} */ public function addWarningLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::WARNING); public function addWarningLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::WARNING); } /** * {@inheritdoc} */ public function addErrorLog(string $message, array $context = []) { $this->addLogWithSeverity($message, $context, RfcLogLevel::ERROR); public function addErrorLog(string $message, array $context = []): ?EntityLogEntryInterface { return $this->addLogWithSeverity($message, $context, RfcLogLevel::ERROR); } }