diff --git a/bundles/AdminBundle/Controller/Admin/DataObject/DataObjectController.php b/bundles/AdminBundle/Controller/Admin/DataObject/DataObjectController.php index f851659aaa7..b09e01be9bc 100644 --- a/bundles/AdminBundle/Controller/Admin/DataObject/DataObjectController.php +++ b/bundles/AdminBundle/Controller/Admin/DataObject/DataObjectController.php @@ -36,6 +36,7 @@ use Pimcore\Model\Schedule\Task; use Pimcore\Model\Version; use Pimcore\Tool; +use Pimcore\Model\Element\ElementInterface; use Symfony\Component\EventDispatcher\GenericEvent; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -235,7 +236,7 @@ private function buildChildrenCondition(DataObject\AbstractObject $object, ?stri } /** - * @param DataObject\AbstractObject $element + * @param ElementInterface $element * * @return array * @@ -243,6 +244,7 @@ private function buildChildrenCondition(DataObject\AbstractObject $object, ?stri */ protected function getTreeNodeConfig($element): array { + /** @var DataObject $child */ $child = $element; $tmpObject = [ diff --git a/bundles/EcommerceFrameworkBundle/CartManager/AbstractCart.php b/bundles/EcommerceFrameworkBundle/CartManager/AbstractCart.php index 0251351aca0..e2f4b6ef827 100644 --- a/bundles/EcommerceFrameworkBundle/CartManager/AbstractCart.php +++ b/bundles/EcommerceFrameworkBundle/CartManager/AbstractCart.php @@ -30,7 +30,7 @@ abstract class AbstractCart extends AbstractModel implements CartInterface { /** - * @var int + * @var int|null */ protected $userId; @@ -331,6 +331,8 @@ public function clear() * @param string $countSubItems - use one of COUNT_MAIN_ITEMS_ONLY, COUNT_MAIN_OR_SUB_ITEMS, COUNT_MAIN_AND_SUB_ITEMS * * @return int + * + * @throws InvalidConfigException */ public function getItemAmount(string $countSubItems = self::COUNT_MAIN_ITEMS_ONLY) { @@ -624,7 +626,7 @@ public function setCreationDateTimestamp($creationDateTimestamp) } /** - * @return int + * @return int|null */ public function getCreationDateTimestamp() { @@ -778,7 +780,7 @@ public function modified() /** * @param int $count * - * @return array + * @return CartItemInterface[] */ public function getRecentlyAddedItems($count) { diff --git a/bundles/EcommerceFrameworkBundle/CartManager/AbstractCartCheckoutData.php b/bundles/EcommerceFrameworkBundle/CartManager/AbstractCartCheckoutData.php index 0fb52847c3d..37e5191577a 100644 --- a/bundles/EcommerceFrameworkBundle/CartManager/AbstractCartCheckoutData.php +++ b/bundles/EcommerceFrameworkBundle/CartManager/AbstractCartCheckoutData.php @@ -17,8 +17,14 @@ abstract class AbstractCartCheckoutData extends \Pimcore\Model\AbstractModel { + /** + * @var string + */ protected $key; + /** + * @var array|string|null + */ protected $data; /** @@ -31,11 +37,17 @@ public function setCart(CartInterface $cart) $this->cart = $cart; } + /** + * @return CartInterface|null + */ public function getCart() { return $this->cart; } + /** + * @return int|string|null + */ public function getCartId() { return $this->getCart()->getId(); @@ -56,21 +68,33 @@ public static function removeAllFromCart($cartId) throw new \Exception('Not implemented.'); } + /** + * @param string $key + */ public function setKey($key) { $this->key = $key; } + /** + * @return string + */ public function getKey() { return $this->key; } + /** + * @param array|string|null $data + */ public function setData($data) { $this->data = $data; } + /** + * @return array|string|null + */ public function getData() { return $this->data; diff --git a/bundles/EcommerceFrameworkBundle/CartManager/SessionCartCheckoutData.php b/bundles/EcommerceFrameworkBundle/CartManager/SessionCartCheckoutData.php index 063da0e7287..40ae473d943 100644 --- a/bundles/EcommerceFrameworkBundle/CartManager/SessionCartCheckoutData.php +++ b/bundles/EcommerceFrameworkBundle/CartManager/SessionCartCheckoutData.php @@ -32,7 +32,10 @@ public static function getByKeyCartId($key, $cartId) public static function removeAllFromCart($cartId) { $checkoutDataItem = new self(); - $checkoutDataItem->getCart()->checkoutData = []; + $cart = $checkoutDataItem->getCart(); + if ($cart instanceof SessionCart) { + $cart->checkoutData = []; + } } public function setCart(CartInterface $cart) @@ -41,6 +44,9 @@ public function setCart(CartInterface $cart) $this->cartId = $cart->getId(); } + /** + * @return CartInterface|null + */ public function getCart() { if (empty($this->cart)) { diff --git a/bundles/EcommerceFrameworkBundle/CheckoutManager/CheckoutManagerFactory.php b/bundles/EcommerceFrameworkBundle/CheckoutManager/CheckoutManagerFactory.php index 5ad1067f61a..ab0a997cc79 100644 --- a/bundles/EcommerceFrameworkBundle/CheckoutManager/CheckoutManagerFactory.php +++ b/bundles/EcommerceFrameworkBundle/CheckoutManager/CheckoutManagerFactory.php @@ -21,6 +21,7 @@ use Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\CheckoutManager; use Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\CheckoutManagerInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\HandlePendingPayments\CancelPaymentOrRecreateOrderStrategy; +use Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\HandlePendingPayments\HandlePendingPaymentsStrategyInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\EnvironmentInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\OrderManager\OrderManagerLocatorInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\V7\Payment\PaymentInterface; @@ -53,7 +54,7 @@ class CheckoutManagerFactory implements CheckoutManagerFactoryInterface protected $checkoutStepDefinitions = []; /** - * @var PaymentInterface + * @var PaymentInterface|null */ protected $paymentProvider; @@ -72,10 +73,13 @@ class CheckoutManagerFactory implements CheckoutManagerFactoryInterface */ protected $className = CheckoutManager::class; + /** + * @var HandlePendingPaymentsStrategyInterface|null + */ protected $handlePendingPaymentStrategy = null; /** - * @var EventDispatcherInterface + * @var EventDispatcherInterface|null */ protected $eventDispatcher = null; diff --git a/bundles/EcommerceFrameworkBundle/CoreExtensions/ClassDefinition/IndexFieldSelection.php b/bundles/EcommerceFrameworkBundle/CoreExtensions/ClassDefinition/IndexFieldSelection.php index 931bf210c33..a15700fd0d6 100644 --- a/bundles/EcommerceFrameworkBundle/CoreExtensions/ClassDefinition/IndexFieldSelection.php +++ b/bundles/EcommerceFrameworkBundle/CoreExtensions/ClassDefinition/IndexFieldSelection.php @@ -17,6 +17,7 @@ use Pimcore\Bundle\EcommerceFrameworkBundle\CoreExtensions\ObjectData; use Pimcore\Model\DataObject; +use Pimcore\Model\DataObject\AbstractObject; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\ClassDefinition\Data\QueryResourcePersistenceAwareInterface; use Pimcore\Model\DataObject\ClassDefinition\Data\ResourcePersistenceAwareInterface; @@ -92,7 +93,7 @@ public function getFilterGroups() } /** - * @param bool $multiPreSelect + * @param string $multiPreSelect */ public function setMultiPreSelect($multiPreSelect) { @@ -100,7 +101,7 @@ public function setMultiPreSelect($multiPreSelect) } /** - * @return bool + * @return string */ public function getMultiPreSelect() { @@ -124,13 +125,13 @@ public function getPredefinedPreSelectOptions() } /** - * @see ResourcePersistenceAwareInterface::getDataForResource - * - * @param ObjectData\IndexFieldSelection|null $data - * @param null|\Pimcore\Model\DataObject\AbstractObject $object + * @param mixed $data + * @param null|AbstractObject $object * @param array $params * * @return array + * + * @see ResourcePersistenceAwareInterface::getDataForResource */ public function getDataForResource($data, $object = null, $params = []) { @@ -150,13 +151,13 @@ public function getDataForResource($data, $object = null, $params = []) } /** - * @see ResourcePersistenceAwareInterface::getDataFromResource - * - * @param array $data - * @param null|\Pimcore\Model\DataObject\AbstractObject $object - * @param mixed $params + * @param mixed $data + * @param null|AbstractObject $object + * @param array $params * * @return ObjectData\IndexFieldSelection|null + * + * @see ResourcePersistenceAwareInterface::getDataFromResource */ public function getDataFromResource($data, $object = null, $params = []) { @@ -168,13 +169,13 @@ public function getDataFromResource($data, $object = null, $params = []) } /** - * @see QueryResourcePersistenceAwareInterface::getDataForQueryResource - * - * @param ObjectData\IndexFieldSelection|null $data - * @param null|\Pimcore\Model\DataObject\AbstractObject $object - * @param mixed $params + * @param mixed $data + * @param null|AbstractObject $object + * @param array $params * * @return array + * + * @see QueryResourcePersistenceAwareInterface::getDataForQueryResource */ public function getDataForQueryResource($data, $object = null, $params = []) { @@ -182,13 +183,13 @@ public function getDataForQueryResource($data, $object = null, $params = []) } /** - * @see Data::getDataForEditmode - * - * @param ObjectData\IndexFieldSelection|null $data - * @param null|\Pimcore\Model\DataObject\AbstractObject $object - * @param mixed $params + * @param mixed $data + * @param null|AbstractObject $object + * @param array $params * * @return array|null + * + * @see Data::getDataForEditmode */ public function getDataForEditmode($data, $object = null, $params = []) { @@ -204,13 +205,13 @@ public function getDataForEditmode($data, $object = null, $params = []) } /** - * @see Data::getDataFromEditmode - * * @param array $data - * @param null|\Pimcore\Model\DataObject\AbstractObject $object + * @param null|AbstractObject $object * @param array $params * * @return ObjectData\IndexFieldSelection|null + * + * @see Data::getDataFromEditmode */ public function getDataFromEditmode($data, $object = null, $params = []) { diff --git a/bundles/EcommerceFrameworkBundle/EnvironmentInterface.php b/bundles/EcommerceFrameworkBundle/EnvironmentInterface.php index 4c2b28d2091..62edd18f487 100644 --- a/bundles/EcommerceFrameworkBundle/EnvironmentInterface.php +++ b/bundles/EcommerceFrameworkBundle/EnvironmentInterface.php @@ -34,7 +34,7 @@ public function getCurrentUserId(); * * @param int $userId * - * @return void + * @return $this */ public function setCurrentUserId($userId); diff --git a/bundles/EcommerceFrameworkBundle/IndexService/Config/ConfigInterface.php b/bundles/EcommerceFrameworkBundle/IndexService/Config/ConfigInterface.php index 5198e11a716..a6f2b03a5a0 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/Config/ConfigInterface.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/Config/ConfigInterface.php @@ -49,7 +49,7 @@ public function getSearchAttributes(): array; /** * return all supported filter types for product index * - * @return array + * @return array|null */ public function getFilterTypeConfig(); diff --git a/bundles/EcommerceFrameworkBundle/IndexService/Config/DefaultFindologic.php b/bundles/EcommerceFrameworkBundle/IndexService/Config/DefaultFindologic.php index bdcd0e54ad0..6ad79ca3947 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/Config/DefaultFindologic.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/Config/DefaultFindologic.php @@ -54,9 +54,9 @@ protected function configureOptionsResolver(string $resolverName, OptionsResolve } /** - * @param string $property + * @param string|null $property * - * @return array|string + * @return array|string|null */ public function getClientConfig($property = null) { diff --git a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultFindologic.php b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultFindologic.php index 7f932534bdd..d62e2198bc5 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultFindologic.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultFindologic.php @@ -21,6 +21,7 @@ use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Config\FindologicConfigInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractCategory; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\IndexableInterface; +use Psr\Log\LoggerInterface; class DefaultFindologic implements ProductListInterface { @@ -75,7 +76,7 @@ class DefaultFindologic implements ProductListInterface protected $offset = 0; /** - * @var AbstractCategory + * @var AbstractCategory|null */ protected $category; @@ -92,7 +93,7 @@ class DefaultFindologic implements ProductListInterface protected $response; /** - * @var array + * @var array|null */ protected $groupedValues; @@ -117,17 +118,17 @@ class DefaultFindologic implements ProductListInterface protected $conditionPriceTo = null; /** - * @var string + * @var string|null */ protected $order; /** - * @var string | array + * @var string|array */ protected $orderKey; /** - * @var Logger + * @var LoggerInterface */ protected $logger; @@ -157,7 +158,9 @@ public function __construct(FindologicConfigInterface $tenantConfig) $this->referer = $_SERVER['HTTP_REFERER']; } - /** @inheritDoc */ + /** + * {@inheritDoc} + */ public function getProducts() { if ($this->products === null) { @@ -227,7 +230,7 @@ public function resetConditions() /** * @param string $fieldname - * @param string $condition + * @param array|string $condition */ public function addRelationCondition($fieldname, $condition) { @@ -273,7 +276,7 @@ public function setOrder($order) } /** - * @return string + * @return string|null */ public function getOrder() { @@ -795,7 +798,7 @@ protected function sendRequest(array $params) } /** - * @return Logger + * @return LoggerInterface */ protected function getLogger() { diff --git a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultMysql.php b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultMysql.php index a6daf4fd01b..7cccf8d2455 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultMysql.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/DefaultMysql.php @@ -21,6 +21,7 @@ use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Config\MysqlConfigInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractCategory; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\IndexableInterface; +use Psr\Log\LoggerInterface; /** * Implementation of product list which works based on the product index of the online shop framework @@ -53,7 +54,7 @@ class DefaultMysql implements ProductListInterface protected $variantMode = ProductListInterface::VARIANT_MODE_INCLUDE; /** - * @var int + * @var int|null */ protected $limit; @@ -63,7 +64,7 @@ class DefaultMysql implements ProductListInterface protected $offset; /** - * @var AbstractCategory + * @var AbstractCategory|null */ protected $category; @@ -78,7 +79,7 @@ class DefaultMysql implements ProductListInterface protected $inProductList = true; /** - * @var Logger + * @var LoggerInterface */ protected $logger; @@ -91,7 +92,9 @@ public function __construct(MysqlConfigInterface $tenantConfig) $this->resource = new DefaultMysql\Dao($this, $this->logger); } - /** @inheritDoc */ + /** + * {@inheritDoc} + */ public function getProducts() { if ($this->products === null) { @@ -144,7 +147,7 @@ public function resetCondition($fieldname) /** * @param string $fieldname - * @param string $condition + * @param string|array $condition */ public function addRelationCondition($fieldname, $condition) { @@ -218,13 +221,19 @@ public function getInProductList() return $this->inProductList; } + /** + * @var string|null + */ protected $order; /** - * @var string | array + * @var string|array|null */ protected $orderKey; + /** + * @var bool + */ protected $orderByPrice = false; public function setOrder($order) @@ -434,6 +443,8 @@ protected function loadElementById($elementId) * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ @@ -457,6 +468,8 @@ public function resetPreparedGroupByValues() * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ @@ -470,6 +483,8 @@ public function prepareGroupByRelationValues($fieldname, $countValues = false, $ * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ @@ -767,8 +782,8 @@ public function current()// : IndexableInterface|false /** * Returns an collection of items for a page. * - * @param int $offset Page offset - * @param int $itemCountPerPage Number of items per page + * @param int $offset Page offset + * @param int $itemCountPerPage Number of items per page * * @return array */ diff --git a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ElasticSearch/AbstractElasticSearch.php b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ElasticSearch/AbstractElasticSearch.php index 83c9b1421d7..070834606f5 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ElasticSearch/AbstractElasticSearch.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ElasticSearch/AbstractElasticSearch.php @@ -20,6 +20,7 @@ use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Config\ElasticSearchConfigInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\ProductList\ProductListInterface; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractCategory; +use Pimcore\Bundle\EcommerceFrameworkBundle\Model\DefaultMockup; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\IndexableInterface; abstract class AbstractElasticSearch implements ProductListInterface @@ -70,12 +71,12 @@ abstract class AbstractElasticSearch implements ProductListInterface protected $variantMode = ProductListInterface::VARIANT_MODE_INCLUDE; /** - * @var int + * @var int|null */ protected $limit; /** - * @var string + * @var string|null */ protected $order; @@ -157,8 +158,14 @@ abstract class AbstractElasticSearch implements ProductListInterface */ protected $productPositionMap = []; + /** + * @var bool + */ protected $doScrollRequest = false; + /** + * @var string + */ protected $scrollRequestKeepAlive = '30s'; /** @@ -212,7 +219,9 @@ public function setTimeout($timeout) return $this; } - /** @inheritDoc */ + /** + * {@inheritDoc} + */ public function getProducts() { if ($this->products === null) { @@ -275,7 +284,7 @@ public function resetCondition($fieldname) * Adds relation condition to product list * * @param string $fieldname - * @param string $condition + * @param string|array $condition */ public function addRelationCondition($fieldname, $condition) { @@ -373,7 +382,7 @@ public function setOrder($order) /** * gets order direction * - * @return string + * @return string|null */ public function getOrder() { @@ -434,7 +443,7 @@ public function setLimit($limit) } /** - * @return int + * @return int|null */ public function getLimit() { @@ -506,6 +515,8 @@ public function getVariantMode() * loads search results from index and returns them * * @return IndexableInterface[] + * + * @throws \Exception */ public function load() { @@ -870,7 +881,7 @@ protected function buildQueryConditions($queryFilters, $excludedFieldnames) * * @param int $elementId * - * @return \Pimcore\Bundle\EcommerceFrameworkBundle\Model\DefaultMockup|null + * @return DefaultMockup|null */ protected function loadElementById($elementId) { @@ -898,6 +909,8 @@ protected function loadElementById($elementId) * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ @@ -938,6 +951,8 @@ public function prepareGroupByValuesWithConfig($fieldname, $countValues = false, * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ @@ -954,6 +969,8 @@ public function prepareGroupByRelationValues($fieldname, $countValues = false, $ * considers both - normal values and relation values * * @param string $fieldname + * @param bool $countValues + * @param bool $fieldnameShouldBeExcluded * * @return void */ diff --git a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ProductListInterface.php b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ProductListInterface.php index 4fd33739d6c..70e1eaa6041 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ProductListInterface.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/ProductList/ProductListInterface.php @@ -94,6 +94,8 @@ public function resetCondition($fieldname); * Reset query condition for fieldname * * @param string $fieldname + * + * @return void */ public function resetQueryCondition($fieldname); @@ -101,7 +103,7 @@ public function resetQueryCondition($fieldname); * Adds relation condition to product list * * @param string $fieldname - * @param string $condition + * @param string|array $condition */ public function addRelationCondition($fieldname, $condition); @@ -140,7 +142,7 @@ public function setOrder($order); /** * gets order direction * - * @return string + * @return string|null */ public function getOrder(); @@ -162,7 +164,7 @@ public function getOrderKey(); public function setLimit($limit); /** - * @return int + * @return int|null */ public function getLimit(); diff --git a/bundles/EcommerceFrameworkBundle/Model/AbstractVoucherTokenType.php b/bundles/EcommerceFrameworkBundle/Model/AbstractVoucherTokenType.php index ad1a0e49806..0e8ff314a60 100644 --- a/bundles/EcommerceFrameworkBundle/Model/AbstractVoucherTokenType.php +++ b/bundles/EcommerceFrameworkBundle/Model/AbstractVoucherTokenType.php @@ -21,7 +21,7 @@ abstract class AbstractVoucherTokenType extends \Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData { /** - * @return bool + * @return bool|null */ public function getOnlyTokenPerCart() { diff --git a/bundles/EcommerceFrameworkBundle/OfferTool/AbstractOfferToolProduct.php b/bundles/EcommerceFrameworkBundle/OfferTool/AbstractOfferToolProduct.php index 5178ddfc4ad..4136e922d4a 100644 --- a/bundles/EcommerceFrameworkBundle/OfferTool/AbstractOfferToolProduct.php +++ b/bundles/EcommerceFrameworkBundle/OfferTool/AbstractOfferToolProduct.php @@ -143,8 +143,8 @@ public function getOSAvailabilityInfo($quantity = null): ?AvailabilityInterface /** * @static * - * @param int $id - * @param bool $force + * @param int|string $id + * @param array|bool $force * * @return AbstractOfferToolProduct|null */ diff --git a/bundles/EcommerceFrameworkBundle/PaymentManager/V7/Payment/PaymentInterface.php b/bundles/EcommerceFrameworkBundle/PaymentManager/V7/Payment/PaymentInterface.php index 7384910b249..bdfb06d9bfc 100644 --- a/bundles/EcommerceFrameworkBundle/PaymentManager/V7/Payment/PaymentInterface.php +++ b/bundles/EcommerceFrameworkBundle/PaymentManager/V7/Payment/PaymentInterface.php @@ -42,7 +42,7 @@ public function startPayment(OrderAgentInterface $orderAgent, PriceInterface $pr /** * Handles response of payment provider and creates payment status object * - * @param StatusInterface $response + * @param StatusInterface|array $response * * @return StatusInterface */ diff --git a/bundles/EcommerceFrameworkBundle/PricingManager/Rule.php b/bundles/EcommerceFrameworkBundle/PricingManager/Rule.php index a77df2d2613..5578f67d1b5 100644 --- a/bundles/EcommerceFrameworkBundle/PricingManager/Rule.php +++ b/bundles/EcommerceFrameworkBundle/PricingManager/Rule.php @@ -110,7 +110,7 @@ public static function getById($id) * @param string $key * @param mixed $value * - * @return AbstractModel + * @return $this * * @internal */ @@ -167,7 +167,7 @@ public function getId() /** * @param string $label - * @param string $locale + * @param string|null $locale * * @return $this */ diff --git a/bundles/EcommerceFrameworkBundle/Tracking/ProductAction.php b/bundles/EcommerceFrameworkBundle/Tracking/ProductAction.php index edd7bf971a3..09280c6dac9 100644 --- a/bundles/EcommerceFrameworkBundle/Tracking/ProductAction.php +++ b/bundles/EcommerceFrameworkBundle/Tracking/ProductAction.php @@ -18,7 +18,7 @@ class ProductAction extends AbstractProductData { /** - * @var int + * @var int|float */ protected $quantity = 1; diff --git a/bundles/EcommerceFrameworkBundle/Tracking/Transaction.php b/bundles/EcommerceFrameworkBundle/Tracking/Transaction.php index b8a7507a867..a745b52c145 100644 --- a/bundles/EcommerceFrameworkBundle/Tracking/Transaction.php +++ b/bundles/EcommerceFrameworkBundle/Tracking/Transaction.php @@ -18,57 +18,57 @@ class Transaction extends AbstractData { /** - * @var string + * @var string|null */ protected $type; /** - * @var string + * @var string|null */ protected $affiliation; /** - * @var float + * @var float|null */ protected $total; /** - * @var float + * @var float|null */ protected $subTotal; /** - * @var float + * @var float|null */ protected $tax; /** - * @var float + * @var float|null */ protected $shipping; /** - * @var string + * @var string|null */ protected $coupon; /** - * @var string + * @var string|null */ protected $list; /** - * @var string + * @var string|null */ protected $step; /** - * @var string + * @var string|null */ protected $option; /** - * @return string + * @return string|null */ public function getType() { @@ -88,7 +88,7 @@ public function setType($type) } /** - * @return string + * @return string|null */ public function getAffiliation() { @@ -108,7 +108,7 @@ public function setAffiliation($affiliation) } /** - * @return float + * @return float|null */ public function getTotal() { @@ -128,7 +128,7 @@ public function setTotal($total) } /** - * @return float + * @return float|null */ public function getSubTotal() { @@ -148,7 +148,7 @@ public function setSubTotal($subTotal) } /** - * @return float + * @return float|null */ public function getTax() { @@ -168,7 +168,7 @@ public function setTax($tax) } /** - * @return float + * @return float|null */ public function getShipping() { @@ -188,7 +188,7 @@ public function setShipping($shipping) } /** - * @return string + * @return string|null */ public function getCoupon() { @@ -208,7 +208,7 @@ public function setCoupon($coupon) } /** - * @return string + * @return string|null */ public function getList() { @@ -228,7 +228,7 @@ public function setList($list) } /** - * @return string + * @return string|null */ public function getStep() { @@ -248,7 +248,7 @@ public function setStep($step) } /** - * @return string + * @return string|null */ public function getOption() { diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/Reservation.php b/bundles/EcommerceFrameworkBundle/VoucherService/Reservation.php index f68c61a637c..517cfaade26 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/Reservation.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/Reservation.php @@ -25,16 +25,24 @@ */ class Reservation extends AbstractModel { - /** @var int|null */ + /** + * @var int|null + */ public $id; - /** @var string|null */ + /** + * @var string|null + */ public $token; - /** @var int|null */ + /** + * @var string|null + */ public $timestamp; - /** @var string|null */ + /** + * @var string|null + */ public $cart_id; /** @@ -259,7 +267,7 @@ public function setId($id) } /** - * @return int|null + * @return string|null */ public function getTimestamp() { @@ -267,7 +275,7 @@ public function getTimestamp() } /** - * @param int|null $timestamp + * @param string|null $timestamp */ public function setTimestamp($timestamp): void { diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/Token.php b/bundles/EcommerceFrameworkBundle/VoucherService/Token.php index 7ae6ac2df7f..eb690c9d1ac 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/Token.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/Token.php @@ -57,7 +57,7 @@ class Token extends AbstractModel public $usages; /** - * @var int + * @var string */ public $timestamp; @@ -171,7 +171,7 @@ public function unuse() } /** - * @return int + * @return string */ public function getTimestamp() { @@ -179,7 +179,7 @@ public function getTimestamp() } /** - * @param int $timestamp + * @param string $timestamp */ public function setTimestamp($timestamp) { diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/Token/Listing.php b/bundles/EcommerceFrameworkBundle/VoucherService/Token/Listing.php index 6aa099c35e3..0ee7b2f619c 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/Token/Listing.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/Token/Listing.php @@ -222,7 +222,7 @@ public static function getCountByReservation($seriesId = null) * @param int $length * @param string|int|null $seriesId * - * @return null|string + * @return null|int */ public static function getCountByLength($length, $seriesId = null) { @@ -361,8 +361,8 @@ public function setTokens($tokens) /** * Returns an collection of items for a page. * - * @param int $offset Page offset - * @param int $itemCountPerPage Number of items per page + * @param int $offset Page offset + * @param int $itemCountPerPage Number of items per page * * @return array */ diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php index 9da3d6cb3b4..198fb1bc1b2 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php @@ -32,7 +32,7 @@ use Pimcore\Model\DataObject\OnlineShopVoucherToken; /** - * @property \Pimcore\Model\DataObject\Fieldcollection\Data\VoucherTokenTypePattern $configuration + * @property VoucherTokenTypePattern $configuration */ class Pattern extends AbstractTokenManager implements ExportableTokenManagerInterface { @@ -227,7 +227,7 @@ public function getStatistics($usagePeriod = null) * may be reached several queries are generated. * returns the generated voucher codes if it was successfully - otherwise false * - * @return bool | array - bool failed - array if codes are generated + * @return bool | array | string - bool failed - array if codes are generated */ public function insertOrUpdateVoucherSeries() { @@ -638,7 +638,7 @@ public function getExampleToken() */ /** - * @return \Pimcore\Model\DataObject\Fieldcollection\Data\VoucherTokenTypePattern + * @return VoucherTokenTypePattern */ public function getConfiguration() { @@ -646,7 +646,7 @@ public function getConfiguration() } /** - * @param \Pimcore\Model\DataObject\Fieldcollection\Data\VoucherTokenTypePattern $configuration + * @param VoucherTokenTypePattern $configuration */ public function setConfiguration($configuration) { diff --git a/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md b/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md index 79f6370dd41..adf8f8abd20 100644 --- a/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md +++ b/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md @@ -8,9 +8,9 @@ This method will return the field/column name for the current version and provide a way to support both version for bundles. E.g. passing `o_id` in Pimcore 10 will return `o_id`, but `id` in Pimcore 11. - [Ecommerce] Elasticsearch 7 support has been deprecated, elasticsearch 8 supported was added. +- [CustomLayout] Passing `int` to `setDefault` is deprecated and will be removed in Pimcore 11. Use type `bool` instead. Same for `getDefault` method, it will return type `bool` only in Pimcore 11. - [ClassSavedInterface] Introduced additional interface implementing the `classSaved` method. The interface will be used by field definitions in `Pimcore\Model\DataObject\ClassDefinition\Data\*`. If your custom field definition implements the `classSaved` method, please use the `ClassSavedInterface` interface. Make sure that you either provide a default value (e.g. `$params = []`) for `$params` or don't use a second parameter in the method signature at all. Note that using the `classSaved` method without implementing the interface is deprecated and won't work in Pimcore 11. - ## 10.5.13 - [Web2Print] Print document twig expressions are now executed in a sandbox with restrictive security policies (just like Sending mails and Dataobject Text Layouts introduced in 10.5.9). diff --git a/lib/Event/Targeting/BuildConditionEvent.php b/lib/Event/Targeting/BuildConditionEvent.php index b205fd0cbfd..8d15bb6cfc6 100644 --- a/lib/Event/Targeting/BuildConditionEvent.php +++ b/lib/Event/Targeting/BuildConditionEvent.php @@ -38,7 +38,7 @@ class BuildConditionEvent extends Event private $config; /** - * @var ConditionInterface + * @var ConditionInterface|null */ private $condition; diff --git a/lib/Image/Adapter.php b/lib/Image/Adapter.php index 18586e048a6..13eae5d5394 100644 --- a/lib/Image/Adapter.php +++ b/lib/Image/Adapter.php @@ -65,7 +65,7 @@ abstract class Adapter protected $preserveMetaData = false; /** - * @var string + * @var string|null */ protected $sourceImageFormat; diff --git a/lib/Mail.php b/lib/Mail.php index 8fbadd480d3..8fdfb777bf3 100644 --- a/lib/Mail.php +++ b/lib/Mail.php @@ -649,6 +649,7 @@ private function getDebugMailRecipients(array $recipients): array /** * @param string $string + * @param string $context * * @return string */ @@ -994,7 +995,7 @@ public function setSubject($subject) /** * format Address from old params(string $address, string $name) * - * @param string|array $addresses + * @param string|array|Address $addresses * * @return array */ diff --git a/lib/Model/AbstractModel.php b/lib/Model/AbstractModel.php index 57274a6cc3f..8ed1f3e3dbb 100644 --- a/lib/Model/AbstractModel.php +++ b/lib/Model/AbstractModel.php @@ -16,6 +16,7 @@ namespace Pimcore\Model; use Pimcore\Logger; +use Pimcore\Model\Dao\DaoInterface; use Pimcore\Model\DataObject\Traits\ObjectVarTrait; /** @@ -46,7 +47,7 @@ abstract class AbstractModel implements ModelInterface private static $daoClassMap = null; /** - * @return \Pimcore\Model\Dao\AbstractDao + * @return DaoInterface */ public function getDao() { diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 085c13498c7..85824adbcfd 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -15,10 +15,12 @@ namespace Pimcore\Model; +use Pimcore\Model\Dao\DaoInterface; + interface ModelInterface { /** - * @return Dao\AbstractDao + * @return DaoInterface */ public function getDao(); diff --git a/lib/Tool/Text.php b/lib/Tool/Text.php index 1a06cb6fb30..6d141da9d6e 100644 --- a/lib/Tool/Text.php +++ b/lib/Tool/Text.php @@ -249,7 +249,7 @@ private static function getElementsInWysiwyg($text) /** * extracts all dependencies to other elements from wysiwyg text * - * @param string $text + * @param string|null $text * * @return array */ @@ -272,7 +272,7 @@ public static function getDependenciesOfWysiwygText($text) } /** - * @param string $text + * @param string|null $text * @param array $tags * * @return array diff --git a/lib/Translation/ExportService/Exporter/Xliff12Exporter.php b/lib/Translation/ExportService/Exporter/Xliff12Exporter.php index f1326557c11..3a9eed36bc4 100644 --- a/lib/Translation/ExportService/Exporter/Xliff12Exporter.php +++ b/lib/Translation/ExportService/Exporter/Xliff12Exporter.php @@ -122,7 +122,7 @@ public function getContentType(): string * @param string $name * @param string $sourceContent * @param string $sourceLang - * @param string $targetContent + * @param string|null $targetContent * @param string $targetLang */ protected function addTransUnitNode(\SimpleXMLElement $xml, $name, $sourceContent, $sourceLang, $targetContent, $targetLang) diff --git a/lib/Twig/Extension/Templating/Placeholder/Container.php b/lib/Twig/Extension/Templating/Placeholder/Container.php index ebbc758e39c..f93666ce394 100644 --- a/lib/Twig/Extension/Templating/Placeholder/Container.php +++ b/lib/Twig/Extension/Templating/Placeholder/Container.php @@ -209,7 +209,7 @@ public function getPostfix() * * Used to implode elements in container * - * @param string $separator + * @param string $separator * * @return Container */ @@ -234,7 +234,7 @@ public function getSeparator() * Set the indentation string for __toString() serialization, * optionally, if a number is passed, it will be the number of spaces * - * @param string|int $indent + * @param string|int $indent * * @return Container */ diff --git a/models/Asset.php b/models/Asset.php index c96196943fa..f4cea62be50 100644 --- a/models/Asset.php +++ b/models/Asset.php @@ -224,7 +224,7 @@ protected static function typeMatch(Asset $asset) } /** - * @param int $id + * @param int|string $id * @param array|bool $force * * @return static|null diff --git a/models/Asset/Image.php b/models/Asset/Image.php index 90d44322128..1f07875ca24 100644 --- a/models/Asset/Image.php +++ b/models/Asset/Image.php @@ -277,7 +277,7 @@ public function getLowQualityPreviewDataUri(): ?string * * @internal * - * @param string|array|Image\Thumbnail\Config $config + * @param string|array|Image\Thumbnail\Config|null $config * * @return Image\Thumbnail\Config|null */ diff --git a/models/Asset/Image/Thumbnail/Config.php b/models/Asset/Image/Thumbnail/Config.php index 803e1942d84..6d7508e8eb3 100644 --- a/models/Asset/Image/Thumbnail/Config.php +++ b/models/Asset/Image/Thumbnail/Config.php @@ -312,7 +312,7 @@ protected function createMediaIfNotExists($name) * * @param string $name * @param array $parameters - * @param string $media + * @param string|null $media * * @return bool */ @@ -340,7 +340,7 @@ public function addItem($name, $parameters, $media = null) * @param int $position * @param string $name * @param array $parameters - * @param string $media + * @param string|null $media * * @return bool */ @@ -499,7 +499,7 @@ public function getQuality() } /** - * @param float $highResolution + * @param float|null $highResolution */ public function setHighResolution($highResolution) { diff --git a/models/DataObject/AbstractObject.php b/models/DataObject/AbstractObject.php index 2d46269927f..a9ba4732403 100644 --- a/models/DataObject/AbstractObject.php +++ b/models/DataObject/AbstractObject.php @@ -359,7 +359,7 @@ public static function getTypes() /** * Static helper to get an object by the passed ID * - * @param int $id + * @param int|string $id * @param array|bool $force * * @return static|null diff --git a/models/DataObject/ClassDefinition/CustomLayout.php b/models/DataObject/ClassDefinition/CustomLayout.php index 5d98830e72f..fa6348391b1 100644 --- a/models/DataObject/ClassDefinition/CustomLayout.php +++ b/models/DataObject/ClassDefinition/CustomLayout.php @@ -23,6 +23,7 @@ use Pimcore\Logger; use Pimcore\Model; use Pimcore\Model\DataObject; +use Symfony\Component\Uid\UuidV4; /** * @method \Pimcore\Model\DataObject\ClassDefinition\CustomLayout\Dao getDao() @@ -78,7 +79,9 @@ class CustomLayout extends Model\AbstractModel protected $layoutDefinitions; /** - * @var int + * @var bool|int + * + * Note: type will change to bool in Pimcore 11 */ protected $default = 0; @@ -143,7 +146,7 @@ public static function getByNameAndClassId(string $name, $classId) /** * @param string $field * - * @return Data|null + * @return Data|Layout|null */ public function getFieldDefinition($field) { @@ -343,8 +346,9 @@ protected function getInfoDocBlock() * * @param string $classId * - * @return int|null + * @return int|null (will be changed to UuidV4|null) */ + #[\ReturnTypeWillChange] public static function getIdentifier($classId) { try { @@ -462,21 +466,29 @@ public function setName($name) } /** - * @return int + * @return bool|int (will be bool) */ + #[\ReturnTypeWillChange] public function getDefault() { return $this->default; } /** - * @param int $default + * @param bool|int $default * * @return $this */ public function setDefault($default) { - $this->default = (int)$default; + if (is_bool($default)) { + $this->default = $default; + } else { + trigger_deprecation('pimcore/pimcore', '10.6', + sprintf('Passing int to %s is deprecated and will be removed in Pimcore 11.' . + 'Use bool instead.', __FUNCTION__)); + $this->default = (int)$default; + } return $this; } diff --git a/models/DataObject/ClassDefinition/Data/Block.php b/models/DataObject/ClassDefinition/Data/Block.php index 7bae828f9c8..e05a2c00d27 100644 --- a/models/DataObject/ClassDefinition/Data/Block.php +++ b/models/DataObject/ClassDefinition/Data/Block.php @@ -22,6 +22,9 @@ use Pimcore\Model\DataObject; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\ClassDefinition\Layout; +use Pimcore\Model\DataObject\Concrete; +use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData; +use Pimcore\Model\DataObject\Localizedfield; use Pimcore\Model\Element; use Pimcore\Normalizer\NormalizerInterface; use Pimcore\Tool\Serialize; @@ -132,7 +135,7 @@ class Block extends Data implements CustomResourcePersistingInterface, ResourceP /** * @see ResourcePersistenceAwareInterface::getDataForResource * - * @param array $data + * @param mixed $data * @param null|DataObject\Concrete $object * @param array $params * @@ -196,9 +199,9 @@ public function getDataForResource($data, $object = null, $params = []) /** * @see ResourcePersistenceAwareInterface::getDataFromResource * - * @param string $data + * @param mixed $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return array|null */ @@ -289,9 +292,9 @@ public function getDataFromResource($data, $object = null, $params = []) /** * @see Data::getDataForEditmode * - * @param array|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -337,9 +340,9 @@ public function getDataForEditmode($data, $object = null, $params = []) /** * @see Data::getDataFromEditmode * - * @param array $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -473,9 +476,9 @@ protected function getBlockDataFromContainer($object, $params = []) /** * @see Data::getVersionPreview * - * @param array|null $data + * @param mixed $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return string */ @@ -505,7 +508,7 @@ public function isDiffChangeAllowed($object, $params = []) * * @param array|null $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return string */ @@ -530,7 +533,7 @@ public function synchronizeWithMasterDefinition(Model\DataObject\ClassDefinition } /** - * @param DataObject\Data\BlockElement[][]|null $data + * @param mixed $data * * @return bool */ @@ -768,7 +771,7 @@ public function __sleep() } /** - * @param array|null $data + * @param mixed $data * * @return array */ @@ -902,7 +905,7 @@ public function setLazyLoading($lazyLoading) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function preSetData(/** mixed */ $container, /** mixed */ $data, /** array */ $params = []) // : mixed { @@ -942,7 +945,7 @@ public function save($object, $params = []) /** * {@inheritdoc} - */ + **/ public function load($container, $params = []) { $field = $this->getName(); diff --git a/models/DataObject/ClassDefinition/Data/Classificationstore.php b/models/DataObject/ClassDefinition/Data/Classificationstore.php index 750d3e086a6..8273a974953 100644 --- a/models/DataObject/ClassDefinition/Data/Classificationstore.php +++ b/models/DataObject/ClassDefinition/Data/Classificationstore.php @@ -47,7 +47,7 @@ class Classificationstore extends Data implements CustomResourcePersistingInterf /** * @internal * - * @var string + * @var string|null */ public $name; @@ -68,7 +68,7 @@ class Classificationstore extends Data implements CustomResourcePersistingInterf /** * @internal * - * @var string + * @var string|null */ public $title; @@ -182,9 +182,9 @@ class Classificationstore extends Data implements CustomResourcePersistingInterf /** * @see Data::getDataForEditmode * - * @param DataObject\Classificationstore|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -342,9 +342,9 @@ private function doGetDataForEditMode($data, $object, &$fieldData, &$metaData, $ /** * @see Data::getDataFromEditmode * - * @param array $containerData + * @param mixed $containerData * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return DataObject\Classificationstore */ @@ -406,7 +406,7 @@ public function getDataFromEditmode($containerData, $object = null, $params = [] /** * @param mixed $data - * @param DataObject\Concrete $object + * @param DataObject\Concrete|null $object * @param mixed $params * * @return string @@ -419,9 +419,9 @@ public function getDataForGrid($data, $object = null, $params = []) /** * @see Data::getVersionPreview * - * @param DataObject\Classificationstore|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return string */ @@ -477,7 +477,7 @@ public function getDataForSearchIndex($object, $params = []) } /** - * @param DataObject\Classificationstore|null $data + * @param mixed $data * * @return bool */ @@ -524,7 +524,7 @@ public function hasChildren() } /** - * @param Data|Layout $child + * @param mixed $child */ public function addChild($child) { @@ -611,7 +611,7 @@ public function classSaved($class/**, $params = []**/) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function preGetData(/** mixed */ $container, /** array */ $params = []) // : mixed { @@ -850,7 +850,7 @@ public function checkValidity($data, $omitMandatoryCheck = false, $params = []) /** * @param mixed $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @throws \Exception */ @@ -862,7 +862,7 @@ public function getDiffDataForEditmode($data, $object = null, $params = []) /** * @param array $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @throws \Exception */ diff --git a/models/DataObject/ClassDefinition/Data/Multiselect.php b/models/DataObject/ClassDefinition/Data/Multiselect.php index 5ca37906579..9fcacfc52a9 100644 --- a/models/DataObject/ClassDefinition/Data/Multiselect.php +++ b/models/DataObject/ClassDefinition/Data/Multiselect.php @@ -131,7 +131,7 @@ class Multiselect extends Data implements public $dynamicOptions = false; /** - * @return array + * @return array|null */ public function getOptions() { @@ -239,7 +239,7 @@ public function getRenderType() /** * @see ResourcePersistenceAwareInterface::getDataForResource * - * @param array|null $data + * @param mixed $data * @param null|DataObject\Concrete $object * @param mixed $params * @@ -257,9 +257,9 @@ public function getDataForResource($data, $object = null, $params = []) /** * @see ResourcePersistenceAwareInterface::getDataFromResource * - * @param string|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array|null */ @@ -275,9 +275,9 @@ public function getDataFromResource($data, $object = null, $params = []) /** * @see QueryResourcePersistenceAwareInterface::getDataForQueryResource * - * @param array $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return string|null */ @@ -293,9 +293,9 @@ public function getDataForQueryResource($data, $object = null, $params = []) /** * @see Data::getDataForEditmode * - * @param array|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return string|null */ @@ -311,9 +311,9 @@ public function getDataForEditmode($data, $object = null, $params = []) /** * @param array $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * - * @return array|string + * @return array|string|null */ public function getDataForGrid($data, $object = null, $params = []) { @@ -348,11 +348,11 @@ public function getDataForGrid($data, $object = null, $params = []) /** * @see Data::getDataFromEditmode * - * @param string $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * - * @return string + * @return mixed */ public function getDataFromEditmode($data, $object = null, $params = []) { @@ -362,12 +362,13 @@ public function getDataFromEditmode($data, $object = null, $params = []) /** * @see Data::getVersionPreview * - * @param array|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * - * @return string|null + * @return string|null (will be string) */ + #[\ReturnTypeWillChange] public function getVersionPreview($data, $object = null, $params = []) { if (is_array($data)) { @@ -422,9 +423,9 @@ public function getDataForSearchIndex($object, $params = []) /** * returns sql query statement to filter according to this data types value(s) * - * @param string $value - * @param string $operator - * @param array $params + * @param mixed $value + * @param string $operator + * @param array $params * * @return string */ @@ -446,8 +447,9 @@ public function getFilterCondition($value, $operator, $params = []) * @param string $operator * @param array $params optional params used to change the behavior * - * @return string|null + * @return string|null (will be string) */ + #[\ReturnTypeWillChange] public function getFilterConditionExt($value, $operator, $params = []) { if ($operator === '=' || $operator === 'LIKE') { @@ -490,7 +492,7 @@ public function isDiffChangeAllowed($object, $params = []) * * @param array|null $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return array|string */ @@ -524,8 +526,9 @@ public function getDiffVersionPreview($data, $object = null, $params = []) } /** - * @param DataObject\ClassDefinition\Data\Multiselect $masterDefinition + * @param DataObject\ClassDefinition\Data\Multiselect $masterDefinition (will be DataObject\ClassDefinition\Data) */ + #[\ReturnTypeWillChange] public function synchronizeWithMasterDefinition(DataObject\ClassDefinition\Data $masterDefinition) { $this->maxItems = $masterDefinition->maxItems; @@ -582,8 +585,8 @@ public function appendData($existingData, $additionalData) } /** - * @param array|null $existingData - * @param array $removeData + * @param mixed $existingData + * @param mixed $removeData * * @return array */ @@ -607,8 +610,8 @@ public function isFilterable(): bool } /** - * @param array|null $value1 - * @param array|null $value2 + * @param mixed $value1 + * @param mixed $value2 * * @return bool */ @@ -719,7 +722,7 @@ public function postSave($containerDefinition, $params = []) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function enrichFieldDefinition(/** array */ $context = []) /** : static */ { diff --git a/models/DataObject/ClassDefinition/Data/Objectbricks.php b/models/DataObject/ClassDefinition/Data/Objectbricks.php index 3096125f292..931e0fbb2fc 100644 --- a/models/DataObject/ClassDefinition/Data/Objectbricks.php +++ b/models/DataObject/ClassDefinition/Data/Objectbricks.php @@ -96,7 +96,7 @@ public function setBorder(bool $border): void /** * @see Data::getDataForEditmode * - * @param DataObject\Objectbrick|null $data + * @param mixed $data * @param null|DataObject\Concrete $object * @param array $params * @@ -285,9 +285,9 @@ private function getDataForField($item, $key, $fielddefinition, $level, $baseObj /** * @see Data::getDataFromEditmode * - * @param string|array $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return Objectbrick\Data\AbstractData */ @@ -346,9 +346,9 @@ public function getDataFromEditmode($data, $object = null, $params = []) /** * @see Data::getVersionPreview * - * @param Objectbrick\Data\AbstractData|null $data + * @param mixed $data * @param null|DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return string */ @@ -467,7 +467,7 @@ public function setAllowedTypes($allowedTypes) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function preSetData(/** mixed */ $container, /** mixed */ $data, /** array */ $params = []) // : mixed { @@ -479,7 +479,7 @@ public function preSetData(/** mixed */ $container, /** mixed */ $data, /** arr } /** - * @param Objectbrick|null $data + * @param mixed $data * * @return array */ @@ -664,8 +664,8 @@ public function checkValidity($data, $omitMandatoryCheck = false, $params = []) /** * @param Objectbrick|null $data - * @param DataObject\Concrete $object - * @param mixed $params + * @param DataObject\Concrete|null $object + * @param array $params * * @return string */ @@ -757,7 +757,7 @@ private function doGetDiffDataForEditmode($data, $getter, $params = [], $level = /** See parent class. * @param mixed $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return array|null */ @@ -786,7 +786,7 @@ public function getDiffDataForEditMode($data, $object = null, $params = []) * * @param array $data * @param DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return mixed */ diff --git a/models/DataObject/ClassDefinition/Data/QuantityValue.php b/models/DataObject/ClassDefinition/Data/QuantityValue.php index 5d5dd29f7e3..bdf5049677b 100644 --- a/models/DataObject/ClassDefinition/Data/QuantityValue.php +++ b/models/DataObject/ClassDefinition/Data/QuantityValue.php @@ -78,7 +78,7 @@ class QuantityValue extends Data implements ResourcePersistenceAwareInterface, Q /** * @internal * - * @var array + * @var array|null */ public $validUnits; @@ -497,9 +497,9 @@ private function buildDecimalColumnType(): string /** * @see ResourcePersistenceAwareInterface::getDataForResource * - * @param Model\DataObject\Data\QuantityValue $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -523,9 +523,9 @@ public function getDataForResource($data, $object = null, $params = []) /** * @see ResourcePersistenceAwareInterface::getDataFromResource * - * @param array $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return Model\DataObject\Data\QuantityValue|null */ @@ -554,9 +554,9 @@ public function getDataFromResource($data, $object = null, $params = []) /** * @see QueryResourcePersistenceAwareInterface::getDataForQueryResource * - * @param Model\DataObject\Data\QuantityValue $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -568,9 +568,9 @@ public function getDataForQueryResource($data, $object = null, $params = []) /** * @see Data::getDataForEditmode * - * @param Model\DataObject\Data\AbstractQuantityValue|null $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array|null */ @@ -589,7 +589,7 @@ public function getDataForEditmode($data, $object = null, $params = []) /** * @param array $data * @param Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return Model\DataObject\Data\QuantityValue|null */ @@ -601,9 +601,9 @@ public function getDataFromGridEditor($data, $object = null, $params = []) /** * @see Data::getDataFromEditmode * - * @param array $data + * @param mixed $data * @param Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return Model\DataObject\Data\QuantityValue|null */ @@ -623,9 +623,9 @@ public function getDataFromEditmode($data, $object = null, $params = []) /** * @see Data::getVersionPreview * - * @param Model\DataObject\Data\QuantityValue|null $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return string */ diff --git a/models/DataObject/ClassDefinition/Data/UrlSlug.php b/models/DataObject/ClassDefinition/Data/UrlSlug.php index 87fabdddb9b..770bdd9b7a3 100644 --- a/models/DataObject/ClassDefinition/Data/UrlSlug.php +++ b/models/DataObject/ClassDefinition/Data/UrlSlug.php @@ -93,7 +93,7 @@ public function setWidth($width) * * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return array */ @@ -129,7 +129,7 @@ public function getDataForEditmode($data, $object = null, $params = []) * * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * * @return Model\DataObject\Data\UrlSlug[] */ @@ -155,8 +155,8 @@ public function getDataFromEditmode($data, $object = null, $params = []) /** * @param float $data - * @param Model\DataObject\Concrete $object - * @param mixed $params + * @param Model\DataObject\Concrete|null $object + * @param array $params * * @return Model\DataObject\Data\UrlSlug[] */ @@ -487,7 +487,7 @@ public function supportsDirtyDetection() } /** - * @param Model\DataObject\Data\UrlSlug[]|null $data + * @param mixed $data * * @return bool */ @@ -507,7 +507,7 @@ public function isEmpty($data) } /** - * @param array $data + * @param array|null $data * @param Model\DataObject\Concrete $object * @param array $params * @param string $lineBreak @@ -536,9 +536,9 @@ protected function getPreviewData($data, $object = null, $params = [], $lineBrea } /** - * @param Model\DataObject\Data\UrlSlug[]|null $data - * @param Model\DataObject\Concrete $object - * @param mixed $params + * @param mixed $data + * @param Model\DataObject\Concrete|null $object + * @param array $params * * @return string */ @@ -549,8 +549,8 @@ public function getVersionPreview($data, $object = null, $params = []) /** * @param null|Model\DataObject\Data\UrlSlug[] $data - * @param Model\DataObject\Concrete $object - * @param mixed $params + * @param Model\DataObject\Concrete|null $object + * @param array $params * * @return array */ @@ -570,9 +570,9 @@ public function isFilterable(): bool /** * returns sql query statement to filter according to this data types value(s) * - * @param string $value - * @param string $operator - * @param array $params + * @param mixed $value + * @param string $operator + * @param array $params * * @return string * @@ -629,7 +629,7 @@ public function setDomainLabelWidth(?int $domainLabelWidth) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function preGetData(/** mixed */ $container, /** array */ $params = []) // : mixed { @@ -678,7 +678,7 @@ public function preGetData(/** mixed */ $container, /** array */ $params = []) / } /** - * { @inheritdoc } + * {@inheritdoc} */ public function preSetData(/** mixed */ $container, /** mixed */ $data, /** array */ $params = []) // : mixed { diff --git a/models/DataObject/ClassDefinition/Data/User.php b/models/DataObject/ClassDefinition/Data/User.php index fcc6ab01148..95b41ede51b 100644 --- a/models/DataObject/ClassDefinition/Data/User.php +++ b/models/DataObject/ClassDefinition/Data/User.php @@ -55,11 +55,11 @@ protected function init() /** * @see ResourcePersistenceAwareInterface::getDataFromResource * - * @param string $data + * @param mixed $data * @param null|Model\DataObject\Concrete $object - * @param mixed $params + * @param array $params * - * @return string + * @return string|null */ public function getDataFromResource($data, $object = null, $params = []) { @@ -77,9 +77,9 @@ public function getDataFromResource($data, $object = null, $params = []) /** * @see ResourcePersistenceAwareInterface::getDataForResource * - * @param string|null $data + * @param mixed $data * @param Model\DataObject\Concrete|null $object - * @param mixed $params + * @param array $params * * @return null|string */ diff --git a/models/DataObject/ClassDefinition/Layout.php b/models/DataObject/ClassDefinition/Layout.php index 9d44c2062cc..ddea90891ef 100644 --- a/models/DataObject/ClassDefinition/Layout.php +++ b/models/DataObject/ClassDefinition/Layout.php @@ -28,42 +28,42 @@ class Layout implements Model\DataObject\ClassDefinition\Data\VarExporterInterfa /** * @internal * - * @var string + * @var string|null */ public $name; /** * @internal * - * @var string + * @var string|null */ public $type; /** * @internal * - * @var string + * @var string|null */ public $region; /** * @internal * - * @var string + * @var string|null */ public $title; /** * @internal * - * @var string|int + * @var string|int|null */ public $width = 0; /** * @internal * - * @var string|int + * @var string|int|null */ public $height = 0; @@ -84,7 +84,7 @@ class Layout implements Model\DataObject\ClassDefinition\Data\VarExporterInterfa /** * @internal * - * @var string + * @var string|null */ public $bodyStyle; @@ -98,7 +98,7 @@ class Layout implements Model\DataObject\ClassDefinition\Data\VarExporterInterfa /** * @internal * - * @var array + * @var array|string|null */ public $permissions; @@ -149,7 +149,7 @@ public function getTitle() } /** - * @return int + * @return int|string|null */ public function getWidth() { @@ -157,7 +157,7 @@ public function getWidth() } /** - * @return int + * @return int|string|null */ public function getHeight() { @@ -173,7 +173,7 @@ public function getCollapsible() } /** - * @return array + * @return array|string */ public function getPermissions() { @@ -229,7 +229,7 @@ public function setTitle($title) } /** - * @param string|int $width + * @param string|int|null $width * * @return $this */ @@ -244,7 +244,7 @@ public function setWidth($width) } /** - * @param string|int $height + * @param string|int|null $height * * @return $this */ @@ -273,7 +273,7 @@ public function setCollapsible($collapsible) } /** - * @param array $permissions + * @param array|string $permissions * * @return $this */ diff --git a/models/DataObject/Data/ElementMetadata.php b/models/DataObject/Data/ElementMetadata.php index 551d0699035..480a98e60e2 100644 --- a/models/DataObject/Data/ElementMetadata.php +++ b/models/DataObject/Data/ElementMetadata.php @@ -17,6 +17,7 @@ use Pimcore\Logger; use Pimcore\Model; +use Pimcore\Model\Element\ElementInterface; use Pimcore\Model\DataObject; /** @@ -37,7 +38,7 @@ class ElementMetadata extends Model\AbstractModel implements DataObject\OwnerAwa protected $elementId; /** - * @var string + * @var string|null */ protected $fieldname; @@ -52,9 +53,9 @@ class ElementMetadata extends Model\AbstractModel implements DataObject\OwnerAwa protected $data = []; /** - * @param string $fieldname + * @param string|null $fieldname * @param array $columns - * @param Model\Element\ElementInterface|null $element + * @param ElementInterface|null $element * * @throws \Exception */ @@ -207,7 +208,7 @@ public function getElement() } /** - * @return string + * @return string|null */ public function getElementType() { @@ -215,7 +216,7 @@ public function getElementType() } /** - * @return int + * @return int|null */ public function getElementId() { diff --git a/models/DataObject/Data/EncryptedField.php b/models/DataObject/Data/EncryptedField.php index d66f95bafa1..5ddd8b0976b 100644 --- a/models/DataObject/Data/EncryptedField.php +++ b/models/DataObject/Data/EncryptedField.php @@ -43,8 +43,8 @@ class EncryptedField implements OwnerAwareFieldInterface protected $encrypted; /** - * @param mixed $plain * @param Data $delegate + * @param mixed $plain */ public function __construct(Data $delegate, $plain) { diff --git a/models/DataObject/Data/ExternalImage.php b/models/DataObject/Data/ExternalImage.php index 3099badb0c8..58f82d70971 100644 --- a/models/DataObject/Data/ExternalImage.php +++ b/models/DataObject/Data/ExternalImage.php @@ -22,7 +22,9 @@ class ExternalImage implements OwnerAwareFieldInterface { use OwnerAwareFieldTrait; - /** @var string|null */ + /** + * @var string|null + */ protected $url; /** diff --git a/models/DataObject/Data/GeoCoordinates.php b/models/DataObject/Data/GeoCoordinates.php index c4c4f7dd179..928e8c26acf 100644 --- a/models/DataObject/Data/GeoCoordinates.php +++ b/models/DataObject/Data/GeoCoordinates.php @@ -23,12 +23,12 @@ class GeoCoordinates implements OwnerAwareFieldInterface use OwnerAwareFieldTrait; /** - * @var float + * @var float|null */ protected $longitude; /** - * @var float + * @var float|null */ protected $latitude; diff --git a/models/DataObject/Data/ImageGallery.php b/models/DataObject/Data/ImageGallery.php index 54e36ca50b1..36085dfcb58 100644 --- a/models/DataObject/Data/ImageGallery.php +++ b/models/DataObject/Data/ImageGallery.php @@ -37,7 +37,7 @@ public function __construct($items = []) } /** - * @return Hotspotimage|false + * @return Hotspotimage|bool|null */ #[\ReturnTypeWillChange] public function current()// : Hotspotimage|false diff --git a/models/DataObject/Data/InputQuantityValue.php b/models/DataObject/Data/InputQuantityValue.php index 33cc6fbcc27..a2cbe993bda 100644 --- a/models/DataObject/Data/InputQuantityValue.php +++ b/models/DataObject/Data/InputQuantityValue.php @@ -20,13 +20,13 @@ class InputQuantityValue extends AbstractQuantityValue { /** - * @var string|null + * @var float|int|string|null */ protected $value; /** * @param string|null $value - * @param Unit|string|null $unit + * @param string|Unit|null $unit */ public function __construct($value = null, $unit = null) { @@ -35,7 +35,7 @@ public function __construct($value = null, $unit = null) } /** - * @param string $value + * @param float|int|string|null $value */ public function setValue($value) { diff --git a/models/DataObject/Data/Link.php b/models/DataObject/Data/Link.php index 028b0db83ab..9a587e2d8f3 100644 --- a/models/DataObject/Data/Link.php +++ b/models/DataObject/Data/Link.php @@ -46,7 +46,7 @@ class Link implements OwnerAwareFieldInterface protected $internal; /** - * @var string + * @var string|null */ protected $direct; @@ -164,7 +164,7 @@ public function setInternal($internal) } /** - * @return string + * @return string|null */ public function getDirect() { @@ -172,11 +172,11 @@ public function getDirect() } /** - * @param string $direct + * @param string|null $direct * * @return $this */ - public function setDirect($direct) + public function setDirect($direct = null) { $this->direct = $direct; $this->markMeDirty(); @@ -479,7 +479,7 @@ public function getHref() } /** - * @return Document|Asset|DataObject|null + * @return DataObject|Asset|Document|null */ public function getElement() { @@ -516,7 +516,7 @@ public function setElement($object) /** * @deprecated use getElement() instead - will be removed in Pimcore 11 * - * @return Asset|DataObject|Document|null + * @return DataObject|Asset|Document|null */ public function getObject() { diff --git a/models/DataObject/Data/ObjectMetadata.php b/models/DataObject/Data/ObjectMetadata.php index c9a6d89f7aa..aa99ddcb301 100644 --- a/models/DataObject/Data/ObjectMetadata.php +++ b/models/DataObject/Data/ObjectMetadata.php @@ -18,6 +18,7 @@ use Pimcore\Logger; use Pimcore\Model; use Pimcore\Model\DataObject; +use Pimcore\Model\DataObject\Concrete; /** * @method \Pimcore\Model\DataObject\Data\ObjectMetadata\Dao getDao() @@ -26,16 +27,18 @@ class ObjectMetadata extends Model\AbstractModel implements DataObject\OwnerAwar { use DataObject\Traits\OwnerAwareFieldTrait; - /** @var DataObject\AbstractObject|null */ + /** + * @var DataObject\AbstractObject|null + */ protected $object; /** - * @var int + * @var int|null */ protected $objectId; /** - * @var string + * @var string|null */ protected $fieldname; @@ -50,9 +53,9 @@ class ObjectMetadata extends Model\AbstractModel implements DataObject\OwnerAwar protected $data = []; /** - * @param string $fieldname + * @param string|null $fieldname * @param array $columns - * @param DataObject\Concrete|null $object + * @param Concrete|null $object */ public function __construct($fieldname, $columns = [], $object = null) { @@ -62,11 +65,11 @@ public function __construct($fieldname, $columns = [], $object = null) } /** - * @param DataObject\Concrete|null $object + * @param Concrete|null $object * * @return $this */ - public function setObject(?DataObject\Concrete $object) + public function setObject(?Concrete $object) { $this->markMeDirty(); @@ -119,7 +122,7 @@ public function __call($name, $arguments) } /** - * @param DataObject\Concrete $object + * @param Concrete $object * @param string $ownertype * @param string $ownername * @param string $position @@ -131,7 +134,7 @@ public function save($object, $ownertype, $ownername, $position, $index) } /** - * @param DataObject\Concrete $source + * @param Concrete $source * @param int $destinationId * @param string $fieldname * @param string $ownertype @@ -141,7 +144,7 @@ public function save($object, $ownertype, $ownername, $position, $index) * * @return ObjectMetadata|null */ - public function load(DataObject\Concrete $source, $destinationId, $fieldname, $ownertype, $ownername, $position, $index) + public function load(Concrete $source, $destinationId, $fieldname, $ownertype, $ownername, $position, $index) { $return = $this->getDao()->load($source, $destinationId, $fieldname, $ownertype, $ownername, $position, $index); $this->markMeDirty(false); @@ -163,7 +166,7 @@ public function setFieldname($fieldname) } /** - * @return string + * @return string|null */ public function getFieldname() { @@ -171,12 +174,12 @@ public function getFieldname() } /** - * @return DataObject\Concrete|null + * @return Concrete|null */ public function getObject() { if ($this->getObjectId()) { - $object = DataObject\Concrete::getById($this->getObjectId()); + $object = Concrete::getById($this->getObjectId()); if (!$object) { Logger::info('object ' . $this->getObjectId() . ' does not exist anymore'); } @@ -188,7 +191,7 @@ public function getObject() } /** - * @param DataObject\Concrete $element + * @param Concrete $element * * @return $this */ @@ -200,7 +203,7 @@ public function setElement($element) } /** - * @return DataObject\Concrete|null + * @return Concrete|null */ public function getElement() { diff --git a/models/DataObject/Data/QuantityValue.php b/models/DataObject/Data/QuantityValue.php index d05ee9ead9e..15a19ce44e7 100644 --- a/models/DataObject/Data/QuantityValue.php +++ b/models/DataObject/Data/QuantityValue.php @@ -24,13 +24,13 @@ class QuantityValue extends AbstractQuantityValue use ObjectVarTrait; /** - * @var float|int|null + * @var float|int|null|string */ protected $value; /** - * @param float|int|null $value - * @param Unit|string|null $unit + * @param float|int|string|null $value + * @param string|Unit|null $unit */ public function __construct($value = null, $unit = null) { @@ -39,7 +39,7 @@ public function __construct($value = null, $unit = null) } /** - * @param float|int|null $value + * @param float|int|string|null $value */ public function setValue($value) { @@ -48,7 +48,7 @@ public function setValue($value) } /** - * @return float|int|null + * @return float|int|string|null */ public function getValue() { diff --git a/models/DataObject/Data/Video.php b/models/DataObject/Data/Video.php index 0284a1c3e6e..61e88083fed 100644 --- a/models/DataObject/Data/Video.php +++ b/models/DataObject/Data/Video.php @@ -19,6 +19,8 @@ use Pimcore\Model\DataObject\OwnerAwareFieldInterface; use Pimcore\Model\DataObject\Traits\ObjectVarTrait; use Pimcore\Model\DataObject\Traits\OwnerAwareFieldTrait; +use Pimcore\Model\Element\ElementDescriptor; +use Pimcore\Model\Element\ElementInterface; class Video implements OwnerAwareFieldInterface { @@ -31,12 +33,12 @@ class Video implements OwnerAwareFieldInterface protected $type; /** - * @var Asset|string|int + * @var string|int|ElementInterface|Asset|ElementDescriptor */ protected $data; /** - * @var Asset|string|int + * @var string|int|Asset|ElementDescriptor|null */ protected $poster; @@ -102,7 +104,7 @@ public function getDescription() } /** - * @param Asset|string|int $poster + * @param Asset|int|string|null $poster */ public function setPoster($poster) { @@ -111,7 +113,7 @@ public function setPoster($poster) } /** - * @return Asset|string|int + * @return Asset|int|string|null */ public function getPoster() { diff --git a/models/DataObject/QuantityValue/Unit.php b/models/DataObject/QuantityValue/Unit.php index 227742018fb..3a29857b085 100644 --- a/models/DataObject/QuantityValue/Unit.php +++ b/models/DataObject/QuantityValue/Unit.php @@ -31,7 +31,7 @@ class Unit extends Model\AbstractModel const CACHE_KEY = 'quantityvalue_units_table'; /** - * @var string + * @var string|null */ protected $id; @@ -51,7 +51,7 @@ class Unit extends Model\AbstractModel protected $longname; /** - * @var string + * @var string|null */ protected $baseunit; diff --git a/models/DataObject/Traits/FieldcollectionObjectbrickDefinitionTrait.php b/models/DataObject/Traits/FieldcollectionObjectbrickDefinitionTrait.php index 0462e8813a5..a61cf5fba2a 100644 --- a/models/DataObject/Traits/FieldcollectionObjectbrickDefinitionTrait.php +++ b/models/DataObject/Traits/FieldcollectionObjectbrickDefinitionTrait.php @@ -41,12 +41,12 @@ trait FieldcollectionObjectbrickDefinitionTrait public $implementsInterfaces; /** - * @var string + * @var string|null */ public $title; /** - * @var string + * @var string|null */ public $group; @@ -106,7 +106,7 @@ public function setParentClass($parentClass) } /** - * @return string + * @return string|null */ public function getTitle() { @@ -114,7 +114,7 @@ public function getTitle() } /** - * @param string $title + * @param string|null $title * * @return $this */ @@ -226,7 +226,7 @@ public function getFieldDefinition($key, $context = []) } /** - * @return string + * @return string|null */ public function getGroup() { @@ -234,7 +234,7 @@ public function getGroup() } /** - * @param string $group + * @param string|null $group * * @return $this */ @@ -291,7 +291,7 @@ public function setGenerateTypeDeclarations($generateTypeDeclarations) * @param Data $fieldDefinition * @param array $context * - * @return mixed + * @return Data */ abstract protected function doEnrichFieldDefinition($fieldDefinition, $context = []); } diff --git a/models/DataObject/Traits/OwnerAwareFieldTrait.php b/models/DataObject/Traits/OwnerAwareFieldTrait.php index ddce6897328..744fdee873c 100644 --- a/models/DataObject/Traits/OwnerAwareFieldTrait.php +++ b/models/DataObject/Traits/OwnerAwareFieldTrait.php @@ -29,7 +29,7 @@ trait OwnerAwareFieldTrait protected $_owner; /** - * @var string + * @var string|null */ protected $_fieldname; diff --git a/models/Document.php b/models/Document.php index 1e23c7c9705..a881fb3c06e 100644 --- a/models/Document.php +++ b/models/Document.php @@ -226,7 +226,7 @@ protected static function typeMatch(Document $document) } /** - * @param int $id + * @param int|string $id * @param array|bool $force * * @return static|null diff --git a/models/Document/Editable/Embed.php b/models/Document/Editable/Embed.php index 864cca72208..0946a26f697 100644 --- a/models/Document/Editable/Embed.php +++ b/models/Document/Editable/Embed.php @@ -25,7 +25,7 @@ class Embed extends Model\Document\Editable /** * @internal * - * @var string + * @var string|null */ protected $url; @@ -39,6 +39,8 @@ public function getType() /** * {@inheritdoc} + * + * @return mixed */ public function getData() { @@ -48,7 +50,7 @@ public function getData() } /** - * @return string + * @return string|null */ public function getUrl() { @@ -57,6 +59,8 @@ public function getUrl() /** * {@inheritdoc} + * + * @return array */ public function getDataForResource() { diff --git a/models/Document/Editable/Image.php b/models/Document/Editable/Image.php index 370cbf8b000..fc9b9e1a7ff 100644 --- a/models/Document/Editable/Image.php +++ b/models/Document/Editable/Image.php @@ -18,6 +18,8 @@ use Pimcore\Model; use Pimcore\Model\Asset; use Pimcore\Model\Element; +use Pimcore\Model\Element\ElementDescriptor; +use Pimcore\Model\Element\ElementInterface; use Pimcore\Tool\Serialize; /** @@ -30,7 +32,7 @@ class Image extends Model\Document\Editable implements IdRewriterInterface, Edit * * @internal * - * @var int + * @var int|null */ protected $id; @@ -39,7 +41,7 @@ class Image extends Model\Document\Editable implements IdRewriterInterface, Edit * * @internal * - * @var string + * @var string|null */ protected $alt; @@ -48,7 +50,7 @@ class Image extends Model\Document\Editable implements IdRewriterInterface, Edit * * @internal * - * @var Asset\Image|null + * @var Asset\Image|ElementDescriptor|ElementInterface|null */ protected $image; @@ -106,7 +108,7 @@ class Image extends Model\Document\Editable implements IdRewriterInterface, Edit * * @internal * - * @var string + * @var string|null */ protected $thumbnail; @@ -120,6 +122,8 @@ public function getType() /** * {@inheritdoc} + * + * @return mixed */ public function getData() { @@ -139,6 +143,8 @@ public function getData() /** * {@inheritdoc} + * + * @return array */ public function getDataForResource() { @@ -214,7 +220,7 @@ public function getDataEditmode() /** : mixed */ } /** - * {@inheritdoc} + * @return array */ public function getConfig() { @@ -247,7 +253,7 @@ public function frontend() $image = $this->getImage(); - if ($image instanceof Asset) { + if ($image instanceof Asset\Image) { $thumbnailName = $this->config['thumbnail'] ?? null; if ($thumbnailName || $this->cropPercent) { // create a thumbnail first @@ -446,7 +452,7 @@ public function getSrc() } /** - * @return Asset\Image|null + * @return Asset\Image|ElementDescriptor|ElementInterface|null */ public function getImage() { @@ -458,9 +464,9 @@ public function getImage() } /** - * @param Asset\Image|null $image + * @param Asset\Image|ElementDescriptor|ElementInterface|null $image * - * @return Model\Document\Editable\Image + * @return $this */ public function setImage($image) { @@ -476,7 +482,7 @@ public function setImage($image) /** * @param int $id * - * @return Model\Document\Editable\Image + * @return $this */ public function setId($id) { @@ -494,7 +500,7 @@ public function getId() } /** - * @param string|array|Asset\Image\Thumbnail\Config $conf + * @param array|string|Asset\Image\Thumbnail\Config $conf * @param bool $deferred * * @return Asset\Image\Thumbnail|string @@ -502,7 +508,7 @@ public function getId() public function getThumbnail($conf, $deferred = true) { $image = $this->getImage(); - if ($image instanceof Asset) { + if ($image instanceof Asset\Image) { $thumbConfig = $image->getThumbnailConfig($conf); if ($thumbConfig && $this->cropPercent) { $this->applyCustomCropping($thumbConfig); @@ -518,6 +524,8 @@ public function getThumbnail($conf, $deferred = true) /** * @param Asset\Image\Thumbnail\Config $thumbConfig + * + * @return void */ private function applyCustomCropping($thumbConfig) { @@ -595,7 +603,7 @@ public function getCacheTags(Model\Document\PageSnippet $ownerDocument, array $t } /** - * {@inheritdoc} + * @return array */ public function resolveDependencies() { @@ -775,7 +783,7 @@ public function getMarker() } /** - * { @inheritdoc } + * {@inheritdoc} */ public function rewriteIds($idMapping) /** : void */ { diff --git a/models/Document/Editable/Numeric.php b/models/Document/Editable/Numeric.php index 5637204e598..be004e9b445 100644 --- a/models/Document/Editable/Numeric.php +++ b/models/Document/Editable/Numeric.php @@ -27,7 +27,7 @@ class Numeric extends Model\Document\Editable * * @internal * - * @var string + * @var string|null */ protected $number = ''; @@ -40,7 +40,7 @@ public function getType() } /** - * {@inheritdoc} + * @return mixed */ public function getData() { diff --git a/models/Document/Editable/Renderlet.php b/models/Document/Editable/Renderlet.php index 440dd8e5ae3..a477be49ecc 100644 --- a/models/Document/Editable/Renderlet.php +++ b/models/Document/Editable/Renderlet.php @@ -43,7 +43,7 @@ class Renderlet extends Model\Document\Editable implements IdRewriterInterface, * * @internal * - * @var Document|Asset|DataObject|null + * @var Document|Asset|null|DataObject|Element\ElementDescriptor */ protected $o; @@ -86,7 +86,7 @@ public function getData() } /** - * {@inheritdoc} + * @return array|null */ public function getDataEditmode() /** : mixed */ { @@ -166,6 +166,8 @@ public function frontend() /** * {@inheritdoc} + * + * @return $this */ public function setDataFromResource($data) { @@ -182,6 +184,8 @@ public function setDataFromResource($data) /** * {@inheritdoc} + * + * @return $this */ public function setDataFromEditmode($data) { @@ -237,7 +241,7 @@ public function resolveDependencies() * * @return string|null * - * @internal param mixed $data + * @internal */ private function getObjectType($object = null) { @@ -338,7 +342,7 @@ public function getId() /** * @param Asset|Document|DataObject|null $o * - * @return Document\Editable\Renderlet + * @return $this */ public function setO($o) { @@ -358,7 +362,7 @@ public function getO() /** * @param string $subtype * - * @return Document\Editable\Renderlet + * @return $this */ public function setSubtype($subtype) { @@ -368,7 +372,7 @@ public function setSubtype($subtype) } /** - * @return string + * @return string|null */ public function getSubtype() { @@ -376,7 +380,7 @@ public function getSubtype() } /** - * { @inheritdoc } + * {@inheritdoc} */ public function rewriteIds($idMapping) /** : void */ { diff --git a/models/Document/Editable/Select.php b/models/Document/Editable/Select.php index 94e12360984..6df9c982333 100644 --- a/models/Document/Editable/Select.php +++ b/models/Document/Editable/Select.php @@ -27,7 +27,7 @@ class Select extends Model\Document\Editable * * @internal * - * @var string + * @var string|null */ protected $text; @@ -40,7 +40,7 @@ public function getType() } /** - * {@inheritdoc} + * @return mixed */ public function getData() { diff --git a/models/Document/Editable/Snippet.php b/models/Document/Editable/Snippet.php index 1a529eb1262..e7505b472ea 100644 --- a/models/Document/Editable/Snippet.php +++ b/models/Document/Editable/Snippet.php @@ -42,7 +42,7 @@ class Snippet extends Model\Document\Editable implements IdRewriterInterface, Ed * * @internal * - * @var Document\Snippet|null + * @var Document\Snippet|Model\Element\ElementDescriptor|null */ protected $snippet = null; @@ -55,7 +55,7 @@ public function getType() } /** - * {@inheritdoc} + * @return mixed */ public function getData() { @@ -79,7 +79,7 @@ public function getId() } /** - * {@inheritdoc} + * @return array|null */ public function getDataEditmode() /** : mixed */ { @@ -246,7 +246,7 @@ public function load() /** : void */ } /** - * { @inheritdoc } + * {@inheritdoc} */ public function rewriteIds($idMapping) /** : void */ { @@ -268,7 +268,7 @@ public function setSnippet($snippet) } /** - * @return Document\Snippet + * @return Document\Snippet|null */ public function getSnippet() { diff --git a/models/Document/Editable/Textarea.php b/models/Document/Editable/Textarea.php index 8130dfe2b35..99aab0a1f21 100644 --- a/models/Document/Editable/Textarea.php +++ b/models/Document/Editable/Textarea.php @@ -27,7 +27,7 @@ class Textarea extends Model\Document\Editable implements EditmodeDataInterface * * @internal * - * @var string + * @var string|null */ protected $text; @@ -40,7 +40,7 @@ public function getType() } /** - * {@inheritdoc} + * @return mixed */ public function getData() { @@ -75,7 +75,7 @@ public function frontend() } /** - * {@inheritdoc} + * @return string */ public function getDataEditmode() /** : mixed */ { diff --git a/models/Document/Editable/Video.php b/models/Document/Editable/Video.php index aa863eb58c5..c2b5c7e6995 100644 --- a/models/Document/Editable/Video.php +++ b/models/Document/Editable/Video.php @@ -92,7 +92,7 @@ class Video extends Model\Document\Editable implements IdRewriterInterface /** * @param int|string|null $id * - * @return Video + * @return $this */ public function setId($id) { @@ -520,8 +520,6 @@ private function getAssetCode(bool $inAdmin = false): string } /** - * @param Asset\Video $asset - * * @return Asset\Image\Thumbnail|Asset\Video\ImageThumbnail */ private function getPosterThumbnailImage(Asset\Video $asset) @@ -1167,7 +1165,7 @@ public function getThumbnail($config) } /** - * { @inheritdoc } + * {@inheritdoc} */ public function rewriteIds($idMapping) /** : void */ { diff --git a/models/Document/Editable/Wysiwyg.php b/models/Document/Editable/Wysiwyg.php index a0173a8ded1..a4a6802b1f4 100644 --- a/models/Document/Editable/Wysiwyg.php +++ b/models/Document/Editable/Wysiwyg.php @@ -29,7 +29,7 @@ class Wysiwyg extends Model\Document\Editable implements IdRewriterInterface, Ed * * @internal * - * @var string + * @var string|null */ protected $text; @@ -58,7 +58,7 @@ public function getText() } /** - * {@inheritdoc} + * @return string|null */ public function getDataEditmode() /** : mixed */ { @@ -119,16 +119,13 @@ public function resolveDependencies() return Text::getDependenciesOfWysiwygText($this->text); } - /** - * {@inheritdoc} - */ public function getCacheTags(Model\Document\PageSnippet $ownerDocument, array $tags = []): array { return Text::getCacheTagsOfWysiwygText($this->text, $tags); } /** - * { @inheritdoc } + * {@inheritdoc} */ public function rewriteIds($idMapping) /** : void */ { diff --git a/models/Element/Service.php b/models/Element/Service.php index ec6158bb57f..b22fa094488 100644 --- a/models/Element/Service.php +++ b/models/Element/Service.php @@ -504,7 +504,7 @@ public static function pathExists($path, $type = null) /** * @param string $type - * @param int $id + * @param int|string $id * @param array|bool $force * * @return Asset|AbstractObject|Document|null @@ -1646,7 +1646,7 @@ public static function escapeCsvRecord(array $rowData): array * @internal * * @param string $type - * @param int|string $id + * @param int|string|null $id * * @return string */ diff --git a/models/Element/Tag.php b/models/Element/Tag.php index 332b580c0d3..d0cada81897 100644 --- a/models/Element/Tag.php +++ b/models/Element/Tag.php @@ -58,7 +58,7 @@ final class Tag extends Model\AbstractModel /** * @internal * - * @var Tag[] + * @var Tag[]|null */ protected $children; diff --git a/models/Metadata/Predefined.php b/models/Metadata/Predefined.php index f2a609e6e6c..f7f753a1150 100644 --- a/models/Metadata/Predefined.php +++ b/models/Metadata/Predefined.php @@ -31,7 +31,7 @@ final class Predefined extends Model\AbstractModel { /** - * @var string + * @var string|null */ protected $id; diff --git a/models/Metadata/Predefined/Listing.php b/models/Metadata/Predefined/Listing.php index 55a18b110c2..7359aedaa81 100644 --- a/models/Metadata/Predefined/Listing.php +++ b/models/Metadata/Predefined/Listing.php @@ -100,7 +100,7 @@ public static function getByTargetType($type, $subTypes = null) /** * @param string $key - * @param string $language + * @param string|null $language * @param string|null $targetSubtype * * @return \Pimcore\Model\Metadata\Predefined|null diff --git a/models/Property/Predefined.php b/models/Property/Predefined.php index 99dd0d9405d..52190c1c868 100644 --- a/models/Property/Predefined.php +++ b/models/Property/Predefined.php @@ -29,7 +29,7 @@ final class Predefined extends Model\AbstractModel { /** - * @var string + * @var string|null */ protected $id; @@ -219,7 +219,7 @@ public function setData($data) } /** - * @return string + * @return string|null */ public function getId() { diff --git a/models/Redirect.php b/models/Redirect.php index 0f29220a745..b80ab8629d5 100644 --- a/models/Redirect.php +++ b/models/Redirect.php @@ -46,7 +46,7 @@ final class Redirect extends AbstractModel ]; /** - * @var int + * @var int|null */ protected $id; @@ -56,7 +56,7 @@ final class Redirect extends AbstractModel protected $type; /** - * @var string + * @var string|null */ protected $source; @@ -71,7 +71,7 @@ final class Redirect extends AbstractModel protected $passThroughParameters = false; /** - * @var string + * @var string|null */ protected $target; @@ -179,7 +179,7 @@ public static function create() } /** - * @return int + * @return int|null */ public function getId() { @@ -187,7 +187,7 @@ public function getId() } /** - * @return string + * @return string|null */ public function getSource() { @@ -195,7 +195,7 @@ public function getSource() } /** - * @return string + * @return string|null */ public function getTarget() { @@ -414,7 +414,7 @@ public function setSourceSite($sourceSite) } /** - * @return int + * @return int|null */ public function getSourceSite() { @@ -438,7 +438,7 @@ public function setTargetSite($targetSite) } /** - * @return int + * @return int|null */ public function getTargetSite() { diff --git a/models/Schedule/Task.php b/models/Schedule/Task.php index e7e809eb04a..406dbeb94d3 100644 --- a/models/Schedule/Task.php +++ b/models/Schedule/Task.php @@ -26,7 +26,7 @@ class Task extends Model\AbstractModel { /** - * @var int + * @var int|null */ protected $id; @@ -115,7 +115,7 @@ public function __construct($data = []) } /** - * @return int + * @return int|null */ public function getId() { diff --git a/models/Site.php b/models/Site.php index 131cf4a024f..d143cfe4da0 100644 --- a/models/Site.php +++ b/models/Site.php @@ -32,7 +32,7 @@ final class Site extends AbstractModel protected static ?Site $currentSite = null; /** - * @var int + * @var int|null */ protected $id; @@ -91,7 +91,9 @@ final class Site extends AbstractModel /** * @param int $id * - * @return Site|null + * @return Site|string|null + * + * @throws \Exception */ public static function getById($id) { @@ -139,7 +141,7 @@ public static function getByRootId($id) /** * @param string $domain * - * @return Site|null + * @return Site|string|null */ public static function getByDomain($domain) { @@ -171,7 +173,9 @@ public static function getByDomain($domain) /** * @param mixed $mixed * - * @return Site|null + * @return Site|string|null + * + * @throws \Exception */ public static function getBy($mixed) { @@ -241,7 +245,7 @@ public static function setCurrentSite(Site $site): void } /** - * @return int + * @return int|null */ public function getId() { diff --git a/models/Staticroute.php b/models/Staticroute.php index a241d04f595..00473b9c1d9 100644 --- a/models/Staticroute.php +++ b/models/Staticroute.php @@ -29,7 +29,7 @@ final class Staticroute extends AbstractModel { /** - * @var string + * @var string|null */ protected $id; @@ -234,7 +234,7 @@ private function getDefaultsArray() } /** - * @return string + * @return string|null */ public function getId() { diff --git a/models/Tool/CustomReport/Config.php b/models/Tool/CustomReport/Config.php index 21aaeb15399..9addb1782a5 100644 --- a/models/Tool/CustomReport/Config.php +++ b/models/Tool/CustomReport/Config.php @@ -83,22 +83,22 @@ class Config extends Model\AbstractModel implements \JsonSerializable protected $chartType = ''; /** - * @var string + * @var string|null */ protected $pieColumn = ''; /** - * @var string + * @var string|null */ protected $pieLabelColumn = ''; /** - * @var string + * @var string|null */ protected $xAxis = ''; /** - * @var string|array + * @var string|array|null */ protected $yAxis = []; @@ -178,7 +178,7 @@ public static function getReportsList(Model\User $user = null) } /** - * @param \stdClass $configuration + * @param \stdClass|null $configuration * @param Config|null $fullConfig * * @deprecated Use ServiceLocator with id 'pimcore.custom_report.adapter.factories' to determine the factory for the adapter instead @@ -372,7 +372,7 @@ public function getChartType() } /** - * @param string $pieColumn + * @param string|null $pieColumn */ public function setPieColumn($pieColumn) { @@ -380,7 +380,7 @@ public function setPieColumn($pieColumn) } /** - * @return string + * @return string|null */ public function getPieColumn() { @@ -388,7 +388,7 @@ public function getPieColumn() } /** - * @param string $xAxis + * @param string|null $xAxis */ public function setXAxis($xAxis) { @@ -396,7 +396,7 @@ public function setXAxis($xAxis) } /** - * @return string + * @return string|null */ public function getXAxis() { @@ -404,7 +404,7 @@ public function getXAxis() } /** - * @param array|string $yAxis + * @param array|string|null $yAxis */ public function setYAxis($yAxis) { @@ -412,7 +412,7 @@ public function setYAxis($yAxis) } /** - * @return array|string + * @return array|string|null */ public function getYAxis() { @@ -420,7 +420,7 @@ public function getYAxis() } /** - * @param string $pieLabelColumn + * @param string|null $pieLabelColumn */ public function setPieLabelColumn($pieLabelColumn) { @@ -428,7 +428,7 @@ public function setPieLabelColumn($pieLabelColumn) } /** - * @return string + * @return string|null */ public function getPieLabelColumn() { diff --git a/models/Tool/Email/Log.php b/models/Tool/Email/Log.php index d761f2b07e2..7d10488e63e 100644 --- a/models/Tool/Email/Log.php +++ b/models/Tool/Email/Log.php @@ -31,21 +31,21 @@ class Log extends Model\AbstractModel /** * EmailLog Id * - * @var int + * @var null|int */ protected $id; /** * Id of the email document or null if no document was given * - * @var int | null + * @var int|null */ protected $documentId; /** * Parameters passed for replacement * - * @var array + * @var string|array */ protected $params; @@ -73,7 +73,7 @@ class Log extends Model\AbstractModel /** * Contains the reply to email addresses (multiple recipients are separated by a ",") * - * @var string + * @var string|null */ protected $replyTo; @@ -143,7 +143,7 @@ class Log extends Model\AbstractModel /** * Error log, when mail send resulted in failure - empty if successfully sent * - * @var ?string + * @var string|null */ protected $error; @@ -184,7 +184,7 @@ public function getRequestUri() /** * Returns the email log id * - * @return int + * @return int|null */ public function getId() { @@ -260,7 +260,7 @@ public function getDocumentId() } /** - * @param array $params + * @param array|string $params * * @return $this */ @@ -331,6 +331,8 @@ public function getSentDate() /** * Checks if a html log file exits and sets $this->emailLogExistsHtml to 0 or 1 + * + * @return $this */ public function setEmailLogExistsHtml() { @@ -353,6 +355,8 @@ public function getEmailLogExistsHtml() /** * Checks if a text log file exits and sets $this->emailLogExistsText to 0 or 1 + * + * @return $this */ public function setEmailLogExistsText() { @@ -396,7 +400,7 @@ public function getTextLogFilename() /** * Returns the content of the html log file * - * @return string | false + * @return string|false */ public function getHtmlLog() { @@ -412,7 +416,7 @@ public function getHtmlLog() /** * Returns the content of the text log file * - * @return string | false + * @return string|false */ public function getTextLog() { @@ -562,7 +566,7 @@ public function setReplyTo($replyTo) /** * Returns the "replyTo" email address * - * @return string + * @return string|null */ public function getReplyTo() { @@ -584,7 +588,7 @@ public function setBodyHtml($html) /** * returns the html content of the email * - * @return string | null + * @return string|null */ public function getBodyHtml() { diff --git a/models/Tool/SettingsStore.php b/models/Tool/SettingsStore.php index b8831463e4a..9f14b6e1ea0 100644 --- a/models/Tool/SettingsStore.php +++ b/models/Tool/SettingsStore.php @@ -35,7 +35,7 @@ final class SettingsStore extends Model\AbstractModel /** * @internal * - * @var string + * @var string|null */ protected $scope; diff --git a/models/Tool/Targeting/Rule.php b/models/Tool/Targeting/Rule.php index 388f9c43c7d..74caf9b7cff 100644 --- a/models/Tool/Targeting/Rule.php +++ b/models/Tool/Targeting/Rule.php @@ -36,7 +36,7 @@ class Rule extends Model\AbstractModel const SCOPE_VISITOR = 'visitor'; /** - * @var int + * @var int|null */ protected $id; @@ -173,7 +173,7 @@ public function setId($id) } /** - * @return int + * @return int|null */ public function getId() { diff --git a/models/Tool/Targeting/TargetGroup.php b/models/Tool/Targeting/TargetGroup.php index 12cb4e7131f..7c2d87d96f7 100644 --- a/models/Tool/Targeting/TargetGroup.php +++ b/models/Tool/Targeting/TargetGroup.php @@ -30,7 +30,7 @@ class TargetGroup extends Model\AbstractModel use RecursionBlockingEventDispatchHelperTrait; /** - * @var int + * @var int|null */ protected $id; @@ -137,7 +137,7 @@ public function setId($id) } /** - * @return int + * @return int|null */ public function getId() { diff --git a/models/Translation.php b/models/Translation.php index 31b00bc1a53..3a445af8a58 100644 --- a/models/Translation.php +++ b/models/Translation.php @@ -64,7 +64,7 @@ final class Translation extends AbstractModel protected $domain = self::DOMAIN_DEFAULT; /** - * @var string + * @var string|null */ protected $type = 'simple'; @@ -91,7 +91,7 @@ public function getType() } /** - * @param string $type + * @param string|null $type */ public function setType($type): void { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7cfff68c51d..7313a8490a9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -55,11 +55,6 @@ parameters: count: 1 path: bundles/EcommerceFrameworkBundle/CoreExtensions/ClassDefinition/IndexFieldSelectionCombo.php - - - message: "#^Parameter \\#2 \\$condition of method Pimcore\\\\Bundle\\\\EcommerceFrameworkBundle\\\\IndexService\\\\ProductList\\\\ProductListInterface\\:\\:addRelationCondition\\(\\) expects string, array\\\\>\\> given\\.$#" - count: 1 - path: bundles/EcommerceFrameworkBundle/FilterService/FilterType/ElasticSearch/MultiSelectRelation.php - - message: "#^Parameter \\#1 \\$fieldname of method Pimcore\\\\Bundle\\\\EcommerceFrameworkBundle\\\\IndexService\\\\ProductList\\\\ProductListInterface\\:\\:getGroupByValues\\(\\) expects string, Pimcore\\\\Bundle\\\\EcommerceFrameworkBundle\\\\CoreExtensions\\\\ObjectData\\\\IndexFieldSelection\\|null given\\.$#" count: 1