');
$this->outputEditmode('
');
-
- return $this;
}
/**
* {@inheritdoc}
*/
- public function blockConstruct()
+ public function blockConstruct(): void
{
// set the current block suffix for the child elements (0, 1, 3, ...)
// this will be removed in blockDestruct
@@ -198,7 +196,7 @@ public function blockConstruct()
/**
* {@inheritdoc}
*/
- public function blockStart($showControls = true, $return = false, $additionalClass = '')
+ public function blockStart(bool $showControls = true, bool $return = false, string $additionalClass = '')
{
$attributes = [
'data-name' => $this->getName(),
@@ -263,7 +261,7 @@ public function setConfig(array $config): static
/**
* If object was serialized, set cached elements to null
*/
- public function __wakeup()
+ public function __wakeup(): void
{
parent::__wakeup();
$this->cachedCurrentElement = null;
diff --git a/models/Document/Editable/Snippet.php b/models/Document/Editable/Snippet.php
index c1388232fa4..9164540f059 100644
--- a/models/Document/Editable/Snippet.php
+++ b/models/Document/Editable/Snippet.php
@@ -59,7 +59,7 @@ public function getData(): mixed
return $this->id;
}
- public function setId(int $id)
+ public function setId(int $id): void
{
$this->id = $id;
}
@@ -210,7 +210,7 @@ public function resolveDependencies(): array
/**
* {@inheritdoc}
*/
- public function __sleep()
+ public function __sleep(): array
{
$finalVars = [];
$parentVars = parent::__sleep();
@@ -245,7 +245,7 @@ public function rewriteIds(array $idMapping): void
}
}
- public function setSnippet(Document\Snippet $snippet)
+ public function setSnippet(Document\Snippet $snippet): void
{
if ($snippet instanceof Document\Snippet) {
$this->id = $snippet->getId();
diff --git a/models/Document/Editable/Video.php b/models/Document/Editable/Video.php
index c0ad9361199..b0218ad7eea 100644
--- a/models/Document/Editable/Video.php
+++ b/models/Document/Editable/Video.php
@@ -222,7 +222,7 @@ public function getData(): mixed
/**
* @return mixed
*/
- protected function getDataEditmode()
+ protected function getDataEditmode(): mixed
{
$data = $this->getData();
diff --git a/models/Document/Email/Dao.php b/models/Document/Email/Dao.php
index 9c8398fdafb..0856325588a 100644
--- a/models/Document/Email/Dao.php
+++ b/models/Document/Email/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Document\PageSnippet\Dao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -49,7 +49,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
@@ -61,7 +61,7 @@ public function create()
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->deleteAllProperties();
diff --git a/models/Document/Folder/Dao.php b/models/Document/Folder/Dao.php
index f3bf9688e1f..74f078e6f9b 100644
--- a/models/Document/Folder/Dao.php
+++ b/models/Document/Folder/Dao.php
@@ -27,7 +27,7 @@ class Dao extends Model\Document\Dao
/**
* Deletes the folder
*/
- public function delete()
+ public function delete(): void
{
parent::delete();
}
diff --git a/models/Document/Hardlink.php b/models/Document/Hardlink.php
index d1887adf6df..2eccbe08723 100644
--- a/models/Document/Hardlink.php
+++ b/models/Document/Hardlink.php
@@ -202,7 +202,7 @@ public function hasChildren(bool $includingUnpublished = false): bool
/**
* {@inheritdoc}
*/
- protected function doDelete()
+ protected function doDelete(): void
{
// check for redirects pointing to this document, and delete them too
$redirects = new Redirect\Listing();
@@ -219,7 +219,7 @@ protected function doDelete()
/**
* {@inheritdoc}
*/
- protected function update(array $params = [])
+ protected function update(array $params = []): void
{
parent::update($params);
$this->saveScheduledTasks();
diff --git a/models/Document/Hardlink/Dao.php b/models/Document/Hardlink/Dao.php
index 624f8f5ff72..db215b1ca1f 100644
--- a/models/Document/Hardlink/Dao.php
+++ b/models/Document/Hardlink/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Document\Dao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -49,7 +49,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
diff --git a/models/Document/Hardlink/Wrapper.php b/models/Document/Hardlink/Wrapper.php
index d74dadf4ce7..307988e1aad 100644
--- a/models/Document/Hardlink/Wrapper.php
+++ b/models/Document/Hardlink/Wrapper.php
@@ -45,7 +45,7 @@ public function save(array $parameters = []): static
*
* @throws \Exception
*/
- protected function update(array $params = [])
+ protected function update(array $params = []): void
{
throw $this->getHardlinkError();
}
@@ -53,7 +53,7 @@ protected function update(array $params = [])
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
throw $this->getHardlinkError();
}
@@ -189,7 +189,7 @@ public function getSourceDocument(): ?Document
return $this->sourceDocument;
}
- public function setSourceDocument(Document $sourceDocument): void
+ public function setSourceDocument(Document $sourceDocument): static
{
$this->sourceDocument = $sourceDocument;
diff --git a/models/Document/Hardlink/Wrapper/WrapperInterface.php b/models/Document/Hardlink/Wrapper/WrapperInterface.php
index 50d844dc38b..b428d3378c7 100644
--- a/models/Document/Hardlink/Wrapper/WrapperInterface.php
+++ b/models/Document/Hardlink/Wrapper/WrapperInterface.php
@@ -21,11 +21,17 @@
interface WrapperInterface extends ElementInterface
{
- public function setHardLinkSource(Document\Hardlink $hardLinkSource);
+ /**
+ * @return $this
+ */
+ public function setHardLinkSource(Document\Hardlink $hardLinkSource): static;
public function getHardLinkSource(): Document\Hardlink;
- public function setSourceDocument(Document $sourceDocument);
+ /**
+ * @return $this
+ */
+ public function setSourceDocument(Document $sourceDocument): static;
public function getSourceDocument(): ?Document;
}
diff --git a/models/Document/Link.php b/models/Document/Link.php
index c2eff475cae..2cc919ae220 100644
--- a/models/Document/Link.php
+++ b/models/Document/Link.php
@@ -382,17 +382,14 @@ public function getHtml(): string
/**
* {@inheritdoc}
*/
- protected function update(array $params = [])
+ protected function update(array $params = []): void
{
parent::update($params);
$this->saveScheduledTasks();
}
- /**
- * @return array
- */
- public function __sleep()
+ public function __sleep(): array
{
$finalVars = [];
$parentVars = parent::__sleep();
diff --git a/models/Document/Link/Dao.php b/models/Document/Link/Dao.php
index d7790b5dbf1..10211edc07b 100644
--- a/models/Document/Link/Dao.php
+++ b/models/Document/Link/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Document\Dao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -50,7 +50,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
diff --git a/models/Document/Newsletter.php b/models/Document/Newsletter.php
index 3fe577be7e2..a506ec07fbf 100644
--- a/models/Document/Newsletter.php
+++ b/models/Document/Newsletter.php
@@ -158,7 +158,7 @@ public function getEnableTrackingParameters(): bool
return $this->enableTrackingParameters;
}
- public function setEnableTrackingParameters(bool $enableTrackingParameters)
+ public function setEnableTrackingParameters(bool $enableTrackingParameters): void
{
$this->enableTrackingParameters = $enableTrackingParameters;
}
@@ -168,7 +168,7 @@ public function getTrackingParameterSource(): string
return $this->trackingParameterSource;
}
- public function setTrackingParameterSource(string $trackingParameterSource)
+ public function setTrackingParameterSource(string $trackingParameterSource): void
{
$this->trackingParameterSource = $trackingParameterSource;
}
@@ -178,7 +178,7 @@ public function getTrackingParameterMedium(): string
return $this->trackingParameterMedium;
}
- public function setTrackingParameterMedium(string $trackingParameterMedium)
+ public function setTrackingParameterMedium(string $trackingParameterMedium): void
{
$this->trackingParameterMedium = $trackingParameterMedium;
}
@@ -197,7 +197,7 @@ public function getTrackingParameterName(): ?string
return $this->trackingParameterName;
}
- public function setTrackingParameterName(string $trackingParameterName)
+ public function setTrackingParameterName(string $trackingParameterName): void
{
$this->trackingParameterName = $trackingParameterName;
}
@@ -207,7 +207,7 @@ public function getSendingMode(): string
return $this->sendingMode;
}
- public function setSendingMode(string $sendingMode)
+ public function setSendingMode(string $sendingMode): void
{
$this->sendingMode = $sendingMode;
}
diff --git a/models/Document/Newsletter/Dao.php b/models/Document/Newsletter/Dao.php
index 16258f38782..998a9de82c6 100644
--- a/models/Document/Newsletter/Dao.php
+++ b/models/Document/Newsletter/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Document\PageSnippet\Dao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -49,7 +49,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
@@ -63,7 +63,7 @@ public function create()
*
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->deleteAllProperties();
diff --git a/models/Document/Page.php b/models/Document/Page.php
index da6e52b6d2c..4d6fac35fe7 100644
--- a/models/Document/Page.php
+++ b/models/Document/Page.php
@@ -74,7 +74,7 @@ class Page extends TargetingDocument
/**
* {@inheritdoc}
*/
- protected function doDelete()
+ protected function doDelete(): void
{
// check for redirects pointing to this document, and delete them too
$redirects = new Redirect\Listing();
@@ -164,7 +164,7 @@ public function getPrettyUrl(): ?string
*
* @param array|string $targetGroupIds
*/
- public function setTargetGroupIds(array|string $targetGroupIds)
+ public function setTargetGroupIds(array|string $targetGroupIds): void
{
if (is_array($targetGroupIds)) {
$targetGroupIds = implode(',', $targetGroupIds);
@@ -194,7 +194,7 @@ public function getTargetGroupIds(): string
*
* @param TargetGroup[]|int[] $targetGroups
*/
- public function setTargetGroups(array $targetGroups)
+ public function setTargetGroups(array $targetGroups): void
{
$ids = array_map(function ($targetGroup) {
if (is_numeric($targetGroup)) {
diff --git a/models/Document/Page/Dao.php b/models/Document/Page/Dao.php
index 299756f531a..baa55882063 100644
--- a/models/Document/Page/Dao.php
+++ b/models/Document/Page/Dao.php
@@ -34,7 +34,7 @@ class Dao extends Model\Document\PageSnippet\Dao implements TargetingDocumentDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -58,7 +58,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
@@ -70,7 +70,7 @@ public function create()
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->deleteAllProperties();
diff --git a/models/Document/PageSnippet.php b/models/Document/PageSnippet.php
index 9d4b9af738d..bd5e0e4ca77 100644
--- a/models/Document/PageSnippet.php
+++ b/models/Document/PageSnippet.php
@@ -123,7 +123,7 @@ public function save(array $parameters = []): static
/**
* {@inheritdoc}
*/
- protected function update(array $params = [])
+ protected function update(array $params = []): void
{
// update elements
$editables = $this->getEditables();
@@ -215,7 +215,7 @@ public function saveVersion(bool $setModificationDate = true, bool $saveOnlyVers
/**
* {@inheritdoc}
*/
- protected function doDelete()
+ protected function doDelete(): void
{
// Dispatch Symfony Message Bus to delete versions
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
@@ -505,7 +505,7 @@ public function getHref(): string
/**
* {@inheritdoc}
*/
- public function __sleep()
+ public function __sleep(): array
{
$finalVars = [];
$parentVars = parent::__sleep();
@@ -601,7 +601,7 @@ public function supportsContentMaster(): bool
*
* @internal
*/
- protected function checkMissingRequiredEditable()
+ protected function checkMissingRequiredEditable(): void
{
// load data which must be requested
$this->getProperties();
diff --git a/models/Document/PageSnippet/Dao.php b/models/Document/PageSnippet/Dao.php
index 1957c964bba..7daffea1139 100644
--- a/models/Document/PageSnippet/Dao.php
+++ b/models/Document/PageSnippet/Dao.php
@@ -30,7 +30,7 @@ abstract class Dao extends Model\Document\Dao
/**
* Delete all editables containing the content from the database
*/
- public function deleteAllEditables()
+ public function deleteAllEditables(): void
{
$this->db->delete('documents_editables', ['documentId' => $this->model->getId()]);
}
diff --git a/models/Document/PrintAbstract.php b/models/Document/PrintAbstract.php
index 4b6bdcb6177..fb6e63bb5b0 100644
--- a/models/Document/PrintAbstract.php
+++ b/models/Document/PrintAbstract.php
@@ -46,7 +46,7 @@ abstract class PrintAbstract extends Document\PageSnippet
*/
protected ?string $controller = 'web2print';
- public function setLastGeneratedDate(\DateTime $lastGenerated)
+ public function setLastGeneratedDate(\DateTime $lastGenerated): void
{
$this->lastGenerated = $lastGenerated->getTimestamp();
}
@@ -68,7 +68,7 @@ public function getInProgress(): ?TmpStore
return TmpStore::get($this->getLockKey());
}
- public function setLastGenerated(int $lastGenerated)
+ public function setLastGenerated(int $lastGenerated): void
{
$this->lastGenerated = $lastGenerated;
}
@@ -78,7 +78,7 @@ public function getLastGenerated(): ?int
return $this->lastGenerated;
}
- public function setLastGenerateMessage(string $lastGenerateMessage)
+ public function setLastGenerateMessage(string $lastGenerateMessage): void
{
$this->lastGenerateMessage = $lastGenerateMessage;
}
diff --git a/models/Document/PrintAbstract/Dao.php b/models/Document/PrintAbstract/Dao.php
index bf8583b1dce..27789037699 100644
--- a/models/Document/PrintAbstract/Dao.php
+++ b/models/Document/PrintAbstract/Dao.php
@@ -36,7 +36,7 @@ class Dao extends Document\PageSnippet\Dao
/**
* Get the valid columns from the database
*/
- public function init()
+ public function init(): void
{
// page
$this->validColumnsPage = $this->getValidTableColumns('documents_printpage');
@@ -49,7 +49,7 @@ public function init()
*
* @throws \Exception
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -67,7 +67,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
@@ -79,7 +79,7 @@ public function create()
/**
* @throws \Exception
*/
- public function update()
+ public function update(): void
{
$this->model->setModificationDate(time());
$document = $this->model->getObjectVars();
@@ -120,7 +120,7 @@ public function update()
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->deleteAllProperties();
diff --git a/models/Document/Service/Dao.php b/models/Document/Service/Dao.php
index 5d38a01a8ad..65d3d0ea961 100644
--- a/models/Document/Service/Dao.php
+++ b/models/Document/Service/Dao.php
@@ -93,7 +93,7 @@ public function getTranslations(Document $document, string $task = 'open'): arra
* @param Document $translation
* @param string|null $language
*/
- public function addTranslation(Document $document, Document $translation, string $language = null)
+ public function addTranslation(Document $document, Document $translation, string $language = null): void
{
$sourceId = $this->getTranslationSourceId($document);
@@ -108,7 +108,7 @@ public function addTranslation(Document $document, Document $translation, string
]);
}
- public function removeTranslation(Document $document)
+ public function removeTranslation(Document $document): void
{
// if $document is a source-document, we need to move them over to a new document
$newSourceId = $this->db->fetchOne('SELECT id FROM documents_translations WHERE sourceId = ?', [$document->getId()]);
@@ -118,7 +118,7 @@ public function removeTranslation(Document $document)
}
}
- public function removeTranslationLink(Document $document, Document $targetDocument)
+ public function removeTranslationLink(Document $document, Document $targetDocument): void
{
$sourceId = $this->getTranslationSourceId($document);
diff --git a/models/Document/Snippet/Dao.php b/models/Document/Snippet/Dao.php
index f800d033ad0..da047a38859 100644
--- a/models/Document/Snippet/Dao.php
+++ b/models/Document/Snippet/Dao.php
@@ -34,7 +34,7 @@ class Dao extends Model\Document\PageSnippet\Dao implements TargetingDocumentDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -52,7 +52,7 @@ public function getById(int $id = null)
}
}
- public function create()
+ public function create(): void
{
parent::create();
diff --git a/models/Document/Targeting/TargetingDocumentInterface.php b/models/Document/Targeting/TargetingDocumentInterface.php
index 1c6be96b33c..781b8f84819 100644
--- a/models/Document/Targeting/TargetingDocumentInterface.php
+++ b/models/Document/Targeting/TargetingDocumentInterface.php
@@ -51,7 +51,7 @@ public function getTargetGroupEditableName(string $name): string;
*
* @param int|null $useTargetGroup
*/
- public function setUseTargetGroup(int $useTargetGroup = null);
+ public function setUseTargetGroup(int $useTargetGroup = null): void;
/**
* Returns the target group to use
diff --git a/models/Document/TargetingDocument.php b/models/Document/TargetingDocument.php
index 6287d295203..302a7bb9876 100644
--- a/models/Document/TargetingDocument.php
+++ b/models/Document/TargetingDocument.php
@@ -29,7 +29,7 @@ abstract class TargetingDocument extends PageSnippet implements TargetingDocumen
/**
* {@inheritdoc}
*/
- public function setUseTargetGroup(int $useTargetGroup = null)
+ public function setUseTargetGroup(int $useTargetGroup = null): void
{
$this->useTargetGroup = $useTargetGroup;
}
@@ -150,7 +150,7 @@ public function getEditable(string $name): ?Editable
/**
* {@inheritdoc}
*/
- public function __sleep()
+ public function __sleep(): array
{
$finalVars = [];
$parentVars = parent::__sleep();
diff --git a/models/Element/AbstractElement.php b/models/Element/AbstractElement.php
index 307faa3928c..3c7ade5b4f1 100644
--- a/models/Element/AbstractElement.php
+++ b/models/Element/AbstractElement.php
@@ -296,7 +296,7 @@ public function setProperty(string $name, string $type, mixed $data, bool $inher
/**
* @internal
*/
- protected function updateModificationInfos()
+ protected function updateModificationInfos(): void
{
if (Model\Version::isEnabled() === true) {
$this->setVersionCount($this->getDao()->getVersionCountForUpdate() + 1);
@@ -356,7 +356,7 @@ public function hasProperty(string $name): bool
return array_key_exists($name, $properties);
}
- public function removeProperty(string $name)
+ public function removeProperty(string $name): void
{
$properties = $this->getProperties();
unset($properties[$name]);
@@ -526,7 +526,7 @@ public function isAllowed(string $type, ?User $user = null): bool
/**
* @internal
*/
- public function unlockPropagate()
+ public function unlockPropagate(): void
{
$type = Service::getElementType($this);
@@ -546,7 +546,7 @@ public function unlockPropagate()
*
* @throws \Exception
*/
- protected function validatePathLength()
+ protected function validatePathLength(): void
{
if (mb_strlen($this->getRealFullPath()) > 765) {
throw new \Exception("Full path is limited to 765 characters, reduce the length of your parent's path");
@@ -566,7 +566,7 @@ public function __getDataVersionTimestamp(): ?int
return $this->__dataVersionTimestamp;
}
- public function __setDataVersionTimestamp(int $_dataVersionTimestamp)
+ public function __setDataVersionTimestamp(int $_dataVersionTimestamp): void
{
$this->__dataVersionTimestamp = $_dataVersionTimestamp;
}
@@ -667,7 +667,7 @@ protected function getBlockedVars(): array
/**
* {@inheritdoc}
*/
- public function __sleep()
+ public function __sleep(): array
{
if ($this->isInDumpState()) {
// this is if we want to make a full dump of the object (eg. for a new version), including children for recyclebin
@@ -677,7 +677,7 @@ public function __sleep()
return array_diff(parent::__sleep(), $this->getBlockedVars());
}
- public function __wakeup()
+ public function __wakeup(): void
{
if ($this->isInDumpState()) {
// set current key and path this is necessary because the serialized data can have a different path than the original element ( element was renamed or moved )
@@ -708,7 +708,7 @@ public function __clone()
*
* @internal
*/
- public function deleteAutoSaveVersions(int $userId = null)
+ public function deleteAutoSaveVersions(int $userId = null): void
{
$list = new Model\Version\Listing();
$list->setLoadAutoSave(true);
@@ -726,7 +726,7 @@ public function deleteAutoSaveVersions(int $userId = null)
/**
* @internal
*/
- protected function removeInheritedProperties()
+ protected function removeInheritedProperties(): void
{
$myProperties = $this->getProperties();
@@ -744,7 +744,7 @@ protected function removeInheritedProperties()
/**
* @internal
*/
- protected function renewInheritedProperties()
+ protected function renewInheritedProperties(): void
{
$this->removeInheritedProperties();
diff --git a/models/Element/Data/MarkerHotspotItem.php b/models/Element/Data/MarkerHotspotItem.php
index 0ea7ae4d37f..1e227363524 100644
--- a/models/Element/Data/MarkerHotspotItem.php
+++ b/models/Element/Data/MarkerHotspotItem.php
@@ -44,7 +44,7 @@ public function getName(): string
return $this->name;
}
- public function setName(string $name)
+ public function setName(string $name): void
{
$this->name = $name;
}
@@ -54,7 +54,7 @@ public function getType(): string
return $this->type;
}
- public function setType(string $type)
+ public function setType(string $type): void
{
$this->type = $type;
}
@@ -64,7 +64,7 @@ public function getValue(): mixed
return $this->value;
}
- public function setValue(mixed $value)
+ public function setValue(mixed $value): void
{
$this->value = $value;
}
diff --git a/models/Element/DeepCopy/PimcoreClassDefinitionReplaceFilter.php b/models/Element/DeepCopy/PimcoreClassDefinitionReplaceFilter.php
index f48e59f929d..6979d94ef5c 100644
--- a/models/Element/DeepCopy/PimcoreClassDefinitionReplaceFilter.php
+++ b/models/Element/DeepCopy/PimcoreClassDefinitionReplaceFilter.php
@@ -38,7 +38,7 @@ public function __construct(callable $callable)
$this->callback = $callable;
}
- public function apply($object, $property, $objectCopier)
+ public function apply($object, $property, $objectCopier): void
{
if (!$object instanceof Concrete) {
return;
diff --git a/models/Element/DirtyIndicatorInterface.php b/models/Element/DirtyIndicatorInterface.php
index 24fba4d3a68..c7cdd25aab6 100644
--- a/models/Element/DirtyIndicatorInterface.php
+++ b/models/Element/DirtyIndicatorInterface.php
@@ -24,11 +24,8 @@ public function isFieldDirty(string $key): bool;
/**
* marks the given field as dirty
- *
- * @param string $field
- * @param bool $dirty
*/
- public function markFieldDirty(string $field, bool $dirty = true);
+ public function markFieldDirty(string $field, bool $dirty = true): void;
- public function resetDirtyMap();
+ public function resetDirtyMap(): void;
}
diff --git a/models/Element/Editlock/Dao.php b/models/Element/Editlock/Dao.php
index f086e6ff4b2..db4404ffa22 100644
--- a/models/Element/Editlock/Dao.php
+++ b/models/Element/Editlock/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getByElement(int $cid, string $ctype)
+ public function getByElement(int $cid, string $ctype): void
{
$data = $this->db->fetchAssociative('SELECT * FROM edit_lock WHERE cid = ? AND ctype = ?', [$cid, $ctype]);
@@ -79,12 +79,12 @@ public function save(): bool
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('edit_lock', ['id' => $this->model->getId()]);
}
- public function clearSession(string $sessionId)
+ public function clearSession(string $sessionId): void
{
$this->db->delete('edit_lock', ['sessionId' => $sessionId]);
}
diff --git a/models/Element/ElementDumpStateInterface.php b/models/Element/ElementDumpStateInterface.php
index 5aca56c2524..48bcd738fe1 100644
--- a/models/Element/ElementDumpStateInterface.php
+++ b/models/Element/ElementDumpStateInterface.php
@@ -25,7 +25,7 @@ interface ElementDumpStateInterface
*
* @param bool $dumpState
*/
- public function setInDumpState(bool $dumpState);
+ public function setInDumpState(bool $dumpState): void;
public function isInDumpState(): bool;
}
diff --git a/models/Element/ElementInterface.php b/models/Element/ElementInterface.php
index 357c47fc34d..4649ac43089 100644
--- a/models/Element/ElementInterface.php
+++ b/models/Element/ElementInterface.php
@@ -153,9 +153,9 @@ public function getVersionCount(): int;
*/
public function save(array $parameters = []): static;
- public function delete();
+ public function delete(): void;
- public function clearDependentCache(array $additionalTags = []);
+ public function clearDependentCache(array $additionalTags = []): void;
public function setId(?int $id): static;
diff --git a/models/Element/Note.php b/models/Element/Note.php
index b273826de08..cd27431258f 100644
--- a/models/Element/Note.php
+++ b/models/Element/Note.php
@@ -126,7 +126,7 @@ public function setElement(ElementInterface $element): static
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
// check if there's a valid user
if (!$this->getUser()) {
diff --git a/models/Element/Note/Dao.php b/models/Element/Note/Dao.php
index 7307da1d160..60fea11c27b 100644
--- a/models/Element/Note/Dao.php
+++ b/models/Element/Note/Dao.php
@@ -33,7 +33,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM notes WHERE id = ?', [$id]);
@@ -148,7 +148,7 @@ public function save(): bool
/** Deletes note from database.
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('notes', ['id' => $this->model->getId()]);
$this->deleteData();
@@ -157,7 +157,7 @@ public function delete()
/** Deletes note data from database.
* @throws \Exception
*/
- protected function deleteData()
+ protected function deleteData(): void
{
$this->db->delete('notes_data', ['id' => $this->model->getId()]);
}
diff --git a/models/Element/PermissionChecker.php b/models/Element/PermissionChecker.php
index 8b234ceac6b..e60994ec280 100644
--- a/models/Element/PermissionChecker.php
+++ b/models/Element/PermissionChecker.php
@@ -29,7 +29,10 @@
*/
class PermissionChecker
{
- public static function check(ElementInterface $element, $users): array
+ /**
+ * @param User[] $users
+ */
+ public static function check(ElementInterface $element, array $users): array
{
$protectedColumns = ['cid', 'cpath', 'userId', 'lEdit', 'lView', 'layouts'];
@@ -66,7 +69,6 @@ public static function check(ElementInterface $element, $users): array
$permissions = [];
$details = [];
- /** @var User $user */
foreach ($users as $user) {
if (!$user instanceof User) {
continue;
@@ -148,7 +150,7 @@ public static function check(ElementInterface $element, $users): array
return $result;
}
- protected static function collectParentIds($element): array
+ protected static function collectParentIds(ElementInterface $element): array
{
// collect properties via parent - ids
$parentIds = [1];
@@ -165,7 +167,7 @@ protected static function collectParentIds($element): array
return $parentIds;
}
- protected static function createDetail($user, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null): array
+ protected static function createDetail(User $user, ?string $a = null, ?bool $b = null, ?string $c = null, ?string $d = null, ?string $e = null, ?string $f = null): array
{
$detailEntry = [
'userId' => $user->getId(),
@@ -175,13 +177,12 @@ protected static function createDetail($user, $a = null, $b = null, $c = null, $
'd' => $d,
'e' => $e,
'f' => $f,
-
];
return $detailEntry;
}
- protected static function getUserPermissions($user, &$details): void
+ protected static function getUserPermissions(User $user, array &$details): void
{
if ($user->isAdmin()) {
$details[] = self::createDetail($user, 'ADMIN', true, null, null);
diff --git a/models/Element/Recyclebin.php b/models/Element/Recyclebin.php
index aceb778a2c4..5160e6ba607 100644
--- a/models/Element/Recyclebin.php
+++ b/models/Element/Recyclebin.php
@@ -26,7 +26,7 @@
*/
final class Recyclebin extends Model\AbstractModel
{
- public function flush()
+ public function flush(): void
{
$this->getDao()->flush();
Storage::get('recycle_bin')->deleteDirectory('/');
diff --git a/models/Element/Recyclebin/Dao.php b/models/Element/Recyclebin/Dao.php
index c1dfd80ca3f..3010a4a5aca 100644
--- a/models/Element/Recyclebin/Dao.php
+++ b/models/Element/Recyclebin/Dao.php
@@ -24,7 +24,7 @@
*/
class Dao extends Model\Dao\AbstractDao
{
- public function flush()
+ public function flush(): void
{
$this->db->executeStatement('DELETE FROM recyclebin');
}
diff --git a/models/Element/Recyclebin/Item.php b/models/Element/Recyclebin/Item.php
index ec744fb0875..89621149f8d 100644
--- a/models/Element/Recyclebin/Item.php
+++ b/models/Element/Recyclebin/Item.php
@@ -62,7 +62,7 @@ class Item extends Model\AbstractModel
* @param Element\ElementInterface $element
* @param Model\User|null $user
*/
- public static function create(Element\ElementInterface $element, Model\User $user = null)
+ public static function create(Element\ElementInterface $element, Model\User $user = null): void
{
$item = new self();
$item->setElement($element);
@@ -93,7 +93,7 @@ public static function getById(int $id): ?Item
*
* @throws \Exception
*/
- public function restore(Model\User $user = null)
+ public function restore(Model\User $user = null): void
{
$dummy = null;
$raw = Storage::get('recycle_bin')->read($this->getStoreageFile());
@@ -161,7 +161,7 @@ public function restore(Model\User $user = null)
/**
* @param Model\User|null $user
*/
- public function save(Model\User $user = null)
+ public function save(Model\User $user = null): void
{
$this->setType(Element\Service::getElementType($this->getElement()));
$this->setSubtype($this->getElement()->getType());
@@ -204,7 +204,7 @@ public function save(Model\User $user = null)
$saveBinaryData($this->getElement(), $saveBinaryData, $this);
}
- public function delete()
+ public function delete(): void
{
$storage = Storage::get('recycle_bin');
$storage->delete($this->getStoreageFile());
@@ -221,7 +221,7 @@ public function delete()
$this->getDao()->delete();
}
- public function loadChildren(Element\ElementInterface $element)
+ public function loadChildren(Element\ElementInterface $element): void
{
$this->amount++;
@@ -260,7 +260,7 @@ public function loadChildren(Element\ElementInterface $element)
*
* @throws \Exception
*/
- protected function doRecursiveRestore(Element\ElementInterface $element)
+ protected function doRecursiveRestore(Element\ElementInterface $element): void
{
$storage = Storage::get('recycle_bin');
$restoreBinaryData = function (Element\ElementInterface $element, self $scope) use ($storage) {
diff --git a/models/Element/Recyclebin/Item/Dao.php b/models/Element/Recyclebin/Item/Dao.php
index 552dfcefb11..2516af68a00 100644
--- a/models/Element/Recyclebin/Item/Dao.php
+++ b/models/Element/Recyclebin/Item/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws \Exception
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM recyclebin WHERE id = ?', [$id]);
@@ -72,7 +72,7 @@ public function save(): bool
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('recyclebin', ['id' => $this->model->getId()]);
}
diff --git a/models/Element/Service.php b/models/Element/Service.php
index 7747ff22981..7143bd2429a 100644
--- a/models/Element/Service.php
+++ b/models/Element/Service.php
@@ -244,11 +244,7 @@ private static function getDependedElement(array $config): Asset|Document|Abstra
};
}
- /**
- * @param ElementInterface|null $element
- *
- */
- public static function doHideUnpublished($element): bool
+ public static function doHideUnpublished(?ElementInterface $element): bool
{
return ($element instanceof AbstractObject && DataObject::doHideUnpublished())
|| ($element instanceof Document && Document::doHideUnpublished());
@@ -597,7 +593,7 @@ public static function minimizePropertiesForEditmode(array $props): array
*
* @internal
*/
- protected function updateChildren(DataObject|Document|Asset\Folder $target, ElementInterface $new)
+ protected function updateChildren(DataObject|Document|Asset\Folder $target, ElementInterface $new): void
{
//check in case of recursion
$found = false;
@@ -945,7 +941,7 @@ public static function createFolderByPath(string $path, array $options = []): As
* @internal
*
*/
- public static function addTreeFilterJoins(array $cv, Asset\Listing|DataObject\Listing|Document\Listing $childrenList)
+ public static function addTreeFilterJoins(array $cv, Asset\Listing|DataObject\Listing|Document\Listing $childrenList): void
{
if ($cv) {
$childrenList->onCreateQueryBuilder(static function (DoctrineQueryBuilder $select) use ($cv) {
@@ -1379,7 +1375,7 @@ function (Concrete $object, Data $fieldDefinition, $property, $currentValue) {
*
* @internal
*/
- public static function saveElementToSession(ElementInterface $element, string $postfix = '', bool $clone = true)
+ public static function saveElementToSession(ElementInterface $element, string $postfix = '', bool $clone = true): void
{
if ($clone) {
$context = [
@@ -1424,7 +1420,7 @@ function (Concrete $object, Data $fieldDefinition, $property, $currentValue) {
*
* @internal
*/
- public static function removeElementFromSession(string $type, int $elementId, string $postfix = '')
+ public static function removeElementFromSession(string $type, int $elementId, string $postfix = ''): void
{
$tmpStoreKey = self::getSessionKey($type, $elementId, $postfix);
TmpStore::delete($tmpStoreKey);
diff --git a/models/Element/Tag.php b/models/Element/Tag.php
index 74cbdcd5b20..825153be756 100644
--- a/models/Element/Tag.php
+++ b/models/Element/Tag.php
@@ -107,7 +107,7 @@ public static function getTagsForElement(string $cType, int $cId): array
* @param int $cId
* @param Tag $tag
*/
- public static function addTagToElement(string $cType, int $cId, Tag $tag)
+ public static function addTagToElement(string $cType, int $cId, Tag $tag): void
{
$event = new TagEvent($tag, [
'elementType' => $cType,
@@ -127,7 +127,7 @@ public static function addTagToElement(string $cType, int $cId, Tag $tag)
* @param int $cId
* @param Tag $tag
*/
- public static function removeTagFromElement(string $cType, int $cId, Tag $tag)
+ public static function removeTagFromElement(string $cType, int $cId, Tag $tag): void
{
$event = new TagEvent($tag, [
'elementType' => $cType,
@@ -148,13 +148,13 @@ public static function removeTagFromElement(string $cType, int $cId, Tag $tag)
* @param int $cId
* @param Tag[] $tags
*/
- public static function setTagsForElement(string $cType, int $cId, array $tags)
+ public static function setTagsForElement(string $cType, int $cId, array $tags): void
{
$tag = new Tag();
$tag->getDao()->setTagsForElement($cType, $cId, $tags);
}
- public static function batchAssignTagsToElement(string $cType, array $cIds, array $tagIds, bool $replace = false)
+ public static function batchAssignTagsToElement(string $cType, array $cIds, array $tagIds, bool $replace = false): void
{
$tag = new Tag();
$tag->getDao()->batchAssignTagsToElement($cType, $cIds, $tagIds, $replace);
@@ -195,7 +195,7 @@ public static function getByPath(string $path): ?Tag
}
}
- public function save()
+ public function save(): void
{
$isUpdate = $this->exists();
@@ -319,7 +319,7 @@ public function hasChildren(): bool
return count($this->getChildren()) > 0;
}
- public function correctPath()
+ public function correctPath(): void
{
//set id path to correct value
$parentIds = [];
@@ -342,7 +342,7 @@ public function correctPath()
*
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->dispatchEvent(new TagEvent($this), TagEvents::PRE_DELETE);
diff --git a/models/Element/Tag/Dao.php b/models/Element/Tag/Dao.php
index b936076c02c..48347cbc431 100644
--- a/models/Element/Tag/Dao.php
+++ b/models/Element/Tag/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM tags WHERE id = ?', [$id]);
if (!$data) {
@@ -99,7 +99,7 @@ public function save(): bool
*
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$this->db->beginTransaction();
@@ -141,12 +141,12 @@ public function getTagsForElement(string $cType, int $cId): array
return $tags;
}
- public function addTagToElement(string $cType, int $cId)
+ public function addTagToElement(string $cType, int $cId): void
{
$this->doAddTagToElement($this->model->getId(), $cType, $cId);
}
- protected function doAddTagToElement(int $tagId, string $cType, int $cId)
+ protected function doAddTagToElement(int $tagId, string $cType, int $cId): void
{
$data = [
'tagid' => $tagId,
@@ -156,7 +156,7 @@ protected function doAddTagToElement(int $tagId, string $cType, int $cId)
Helper::insertOrUpdate($this->db, 'tags_assignment', $data);
}
- public function removeTagFromElement(string $cType, int $cId)
+ public function removeTagFromElement(string $cType, int $cId): void
{
$this->db->delete('tags_assignment', [
'tagid' => $this->model->getId(),
@@ -172,7 +172,7 @@ public function removeTagFromElement(string $cType, int $cId)
*
* @throws \Exception
*/
- public function setTagsForElement(string $cType, int $cId, array $tags)
+ public function setTagsForElement(string $cType, int $cId, array $tags): void
{
$this->db->beginTransaction();
@@ -191,7 +191,7 @@ public function setTagsForElement(string $cType, int $cId, array $tags)
}
}
- public function batchAssignTagsToElement(string $cType, array $cIds, array $tagIds, bool $replace)
+ public function batchAssignTagsToElement(string $cType, array $cIds, array $tagIds, bool $replace): void
{
if ($replace) {
$quotedCIds = [];
diff --git a/models/Element/ValidationException.php b/models/Element/ValidationException.php
index b27040f54f4..f201dacb056 100644
--- a/models/Element/ValidationException.php
+++ b/models/Element/ValidationException.php
@@ -34,12 +34,12 @@ public function getSubItems(): array
/**
* @param \Exception[] $subItems
*/
- public function setSubItems(array $subItems = [])
+ public function setSubItems(array $subItems = []): void
{
$this->subItems = $subItems;
}
- public function addContext(string $context)
+ public function addContext(string $context): void
{
$this->contextStack[] = $context;
}
diff --git a/models/Element/WorkflowState/Dao.php b/models/Element/WorkflowState/Dao.php
index 8596075020b..5122e4d23ec 100644
--- a/models/Element/WorkflowState/Dao.php
+++ b/models/Element/WorkflowState/Dao.php
@@ -32,7 +32,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getByPrimary(int $cid, string $ctype, string $workflow)
+ public function getByPrimary(int $cid, string $ctype, string $workflow): void
{
$data = $this->db->fetchAssociative('SELECT * FROM element_workflow_state WHERE cid = ? AND ctype = ? AND workflow = ?', [$cid, $ctype, $workflow]);
@@ -68,7 +68,7 @@ public function save(): bool
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('element_workflow_state', [
'cid' => $this->model->getCid(),
diff --git a/models/GridConfig.php b/models/GridConfig.php
index a5f40aa04b0..cc41c201129 100644
--- a/models/GridConfig.php
+++ b/models/GridConfig.php
@@ -70,7 +70,7 @@ public static function getById(int $id): ?GridConfig
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if (!$this->getId()) {
$this->setCreationDate(time());
@@ -84,7 +84,7 @@ public function save()
/**
* Delete this GridConfig
*/
- public function delete()
+ public function delete(): void
{
$this->getDao()->delete();
}
@@ -94,7 +94,7 @@ public function getId(): ?int
return $this->id;
}
- public function setId(int $id)
+ public function setId(int $id): void
{
$this->id = (int) $id;
}
@@ -104,7 +104,7 @@ public function getOwnerId(): ?int
return $this->ownerId;
}
- public function setOwnerId(int $ownerId)
+ public function setOwnerId(int $ownerId): void
{
$this->ownerId = $ownerId;
}
@@ -114,7 +114,7 @@ public function getClassId(): string
return $this->classId;
}
- public function setClassId(string $classId)
+ public function setClassId(string $classId): void
{
$this->classId = $classId;
}
@@ -124,7 +124,7 @@ public function getName(): string
return $this->name;
}
- public function setName(string $name)
+ public function setName(string $name): void
{
$this->name = $name;
}
@@ -134,7 +134,7 @@ public function getSearchType(): string
return $this->searchType;
}
- public function setSearchType(string $searchType)
+ public function setSearchType(string $searchType): void
{
$this->searchType = $searchType;
}
@@ -144,7 +144,7 @@ public function getConfig(): string
return $this->config;
}
- public function setConfig(string $config)
+ public function setConfig(string $config): void
{
$this->config = $config;
}
@@ -154,7 +154,7 @@ public function getDescription(): ?string
return $this->description;
}
- public function setDescription(?string $description)
+ public function setDescription(?string $description): void
{
$this->description = $description;
}
@@ -164,7 +164,7 @@ public function getCreationDate(): ?int
return $this->creationDate;
}
- public function setCreationDate(int $creationDate)
+ public function setCreationDate(int $creationDate): void
{
$this->creationDate = $creationDate;
}
@@ -174,7 +174,7 @@ public function getModificationDate(): ?int
return $this->modificationDate;
}
- public function setModificationDate(int $modificationDate)
+ public function setModificationDate(int $modificationDate): void
{
$this->modificationDate = $modificationDate;
}
@@ -184,7 +184,7 @@ public function isShareGlobally(): bool
return $this->shareGlobally;
}
- public function setShareGlobally(bool $shareGlobally)
+ public function setShareGlobally(bool $shareGlobally): void
{
$this->shareGlobally = (bool) $shareGlobally;
}
@@ -194,7 +194,7 @@ public function isSetAsFavourite(): bool
return $this->setAsFavourite;
}
- public function setSetAsFavourite(bool $setAsFavourite)
+ public function setSetAsFavourite(bool $setAsFavourite): void
{
$this->setAsFavourite = (bool) $setAsFavourite;
}
@@ -224,7 +224,7 @@ public function getType(): string
*
* @param string $type
*/
- public function setType(string $type)
+ public function setType(string $type): void
{
$this->type = $type;
}
diff --git a/models/GridConfig/Dao.php b/models/GridConfig/Dao.php
index e04050e5391..cbea13ee2da 100644
--- a/models/GridConfig/Dao.php
+++ b/models/GridConfig/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM gridconfigs WHERE id = ?', [$id]);
@@ -75,7 +75,7 @@ public function save(): int
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('gridconfigs', ['id' => $this->model->getId()]);
}
diff --git a/models/GridConfigFavourite.php b/models/GridConfigFavourite.php
index dc7115c0fc1..6600fe70fe8 100644
--- a/models/GridConfigFavourite.php
+++ b/models/GridConfigFavourite.php
@@ -65,7 +65,7 @@ public static function getByOwnerAndClassAndObjectId(int $ownerId, string $class
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
$this->getDao()->save();
}
@@ -73,7 +73,7 @@ public function save()
/**
* Delete this favourite
*/
- public function delete()
+ public function delete(): void
{
$this->getDao()->delete();
}
@@ -83,7 +83,7 @@ public function getOwnerId(): int
return $this->ownerId;
}
- public function setOwnerId(int $ownerId)
+ public function setOwnerId(int $ownerId): void
{
$this->ownerId = $ownerId;
}
@@ -93,7 +93,7 @@ public function getClassId(): string
return $this->classId;
}
- public function setClassId(string $classId)
+ public function setClassId(string $classId): void
{
$this->classId = $classId;
}
@@ -103,7 +103,7 @@ public function getGridConfigId(): int
return $this->gridConfigId;
}
- public function setGridConfigId(int $gridConfigId)
+ public function setGridConfigId(int $gridConfigId): void
{
$this->gridConfigId = $gridConfigId;
}
@@ -113,7 +113,7 @@ public function getSearchType(): string
return $this->searchType;
}
- public function setSearchType(string $searchType)
+ public function setSearchType(string $searchType): void
{
$this->searchType = $searchType;
}
@@ -123,7 +123,7 @@ public function getObjectId(): int
return $this->objectId;
}
- public function setObjectId(int $objectId)
+ public function setObjectId(int $objectId): void
{
$this->objectId = $objectId;
}
@@ -143,7 +143,7 @@ public function getType(): string
*
* @param string $type
*/
- public function setType(string $type)
+ public function setType(string $type): void
{
$this->type = $type;
}
diff --git a/models/GridConfigFavourite/Dao.php b/models/GridConfigFavourite/Dao.php
index bc62ac6e151..f00cb1a26cb 100644
--- a/models/GridConfigFavourite/Dao.php
+++ b/models/GridConfigFavourite/Dao.php
@@ -33,7 +33,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, int $objectId = null, string $searchType = null)
+ public function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, int $objectId = null, string $searchType = null): void
{
$query = 'SELECT * FROM gridconfig_favourites WHERE ownerId = ? AND classId = ? AND searchType = ?';
$params = [$ownerId, $classId, $searchType];
@@ -79,7 +79,7 @@ public function save(): Model\GridConfigFavourite
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$params = ['ownerId' => $this->model->getOwnerId(), 'classId' => $this->model->getClassId()];
if ($this->model->getSearchType()) {
diff --git a/models/GridConfigShare.php b/models/GridConfigShare.php
index fc436352f5f..8ca6167bfeb 100644
--- a/models/GridConfigShare.php
+++ b/models/GridConfigShare.php
@@ -44,7 +44,7 @@ public static function getByGridConfigAndSharedWithId(int $gridConfigId, int $sh
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
$this->getDao()->save();
}
@@ -52,7 +52,7 @@ public function save()
/**
* Delete this share
*/
- public function delete()
+ public function delete(): void
{
$this->getDao()->delete();
}
@@ -62,7 +62,7 @@ public function getGridConfigId(): int
return $this->gridConfigId;
}
- public function setGridConfigId(int $gridConfigId)
+ public function setGridConfigId(int $gridConfigId): void
{
$this->gridConfigId = $gridConfigId;
}
@@ -72,7 +72,7 @@ public function getSharedWithUserId(): int
return $this->sharedWithUserId;
}
- public function setSharedWithUserId(int $sharedWithUserId)
+ public function setSharedWithUserId(int $sharedWithUserId): void
{
$this->sharedWithUserId = $sharedWithUserId;
}
diff --git a/models/GridConfigShare/Dao.php b/models/GridConfigShare/Dao.php
index 72263cd889b..ac9b70af10f 100644
--- a/models/GridConfigShare/Dao.php
+++ b/models/GridConfigShare/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getByGridConfigAndSharedWithId(int $gridConfigId, int $sharedWithUserId)
+ public function getByGridConfigAndSharedWithId(int $gridConfigId, int $sharedWithUserId): void
{
$data = $this->db->fetchAssociative('SELECT * FROM gridconfig_shares WHERE gridConfigId = ? AND sharedWithUserId = ?', [$gridConfigId, $sharedWithUserId]);
@@ -42,7 +42,7 @@ public function getByGridConfigAndSharedWithId(int $gridConfigId, int $sharedWit
$this->assignVariablesToModel($data);
}
- public function save()
+ public function save(): void
{
$gridConfigFavourite = $this->model->getObjectVars();
$data = [];
@@ -63,7 +63,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('gridconfig_shares', ['gridConfigId' => $this->model->getGridConfigId(), 'sharedWithUserId' => $this->model->getSharedWithUserId()]);
}
diff --git a/models/Metadata/Predefined.php b/models/Metadata/Predefined.php
index 46affd49eae..7a62ad68b85 100644
--- a/models/Metadata/Predefined.php
+++ b/models/Metadata/Predefined.php
@@ -191,7 +191,7 @@ public function getModificationDate(): ?int
return $this->modificationDate;
}
- public function setLanguage(?string $language)
+ public function setLanguage(?string $language): void
{
$this->language = $language;
}
@@ -201,7 +201,7 @@ public function getLanguage(): ?string
return $this->language;
}
- public function setGroup(?string $group)
+ public function setGroup(?string $group): void
{
$this->group = $group;
}
@@ -211,7 +211,7 @@ public function getGroup(): ?string
return $this->group;
}
- public function setTargetSubtype(?string $targetSubtype)
+ public function setTargetSubtype(?string $targetSubtype): void
{
$this->targetSubtype = $targetSubtype;
}
@@ -226,12 +226,12 @@ public function getConfig(): ?string
return $this->config;
}
- public function setConfig(?string $config)
+ public function setConfig(?string $config): void
{
$this->config = $config;
}
- public function minimize()
+ public function minimize(): void
{
try {
$loader = \Pimcore::getContainer()->get('pimcore.implementation_loader.asset.metadata.data');
@@ -243,7 +243,7 @@ public function minimize()
}
}
- public function expand()
+ public function expand(): void
{
try {
$loader = \Pimcore::getContainer()->get('pimcore.implementation_loader.asset.metadata.data');
diff --git a/models/Metadata/Predefined/Dao.php b/models/Metadata/Predefined/Dao.php
index b4f8420da3c..70cf1785ca6 100644
--- a/models/Metadata/Predefined/Dao.php
+++ b/models/Metadata/Predefined/Dao.php
@@ -25,7 +25,7 @@
*/
class Dao extends Model\Dao\PimcoreLocationAwareConfigDao
{
- public function configure()
+ public function configure(): void
{
$config = \Pimcore::getContainer()->getParameter('pimcore.config');
@@ -42,7 +42,7 @@ public function configure()
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(string $id = null)
+ public function getById(string $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -67,7 +67,7 @@ public function getById(string $id = null)
*
* @throws \Exception
*/
- public function getByNameAndLanguage(string $name = null, string $language = null)
+ public function getByNameAndLanguage(string $name = null, string $language = null): void
{
$list = new Listing();
/** @var Model\Metadata\Predefined[] $definitions */
@@ -93,7 +93,7 @@ public function getByNameAndLanguage(string $name = null, string $language = nul
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->model->setId((string)Uid::v4());
@@ -120,7 +120,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->deleteData($this->model->getId());
}
diff --git a/models/Notification/Dao.php b/models/Notification/Dao.php
index d779d1f42b6..f7f97bbbc85 100644
--- a/models/Notification/Dao.php
+++ b/models/Notification/Dao.php
@@ -54,7 +54,7 @@ public function getById(int $id): void
/**
* Save notification
*/
- public function save()
+ public function save(): void
{
$model = $this->getModel();
$model->setModificationDate(date('Y-m-d H:i:s'));
diff --git a/models/Property.php b/models/Property.php
index 03e9cc41bff..79f99595d1f 100644
--- a/models/Property.php
+++ b/models/Property.php
@@ -273,7 +273,7 @@ public function resolveDependencies(): array
*
* @internal
*/
- public function rewriteIds(array $idMapping)
+ public function rewriteIds(array $idMapping): void
{
if (!$this->isInherited()) {
if (array_key_exists($this->getType(), $idMapping)) {
diff --git a/models/Property/Dao.php b/models/Property/Dao.php
index 0cbcc16c998..eb11f1115b7 100644
--- a/models/Property/Dao.php
+++ b/models/Property/Dao.php
@@ -28,7 +28,7 @@ class Dao extends Model\Dao\AbstractDao
/**
* Save object to database
*/
- public function save()
+ public function save(): void
{
$data = $this->model->getData();
diff --git a/models/Property/Predefined/Dao.php b/models/Property/Predefined/Dao.php
index 2bc5aba018f..adea0de6012 100644
--- a/models/Property/Predefined/Dao.php
+++ b/models/Property/Predefined/Dao.php
@@ -25,7 +25,7 @@
*/
class Dao extends Model\Dao\PimcoreLocationAwareConfigDao
{
- public function configure()
+ public function configure(): void
{
$config = \Pimcore::getContainer()->getParameter('pimcore.config');
@@ -42,7 +42,7 @@ public function configure()
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(string $id = null)
+ public function getById(string $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -69,7 +69,7 @@ public function getById(string $id = null)
*
* @throws Model\Exception\NotFoundException
*/
- public function getByKey(string $key = null)
+ public function getByKey(string $key = null): void
{
if ($key != null) {
$this->model->setKey($key);
@@ -96,7 +96,7 @@ public function getByKey(string $key = null)
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->model->setId((string)Uid::v4());
@@ -123,7 +123,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->deleteData($this->model->getId());
}
diff --git a/models/Redirect.php b/models/Redirect.php
index e6a8b7226c0..c8cf521dba2 100644
--- a/models/Redirect.php
+++ b/models/Redirect.php
@@ -164,7 +164,7 @@ public function getType(): string
*
* @param string $type
*/
- public function setType(string $type)
+ public function setType(string $type): void
{
if (!empty($type) && !in_array($type, self::TYPES)) {
throw new \InvalidArgumentException(sprintf('Invalid type "%s"', $type));
@@ -225,7 +225,7 @@ public function getHttpStatus(): string
return 'HTTP/1.1 ' . $statusCode . ' ' . $this->getStatusCodes()[$statusCode];
}
- public function clearDependentCache()
+ public function clearDependentCache(): void
{
// this is mostly called in Redirect\Dao not here
try {
@@ -352,7 +352,7 @@ public function getUserOwner(): ?int
return $this->userOwner;
}
- public function setUserOwner(?int $userOwner)
+ public function setUserOwner(?int $userOwner): void
{
$this->userOwner = $userOwner;
}
@@ -362,12 +362,12 @@ public function getUserModification(): ?int
return $this->userModification;
}
- public function setUserModification(int $userModification)
+ public function setUserModification(int $userModification): void
{
$this->userModification = $userModification;
}
- public function save()
+ public function save(): void
{
$this->dispatchEvent(new RedirectEvent($this), RedirectEvents::PRE_SAVE);
$this->getDao()->save();
@@ -375,7 +375,7 @@ public function save()
$this->clearDependentCache();
}
- public function delete()
+ public function delete(): void
{
$this->dispatchEvent(new RedirectEvent($this), RedirectEvents::PRE_DELETE);
$this->getDao()->delete();
diff --git a/models/Redirect/Dao.php b/models/Redirect/Dao.php
index 982e870418b..d465c534bc3 100644
--- a/models/Redirect/Dao.php
+++ b/models/Redirect/Dao.php
@@ -34,7 +34,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -55,7 +55,7 @@ public function getById(int $id = null)
*
* @throws NotFoundException
*/
- public function getByExactMatch(Request $request, ?Site $site = null, bool $override = false)
+ public function getByExactMatch(Request $request, ?Site $site = null, bool $override = false): void
{
$partResolver = new RedirectUrlPartResolver($request);
$siteId = $site ? $site->getId() : null;
@@ -99,7 +99,7 @@ public function getByExactMatch(Request $request, ?Site $site = null, bool $over
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
// create in database
@@ -128,12 +128,12 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('redirects', ['id' => $this->model->getId()]);
}
- protected function updateModificationInfos()
+ protected function updateModificationInfos(): void
{
$updateTime = time();
$this->model->setModificationDate($updateTime);
diff --git a/models/Schedule/Task/Dao.php b/models/Schedule/Task/Dao.php
index 6a4debce47e..581ceb7e768 100644
--- a/models/Schedule/Task/Dao.php
+++ b/models/Schedule/Task/Dao.php
@@ -29,7 +29,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM schedule_tasks WHERE id = ?', [$id]);
if (!$data) {
@@ -38,7 +38,7 @@ public function getById(int $id)
$this->assignVariablesToModel($data);
}
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->create();
@@ -50,7 +50,7 @@ public function save()
/**
* Create a new record for the object in database
*/
- public function create()
+ public function create(): void
{
$this->db->insert('schedule_tasks', []);
$this->model->setId((int) $this->db->lastInsertId());
@@ -59,7 +59,7 @@ public function create()
/**
* Save changes to database, it's an good idea to use save() instead
*/
- public function update()
+ public function update(): void
{
$site = $this->model->getObjectVars();
$data = [];
@@ -81,7 +81,7 @@ public function update()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('schedule_tasks', ['id' => $this->model->getId()]);
}
diff --git a/models/Search/Backend/Data.php b/models/Search/Backend/Data.php
index 5a37dbdd8ca..7d9c620211c 100644
--- a/models/Search/Backend/Data.php
+++ b/models/Search/Backend/Data.php
@@ -477,7 +477,7 @@ public static function getForElement(Element\ElementInterface $element): self
return $data;
}
- public function delete()
+ public function delete(): void
{
$this->getDao()->delete();
}
@@ -485,7 +485,7 @@ public function delete()
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if ($this->id instanceof Data\Id) {
$this->dispatchEvent(new SearchBackendEvent($this), SearchBackendEvents::PRE_SAVE);
diff --git a/models/Search/Backend/Data/Dao.php b/models/Search/Backend/Data/Dao.php
index 6baeb63784b..c89dbe4ec6e 100644
--- a/models/Search/Backend/Data/Dao.php
+++ b/models/Search/Backend/Data/Dao.php
@@ -49,7 +49,7 @@ public function getForElement(Model\Element\ElementInterface $element): void
}
}
- public function save()
+ public function save(): void
{
$oldFullPath = $this->db->fetchOne('SELECT fullpath FROM search_backend_data WHERE id = :id and maintype = :type FOR UPDATE', [
'id' => $this->model->getId()->getId(),
@@ -88,7 +88,7 @@ public function save()
/**
* Deletes from database
*/
- public function delete()
+ public function delete(): void
{
if ($this->model->getId() instanceof Model\Search\Backend\Data\Id) {
$this->db->delete('search_backend_data', [
@@ -100,19 +100,19 @@ public function delete()
}
}
- public function getMinWordLengthForFulltextIndex()
+ public function getMinWordLengthForFulltextIndex(): int
{
try {
- return $this->db->fetchOne('SELECT @@innodb_ft_min_token_size');
+ return (int) $this->db->fetchOne('SELECT @@innodb_ft_min_token_size');
} catch (\Exception $e) {
return 3;
}
}
- public function getMaxWordLengthForFulltextIndex()
+ public function getMaxWordLengthForFulltextIndex(): int
{
try {
- return $this->db->fetchOne('SELECT @@innodb_ft_max_token_size');
+ return (int) $this->db->fetchOne('SELECT @@innodb_ft_max_token_size');
} catch (\Exception $e) {
return 84;
}
diff --git a/models/Site/Dao.php b/models/Site/Dao.php
index 2b50a27ab06..e15a3004867 100644
--- a/models/Site/Dao.php
+++ b/models/Site/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM sites WHERE id = ?', [$id]);
if (empty($data['id'])) {
@@ -44,7 +44,7 @@ public function getById(int $id)
*
* @throws NotFoundException
*/
- public function getByRootId(int $id)
+ public function getByRootId(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM sites WHERE rootId = ?', [$id]);
if (empty($data['id'])) {
@@ -58,7 +58,7 @@ public function getByRootId(int $id)
*
* @throws NotFoundException
*/
- public function getByDomain(string $domain)
+ public function getByDomain(string $domain): void
{
$data = $this->db->fetchAssociative('SELECT * FROM sites WHERE mainDomain = ? OR domains LIKE ?', [$domain, '%"' . $domain . '"%']);
if (empty($data['id'])) {
@@ -98,7 +98,7 @@ public function getByDomain(string $domain)
/**
* Save object to database
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->create();
@@ -110,7 +110,7 @@ public function save()
/**
* Create a new record for the object in database
*/
- public function create()
+ public function create(): void
{
$ts = time();
$this->model->setCreationDate($ts);
@@ -122,7 +122,7 @@ public function create()
/**
* Save changes to database, it's a good idea to use save() instead
*/
- public function update()
+ public function update(): void
{
$ts = time();
$this->model->setModificationDate($ts);
@@ -150,7 +150,7 @@ public function update()
/**
* Deletes site from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('sites', ['id' => $this->model->getId()]);
//clean slug table
diff --git a/models/Staticroute.php b/models/Staticroute.php
index 0190d62245d..3193b3293f3 100644
--- a/models/Staticroute.php
+++ b/models/Staticroute.php
@@ -80,7 +80,7 @@ final class Staticroute extends AbstractModel
*
* @param Staticroute|null $route
*/
- public static function setCurrentRoute(?Staticroute $route)
+ public static function setCurrentRoute(?Staticroute $route): void
{
self::$_currentRoute = $route;
}
diff --git a/models/Staticroute/Dao.php b/models/Staticroute/Dao.php
index 013271c86f0..7e4fa970c68 100644
--- a/models/Staticroute/Dao.php
+++ b/models/Staticroute/Dao.php
@@ -26,7 +26,7 @@
*/
class Dao extends Model\Dao\PimcoreLocationAwareConfigDao
{
- public function configure()
+ public function configure(): void
{
$config = \Pimcore::getContainer()->getParameter('pimcore.config');
@@ -41,7 +41,7 @@ public function configure()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->deleteData($this->model->getId());
}
@@ -66,7 +66,7 @@ public function getAll(): array
*
* @throws NotFoundException
*/
- public function getById(string $id = null)
+ public function getById(string $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -94,7 +94,7 @@ public function getById(string $id = null)
*
* @throws NotFoundException
*/
- public function getByName(string $name = null, int $siteId = null)
+ public function getByName(string $name = null, int $siteId = null): void
{
if ($name != null) {
$this->model->setName($name);
@@ -152,7 +152,7 @@ protected function prepareDataStructureForYaml(string $id, mixed $data): mixed
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->model->setId((string)Uid::v4());
diff --git a/models/Tool/CustomReport/Config.php b/models/Tool/CustomReport/Config.php
index 71e4f404e8f..867a1e00a8a 100644
--- a/models/Tool/CustomReport/Config.php
+++ b/models/Tool/CustomReport/Config.php
@@ -151,7 +151,7 @@ public static function getAdapter(?\stdClass $configuration, Config $fullConfig
return $factory->create($configuration, $fullConfig);
}
- public function setName(string $name)
+ public function setName(string $name): void
{
$this->name = $name;
}
@@ -161,7 +161,7 @@ public function getName(): string
return $this->name;
}
- public function setSql(string $sql)
+ public function setSql(string $sql): void
{
$this->sql = $sql;
}
@@ -171,7 +171,7 @@ public function getSql(): string
return $this->sql;
}
- public function setColumnConfiguration(array $columnConfiguration)
+ public function setColumnConfiguration(array $columnConfiguration): void
{
$this->columnConfiguration = $columnConfiguration;
}
@@ -181,7 +181,7 @@ public function getColumnConfiguration(): array
return $this->columnConfiguration;
}
- public function setGroup(string $group)
+ public function setGroup(string $group): void
{
$this->group = $group;
}
@@ -191,7 +191,7 @@ public function getGroup(): string
return $this->group;
}
- public function setGroupIconClass(string $groupIconClass)
+ public function setGroupIconClass(string $groupIconClass): void
{
$this->groupIconClass = $groupIconClass;
}
@@ -201,7 +201,7 @@ public function getGroupIconClass(): string
return $this->groupIconClass;
}
- public function setIconClass(string $iconClass)
+ public function setIconClass(string $iconClass): void
{
$this->iconClass = $iconClass;
}
@@ -211,7 +211,7 @@ public function getIconClass(): string
return $this->iconClass;
}
- public function setNiceName(string $niceName)
+ public function setNiceName(string $niceName): void
{
$this->niceName = $niceName;
}
@@ -221,7 +221,7 @@ public function getNiceName(): string
return $this->niceName;
}
- public function setMenuShortcut(bool $menuShortcut)
+ public function setMenuShortcut(bool $menuShortcut): void
{
$this->menuShortcut = (bool) $menuShortcut;
}
@@ -231,7 +231,7 @@ public function getMenuShortcut(): bool
return $this->menuShortcut;
}
- public function setDataSourceConfig(array $dataSourceConfig)
+ public function setDataSourceConfig(array $dataSourceConfig): void
{
$this->dataSourceConfig = $dataSourceConfig;
}
@@ -252,7 +252,7 @@ public function getDataSourceConfig(): ?\stdClass
return null;
}
- public function setChartType(string $chartType)
+ public function setChartType(string $chartType): void
{
$this->chartType = $chartType;
}
@@ -262,7 +262,7 @@ public function getChartType(): string
return $this->chartType;
}
- public function setPieColumn(?string $pieColumn)
+ public function setPieColumn(?string $pieColumn): void
{
$this->pieColumn = $pieColumn;
}
@@ -272,7 +272,7 @@ public function getPieColumn(): ?string
return $this->pieColumn;
}
- public function setXAxis(?string $xAxis)
+ public function setXAxis(?string $xAxis): void
{
$this->xAxis = $xAxis;
}
@@ -282,7 +282,7 @@ public function getXAxis(): ?string
return $this->xAxis;
}
- public function setYAxis(array|string|null $yAxis)
+ public function setYAxis(array|string|null $yAxis): void
{
$this->yAxis = $yAxis;
}
@@ -292,7 +292,7 @@ public function getYAxis(): array|string|null
return $this->yAxis;
}
- public function setPieLabelColumn(?string $pieLabelColumn)
+ public function setPieLabelColumn(?string $pieLabelColumn): void
{
$this->pieLabelColumn = $pieLabelColumn;
}
@@ -307,7 +307,7 @@ public function getModificationDate(): ?int
return $this->modificationDate;
}
- public function setModificationDate(int $modificationDate)
+ public function setModificationDate(int $modificationDate): void
{
$this->modificationDate = $modificationDate;
}
@@ -317,7 +317,7 @@ public function getCreationDate(): ?int
return $this->creationDate;
}
- public function setCreationDate(int $creationDate)
+ public function setCreationDate(int $creationDate): void
{
$this->creationDate = $creationDate;
}
@@ -327,7 +327,7 @@ public function getReportClass(): string
return $this->reportClass;
}
- public function setReportClass(string $reportClass)
+ public function setReportClass(string $reportClass): void
{
$this->reportClass = $reportClass;
}
diff --git a/models/Tool/CustomReport/Config/Dao.php b/models/Tool/CustomReport/Config/Dao.php
index 328be5279e7..f5c22db5072 100644
--- a/models/Tool/CustomReport/Config/Dao.php
+++ b/models/Tool/CustomReport/Config/Dao.php
@@ -24,7 +24,7 @@
*/
class Dao extends Model\Dao\PimcoreLocationAwareConfigDao
{
- public function configure()
+ public function configure(): void
{
$config = \Pimcore::getContainer()->getParameter('pimcore.config');
@@ -41,7 +41,7 @@ public function configure()
*
* @throws Model\Exception\NotFoundException
*/
- public function getByName(string $id = null)
+ public function getByName(string $id = null): void
{
if ($id != null) {
$this->model->setName($id);
@@ -67,7 +67,7 @@ public function getByName(string $id = null)
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
$ts = time();
if (!$this->model->getCreationDate()) {
@@ -92,7 +92,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->deleteData($this->model->getName());
}
diff --git a/models/Tool/Email/Blacklist.php b/models/Tool/Email/Blacklist.php
index 91b467645bd..b1eac620ef1 100644
--- a/models/Tool/Email/Blacklist.php
+++ b/models/Tool/Email/Blacklist.php
@@ -45,7 +45,7 @@ public static function getByAddress(string $addr): ?Blacklist
}
}
- public function setAddress(string $address)
+ public function setAddress(string $address): void
{
$this->address = $address;
}
@@ -55,7 +55,7 @@ public function getAddress(): ?string
return $this->address;
}
- public function setCreationDate(int $creationDate)
+ public function setCreationDate(int $creationDate): void
{
$this->creationDate = (int) $creationDate;
}
@@ -69,7 +69,7 @@ public function getCreationDate(): int
return $this->creationDate;
}
- public function setModificationDate(int $modificationDate)
+ public function setModificationDate(int $modificationDate): void
{
$this->modificationDate = (int) $modificationDate;
}
diff --git a/models/Tool/Email/Blacklist/Dao.php b/models/Tool/Email/Blacklist/Dao.php
index f34e484b676..35c1af439f8 100644
--- a/models/Tool/Email/Blacklist/Dao.php
+++ b/models/Tool/Email/Blacklist/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException(
*/
- public function getByAddress(string $address)
+ public function getByAddress(string $address): void
{
$data = $this->db->fetchAssociative('SELECT * FROM email_blacklist WHERE address = ?', [$address]);
@@ -43,7 +43,7 @@ public function getByAddress(string $address)
/**
* Save object to database
*/
- public function save()
+ public function save(): void
{
$this->model->setModificationDate(time());
if (!$this->model->getCreationDate()) {
@@ -70,7 +70,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('email_blacklist', ['address' => $this->model->getAddress()]);
}
diff --git a/models/Tool/Email/Log.php b/models/Tool/Email/Log.php
index 7498b90339a..6c257627981 100644
--- a/models/Tool/Email/Log.php
+++ b/models/Tool/Email/Log.php
@@ -402,7 +402,7 @@ public function getTextLog(): bool|string
/**
* Removes the log file entry from the db and removes the log files on the system
*/
- public function delete()
+ public function delete(): void
{
$storage = Storage::get('email_log');
$storage->delete($this->getHtmlLogFilename());
@@ -410,7 +410,7 @@ public function delete()
$this->getDao()->delete();
}
- public function save()
+ public function save(): void
{
$this->getDao()->save();
diff --git a/models/Tool/Email/Log/Dao.php b/models/Tool/Email/Log/Dao.php
index 2eacf4e7e9b..2785bcf4d01 100644
--- a/models/Tool/Email/Log/Dao.php
+++ b/models/Tool/Email/Log/Dao.php
@@ -37,7 +37,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @param int|null $id
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -50,7 +50,7 @@ public function getById(int $id = null)
/**
* Save document to database
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->create();
@@ -94,12 +94,12 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete(self::$dbTable, ['id' => $this->model->getId()]);
}
- public function create()
+ public function create(): void
{
$this->db->insert(self::$dbTable, []);
diff --git a/models/Tool/Targeting/Rule.php b/models/Tool/Targeting/Rule.php
index db387b56953..86dc8737989 100644
--- a/models/Tool/Targeting/Rule.php
+++ b/models/Tool/Targeting/Rule.php
@@ -180,7 +180,7 @@ public function getConditions(): array
return $this->conditions;
}
- public function setScope(string $scope)
+ public function setScope(string $scope): void
{
if (!empty($scope)) {
$this->scope = $scope;
@@ -192,7 +192,7 @@ public function getScope(): string
return $this->scope;
}
- public function setActive(bool $active)
+ public function setActive(bool $active): void
{
$this->active = (bool) $active;
}
@@ -207,7 +207,7 @@ public function getPrio(): int
return $this->prio;
}
- public function setPrio(int $prio)
+ public function setPrio(int $prio): void
{
$this->prio = $prio;
}
diff --git a/models/Tool/Targeting/Rule/Dao.php b/models/Tool/Targeting/Rule/Dao.php
index f5ff3c282aa..43a74b72e91 100644
--- a/models/Tool/Targeting/Rule/Dao.php
+++ b/models/Tool/Targeting/Rule/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -54,7 +54,7 @@ public function getById(int $id = null)
*
* @throws \Exception
*/
- public function getByName(string $name = null)
+ public function getByName(string $name = null): void
{
if ($name != null) {
$this->model->setName($name);
@@ -75,7 +75,7 @@ public function getByName(string $name = null)
/**
* Save object to database
*/
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->create();
@@ -87,7 +87,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('targeting_rules', ['id' => $this->model->getId()]);
}
@@ -95,7 +95,7 @@ public function delete()
/**
* @throws \Exception
*/
- public function update()
+ public function update(): void
{
$type = $this->model->getObjectVars();
$data = [];
@@ -115,7 +115,7 @@ public function update()
$this->db->update('targeting_rules', $data, ['id' => $this->model->getId()]);
}
- public function create()
+ public function create(): void
{
$this->db->insert('targeting_rules', []);
$this->model->setId((int) $this->db->lastInsertId());
diff --git a/models/Tool/Targeting/TargetGroup.php b/models/Tool/Targeting/TargetGroup.php
index b1385eae5e0..f80f82e396d 100644
--- a/models/Tool/Targeting/TargetGroup.php
+++ b/models/Tool/Targeting/TargetGroup.php
@@ -111,7 +111,7 @@ public function getName(): string
return $this->name;
}
- public function setThreshold(int $threshold)
+ public function setThreshold(int $threshold): void
{
$this->threshold = $threshold;
}
@@ -121,7 +121,7 @@ public function getThreshold(): int
return $this->threshold;
}
- public function setActive(bool $active)
+ public function setActive(bool $active): void
{
$this->active = (bool)$active;
}
diff --git a/models/Tool/Targeting/TargetGroup/Dao.php b/models/Tool/Targeting/TargetGroup/Dao.php
index 2c1961f6c2c..12f5a788394 100644
--- a/models/Tool/Targeting/TargetGroup/Dao.php
+++ b/models/Tool/Targeting/TargetGroup/Dao.php
@@ -31,7 +31,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if (null !== $id) {
$this->model->setId($id);
@@ -53,7 +53,7 @@ public function getById(int $id = null)
*
* @throws Model\Exception\NotFoundException
*/
- public function getByName(string $name = null)
+ public function getByName(string $name = null): void
{
if (null !== $name) {
$this->model->setName($name);
@@ -71,7 +71,7 @@ public function getByName(string $name = null)
}
}
- public function save()
+ public function save(): void
{
if (!$this->model->getId()) {
$this->create();
@@ -80,12 +80,12 @@ public function save()
$this->update();
}
- public function delete()
+ public function delete(): void
{
$this->db->delete('targeting_target_groups', ['id' => $this->model->getId()]);
}
- public function update()
+ public function update(): void
{
$type = $this->model->getObjectVars();
$data = [];
@@ -107,7 +107,7 @@ public function update()
$this->db->update('targeting_target_groups', $data, ['id' => $this->model->getId()]);
}
- public function create()
+ public function create(): void
{
$this->db->insert('targeting_target_groups', []);
$this->model->setId((int) $this->db->lastInsertId());
diff --git a/models/Tool/TmpStore.php b/models/Tool/TmpStore.php
index dcb1f1958f1..f2354c85b99 100644
--- a/models/Tool/TmpStore.php
+++ b/models/Tool/TmpStore.php
@@ -162,7 +162,7 @@ public function getId(): string
return $this->id;
}
- public function setId(string $id)
+ public function setId(string $id): void
{
$this->id = $id;
}
@@ -172,7 +172,7 @@ public function getTag(): string
return $this->tag;
}
- public function setTag(string $tag)
+ public function setTag(string $tag): void
{
$this->tag = $tag;
}
@@ -182,7 +182,7 @@ public function getData(): mixed
return $this->data;
}
- public function setData(mixed $data)
+ public function setData(mixed $data): void
{
$this->data = $data;
}
@@ -192,7 +192,7 @@ public function getDate(): int
return $this->date;
}
- public function setDate(int $date)
+ public function setDate(int $date): void
{
$this->date = $date;
}
@@ -202,7 +202,7 @@ public function isSerialized(): bool
return $this->serialized;
}
- public function setSerialized(bool $serialized)
+ public function setSerialized(bool $serialized): void
{
$this->serialized = $serialized;
}
@@ -212,7 +212,7 @@ public function getExpiryDate(): int
return $this->expiryDate;
}
- public function setExpiryDate(int $expiryDate)
+ public function setExpiryDate(int $expiryDate): void
{
$this->expiryDate = $expiryDate;
}
diff --git a/models/Tool/TmpStore/Dao.php b/models/Tool/TmpStore/Dao.php
index adb01f0bf96..373786cbb11 100644
--- a/models/Tool/TmpStore/Dao.php
+++ b/models/Tool/TmpStore/Dao.php
@@ -49,7 +49,7 @@ public function add(string $id, mixed $data, ?string $tag = null, ?int $lifetime
}
}
- public function delete(string $id)
+ public function delete(string $id): void
{
$this->db->delete('tmp_store', ['id' => $id]);
}
diff --git a/models/Tool/UUID.php b/models/Tool/UUID.php
index 8eff6ffc5cd..a0653103654 100644
--- a/models/Tool/UUID.php
+++ b/models/Tool/UUID.php
@@ -145,7 +145,7 @@ public function getUuid(): string
return $this->uuid;
}
- public function setUuid(string $uuid)
+ public function setUuid(string $uuid): void
{
$this->uuid = $uuid;
}
diff --git a/models/Tool/UUID/Dao.php b/models/Tool/UUID/Dao.php
index be68ffa5609..b3920db897f 100644
--- a/models/Tool/UUID/Dao.php
+++ b/models/Tool/UUID/Dao.php
@@ -27,14 +27,14 @@ class Dao extends Model\Dao\AbstractDao
{
const TABLE_NAME = 'uuids';
- public function save()
+ public function save(): void
{
$data = $this->getValidObjectVars();
Helper::insertOrUpdate($this->db, self::TABLE_NAME, $data);
}
- public function create()
+ public function create(): void
{
$data = $this->getValidObjectVars();
@@ -57,7 +57,7 @@ private function getValidObjectVars(): array
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$uuid = $this->model->getUuid();
if (!$uuid) {
diff --git a/models/Translation.php b/models/Translation.php
index 719ff79f7f8..2b492012f36 100644
--- a/models/Translation.php
+++ b/models/Translation.php
@@ -188,7 +188,7 @@ public static function getValidLanguages(string $domain = self::DOMAIN_DEFAULT):
return Tool::getValidLanguages();
}
- public function addTranslation(string $language, string $text)
+ public function addTranslation(string $language, string $text): void
{
$this->translations[$language] = $text;
}
@@ -206,7 +206,7 @@ public function hasTranslation(string $language): bool
/**
* @internal
*/
- public static function clearDependentCache()
+ public static function clearDependentCache(): void
{
Cache::clearTags(['translator', 'translate']);
}
@@ -327,7 +327,7 @@ public static function isAValidDomain(string $domain): bool
return $translation->getDao()->isAValidDomain($domain);
}
- public function save()
+ public function save(): void
{
$this->dispatchEvent(new TranslationEvent($this), TranslationEvents::PRE_SAVE);
@@ -338,7 +338,7 @@ public function save()
self::clearDependentCache();
}
- public function delete()
+ public function delete(): void
{
$this->dispatchEvent(new TranslationEvent($this), TranslationEvents::PRE_DELETE);
diff --git a/models/Translation/Dao.php b/models/Translation/Dao.php
index 6ff76534619..9241355d426 100644
--- a/models/Translation/Dao.php
+++ b/models/Translation/Dao.php
@@ -45,7 +45,7 @@ public function getDatabaseTableName(): string
* @throws NotFoundResourceException
* @throws \Doctrine\DBAL\Exception
*/
- public function getByKey(string $key, array $languages = null)
+ public function getByKey(string $key, array $languages = null): void
{
if (is_array($languages)) {
$sql = 'SELECT * FROM ' . $this->getDatabaseTableName() . ' WHERE `key` = :key
@@ -77,7 +77,7 @@ public function getByKey(string $key, array $languages = null)
/**
* Save object to database
*/
- public function save()
+ public function save(): void
{
//Create Domain table if doesn't exist
$this->createOrUpdateTable();
@@ -119,7 +119,7 @@ public function save()
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete($this->getDatabaseTableName(), [$this->db->quoteIdentifier('key') => $this->model->getKey()]);
}
@@ -176,7 +176,7 @@ public function isAValidDomain(string $domain): bool
}
}
- public function createOrUpdateTable()
+ public function createOrUpdateTable(): void
{
$table = $this->getDatabaseTableName();
diff --git a/models/Translation/Listing.php b/models/Translation/Listing.php
index 6c614c159bd..8e8e88ac2ec 100644
--- a/models/Translation/Listing.php
+++ b/models/Translation/Listing.php
@@ -100,7 +100,7 @@ public static function getCacheLimit(): int
return self::$cacheLimit;
}
- public static function setCacheLimit(int $cacheLimit)
+ public static function setCacheLimit(int $cacheLimit): void
{
self::$cacheLimit = $cacheLimit;
}
diff --git a/models/Translation/Listing/Dao.php b/models/Translation/Listing/Dao.php
index fac04e0c09b..a41dde9064a 100644
--- a/models/Translation/Listing/Dao.php
+++ b/models/Translation/Listing/Dao.php
@@ -138,7 +138,7 @@ public function isCacheable(): bool
return true;
}
- public function cleanup()
+ public function cleanup(): void
{
$keysToDelete = $this->db->fetchFirstColumn('SELECT `key` FROM ' . $this->getDatabaseTableName() . ' as tbl1 WHERE
(SELECT count(*) FROM ' . $this->getDatabaseTableName() . " WHERE `key` = tbl1.`key` AND (`text` IS NULL OR `text` = ''))
diff --git a/models/User.php b/models/User.php
index 099c2ed2a0e..ef256221c15 100644
--- a/models/User.php
+++ b/models/User.php
@@ -392,7 +392,9 @@ protected function getOriginalImageStoragePath(): string
return sprintf('/user-image/user-%s.png', $this->getId());
}
- // @internal
+ /**
+ * @internal
+ */
protected function getThumbnailImageStoragePath(): string
{
return sprintf('/user-image/user-thumbnail-%s.png', $this->getId());
diff --git a/models/User/AbstractUser.php b/models/User/AbstractUser.php
index 689b8fa1e30..9f17625bf07 100644
--- a/models/User/AbstractUser.php
+++ b/models/User/AbstractUser.php
@@ -177,7 +177,7 @@ public function save(): static
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
if ($this->getId() < 1) {
throw new \Exception('Deleting the system user is not allowed!');
@@ -241,7 +241,7 @@ public function setType(string $type): static
/**
* @throws \Exception
*/
- protected function update()
+ protected function update(): void
{
$this->getDao()->update();
}
diff --git a/models/User/AbstractUser/Dao.php b/models/User/AbstractUser/Dao.php
index cf0100356fe..9a9dffd0341 100644
--- a/models/User/AbstractUser/Dao.php
+++ b/models/User/AbstractUser/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws Model\Exception\NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
if ($this->model->getType()) {
$data = $this->db->fetchAssociative('SELECT * FROM users WHERE `type` = ? AND id = ?', [$this->model->getType(), $id]);
@@ -50,7 +50,7 @@ public function getById(int $id)
*
* @throws Model\Exception\NotFoundException
*/
- public function getByName(string $name)
+ public function getByName(string $name): void
{
$data = $this->db->fetchAssociative('SELECT * FROM users WHERE `type` = ? AND `name` = ?', [$this->model->getType(), $name]);
@@ -61,7 +61,7 @@ public function getByName(string $name)
}
}
- public function create()
+ public function create(): void
{
$this->db->insert('users', [
'name' => $this->model->getName(),
@@ -90,7 +90,7 @@ public function hasChildren(): bool
/**
* @throws \Exception
*/
- public function update()
+ public function update(): void
{
if (strlen($this->model->getName()) < 2) {
throw new \Exception('Name of user/role must be at least 2 characters long');
@@ -120,7 +120,7 @@ public function update()
/**
* @throws \Exception
*/
- public function delete()
+ public function delete(): void
{
$userId = $this->model->getId();
Logger::debug('delete user with ID: ' . $userId);
@@ -131,7 +131,7 @@ public function delete()
/**
* @throws \Exception
*/
- public function setLastLoginDate()
+ public function setLastLoginDate(): void
{
$data['lastLogin'] = (new \DateTime())->getTimestamp();
$this->db->update('users', $data, ['id' => $this->model->getId()]);
diff --git a/models/User/Dao.php b/models/User/Dao.php
index 8619ea7a5aa..0e4dd32fc70 100644
--- a/models/User/Dao.php
+++ b/models/User/Dao.php
@@ -25,7 +25,7 @@ class Dao extends UserRole\Dao
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
parent::delete();
diff --git a/models/User/Permission/Definition/Dao.php b/models/User/Permission/Definition/Dao.php
index 1cc20af8048..feeb9a35f0e 100644
--- a/models/User/Permission/Definition/Dao.php
+++ b/models/User/Permission/Definition/Dao.php
@@ -26,7 +26,7 @@
*/
class Dao extends Model\Dao\AbstractDao
{
- public function save()
+ public function save(): void
{
try {
Helper::insertOrUpdate($this->db, 'users_permission_definitions', [
diff --git a/models/User/UserRole.php b/models/User/UserRole.php
index a9d04c62050..1d5cce14d18 100644
--- a/models/User/UserRole.php
+++ b/models/User/UserRole.php
@@ -91,7 +91,7 @@ class UserRole extends AbstractUser
/**
* {@inheritdoc}
*/
- protected function update()
+ protected function update(): void
{
$this->getDao()->update();
diff --git a/models/User/UserRole/Dao.php b/models/User/UserRole/Dao.php
index 3f1b71af7e8..cc757f1a4fb 100644
--- a/models/User/UserRole/Dao.php
+++ b/models/User/UserRole/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\User\AbstractUser\Dao
*
* @throws \Exception
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
parent::getById($id);
@@ -44,7 +44,7 @@ public function getById(int $id)
*
* @throws \Exception
*/
- public function getByName(string $name)
+ public function getByName(string $name): void
{
parent::getByName($name);
@@ -53,7 +53,7 @@ public function getByName(string $name)
}
}
- public function loadWorkspaces()
+ public function loadWorkspaces(): void
{
$types = ['asset', 'document', 'object'];
@@ -72,7 +72,7 @@ public function loadWorkspaces()
}
}
- public function emptyWorkspaces()
+ public function emptyWorkspaces(): void
{
$this->db->delete('users_workspaces_asset', ['userId' => $this->model->getId()]);
$this->db->delete('users_workspaces_document', ['userId' => $this->model->getId()]);
diff --git a/models/User/Workspace/Dao.php b/models/User/Workspace/Dao.php
index cd03ae97ea8..2184d86fc43 100644
--- a/models/User/Workspace/Dao.php
+++ b/models/User/Workspace/Dao.php
@@ -26,7 +26,7 @@
*/
class Dao extends Model\Dao\AbstractDao
{
- public function save()
+ public function save(): void
{
$tableName = '';
if ($this->model instanceof Workspace\Asset) {
diff --git a/models/User/Workspace/DataObject.php b/models/User/Workspace/DataObject.php
index f73b835f510..aee7a9ce318 100644
--- a/models/User/Workspace/DataObject.php
+++ b/models/User/Workspace/DataObject.php
@@ -77,7 +77,7 @@ public function getUnpublish(): bool
return $this->unpublish;
}
- public function setLEdit(string $lEdit)
+ public function setLEdit(string $lEdit): void
{
//@TODO - at the moment disallowing all languages is not possible - the empty lEdit value means that every language is allowed to edit...
$this->lEdit = $lEdit;
@@ -88,7 +88,7 @@ public function getLEdit(): ?string
return $this->lEdit;
}
- public function setLView(string $lView)
+ public function setLView(string $lView): void
{
$this->lView = $lView;
}
@@ -98,7 +98,7 @@ public function getLView(): ?string
return $this->lView;
}
- public function setLayouts(string $layouts)
+ public function setLayouts(string $layouts): void
{
$this->layouts = $layouts;
}
diff --git a/models/Version.php b/models/Version.php
index 8d5e915a774..abc61895412 100644
--- a/models/Version.php
+++ b/models/Version.php
@@ -104,7 +104,7 @@ public static function getById(int $id): ?Version
*
* @static
*/
- public static function disable()
+ public static function disable(): void
{
self::$disabled = true;
}
@@ -115,7 +115,7 @@ public static function disable()
*
* @static
*/
- public static function enable()
+ public static function enable(): void
{
self::$disabled = false;
}
@@ -128,7 +128,7 @@ public static function isEnabled(): bool
/**
* @throws \Exception
*/
- public function save()
+ public function save(): void
{
$this->dispatchEvent(new VersionEvent($this), VersionEvents::PRE_SAVE);
@@ -260,7 +260,7 @@ function (Concrete $object, Data $fieldDefinition, $property, $currentValue) {
/**
* Delete this Version
*/
- public function delete()
+ public function delete(): void
{
$this->dispatchEvent(new VersionEvent($this), VersionEvents::PRE_DELETE);
diff --git a/models/Version/Adapter/ProxyVersionStorageAdapter.php b/models/Version/Adapter/ProxyVersionStorageAdapter.php
index dc19a91aaa1..8218942547f 100644
--- a/models/Version/Adapter/ProxyVersionStorageAdapter.php
+++ b/models/Version/Adapter/ProxyVersionStorageAdapter.php
@@ -68,7 +68,7 @@ public function delete(Version $version, bool $isBinaryHashInUse): void
$this->storageAdapter->delete($version, $isBinaryHashInUse);
}
- public function setStorageAdapter(VersionStorageAdapterInterface $adapter)
+ public function setStorageAdapter(VersionStorageAdapterInterface $adapter): void
{
$this->storageAdapter = $adapter;
}
diff --git a/models/Version/Dao.php b/models/Version/Dao.php
index 3b1c29ae35b..82a9ef4e17b 100644
--- a/models/Version/Dao.php
+++ b/models/Version/Dao.php
@@ -32,7 +32,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws NotFoundException
*/
- public function getById(int $id)
+ public function getById(int $id): void
{
$data = $this->db->fetchAssociative('SELECT * FROM versions WHERE id = ?', [$id]);
@@ -78,7 +78,7 @@ public function save(): int
/**
* Deletes object from database
*/
- public function delete()
+ public function delete(): void
{
$this->db->delete('versions', ['id' => $this->model->getId()]);
}
diff --git a/models/Version/SetDumpStateFilter.php b/models/Version/SetDumpStateFilter.php
index b50ebb39310..3a84bf7d0a3 100644
--- a/models/Version/SetDumpStateFilter.php
+++ b/models/Version/SetDumpStateFilter.php
@@ -34,7 +34,7 @@ public function __construct(bool $state)
/**
* {@inheritdoc}
*/
- public function apply($object, $property, $objectCopier)
+ public function apply($object, $property, $objectCopier): void
{
if ($object instanceof ElementDumpStateInterface) {
$object->setInDumpState($this->state);
diff --git a/models/WebsiteSetting.php b/models/WebsiteSetting.php
index d1a2372f0b6..460debebb9e 100644
--- a/models/WebsiteSetting.php
+++ b/models/WebsiteSetting.php
@@ -239,7 +239,7 @@ public function getLanguage(): string
return $this->language;
}
- public function setLanguage(string $language)
+ public function setLanguage(string $language): void
{
$this->language = $language;
}
@@ -247,7 +247,7 @@ public function setLanguage(string $language)
/**
* @internal
*/
- public function clearDependentCache()
+ public function clearDependentCache(): void
{
\Pimcore\Cache::clearTag('website_config');
}
diff --git a/models/WebsiteSetting/Dao.php b/models/WebsiteSetting/Dao.php
index 7693fe7416c..505e3b6ff14 100644
--- a/models/WebsiteSetting/Dao.php
+++ b/models/WebsiteSetting/Dao.php
@@ -30,7 +30,7 @@ class Dao extends Model\Dao\AbstractDao
*
* @throws NotFoundException
*/
- public function getById(int $id = null)
+ public function getById(int $id = null): void
{
if ($id != null) {
$this->model->setId($id);
@@ -53,7 +53,7 @@ public function getById(int $id = null)
*
* @throws NotFoundException
*/
- public function getByName(string $name = null, int $siteId = null, string $language = null)
+ public function getByName(string $name = null, int $siteId = null, string $language = null): void
{
if ($name != null) {
$this->model->setName($name);
@@ -83,7 +83,7 @@ public function getByName(string $name = null, int $siteId = null, string $langu
}
}
- public function save()
+ public function save(): void
{
if ($this->model->getId()) {
$this->update();
@@ -92,13 +92,13 @@ public function save()
}
}
- public function delete()
+ public function delete(): void
{
$this->db->delete('website_settings', ['id' => $this->model->getId()]);
$this->model->clearDependentCache();
}
- public function update()
+ public function update(): void
{
$ts = time();
$this->model->setModificationDate($ts);
@@ -117,7 +117,7 @@ public function update()
$this->model->clearDependentCache();
}
- public function create()
+ public function create(): void
{
$ts = time();
$this->model->setModificationDate($ts);
diff --git a/models/WebsiteSetting/Listing.php b/models/WebsiteSetting/Listing.php
index 0b62ec9dddc..6af519396b9 100644
--- a/models/WebsiteSetting/Listing.php
+++ b/models/WebsiteSetting/Listing.php
@@ -36,7 +36,7 @@ class Listing extends Model\Listing\AbstractListing
/**
* @param WebsiteSetting[]|null $settings
*/
- public function setSettings(?array $settings)
+ public function setSettings(?array $settings): void
{
$this->settings = $settings;
}
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index d603ad5dcfa..e3fa42ea528 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1,25 +1,10 @@
parameters:
ignoreErrors:
- -
- message: "#^Offset 'image' on array\\{\\} in empty\\(\\) does not exist\\.$#"
- count: 1
- path: bundles/AdminBundle/src/GDPR/DataProvider/DataObjects.php
-
- -
- message: "#^Offset 'object' on array\\{\\} in empty\\(\\) does not exist\\.$#"
- count: 1
- path: bundles/AdminBundle/src/GDPR/DataProvider/DataObjects.php
-
-
message: "#^Negated boolean expression is always false\\.$#"
count: 3
path: bundles/CoreBundle/src/DependencyInjection/PimcoreCoreExtension.php
- -
- message: "#^If condition is always false\\.$#"
- count: 1
- path: bundles/CoreBundle/src/EventListener/Frontend/RoutingListener.php
-
-
message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#"
count: 1
@@ -50,11 +35,6 @@ parameters:
count: 1
path: bundles/EcommerceFrameworkBundle/src/FilterService/FilterType/Findologic/NumberRangeSelection.php
- -
- message: "#^Result of \\|\\| is always true\\.$#"
- count: 1
- path: bundles/EcommerceFrameworkBundle/src/FilterService/FilterType/SelectCategory.php
-
-
message: "#^If condition is always true\\.$#"
count: 1
diff --git a/phpstan-parameters.neon b/phpstan-parameters.neon
index 27ef8eb1d88..9ff31ceee10 100644
--- a/phpstan-parameters.neon
+++ b/phpstan-parameters.neon
@@ -1,5 +1,5 @@
parameters:
- level: 5
+ level: 6
paths:
- bundles
@@ -23,3 +23,6 @@ parameters:
universalObjectCratesClasses:
- Pimcore\Config\Config
- Pimcore\Templating\Model\ViewModel
+
+ checkGenericClassInNonGenericObjectType: false
+ checkMissingIterableValueType: false
diff --git a/tests/Unit/HttpKernel/BundleCollection/BundleCollectionTest.php b/tests/Unit/HttpKernel/BundleCollection/BundleCollectionTest.php
index dc8dd796aca..3a05e37ac3a 100644
--- a/tests/Unit/HttpKernel/BundleCollection/BundleCollectionTest.php
+++ b/tests/Unit/HttpKernel/BundleCollection/BundleCollectionTest.php
@@ -321,7 +321,7 @@ class BundleD extends Bundle
class BundleE extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->addBundle(new BundleF());
}
@@ -333,7 +333,7 @@ class BundleF extends Bundle
class BundleG extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->addBundle(new BundleH, 8);
}
@@ -341,7 +341,7 @@ public static function registerDependentBundles(BundleCollection $collection)
class BundleH extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->addBundle(new BundleG, 5);
}
@@ -349,7 +349,7 @@ public static function registerDependentBundles(BundleCollection $collection)
class BundleI extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->addBundle(new BundleA);
$collection->addBundle(new BundleB);
@@ -359,7 +359,7 @@ public static function registerDependentBundles(BundleCollection $collection)
class BundleJ extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->addBundle(new BundleH(), 9);
}
diff --git a/tests/Unit/HttpKernel/BundleCollection/ItemTest.php b/tests/Unit/HttpKernel/BundleCollection/ItemTest.php
index bd73bd7fa0e..bcec8949553 100644
--- a/tests/Unit/HttpKernel/BundleCollection/ItemTest.php
+++ b/tests/Unit/HttpKernel/BundleCollection/ItemTest.php
@@ -99,7 +99,7 @@ class ItemTestBundleB extends AbstractPimcoreBundle
class ItemTestBundleC extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->add(new Item(new ItemTestBundleA()));
}
diff --git a/tests/Unit/HttpKernel/BundleCollection/LazyLoadedItemTest.php b/tests/Unit/HttpKernel/BundleCollection/LazyLoadedItemTest.php
index dd869dd5895..e6692fc45ef 100644
--- a/tests/Unit/HttpKernel/BundleCollection/LazyLoadedItemTest.php
+++ b/tests/Unit/HttpKernel/BundleCollection/LazyLoadedItemTest.php
@@ -171,7 +171,7 @@ public static function getCounter(): int
class LazyLoadedItemTestBundleC extends Bundle implements DependentBundleInterface
{
- public static function registerDependentBundles(BundleCollection $collection)
+ public static function registerDependentBundles(BundleCollection $collection): void
{
$collection->add(new LazyLoadedItem(LazyLoadedItemTestBundleA::class));
}