Skip to content

Commit

Permalink
[TASK] More Cleanups (#1119)
Browse files Browse the repository at this point in the history
* [TASK] Remove superfluous statement

* [TASK] Cleanup invalid method parameters

* [TASK] Import RenderingContextInterface

* [TASK] Import FQCN

* [TASK] Fix Doc-comments

* [TASK] Remove unused imports
  • Loading branch information
cedricziel authored and NamelessCoder committed Sep 14, 2016
1 parent b4bd307 commit 495f2a2
Show file tree
Hide file tree
Showing 28 changed files with 22 additions and 37 deletions.
5 changes: 4 additions & 1 deletion Classes/Traits/ArrayConsumingViewHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ protected function getArgumentFromArgumentsOrTagContentAndConvertToArray($argume
* Override of VhsViewHelperTrait equivalent. Does what
* that function does, but also ensures an array return.
*
* @param string $argumentName
* @param array $arguments
* @param string $argumentName
* @param \Closure $renderChildrenClosure
*
* @return mixed
*/
protected function getArgumentFromArgumentsOrTagContentAndConvertToArrayStatic(
Expand Down
6 changes: 4 additions & 2 deletions Classes/Traits/ConditionViewHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;

/**
* This trait can be used by viewhelpers that generate image tags
* to add srcsets based to the imagetag for better responsiveness
Expand Down Expand Up @@ -41,13 +43,13 @@ public function render()
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
static public function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
RenderingContextInterface $renderingContext
) {
$hasEvaluated = true;
if (static::evaluateCondition($arguments)) {
Expand Down
7 changes: 5 additions & 2 deletions Classes/Traits/PageRendererTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* Class PageRendererTrait
*
Expand All @@ -21,10 +24,10 @@ trait PageRendererTrait
/**
* Provides a shared (singleton) instance of PageRenderer
*
* @return \TYPO3\CMS\Core\Page\PageRenderer
* @return PageRenderer
*/
protected static function getPageRenderer()
{
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
return GeneralUtility::makeInstance(PageRenderer::class);
}
}
1 change: 0 additions & 1 deletion Classes/Traits/SourceSetViewHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use FluidTYPO3\Vhs\Utility\FrontendSimulationUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;

/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
Expand Down
5 changes: 4 additions & 1 deletion Classes/Traits/TemplateVariableViewHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ protected function registerAsArgument()
}

/**
* @param string $variable
*
* @return mixed
*/
protected function renderChildrenWithVariableOrReturnInput($variable = null)
Expand All @@ -67,6 +69,8 @@ protected function renderChildrenWithVariableOrReturnInput($variable = null)
}

/**
* @param mixed $variable
* @param string $as
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @param \Closure $renderChildrenClosure
* @return mixed
Expand Down Expand Up @@ -133,7 +137,6 @@ protected static function renderChildrenWithVariablesStatic(
/**
* @param array $variables
* @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer
* @param \Closure $renderChildrenClosure
* @return array
*/
private static function backupVariables(array $variables, $templateVariableContainer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface;
use TYPO3\CMS\Extbase\Reflection\ReflectionService;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
use FluidTYPO3\Vhs\Traits\ConditionViewHelperTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function initializeArguments()
protected static function evaluateCondition($arguments = null)
{
return false !== self::assertHaystackHasNeedle($arguments['haystack'], $arguments['needle'], $arguments);
;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions Classes/ViewHelpers/Content/Random/GetViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* LICENSE.md file that was distributed with this source code.
*/

use FluidTYPO3\Vhs\ViewHelpers\Content\Random\RenderViewHelper;

/**
* ViewHelper for fetching a random content element in Fluid page templates.
*/
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Format/ReplaceViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ReplaceViewHelper extends AbstractViewHelper
* @param string $content
* @param string $replacement
* @param integer $count
* @param boolean $caseSensitve
* @param boolean $caseSensitive
* @return string
*/
public function render($substring, $content = null, $replacement = '', $count = null, $caseSensitive = true)
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/ColumnViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* ### Iterator Column Extraction ViewHelper
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/PopViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* Pops the last value off $subject (but does not change $subject itself as array_pop would).
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/PushViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* Adds one variable to the end of the array and returns the result.
Expand Down
2 changes: 0 additions & 2 deletions Classes/ViewHelpers/Iterator/RangeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
* LICENSE.md file that was distributed with this source code.
*/

use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* ### Iterator Range ViewHelper
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/ReverseViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* ### Iterator Reversal ViewHelper
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/ShiftViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* Shifts the first value off $subject (but does not change $subject itself as array_shift would).
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/SliceViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* Slice an Iterator by $start and $length.
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/UniqueViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* ### Iterator Unique Values ViewHelper
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Iterator/ValuesViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* Gets values from an iterator, removing current keys (if any exist).
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/LViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;

/**
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Media/ExistsViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;

/**
* File/Directory Exists Condition ViewHelper.
Expand Down
2 changes: 0 additions & 2 deletions Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/

use FluidTYPO3\Vhs\ViewHelpers\Media\AbstractMediaViewHelper;
use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
use TYPO3\CMS\Core\Utility\CommandUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Media/PictureViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
use TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder;
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use FluidTYPO3\Vhs\Traits\TagViewHelperTrait;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Page\PageRepository;

/**
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Page/InfoViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use FluidTYPO3\Vhs\Service\PageService;
use FluidTYPO3\Vhs\Traits\DefaultRenderMethodViewHelperTrait;
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
Expand Down
6 changes: 3 additions & 3 deletions Classes/ViewHelpers/Page/LanguageMenuViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public function render()
// to set the tagName we should call initialize()
$this->initialize();

$this->languageMenu = $this->parseLanguageMenu($this->arguments['order'], $this->arguments['labelOverwrite']);
$this->languageMenu = $this->parseLanguageMenu();
$this->templateVariableContainer->add($this->arguments['as'], $this->languageMenu);
$content = $this->renderChildren();
$this->templateVariableContainer->remove($this->arguments['as']);
if (0 === strlen(trim($content))) {
$content = $this->autoRender($this->languageMenu);
$content = $this->autoRender();
}
return $content;
}
Expand Down Expand Up @@ -320,7 +320,7 @@ protected function parseLanguageMenu()
foreach ($languageMenu as $key => $value) {
$current = $GLOBALS['TSFE']->sys_language_uid === (integer) $key ? 1 : 0;
$inactive = $pageArray[$key] || (integer) $key === $this->defaultLangUid ? 0 : 1;
$url = $this->getLanguageUrl($key, $inactive);
$url = $this->getLanguageUrl($key);
if (true === empty($url)) {
$url = GeneralUtility::getIndpEnv('REQUEST_URI');
}
Expand Down
2 changes: 0 additions & 2 deletions Classes/ViewHelpers/Uri/GravatarViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@


use FluidTYPO3\Vhs\Traits\DefaultRenderMethodViewHelperTrait;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;

/**
* ### ExtConf ViewHelper
Expand Down Expand Up @@ -55,7 +54,7 @@ public function initializeArguments()

/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
Expand Down

0 comments on commit 495f2a2

Please sign in to comment.