diff --git a/Entity/AkeneoLocale.php b/Entity/AkeneoLocale.php index d7cd8b80..a9520895 100644 --- a/Entity/AkeneoLocale.php +++ b/Entity/AkeneoLocale.php @@ -53,9 +53,6 @@ public function getCode() return $this->code; } - /** - * @return AkeneoLocale - */ public function setCode(string $code): self { $this->code = $code; @@ -93,9 +90,6 @@ public function getAkeneoSettings() return $this->akeneoSettings; } - /** - * @return AkeneoLocale - */ public function setAkeneoSettings(AkeneoSettings $akeneoSettings = null): self { $this->akeneoSettings = $akeneoSettings; diff --git a/Entity/AkeneoSettings.php b/Entity/AkeneoSettings.php index 7e1d61a9..dbdbeee0 100644 --- a/Entity/AkeneoSettings.php +++ b/Entity/AkeneoSettings.php @@ -643,9 +643,6 @@ public function getTokenExpiryDateTime() return $this->tokenExpiryDateTime; } - /** - * @return AkeneoSettings - */ public function setTokenExpiryDateTime(DateTime $tokenExpiryDateTime): self { $this->tokenExpiryDateTime = $tokenExpiryDateTime; @@ -680,8 +677,6 @@ public function setRootCategory(Category $rootCategory = null) /** * Get mapped locale. * - * @param $locale - * * @return null|string */ public function getMappedAkeneoLocale(string $locale) @@ -723,9 +718,6 @@ public function getPriceList(): ?PriceList return $this->priceList; } - /** - * @return AkeneoSettings - */ public function setPriceList(PriceList $priceList): self { $this->priceList = $priceList; diff --git a/Integration/AkeneoSearchBuilder.php b/Integration/AkeneoSearchBuilder.php index e65ae466..f6dce033 100644 --- a/Integration/AkeneoSearchBuilder.php +++ b/Integration/AkeneoSearchBuilder.php @@ -47,9 +47,6 @@ public function getFilters(string $json = null): array return $searchBuilder->getFilters(); } - /** - * @param $string - */ public function isJSON($string): bool { return is_string($string) && is_array(json_decode($string, true)) && (\JSON_ERROR_NONE == json_last_error()); diff --git a/Tools/AttributeEntityGeneratorExtension.php b/Tools/AttributeEntityGeneratorExtension.php index 9a2bf7b2..c63cff26 100644 --- a/Tools/AttributeEntityGeneratorExtension.php +++ b/Tools/AttributeEntityGeneratorExtension.php @@ -70,10 +70,13 @@ private function generateBasicMethods(string $attributeName, array $fields, Clas } $getMethodBody = $getMethodBody ? $getMethodBody .= 'return null;' : $initialGetMethodBody; + if ($getMethodBody) { + $class->addMethod($getMethodName)->addBody($getMethodBody); + } $setMethodBody = $setMethodBody ? $setMethodBody .= 'return $this;' : $initialSetMethodBody; - - $class->addMethod($getMethodName)->addBody($getMethodBody); - $class->addMethod($setMethodName)->addBody($setMethodBody)->addParameter('value'); + if ($setMethodBody) { + $class->addMethod($setMethodName)->addBody($setMethodBody)->addParameter('value'); + } } private function generateRelationDefaultMethods(string $attributeName, array $fields, ClassGenerator $class): void diff --git a/Validator/JsonValidator.php b/Validator/JsonValidator.php index 118d490d..db1e8985 100644 --- a/Validator/JsonValidator.php +++ b/Validator/JsonValidator.php @@ -20,8 +20,6 @@ public function validate($value, Constraint $constraint) } /** - * @param $string - * * @return bool */ private function isJSON($string)