Completed
Pull Request — develop (#1492)
by
unknown
16:55 queued 12s
created
src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Sniffs\Sniff;
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 
15
-class CharacterBeforePHPOpeningTagSniff implements Sniff
16
-{
15
+class CharacterBeforePHPOpeningTagSniff implements Sniff {
17 16
 
18 17
     /**
19 18
      * List of supported BOM definitions.
@@ -34,8 +33,7 @@  discard block
 block discarded – undo
34 33
      *
35 34
      * @return array
36 35
      */
37
-    public function register()
38
-    {
36
+    public function register() {
39 37
         return [T_OPEN_TAG];
40 38
 
41 39
     }//end register()
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
      *
51 49
      * @return void
52 50
      */
53
-    public function process(File $phpcsFile, $stackPtr)
54
-    {
51
+    public function process(File $phpcsFile, $stackPtr) {
55 52
         $expected = 0;
56 53
         if ($stackPtr > 0) {
57 54
             // Allow a byte-order mark.
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util;
15 15
 
16
-class LowerCaseKeywordSniff implements Sniff
17
-{
16
+class LowerCaseKeywordSniff implements Sniff {
18 17
 
19 18
 
20 19
     /**
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
      *
23 22
      * @return array
24 23
      */
25
-    public function register()
26
-    {
24
+    public function register() {
27 25
         return [
28 26
             T_HALT_COMPILER,
29 27
             T_ABSTRACT,
@@ -109,8 +107,7 @@  discard block
 block discarded – undo
109 107
      *
110 108
      * @return void
111 109
      */
112
-    public function process(File $phpcsFile, $stackPtr)
113
-    {
110
+    public function process(File $phpcsFile, $stackPtr) {
114 111
         $tokens  = $phpcsFile->getTokens();
115 112
         $keyword = $tokens[$stackPtr]['content'];
116 113
         if (strtolower($keyword) !== $keyword) {
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Sniffs\Sniff;
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 
15
-class UpperCaseConstantSniff implements Sniff
16
-{
15
+class UpperCaseConstantSniff implements Sniff {
17 16
 
18 17
 
19 18
     /**
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      *
22 21
      * @return array
23 22
      */
24
-    public function register()
25
-    {
23
+    public function register() {
26 24
         return [
27 25
             T_TRUE,
28 26
             T_FALSE,
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      *
42 40
      * @return void
43 41
      */
44
-    public function process(File $phpcsFile, $stackPtr)
45
-    {
42
+    public function process(File $phpcsFile, $stackPtr) {
46 43
         $tokens   = $phpcsFile->getTokens();
47 44
         $keyword  = $tokens[$stackPtr]['content'];
48 45
         $expected = strtoupper($keyword);
Please login to merge, or discard this patch.
squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
 use PHP_CodeSniffer\Files\File;
15 15
 use PHP_CodeSniffer\Config;
16 16
 
17
-class SyntaxSniff implements Sniff
18
-{
17
+class SyntaxSniff implements Sniff {
19 18
 
20 19
     /**
21 20
      * The path to the PHP version we are checking with.
@@ -30,8 +29,7 @@  discard block
 block discarded – undo
30 29
      *
31 30
      * @return array
32 31
      */
33
-    public function register()
34
-    {
32
+    public function register() {
35 33
         return [T_OPEN_TAG];
36 34
 
37 35
     }//end register()
@@ -46,8 +44,7 @@  discard block
 block discarded – undo
46 44
      *
47 45
      * @return void
48 46
      */
49
-    public function process(File $phpcsFile, $stackPtr)
50
-    {
47
+    public function process(File $phpcsFile, $stackPtr) {
51 48
         if ($this->phpPath === null) {
52 49
             $this->phpPath = Config::getExecutablePath('php');
53 50
         }
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util\Tokens;
15 15
 
16
-class DisallowShortOpenTagSniff implements Sniff
17
-{
16
+class DisallowShortOpenTagSniff implements Sniff {
18 17
 
19 18
 
20 19
     /**
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
      *
23 22
      * @return array
24 23
      */
25
-    public function register()
26
-    {
24
+    public function register() {
27 25
         $targets = [
28 26
             T_OPEN_TAG,
29 27
             T_OPEN_TAG_WITH_ECHO,
@@ -48,8 +46,7 @@  discard block
 block discarded – undo
48 46
      *
49 47
      * @return void
50 48
      */
51
-    public function process(File $phpcsFile, $stackPtr)
52
-    {
49
+    public function process(File $phpcsFile, $stackPtr) {
53 50
         $tokens = $phpcsFile->getTokens();
54 51
         $token  = $tokens[$stackPtr];
55 52
 
@@ -144,8 +141,7 @@  discard block
 block discarded – undo
144 141
      *
145 142
      * @return string
146 143
      */
147
-    protected function getSnippet($content, $start='', $length=40)
148
-    {
144
+    protected function getSnippet($content, $start='', $length=40) {
149 145
         $startPos = 0;
150 146
 
151 147
         if ($start !== '') {
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Sniffs\Sniff;
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 
15
-class SAPIUsageSniff implements Sniff
16
-{
15
+class SAPIUsageSniff implements Sniff {
17 16
 
18 17
 
19 18
     /**
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      *
22 21
      * @return array
23 22
      */
24
-    public function register()
25
-    {
23
+    public function register() {
26 24
         return [T_STRING];
27 25
 
28 26
     }//end register()
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
      *
38 36
      * @return void
39 37
      */
40
-    public function process(File $phpcsFile, $stackPtr)
41
-    {
38
+    public function process(File $phpcsFile, $stackPtr) {
42 39
         $tokens = $phpcsFile->getTokens();
43 40
 
44 41
         $ignore = [
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Sniffs\Sniff;
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 
15
-class BacktickOperatorSniff implements Sniff
16
-{
15
+class BacktickOperatorSniff implements Sniff {
17 16
 
18 17
 
19 18
     /**
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      *
22 21
      * @return array
23 22
      */
24
-    public function register()
25
-    {
23
+    public function register() {
26 24
         return [T_BACKTICK];
27 25
 
28 26
     }//end register()
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
      *
38 36
      * @return void
39 37
      */
40
-    public function process(File $phpcsFile, $stackPtr)
41
-    {
38
+    public function process(File $phpcsFile, $stackPtr) {
42 39
         $error = 'Use of the backtick operator is forbidden';
43 40
         $phpcsFile->addError($error, $stackPtr, 'Found');
44 41
 
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util\Tokens;
15 15
 
16
-class LowerCaseTypeSniff implements Sniff
17
-{
16
+class LowerCaseTypeSniff implements Sniff {
18 17
 
19 18
 
20 19
     /**
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
      *
23 22
      * @return array
24 23
      */
25
-    public function register()
26
-    {
24
+    public function register() {
27 25
         $tokens   = Tokens::$castTokens;
28 26
         $tokens[] = T_FUNCTION;
29 27
         $tokens[] = T_CLOSURE;
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      *
42 40
      * @return void
43 41
      */
44
-    public function process(File $phpcsFile, $stackPtr)
45
-    {
42
+    public function process(File $phpcsFile, $stackPtr) {
46 43
         $tokens = $phpcsFile->getTokens();
47 44
 
48 45
         if (isset(Tokens::$castTokens[$tokens[$stackPtr]['code']]) === true) {
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
 use PHP_CodeSniffer\Files\File;
16 16
 use PHP_CodeSniffer\Config;
17 17
 
18
-class DisallowAlternativePHPTagsSniff implements Sniff
19
-{
18
+class DisallowAlternativePHPTagsSniff implements Sniff {
20 19
 
21 20
     /**
22 21
      * Whether ASP tags are enabled or not.
@@ -38,8 +37,7 @@  discard block
 block discarded – undo
38 37
      *
39 38
      * @return array
40 39
      */
41
-    public function register()
42
-    {
40
+    public function register() {
43 41
         if ($this->phpVersion === null) {
44 42
             $this->phpVersion = Config::getConfigData('php_version');
45 43
             if ($this->phpVersion === null) {
@@ -69,8 +67,7 @@  discard block
 block discarded – undo
69 67
      *
70 68
      * @return void
71 69
      */
72
-    public function process(File $phpcsFile, $stackPtr)
73
-    {
70
+    public function process(File $phpcsFile, $stackPtr) {
74 71
         $tokens  = $phpcsFile->getTokens();
75 72
         $openTag = $tokens[$stackPtr];
76 73
         $content = $openTag['content'];
@@ -170,8 +167,7 @@  discard block
 block discarded – undo
170 167
      *
171 168
      * @return string
172 169
      */
173
-    protected function getSnippet($content, $start='', $length=40)
174
-    {
170
+    protected function getSnippet($content, $start='', $length=40) {
175 171
         $startPos = 0;
176 172
 
177 173
         if ($start !== '') {
@@ -202,8 +198,7 @@  discard block
 block discarded – undo
202 198
      *
203 199
      * @return int|false Pointer to the position in the stack for the closing tag or false if not found.
204 200
      */
205
-    protected function findClosingTag(File $phpcsFile, $tokens, $stackPtr, $content)
206
-    {
201
+    protected function findClosingTag(File $phpcsFile, $tokens, $stackPtr, $content) {
207 202
         $closer = $phpcsFile->findNext(T_CLOSE_TAG, ($stackPtr + 1));
208 203
 
209 204
         if ($closer !== false && $content === trim($tokens[$closer]['content'])) {
@@ -226,8 +221,7 @@  discard block
 block discarded – undo
226 221
      *
227 222
      * @return void
228 223
      */
229
-    protected function addChangeset(File $phpcsFile, $tokens, $openTagPointer, $closeTagPointer, $echo=false)
230
-    {
224
+    protected function addChangeset(File $phpcsFile, $tokens, $openTagPointer, $closeTagPointer, $echo=false) {
231 225
         // Build up the open tag replacement and make sure there's always whitespace behind it.
232 226
         $openReplacement = '<?php';
233 227
         if ($echo === true) {
Please login to merge, or discard this patch.