Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix all CS problems

  • Loading branch information...
commit 9e7b27667f4154fa22c675a78bc3894d60519488 1 parent 1a5f72b
Christian Weiske cweiske authored
8 HTML/Template/PHPLIB/Generator.php
View
@@ -34,9 +34,9 @@ class HTML_Template_PHPLIB_Generator
*
* @return string PHP code
*/
- function getCodeBlockDefinition($strFile, $strTplName = null,
- $strPrefix = '$tpl')
- {
+ function getCodeBlockDefinition(
+ $strFile, $strTplName = null, $strPrefix = '$tpl'
+ ) {
$arBlocks = HTML_Template_PHPLIB_Generator::getBlocks(
HTML_Template_PHPLIB_Helper::getLines($strFile)
);
@@ -83,7 +83,7 @@ function getCodeBlock($arBlocks, $strTplName, $strPrefix = '$tpl')
foreach ($arBlocks as $arBlock) {
if (count($arBlock['sub']) > 0) {
$code .= HTML_Template_PHPLIB_Generator::getCodeBlock(
- $arBlock['sub'], $strTplName, $strPrefix
+ $arBlock['sub'], $strTplName, $strPrefix
);
}
$code .= $strPrefix . "->setBlock('" . $strTplName . "','"
4 HTML/Template/PHPLIB/Tool.php
View
@@ -134,7 +134,7 @@ function doValidate($args)
$this->dieHard("No template files to validate\n", 1);
}
- require_once 'HTML/Template/PHPLIB/Validator.php';
+ include_once 'HTML/Template/PHPLIB/Validator.php';
$nError = 0;
foreach ($args as $file) {
if (file_exists($file)) {
@@ -177,7 +177,7 @@ function doGenerate($args)
}
$strFile = $args[0];
- require_once 'HTML/Template/PHPLIB/Generator.php';
+ include_once 'HTML/Template/PHPLIB/Generator.php';
$strCode = HTML_Template_PHPLIB_Generator::getCodeBlockDefinition(
$strFile
);
39 HTML/Template/PHPLIB/Validator.php
View
@@ -89,12 +89,14 @@ function checkBlockDefinitions($arLines)
$strType = $arMatches[2];
$strBlockName = $arMatches[4];
- $strArName = $strType == 'BEGIN' ? 'arBlockOpen' : 'arBlockClose';
+ $strArName = $strType == 'BEGIN'
+ ? 'arBlockOpen' : 'arBlockClose';
if ($arMatches[1] == '') {
//space missing between <!-- and BEGIN|END
$arErrors[] = array(
'short' => 'MISSING_SPACE',
- 'message' => 'Space missing between HTML comment opening marker and ' . $strType,
+ 'message' => 'Space missing between HTML comment'
+ . ' opening marker and ' . $strType,
'line' => $nLine,
'code' => $strLine
);
@@ -103,7 +105,8 @@ function checkBlockDefinitions($arLines)
//space missing between BEGIN and block name
$arErrors[] = array(
'short' => 'MISSING_SPACE',
- 'message' => 'Space missing between ' . $strType . ' and block name',
+ 'message' => 'Space missing between ' . $strType
+ . ' and block name',
'line' => $nLine,
'code' => $strLine
);
@@ -129,7 +132,8 @@ function checkBlockDefinitions($arLines)
//space missing between block name and -->
$arErrors[] = array(
'short' => 'MISSING_SPACE',
- 'message' => 'Space missing between block name and HTML comment end marker',
+ 'message' => 'Space missing between block name and'
+ . ' HTML comment end marker',
'line' => $nLine,
'code' => $strLine
);
@@ -146,7 +150,8 @@ function checkBlockDefinitions($arLines)
$arErrors[] = array(
'short' => 'DUPLICATE_BLOCK',
'message' => 'Block "' . $strBlockName . '" is opened'
- . ' several times on lines ' . implode(', ', $arLines),
+ . ' several times on lines '
+ . implode(', ', $arLines),
'line' => $arLines[0],
'code' => $strBlockName
);
@@ -165,7 +170,8 @@ function checkBlockDefinitions($arLines)
$arErrors[] = array(
'short' => 'DUPLICATE_BLOCK',
'message' => 'Block "' . $strBlockName . '" is closed'
- . ' several times on lines ' . implode(', ', $arLines),
+ . ' several times on lines '
+ . implode(', ', $arLines),
'line' => $arLines[0],
'code' => $strBlockName
);
@@ -173,7 +179,8 @@ function checkBlockDefinitions($arLines)
if (!isset($arBlockOpen[$strBlockName])) {
$arErrors[] = array(
'short' => 'UNFINISHED_BLOCK',
- 'message' => 'Block "' . $strBlockName . '" is closed but not opened.',
+ 'message' => 'Block "' . $strBlockName . '" is closed'
+ . ' but not opened.',
'line' => $arLines[0],
'code' => $strBlockName
);
@@ -186,10 +193,12 @@ function checkBlockDefinitions($arLines)
*/
foreach ($arBlockOpen as $strBlockName => $arLines) {
if (isset($arBlockClose[$strBlockName])
- && $arLines[0] > $arBlockClose[$strBlockName][0]) {
+ && $arLines[0] > $arBlockClose[$strBlockName][0]
+ ) {
$arErrors[] = array(
'short' => 'WRONG_ORDER',
- 'message' => 'BEGIN of block "' . $strBlockName . '" defined after END.',
+ 'message' => 'BEGIN of block "' . $strBlockName . '"'
+ . ' defined after END.',
'line' => $arLines[0],
'code' => $strBlockName
);
@@ -217,8 +226,10 @@ function checkBlockDefinitions($arLines)
} else {
$arErrors[] = array(
'short' => 'WRONG_NESTING',
- 'message' => 'Block "' . $arBlock['name'] . '" closed,'
- . ' but "' . $strStackName . '" is still open.',
+ 'message' => 'Block "' . $arBlock['name']
+ . '" closed,'
+ . ' but "' . $strStackName
+ . '" is still open.',
'line' => $arBlock['line'],
'code' => $arBlock['code']
);
@@ -269,14 +280,16 @@ function checkVariables($arLines)
if ($chOpen != '{') {
$arErrors[] = array(
'short' => 'OPENING_BRACE_MISSING',
- 'message' => 'Variable "' . $strVariable . '" misses opening brace.',
+ 'message' => 'Variable "' . $strVariable
+ . '" misses opening brace.',
'line' => $nLine,
'code' => $strFull
);
} else if ($chClose != '}') {
$arErrors[] = array(
'short' => 'CLOSING_BRACE_MISSING',
- 'message' => 'Variable "' . $strVariable . '" misses closing brace.',
+ 'message' => 'Variable "' . $strVariable
+ . '" misses closing brace.',
'line' => $nLine,
'code' => $strFull
);
Please sign in to comment.
Something went wrong with that request. Please try again.