Skip to content

Commit

Permalink
Remove SlugHelper from constructor argument
Browse files Browse the repository at this point in the history
  • Loading branch information
froemken committed May 25, 2021
1 parent 116e176 commit f8e7fe3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
27 changes: 14 additions & 13 deletions Classes/Updates/SlugUpdateWizard.php
Expand Up @@ -39,19 +39,6 @@ class SlugUpdateWizard implements UpgradeWizardInterface
*/
protected $slugHelper;

public function __construct(SlugHelper $slugHelper = null)
{
if ($slugHelper === null) {
$slugHelper = GeneralUtility::makeInstance(
SlugHelper::class,
$this->tableName,
$this->fieldName,
$GLOBALS['TCA'][$this->tableName]['columns']['path_segment']['config']
);
}
$this->slugHelper = $slugHelper;
}

/**
* Return the identifier for this wizard
* This should be the same string as used in the ext_localconf class registration
Expand Down Expand Up @@ -145,6 +132,20 @@ public function executeUpdate(): bool
return true;
}

protected function getSlugHelper(): SlugHelper
{
if ($this->slugHelper === null) {
$this->slugHelper = GeneralUtility::makeInstance(
SlugHelper::class,
$this->tableName,
$this->fieldName,
$GLOBALS['TCA'][$this->tableName]['columns']['path_segment']['config']
);
}

return $this->slugHelper;
}

/**
* @return string[]
*/
Expand Down
4 changes: 3 additions & 1 deletion Documentation/Changelog/Index.rst
Expand Up @@ -6,4 +6,6 @@
Change log
==========

...
**Version 4.0.3**

- Move SlugHelper from constructor argument into getSlugHelper()
2 changes: 1 addition & 1 deletion Documentation/Settings.cfg
Expand Up @@ -25,7 +25,7 @@ project = daycarecenters
# ... (recommended) version, displayed next to title (desktop) and in <meta name="book-version"
# .................................................................................

release = 4.0.0
release = 4.0.3

# .................................................................................
# ... (recommended) displayed in footer
Expand Down

0 comments on commit f8e7fe3

Please sign in to comment.