Completed
Pull Request — develop (#1492)
by
unknown
16:55 queued 12s
created
php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.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 OneClassPerFileSniff implements Sniff
16
-{
15
+class OneClassPerFileSniff 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_CLASS];
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
         $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1));
43 40
         if ($nextClass !== false) {
44 41
             $error = 'Only one class is allowed in a file';
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.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 InlineHTMLSniff implements Sniff
16
-{
15
+class InlineHTMLSniff 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_INLINE_HTML];
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
         // Allow a byte-order mark.
56 53
         $tokens = $phpcsFile->getTokens();
57 54
         foreach ($this->bomDefinitions as $bomName => $expectedBomHex) {
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.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 OneInterfacePerFileSniff implements Sniff
16
-{
15
+class OneInterfacePerFileSniff 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_INTERFACE];
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
         $nextInterface = $phpcsFile->findNext($this->register(), ($stackPtr + 1));
43 40
         if ($nextInterface !== false) {
44 41
             $error = 'Only one interface is allowed in a file';
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
 use PHP_CodeSniffer\Files\File;
18 18
 use PHP_CodeSniffer\Util\Tokens;
19 19
 
20
-class LineLengthSniff implements Sniff
21
-{
20
+class LineLengthSniff implements Sniff {
22 21
 
23 22
     /**
24 23
      * The limit that the length of a line should not exceed.
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
      *
50 49
      * @return array
51 50
      */
52
-    public function register()
53
-    {
51
+    public function register() {
54 52
         return [T_OPEN_TAG];
55 53
 
56 54
     }//end register()
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      *
66 64
      * @return int
67 65
      */
68
-    public function process(File $phpcsFile, $stackPtr)
69
-    {
66
+    public function process(File $phpcsFile, $stackPtr) {
70 67
         $tokens = $phpcsFile->getTokens();
71 68
         for ($i = 1; $i < $phpcsFile->numTokens; $i++) {
72 69
             if ($tokens[$i]['column'] === 1) {
@@ -91,8 +88,7 @@  discard block
 block discarded – undo
91 88
      *
92 89
      * @return null|false
93 90
      */
94
-    protected function checkLineLength($phpcsFile, $tokens, $stackPtr)
95
-    {
91
+    protected function checkLineLength($phpcsFile, $tokens, $stackPtr) {
96 92
         // The passed token is the first on the line.
97 93
         $stackPtr--;
98 94
 
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.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\Sniffs\Sniff;
14 14
 use PHP_CodeSniffer\Files\File;
15 15
 
16
-class ByteOrderMarkSniff implements Sniff
17
-{
16
+class ByteOrderMarkSniff implements Sniff {
18 17
 
19 18
     /**
20 19
      * List of supported BOM definitions.
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
      *
36 35
      * @return array
37 36
      */
38
-    public function register()
39
-    {
37
+    public function register() {
40 38
         return [T_INLINE_HTML];
41 39
 
42 40
     }//end register()
@@ -51,8 +49,7 @@  discard block
 block discarded – undo
51 49
      *
52 50
      * @return void
53 51
      */
54
-    public function process(File $phpcsFile, $stackPtr)
55
-    {
52
+    public function process(File $phpcsFile, $stackPtr) {
56 53
         // The BOM will be the very first token in the file.
57 54
         if ($stackPtr !== 0) {
58 55
             return;
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.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 LineEndingsSniff implements Sniff
16
-{
15
+class LineEndingsSniff implements Sniff {
17 16
 
18 17
     /**
19 18
      * A list of tokenizers this sniff supports.
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
      *
40 39
      * @return array
41 40
      */
42
-    public function register()
43
-    {
41
+    public function register() {
44 42
         return [T_OPEN_TAG];
45 43
 
46 44
     }//end register()
@@ -55,8 +53,7 @@  discard block
 block discarded – undo
55 53
      *
56 54
      * @return int
57 55
      */
58
-    public function process(File $phpcsFile, $stackPtr)
59
-    {
56
+    public function process(File $phpcsFile, $stackPtr) {
60 57
         $found = $phpcsFile->eolChar;
61 58
         $found = str_replace("\n", '\n', $found);
62 59
         $found = str_replace("\r", '\r', $found);
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.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 EndFileNoNewlineSniff implements Sniff
16
-{
15
+class EndFileNoNewlineSniff implements Sniff {
17 16
 
18 17
     /**
19 18
      * A list of tokenizers this sniff supports.
@@ -32,8 +31,7 @@  discard block
 block discarded – undo
32 31
      *
33 32
      * @return array
34 33
      */
35
-    public function register()
36
-    {
34
+    public function register() {
37 35
         return [T_OPEN_TAG];
38 36
 
39 37
     }//end register()
@@ -48,8 +46,7 @@  discard block
 block discarded – undo
48 46
      *
49 47
      * @return int
50 48
      */
51
-    public function process(File $phpcsFile, $stackPtr)
52
-    {
49
+    public function process(File $phpcsFile, $stackPtr) {
53 50
         // Skip to the end of the file.
54 51
         $tokens   = $phpcsFile->getTokens();
55 52
         $stackPtr = ($phpcsFile->numTokens - 1);
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.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 EndFileNewlineSniff implements Sniff
16
-{
15
+class EndFileNewlineSniff implements Sniff {
17 16
 
18 17
     /**
19 18
      * A list of tokenizers this sniff supports.
@@ -32,8 +31,7 @@  discard block
 block discarded – undo
32 31
      *
33 32
      * @return array
34 33
      */
35
-    public function register()
36
-    {
34
+    public function register() {
37 35
         return [T_OPEN_TAG];
38 36
 
39 37
     }//end register()
@@ -48,8 +46,7 @@  discard block
 block discarded – undo
48 46
      *
49 47
      * @return int
50 48
      */
51
-    public function process(File $phpcsFile, $stackPtr)
52
-    {
49
+    public function process(File $phpcsFile, $stackPtr) {
53 50
         // Skip to the end of the file.
54 51
         $tokens   = $phpcsFile->getTokens();
55 52
         $stackPtr = ($phpcsFile->numTokens - 1);
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.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 OneTraitPerFileSniff implements Sniff
16
-{
15
+class OneTraitPerFileSniff 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_TRAIT];
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
         $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1));
43 40
         if ($nextClass !== false) {
44 41
             $error = 'Only one trait is allowed in a file';
Please login to merge, or discard this patch.