* See: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php
*
* @author Tim Duesterhus
- * @license BSD Licence <https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt>
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @category Community Framework
*/
* See: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php
*
* @author Tim Duesterhus
- * @license BSD Licence <https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt>
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @category Community Framework
*/
}
}
+ $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1));
+ $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true);
+ if ($tokens[$next]['code'] === T_USE) {
+ $diff = $tokens[$next]['line'] - $tokens[$stackPtr]['line'] - 1;
+ if ($diff !== 0) {
+ $error = 'There must not be any blank lines between use statements; %s found;';
+ $data = array($diff);
+ $phpcsFile->addError($error, $stackPtr, 'SpaceBetweenUse', $data);
+ }
+ }
+
// Only interested in the last USE statement from here onwards.
$nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1));
if ($nextUse !== false) {
- return;
+ $next = $phpcsFile->findNext(T_WHITESPACE, ($nextUse + 1), null, true);
+ if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS) {
+ return;
+ }
}
$end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1));
}
$error = 'There must be one blank line after the last USE statement; %s found;';
- $data = array($diff);
+ $data = array($diff);
$phpcsFile->addError($error, $stackPtr, 'SpaceAfterLastUse', $data);
}
* See: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php
*
* @author Tim Duesterhus
- * @license BSD Licence <https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt>
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @category Community Framework
*/
<?php
namespace wcf\acp\form;
use wcf\data\style\StyleEditor;
-
use wcf\data\package\Package;
use wcf\data\style\StyleAction;
use wcf\data\template\group\TemplateGroupList;
<?php
namespace wcf\system\cache\builder;
-use wcf\system\Regex;
-
use wcf\data\option\category\OptionCategory;
use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\Regex;
use wcf\system\WCF;
/**
<?php
namespace wcf\system\package;
-use wcf\data\package\Package;
-
use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
use wcf\data\package\installation\queue\PackageInstallationQueueList;
+use wcf\data\package\Package;
use wcf\system\exception\SystemException;
use wcf\system\Callback;
use wcf\system\WCF;