diff --git a/.docker/app_test/Dockerfile b/.docker/app_test/Dockerfile index a275da0..253a38c 100644 --- a/.docker/app_test/Dockerfile +++ b/.docker/app_test/Dockerfile @@ -13,5 +13,4 @@ COPY . /packages/ValueObject WORKDIR /packages/ValueObject RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -RUN composer -vvv global require hirak/prestissimo RUN composer install diff --git a/src/Utils/LoggerTrait.php b/src/Utils/LoggerTrait.php index 30995a1..1cf75e3 100644 --- a/src/Utils/LoggerTrait.php +++ b/src/Utils/LoggerTrait.php @@ -60,11 +60,15 @@ public function setLogger(LoggerInterface $logger): self * @param int $level * @param mixed[] $context * + * @SuppressWarnings(PHPMD.ErrorControlOperator) + * * @return $this */ public function logMessage(string $message, int $level, array $context = []): self { if (!$this->logger instanceof LoggerInterface) { + @trigger_error('Logger not set for class:'.get_class($this), E_USER_WARNING); + return $this; } @@ -105,11 +109,15 @@ public function logMessage(string $message, int $level, array $context = []): se * @param int $level * @param string $message The error message to log * + * @SuppressWarnings(PHPMD.ErrorControlOperator) + * * @return $this */ public function logException(Throwable $exception, int $level, string $message): self { if (!$this->logger instanceof LoggerInterface) { + @trigger_error('Logger not set for class:'.get_class($this), E_USER_WARNING); + return $this; }