diff --git a/phpstan-baseline-level-3.neon b/phpstan-baseline-level-3.neon index c5e4d32fc..bcc9b773d 100644 --- a/phpstan-baseline-level-3.neon +++ b/phpstan-baseline-level-3.neon @@ -10,16 +10,6 @@ parameters: count: 1 path: src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php - - - message: "#^Parameter \\#3 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\) of method Chill\\\\ActivityBundle\\\\Service\\\\DocGenerator\\\\ActivityContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#" - count: 1 - path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php - - - - message: "#^Parameter \\#3 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\) of method Chill\\\\ActivityBundle\\\\Service\\\\DocGenerator\\\\ActivityContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#" - count: 3 - path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php - - message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityReason\\) of method Chill\\\\ActivityBundle\\\\Templating\\\\Entity\\\\ActivityReasonRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#" count: 2 diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index ac832b34b..60af723dc 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -32,6 +32,9 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @implements DocGeneratorContextWithPublicFormInterface + */ class ActivityContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface @@ -237,9 +240,6 @@ class ActivityContext implements return $denormalized; } - /** - * @param Activity $entity - */ public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $storedObject->setTitle($this->translatableStringHelper->localize($template->getName())); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php index c5efc4bfd..ce75cafa8 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php @@ -134,7 +134,7 @@ final class ChillDocumentManager implements DocumentManagerInterface */ public function getCreationDate(Document $document): DateTimeInterface { - return $document->getCreationDate(); + return $document->getCreatedAt() ?? new \DateTimeImmutable('now'); } /**