Skip to content

Commit

Permalink
Do not add empty setters to caches to avoid serialized field issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dxops committed Oct 19, 2022
1 parent 372da6b commit 29e75c5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
6 changes: 0 additions & 6 deletions Entity/AkeneoLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public function getCode()
return $this->code;
}

/**
* @return AkeneoLocale
*/
public function setCode(string $code): self
{
$this->code = $code;
Expand Down Expand Up @@ -93,9 +90,6 @@ public function getAkeneoSettings()
return $this->akeneoSettings;
}

/**
* @return AkeneoLocale
*/
public function setAkeneoSettings(AkeneoSettings $akeneoSettings = null): self
{
$this->akeneoSettings = $akeneoSettings;
Expand Down
8 changes: 0 additions & 8 deletions Entity/AkeneoSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,6 @@ public function getTokenExpiryDateTime()
return $this->tokenExpiryDateTime;
}

/**
* @return AkeneoSettings
*/
public function setTokenExpiryDateTime(DateTime $tokenExpiryDateTime): self
{
$this->tokenExpiryDateTime = $tokenExpiryDateTime;
Expand Down Expand Up @@ -680,8 +677,6 @@ public function setRootCategory(Category $rootCategory = null)
/**
* Get mapped locale.
*
* @param $locale
*
* @return null|string
*/
public function getMappedAkeneoLocale(string $locale)
Expand Down Expand Up @@ -723,9 +718,6 @@ public function getPriceList(): ?PriceList
return $this->priceList;
}

/**
* @return AkeneoSettings
*/
public function setPriceList(PriceList $priceList): self
{
$this->priceList = $priceList;
Expand Down
3 changes: 0 additions & 3 deletions Integration/AkeneoSearchBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
9 changes: 6 additions & 3 deletions Tools/AttributeEntityGeneratorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Validator/JsonValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function validate($value, Constraint $constraint)
}

/**
* @param $string
*
* @return bool
*/
private function isJSON($string)
Expand Down

0 comments on commit 29e75c5

Please sign in to comment.