Skip to content

Commit 3487e2f

Browse files
oliverkleehelhum
authored andcommitted
[CLEANUP] Code autoformatting (#29)
Also move and @var annotation to directly before the creation of the variable allow php-cs-fixer to recognize it as a documentation comment.
1 parent 7821162 commit 3487e2f

10 files changed

Lines changed: 28 additions & 14 deletions

Classes/Configuration/RecordRenderingConfigurationBuilder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(RenderingContext $renderingContext)
3737
* @param string $contextRecord
3838
*
3939
* @return string[]
40+
*
4041
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
4142
*/
4243
public function configurationFor($extensionName, $pluginName, $contextRecord = 'currentPage')
@@ -46,7 +47,7 @@ public function configurationFor($extensionName, $pluginName, $contextRecord = '
4647
$renderingPath = $this->resolveRenderingPath($pluginSignature);
4748
return array(
4849
'record' => $tableName . '_' . $uid,
49-
'path' => $renderingPath
50+
'path' => $renderingPath,
5051
);
5152
}
5253

@@ -102,16 +103,19 @@ protected function buildPluginSignature($extensionName, $pluginName)
102103

103104
/**
104105
* @param string $pluginSignature
106+
*
105107
* @return string
108+
*
106109
* @throws ConfigurationBuildingException
107110
*/
108111
protected function resolveRenderingPath($pluginSignature)
109112
{
110113
$typoScriptRenderingSetup = $this->renderingContext->getFrontendController()->tmpl->setup['tt_content.'];
111114
if (isset($typoScriptRenderingSetup[$pluginSignature . '.']['20'])) {
112115
return sprintf('tt_content.%s.20', $pluginSignature);
113-
} elseif(isset($typoScriptRenderingSetup['list.']['20.'][$pluginSignature])) {
116+
} elseif (isset($typoScriptRenderingSetup['list.']['20.'][$pluginSignature])) {
114117
return sprintf('tt_content.list.20.%s', $pluginSignature);
115118
}
116119
throw new ConfigurationBuildingException(sprintf('Could not determine rendering location for plugin signature "%s"', $pluginSignature), 1466779430);
117-
}}
120+
}
121+
}

Classes/Core/FrontendRenderingProvisioner.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/**
2020
* Class FrontendRenderingProvisioner
2121
* Initializes TYPO3 TypoScriptRendering to be prepared for rendering
22+
*
2223
* @see \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit()
2324
* This is a try to only initialize a basic set as not everything in pagegenInit() makes sense in our case.
2425
* But it might well be that it'd be better to just use the (ugly) API instead.

Classes/RenderingDispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class RenderingDispatcher
4444

4545
/**
4646
* @param RequestBuilder $requestBuilder
47-
*
4847
* @param string[] $renderer
4948
*/
5049
public function __construct(RequestBuilder $requestBuilder = null, array $renderer = null)
@@ -106,16 +105,17 @@ protected function ensureRequiredEnvironment()
106105
*/
107106
protected function resolveRenderer(Request $request)
108107
{
109-
/** @var RenderingInterface $renderer */
110108
if ($request->hasArgument('renderer') && isset($this->renderer[$request->getArgument('renderer')])) {
111109
$rendererClassName = $this->renderer[$request->getArgument('renderer')];
110+
/** @var RenderingInterface $renderer */
112111
$renderer = new $rendererClassName();
113112
if ($renderer->canRender($request)) {
114113
return $renderer;
115114
}
116115
}
117116

118117
foreach ($this->renderer as $rendererClassName) {
118+
/** @var RenderingInterface $renderer */
119119
$renderer = new $rendererClassName();
120120
if ($renderer->canRender($request)) {
121121
return $renderer;

Classes/ViewHelpers/Uri/AjaxActionViewHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class AjaxActionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractView
5555
* @param string $contextRecord The record that the rendering should depend upon. e.g. current (default: record is fetched from current Extbase plugin), tt_content:12 (tt_content record with uid 12), pages:15 (pages record with uid 15), 'currentPage' record of current page
5656
*
5757
* @return string Rendered link
58+
*
5859
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
5960
*/
6061
public function render($action = null, array $arguments = array(), $controller = null, $extensionName = null, $pluginName = null, $pageUid = null, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = array(), $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = null, $contextRecord = 'current')
@@ -100,6 +101,7 @@ public function render($action = null, array $arguments = array(), $controller =
100101
* @param string $contextRecord
101102
*
102103
* @return string[]
104+
*
103105
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
104106
*/
105107
public function buildTypoScriptRenderingConfiguration($extensionName, $pluginName, $contextRecord)

Classes/ViewHelpers/Widget/LinkViewHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
2626
*/
2727
protected $tagName = 'a';
2828

29-
3029
/**
3130
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManager
3231
* @inject
@@ -37,6 +36,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
3736
* Initialize arguments
3837
*
3938
* @return void
39+
*
4040
* @api
4141
*/
4242
public function initializeArguments()
@@ -62,6 +62,7 @@ public function initializeArguments()
6262
* @param string $contextRecord The record that the rendering should depend upon. e.g. current (default: record is fetched from current Extbase plugin), tt_content:12 (tt_content record with uid 12), pages:15 (pages record with uid 15), 'currentPage' record of current page
6363
*
6464
* @return string The rendered link
65+
*
6566
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
6667
*/
6768
public function render($pluginName, $extensionName, $action = null, array $arguments = array(), $section = '', $format = '', $ajax = true, $contextRecord = 'current')
@@ -80,6 +81,7 @@ public function render($pluginName, $extensionName, $action = null, array $argum
8081
* Gets the URI for an Ajax Request.
8182
*
8283
* @return string the Ajax URI
84+
*
8385
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
8486
*/
8587
protected function getAjaxUri()
@@ -160,6 +162,7 @@ protected function getWidgetUri()
160162
* @param string $contextRecord
161163
*
162164
* @return string[]
165+
*
163166
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
164167
*/
165168
public function buildTypoScriptRenderingConfiguration($extensionName, $pluginName, $contextRecord)

Classes/ViewHelpers/Widget/UriViewHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class UriViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
3131
* Initialize arguments
3232
*
3333
* @return void
34+
*
3435
* @api
3536
*/
3637
public function initializeArguments()
@@ -51,6 +52,7 @@ public function initializeArguments()
5152
* @param string $contextRecord The record that the rendering should depend upon. e.g. current (default: record is fetched from current Extbase plugin), tt_content:12 (tt_content record with uid 12), pages:15 (pages record with uid 15), 'currentPage' record of current page
5253
*
5354
* @return string The rendered link
55+
*
5456
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
5557
*/
5658
public function render($pluginName, $extensionName, $action = null, array $arguments = array(), $section = '', $format = '', $ajax = true, $contextRecord = 'current')
@@ -66,6 +68,7 @@ public function render($pluginName, $extensionName, $action = null, array $argum
6668
* Get the URI for an Ajax Request.
6769
*
6870
* @return string the Ajax URI
71+
*
6972
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
7073
*/
7174
protected function getAjaxUri()
@@ -146,6 +149,7 @@ protected function getWidgetUri()
146149
* @param string $contextRecord
147150
*
148151
* @return string[]
152+
*
149153
* @throws \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
150154
*/
151155
public function buildTypoScriptRenderingConfiguration($extensionName, $pluginName, $contextRecord)

Tests/Functional/AbstractRenderingTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function setUpFrontendRootPage($pageId, array $typoScriptFiles = array
6565
{
6666
$page = array(
6767
'uid' => $pageId,
68-
'title' => 'root'
68+
'title' => 'root',
6969
);
7070
$this->getDatabaseConnection()->exec_INSERTquery('pages', $page);
7171
parent::setUpFrontendRootPage($pageId, array('EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.ts'));

Tests/Unit/Configuration/RecordRenderingConfigurationBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ protected function setUp()
4646
'20.' => array(
4747
'news_pi1' => 'USER',
4848
'news_pi1.' => array(),
49-
)
49+
),
5050
),
5151
'news_pi2.' => array(
5252
'20' => 'USER',
53-
'20.' => array()
54-
)
55-
)
53+
'20.' => array(),
54+
),
55+
),
5656
);
5757
}
5858

Tests/Unit/Renderer/RecordRendererTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function configurationDataProvider()
8787
'root page' => array(
8888
array('path' => ''),
8989
array('dontCheckPid' => '1', 'source' => 'pages_1', 'tables' => 'pages'),
90-
'1'
90+
'1',
9191
),
9292
);
9393
}
@@ -111,7 +111,7 @@ public function configurationIsGeneratedCorrectlyFromRequest(array $requestArgum
111111
array(
112112
'uid' => '1',
113113
'pid' => '0',
114-
)
114+
),
115115
)
116116
);
117117
$tsfeMock->id = $pageId;

ext_localconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['typoscript_rendering'] = array();
99
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['typoscript_rendering']['renderClasses'] = array(
10-
'record' => 'Helhum\\TyposcriptRendering\\Renderer\\RecordRenderer'
10+
'record' => 'Helhum\\TyposcriptRendering\\Renderer\\RecordRenderer',
1111
);
1212

1313
}, $_EXTKEY);

0 commit comments

Comments
 (0)