Skip to content

Commit

Permalink
Fixed phpdoc types - (pimcore#14051)
Browse files Browse the repository at this point in the history
* fixed phpdoc types - in preparation for pimcore#13869

* Update bundles/EcommerceFrameworkBundle/CartManager/CartPriceCalculatorInterface.php

Co-authored-by: Sebastian Blank <[email protected]>

* Update bundles/EcommerceFrameworkBundle/IndexService/Getter/TagsGetter.php

Co-authored-by: Sebastian Blank <[email protected]>

* Apply suggestions from code review

Co-authored-by: Sebastian Blank <[email protected]>

* fixed phpdoc types - in preparation for pimcore#13869

* fixed phpdoc types - in preparation for pimcore#13869

* fixed phpdoc types - in preparation for pimcore#13869

* Apply suggestions from code review

Co-authored-by: mcop1 <[email protected]>

* Apply suggestions from code review

Co-authored-by: Sebastian Blank <[email protected]>

Co-authored-by: Sebastian Blank <[email protected]>
Co-authored-by: mcop1 <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2023
1 parent ad03a42 commit 596f565
Show file tree
Hide file tree
Showing 97 changed files with 551 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function getCartId()

abstract public function save();

/**
* @param string $key
* @param int|string $cartId
* @return AbstractCartCheckoutData|null
*/
public static function getByKeyCartId($key, $cartId)
{
throw new \Exception('Not implemented.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public function save()
$this->getDao()->save();
}

/**
* @param string $key
* @param int|string $cartId
* @return AbstractCartCheckoutData|null
*/
public static function getByKeyCartId($key, $cartId)
{
$cacheKey = CartCheckoutData\Dao::TABLE_NAME . '_' . $key . '_' . $cartId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ public function getVoucherTokenCodes();
public function getPricingManagerTokenInformationDetails(): array;

/**
* @param int $errorCode
* @return bool
*/
public function isVoucherErrorCode($errorCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ protected function configureModificatorResolver(OptionsResolver $resolver)
}

/**
* @param bool $ignorePricingRules
* @return void
* @throws UnsupportedException
*/
public function calculate($ignorePricingRules = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function initModificators();
/**
* Calculates cart sums and saves results
*
* @param bool $ignorePricingRules
* @return void
*/
public function calculate($ignorePricingRules = false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function save()
throw new \Exception('Not implemented, should not be needed for this cart type.');
}

/**
* @param string $key
* @param int|string $cartId
* @return AbstractCartCheckoutData|null
*/
public static function getByKeyCartId($key, $cartId)
{
throw new \Exception('Not implemented, should not be needed for this cart type.');
Expand Down Expand Up @@ -56,11 +61,18 @@ public function getCart()
return $this->cart;
}

/**
* @return int|string|null
*/
public function getCartId()
{
return $this->cartId;
}

/**
* @param int|string|null $cartId
* @return void
*/
public function setCartId($cartId)
{
$this->cartId = $cartId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@ public function __construct()
{
}

/**
* @param bool $considerTenants
* @return void
*/
public function setConsiderTenants($considerTenants)
{
$this->considerTenants = $considerTenants;
}

/**
* @return bool
*/
public function getConsiderTenants()
{
return $this->considerTenants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,52 @@ protected function buildOptions(): array
return $options;
}

/**
* @param bool $specificPriceField
* @return void
*/
public function setSpecificPriceField($specificPriceField)
{
$this->specificPriceField = $specificPriceField;
}

/**
* @return bool
*/
public function getSpecificPriceField()
{
return $this->specificPriceField;
}

/**
* @param bool $showAllFields
* @return void
*/
public function setShowAllFields($showAllFields)
{
$this->showAllFields = $showAllFields;
}

/**
* @return bool
*/
public function getShowAllFields()
{
return $this->showAllFields;
}

/**
* @param bool $considerTenants
* @return void
*/
public function setConsiderTenants($considerTenants)
{
$this->considerTenants = $considerTenants;
}

/**
* @return bool
*/
public function getConsiderTenants()
{
return $this->considerTenants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,52 @@ class IndexFieldSelectionField extends Textarea

public $considerTenants = false;

/**
* @param bool $specificPriceField
* @return void
*/
public function setSpecificPriceField($specificPriceField)
{
$this->specificPriceField = $specificPriceField;
}

/**
* @return bool
*/
public function getSpecificPriceField()
{
return $this->specificPriceField;
}

/**
* @param bool $showAllFields
* @return void
*/
public function setShowAllFields($showAllFields)
{
$this->showAllFields = $showAllFields;
}

/**
* @return bool
*/
public function getShowAllFields()
{
return $this->showAllFields;
}

/**
* @param bool $considerTenants
* @return void
*/
public function setConsiderTenants($considerTenants)
{
$this->considerTenants = $considerTenants;
}

/**
* @return bool
*/
public function getConsiderTenants()
{
return $this->considerTenants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

abstract class AssortmentTenantAwareServiceLocator extends TenantAwareServiceLocator
{
/**
* @return string|null
*/
protected function getEnvironmentTenant()
{
return $this->environment->getCurrentAssortmentTenant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

abstract class CheckoutTenantAwareServiceLocator extends TenantAwareServiceLocator
{
/**
* @return string|null
*/
protected function getEnvironmentTenant()
{
return $this->environment->getCurrentCheckoutTenant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function __construct(PsrContainerInterface $locator)
$this->locator = $locator;
}

/**
* @return mixed
*/
protected function locate(string $name = null)
{
$name = $this->resolveName($name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function __construct(
$this->strictTenants = $strictTenants;
}

/**
* @return mixed
*/
protected function locate(string $tenant = null)
{
$tenant = $this->resolveTenant($tenant);
Expand Down Expand Up @@ -87,5 +90,8 @@ protected function resolveTenant(string $tenant = null)
return $this->defaultTenant;
}

/**
* @return string|null
*/
abstract protected function getEnvironmentTenant();
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function getSubTenantCondition()
* creates object mockup for given data
*
* @param int $objectId
* @param mixed $data
* @param array $data
* @param array $relations
*
* @return DefaultMockup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public function getOptions(): array
return $this->options;
}

/**
* @param string $name
* @param mixed $defaultValue
* @return mixed
*/
public function getOption(string $name, $defaultValue = null)
{
return $this->options[$name] ?? $defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function setTenantWorker(WorkerInterface $tenantWorker)
* creates object mockup for given data
*
* @param int $objectId
* @param mixed $data
* @param array $data
* @param array $relations
*
* @return DefaultMockup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface MockupConfigInterface
* creates object mockup for given data
*
* @param int $objectId
* @param mixed $data
* @param array $data
* @param array $relations
*
* @return mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OptimizedMysql extends DefaultMysql implements MockupConfigInterface
* creates object mockup for given data
*
* @param int $objectId
* @param mixed $data
* @param array $data
* @param array $relations
*
* @return DefaultMockup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class DefaultBrickGetter implements GetterInterface
{
use OptionsResolverTrait;

/**
* @param object $object
* @param array $config
* @return mixed
*/
public function get($object, $config = null)
{
$config = $this->resolveOptions($config ?? []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class DefaultBrickGetterSequence implements GetterInterface
{
use OptionsResolverTrait;

/**
* @param object $object
* @param array $config
* @return mixed
*/
public function get($object, $config = null)
{
$config = $this->resolveOptions($config ?? []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class DefaultBrickGetterSequenceToMultiselect implements GetterInterface
{
use OptionsResolverTrait;

/**
* @param object $object
* @param array $config
* @return mixed
*/
public function get($object, $config = null)
{
$config = $this->resolveOptions($config ?? []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DefaultClassificationAttributeGetter implements GetterInterface
* note that this getter does not support localization at the moment
*
* @param object $object
* @param array|null $config
* @param array $config
*
* @return mixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@
*/
interface ExtendedGetterInterface extends GetterInterface
{
/**
* @param object $object
* @param array $config
* @param int|null $subObjectId
* @param ConfigInterface|null $tenantConfig
* @return mixed
*/
public function get($object, $config = null, $subObjectId = null, ConfigInterface $tenantConfig = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@

interface GetterInterface
{
/**
* @param object $object
* @param array $config
* @return mixed
*/
public function get($object, $config = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class TagsGetter implements GetterInterface
{
use OptionsResolverTrait;

/**
* @param object $element
* @param array $config
* @return mixed
*/
public function get($element, $config = null)
{
$config = $this->resolveOptions($config ?? []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

class AssetId implements InterpreterInterface
{
/**
* @param mixed $value
* @param array|null $config
* @return int|null
*/
public function interpret($value, $config = null)
{
if (!empty($value) && $value instanceof Asset) {
Expand Down
Loading

0 comments on commit 596f565

Please sign in to comment.