diff --git a/Classes/Extbase/Property/TypeConverter/ObjectConverter.php b/Classes/Extbase/Property/TypeConverter/ObjectConverter.php index d347551a..90c5c160 100644 --- a/Classes/Extbase/Property/TypeConverter/ObjectConverter.php +++ b/Classes/Extbase/Property/TypeConverter/ObjectConverter.php @@ -53,17 +53,32 @@ class Tx_PtExtbase_Extbase_Property_TypeConverter_ObjectConverter extends \TYPO3 protected $priority = 0; /** - * @inject * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface */ protected $objectManager; /** - * @inject * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService */ protected $reflectionService; + + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager): void + { + $this->objectManager = $objectManager; + } + + /** + * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService + */ + public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService): void + { + $this->reflectionService = $reflectionService; + } + /** * Only convert non-persistent types * diff --git a/Classes/Logger/Logger.php b/Classes/Logger/Logger.php index d772e085..7fb17105 100644 --- a/Classes/Logger/Logger.php +++ b/Classes/Logger/Logger.php @@ -35,36 +35,38 @@ class Logger implements SingletonInterface */ protected $loggerManager; - /** * @var \TYPO3\CMS\Core\Log\Logger */ protected $logger; - /** * @var string */ protected $logFilePath; - /** * @var string */ protected $exceptionDirectory; + /** + * @var string + */ + protected $defaultLogComponent; /** - * @inject - * @var \PunktDe\PtExtbase\Logger\LoggerConfiguration + * @var LoggerConfiguration */ protected $loggerConfiguration; - /** - * @var string + * @param LoggerConfiguration $loggerConfiguration */ - protected $defaultLogComponent; + public function injectLoggerConfiguration(LoggerConfiguration $loggerConfiguration): void + { + $this->loggerConfiguration = $loggerConfiguration; + } public function __construct() diff --git a/Classes/Utility/GenericShellCommandWrapper/AbstractResult.php b/Classes/Utility/GenericShellCommandWrapper/AbstractResult.php index ec60c185..932bd320 100644 --- a/Classes/Utility/GenericShellCommandWrapper/AbstractResult.php +++ b/Classes/Utility/GenericShellCommandWrapper/AbstractResult.php @@ -21,6 +21,8 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use PunktDe\PtExtbase\Logger\Logger; +use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; /** @@ -30,53 +32,74 @@ */ abstract class AbstractResult { + /** - * @inject - * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface + * @var GenericShellCommand */ - protected $objectManager; + protected $command; /** - * @inject - * @var \PunktDe\PtExtbase\Logger\Logger + * @var int */ - protected $logger; + protected $exitCode; /** - * @inject - * @var \PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\ExecutionManager + * @var string */ - protected $executionManager; + protected $rawResult = ''; /** - * @var \PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand + * @var ResultObjectStorage */ - protected $command; + protected $result; /** - * @var integer + * @var ObjectManagerInterface */ - protected $exitCode; + protected $objectManager; + /** + * @var Logger + */ + protected $logger; /** - * @var string + * @var ExecutionManager */ - protected $rawResult = ''; + protected $executionManager; /** - * @var ResultObjectStorage + * @param ObjectManagerInterface $objectManager */ - protected $result; + public function injectObjectManager(ObjectManagerInterface $objectManager): void + { + $this->objectManager = $objectManager; + } + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + + /** + * @param ExecutionManager $executionManager + */ + public function injectExecutionManager(ExecutionManager $executionManager): void + { + $this->executionManager = $executionManager; + } /** - * @param \PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand $command + * @param GenericShellCommand $command */ public function __construct($command) { diff --git a/Classes/Utility/GenericShellCommandWrapper/ExecutionManager.php b/Classes/Utility/GenericShellCommandWrapper/ExecutionManager.php index 8eeceda4..c2040965 100644 --- a/Classes/Utility/GenericShellCommandWrapper/ExecutionManager.php +++ b/Classes/Utility/GenericShellCommandWrapper/ExecutionManager.php @@ -21,6 +21,8 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use PunktDe\PtExtbase\Logger\Logger; +use PunktDe\PtExtbase\Utility\ShellCommandService; use TYPO3\CMS\Core\SingletonInterface; /** @@ -30,20 +32,35 @@ */ class ExecutionManager implements SingletonInterface { + /** - * @inject - * @var \PunktDe\PtExtbase\Utility\ShellCommandService + * @var ShellCommandService */ protected $shellCommandService; - /** - * @inject - * @var \PunktDe\PtExtbase\Logger\Logger + * @var Logger */ protected $logger; + /** + * @param ShellCommandService $shellCommandService + */ + public function injectShellCommandService(ShellCommandService $shellCommandService): void + { + $this->shellCommandService = $shellCommandService; + } + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + + /** * @var GenericShellCommand */ diff --git a/Classes/Utility/GenericShellCommandWrapper/GenericShellCommand.php b/Classes/Utility/GenericShellCommandWrapper/GenericShellCommand.php index 1151a90f..0c98059b 100644 --- a/Classes/Utility/GenericShellCommandWrapper/GenericShellCommand.php +++ b/Classes/Utility/GenericShellCommandWrapper/GenericShellCommand.php @@ -21,6 +21,9 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use PunktDe\PtExtbase\Logger\Logger; +use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; + /** * Generic Shell Command * @@ -53,20 +56,32 @@ class GenericShellCommand */ protected $subCommand; - /** - * @inject - * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface + * @var ObjectManagerInterface */ protected $objectManager; - /** - * @inject - * @var \PunktDe\PtExtbase\Logger\Logger + * @var Logger */ protected $logger; + /** + * @param ObjectManagerInterface $objectManager + */ + public function injectObjectManager(ObjectManagerInterface $objectManager): void + { + $this->objectManager = $objectManager; + } + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + /** * @return string diff --git a/Classes/Utility/Git/GitRepository.php b/Classes/Utility/Git/GitRepository.php index b159c7c8..e9465d6e 100644 --- a/Classes/Utility/Git/GitRepository.php +++ b/Classes/Utility/Git/GitRepository.php @@ -21,8 +21,10 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use PunktDe\PtExtbase\Logger\Logger; use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; use PunktDe\PtExtbase\Utility\Files; +use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; /** * Git Repository @@ -31,27 +33,48 @@ */ class GitRepository { + /** - * @inject - * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface + * @var ObjectManagerInterface */ protected $objectManager; - /** - * @inject - * @var \PunktDe\PtExtbase\Logger\Logger + * @var Logger */ protected $logger; - /** - * @inject - * @var \PunktDe\PtExtbase\Utility\Git\GitExecutionManager + * @var GitExecutionManager */ protected $gitExecutionManager; + /** + * @param ObjectManagerInterface $objectManager + */ + public function injectObjectManager(ObjectManagerInterface $objectManager): void + { + $this->objectManager = $objectManager; + } + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + + /** + * @param GitExecutionManager $gitExecutionManager + */ + public function injectGitExecutionManager(GitExecutionManager $gitExecutionManager): void + { + $this->gitExecutionManager = $gitExecutionManager; + } + + /** * @var string */ diff --git a/Classes/Utility/Git/Result/Result.php b/Classes/Utility/Git/Result/Result.php index db36b9ac..bc739e13 100644 --- a/Classes/Utility/Git/Result/Result.php +++ b/Classes/Utility/Git/Result/Result.php @@ -22,6 +22,7 @@ ***************************************************************/ use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\AbstractResult; +use PunktDe\PtExtbase\Utility\Git\GitExecutionManager; /** * Result @@ -30,12 +31,20 @@ */ class Result extends AbstractResult { + /** - * @inject - * @var \PunktDe\PtExtbase\Utility\Git\GitExecutionManager + * @var GitExecutionManager */ protected $executionManager; + /** + * @param GitExecutionManager $executionManager + */ + public function injectExecutionManager(GitExecutionManager $executionManager): void + { + $this->executionManager = $executionManager; + } + /** * @return void diff --git a/Classes/Utility/HeaderInclusion.php b/Classes/Utility/HeaderInclusion.php index 4e0e7d8f..b9ef0052 100644 --- a/Classes/Utility/HeaderInclusion.php +++ b/Classes/Utility/HeaderInclusion.php @@ -36,14 +36,21 @@ class Tx_PtExtbase_Utility_HeaderInclusion implements \TYPO3\CMS\Core\SingletonInterface { + /** * @var \TYPO3\CMS\Core\Page\PageRenderer - * @inject */ protected $pageRenderer; - - + /** + * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer + */ + public function injectPageRenderer(\TYPO3\CMS\Core\Page\PageRenderer $pageRenderer): void + { + $this->pageRenderer = $pageRenderer; + } + + /** * Add JS inline code * diff --git a/Classes/Utility/RealUrl.php b/Classes/Utility/RealUrl.php index c7f819e2..918ef048 100644 --- a/Classes/Utility/RealUrl.php +++ b/Classes/Utility/RealUrl.php @@ -23,6 +23,7 @@ use PunktDe\PtExtbase\Utility\RealUrl\UrlDecoder; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** @@ -32,16 +33,25 @@ */ class RealUrl implements SingletonInterface { + + /** + * @var UrlDecoder + */ + protected $urlDecoder; + /** - * @inject - * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface + * @var ObjectManagerInterface */ protected $objectManager; /** - * @var UrlDecoder + * @param ObjectManagerInterface $objectManager */ - protected $urlDecoder; + public function injectObjectManager(ObjectManagerInterface $objectManager): void + { + $this->objectManager = $objectManager; + } + /** * Map path to page ID diff --git a/Classes/Utility/ShellCommandService.php b/Classes/Utility/ShellCommandService.php index 6c95a9f3..0f46312a 100644 --- a/Classes/Utility/ShellCommandService.php +++ b/Classes/Utility/ShellCommandService.php @@ -21,6 +21,7 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use PunktDe\PtExtbase\Logger\Logger; use TYPO3\CMS\Core\SingletonInterface; /** @@ -30,12 +31,6 @@ */ class ShellCommandService implements SingletonInterface { - /** - * @inject - * @var \PunktDe\PtExtbase\Logger\Logger - */ - protected $logger; - /** * @var string @@ -56,29 +51,39 @@ class ShellCommandService implements SingletonInterface /** - * @var integer + * @var int */ protected $exitCode = 0; - /** * @var string */ protected $returnedOutput = ''; - /** - * @var boolean + * @var bool */ protected $redirectStandardErrorToStandardOut = false; - /** - * @var boolean + * @var bool */ protected $simulateMode = false; + /** + * @var Logger + */ + protected $logger; + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + /** * @param mixed $command The shell command to execute, either string or array of commands * @return mixed The output of the shell command or FALSE if the command returned a non-zero exit code and $ignoreErrors was enabled. diff --git a/Classes/Utility/Wget/WgetCommand.php b/Classes/Utility/Wget/WgetCommand.php index 3fa2b5df..89eb920f 100644 --- a/Classes/Utility/Wget/WgetCommand.php +++ b/Classes/Utility/Wget/WgetCommand.php @@ -1,6 +1,7 @@ '-e https_proxy="%s"', ]; - - /** - * @var \PunktDe\PtExtbase\Logger\Logger - * @inject - */ - protected $logger; - - /** * @var string */ @@ -254,6 +247,19 @@ class WgetCommand protected $httpsProxy; + /** + * @var Logger + */ + protected $logger; + + /** + * @param Logger $logger + */ + public function injectLogger(Logger $logger): void + { + $this->logger = $logger; + } + /** * @param string $wgetBinaryPath * @return $this diff --git a/Classes/Utility/Wget/WgetLogParser.php b/Classes/Utility/Wget/WgetLogParser.php index f70b84d3..e731c805 100644 --- a/Classes/Utility/Wget/WgetLogParser.php +++ b/Classes/Utility/Wget/WgetLogParser.php @@ -26,6 +26,8 @@ namespace PunktDe\PtExtbase\Utility\Wget; +use TYPO3\CMS\Extbase\Object\ObjectManager; + class WgetLogParser { /** @@ -33,13 +35,18 @@ class WgetLogParser */ protected $wgetCommand; - /** - * @var \TYPO3\CMS\Extbase\Object\ObjectManager - * @inject + * @var ObjectManager */ protected $objectManager; + /** + * @param ObjectManager $objectManager + */ + public function injectObjectManager(ObjectManager $objectManager): void + { + $this->objectManager = $objectManager; + } public function parseLog(WgetCommand $wgetCommand) diff --git a/Classes/ViewHelpers/Be/IconViewHelper.php b/Classes/ViewHelpers/Be/IconViewHelper.php index 27dfdba4..83da0fe6 100755 --- a/Classes/ViewHelpers/Be/IconViewHelper.php +++ b/Classes/ViewHelpers/Be/IconViewHelper.php @@ -29,6 +29,8 @@ ***************************************************************/ use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Imaging\IconRegistry; use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper; /* * = Examples = @@ -58,17 +60,33 @@ class IconViewHelper extends AbstractBackendViewHelper { /** - * @var \TYPO3\CMS\Core\Imaging\IconRegistry - * @inject + * @var IconRegistry */ protected $iconRegistry; /** - * @var \TYPO3\CMS\Core\Imaging\IconFactory - * @inject + * @var IconFactory */ protected $iconFactory; + + /** + * @param IconRegistry $iconRegistry + */ + public function injectIconRegistry(IconRegistry $iconRegistry): void + { + $this->iconRegistry = $iconRegistry; + } + + /** + * @param IconFactory $iconFactory + */ + public function injectIconFactory(IconFactory $iconFactory): void + { + $this->iconFactory = $iconFactory; + } + + /** * Renders an icon link as known from the TYPO3 backend * diff --git a/Classes/ViewHelpers/ErrorMessagesViewHelper.php b/Classes/ViewHelpers/ErrorMessagesViewHelper.php index 96454f4c..54c2e198 100644 --- a/Classes/ViewHelpers/ErrorMessagesViewHelper.php +++ b/Classes/ViewHelpers/ErrorMessagesViewHelper.php @@ -22,16 +22,27 @@ * * This copyright notice MUST APPEAR in all copies of the script! */ + +use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; class ErrorMessagesViewHelper extends AbstractTagBasedViewHelper { + /** - * @var \TYPO3\CMS\Extbase\Utility\LocalizationUtility - * @inject + * @var LocalizationUtility */ protected $localization; + /** + * @param LocalizationUtility $localization + */ + public function injectLocalization(LocalizationUtility $localization): void + { + $this->localization = $localization; + } + + /** * @param string $extension * @param string $file diff --git a/Classes/ViewHelpers/FileTypeIconViewHelper.php b/Classes/ViewHelpers/FileTypeIconViewHelper.php index 97934fae..1a77b567 100644 --- a/Classes/ViewHelpers/FileTypeIconViewHelper.php +++ b/Classes/ViewHelpers/FileTypeIconViewHelper.php @@ -20,6 +20,8 @@ * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ + +use PunktDe\PtExtbase\Utility\Files; use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; /** @@ -35,11 +37,19 @@ class FileTypeIconViewHelper extends AbstractTagBasedViewHelper protected $tagName = 'img'; /** - * @var \PunktDe\PtExtbase\Utility\Files - * @inject + * @var Files */ protected $fileUtility; + /** + * @param Files $fileUtility + */ + public function injectFileUtility(Files $fileUtility): void + { + $this->fileUtility = $fileUtility; + } + + /** * @param string $fileExtension * @param string $iconBaseDirectory diff --git a/Classes/ViewHelpers/Javascript/TemplateViewHelper.php b/Classes/ViewHelpers/Javascript/TemplateViewHelper.php index 43c28f93..2102c98d 100644 --- a/Classes/ViewHelpers/Javascript/TemplateViewHelper.php +++ b/Classes/ViewHelpers/Javascript/TemplateViewHelper.php @@ -51,13 +51,6 @@ class TemplateViewHelper extends AbstractViewHelper */ protected $escapeOutput = false; - /** - * @inject - * @var \TYPO3\CMS\Extbase\Service\ExtensionService - */ - protected $extensionService; - - /** * Relative extpath to the extension (eg typo3conf/ext/pt_extbase/) * @@ -95,6 +88,20 @@ class TemplateViewHelper extends AbstractViewHelper protected $arguments = []; + /** + * @var ExtensionService + */ + protected $extensionService; + + /** + * @param ExtensionService $extensionService + */ + public function injectExtensionService(ExtensionService $extensionService): void + { + $this->extensionService = $extensionService; + } + + /** * Initialize ViewHelper *