Completed
Pull Request — develop (#1492)
by
unknown
16:55 queued 12s
created
PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  * @package  PHPCompatibility
22 22
  * @author   Juliette Reinders Folmer <[email protected]>
23 23
  */
24
-class NewMagicMethodsSniff extends AbstractNewFeatureSniff
25
-{
24
+class NewMagicMethodsSniff extends AbstractNewFeatureSniff {
26 25
 
27 26
     /**
28 27
      * A list of new magic methods, not considered magic in older versions.
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      *
82 81
      * @return array
83 82
      */
84
-    public function register()
85
-    {
83
+    public function register() {
86 84
         return array(\T_FUNCTION);
87 85
     }
88 86
 
@@ -96,8 +94,7 @@  discard block
 block discarded – undo
96 94
      *
97 95
      * @return void
98 96
      */
99
-    public function process(File $phpcsFile, $stackPtr)
100
-    {
97
+    public function process(File $phpcsFile, $stackPtr) {
101 98
         $functionName   = $phpcsFile->getDeclarationName($stackPtr);
102 99
         $functionNameLc = strtolower($functionName);
103 100
 
@@ -124,8 +121,7 @@  discard block
 block discarded – undo
124 121
      *
125 122
      * @return array Version and other information about the item.
126 123
      */
127
-    public function getItemArray(array $itemInfo)
128
-    {
124
+    public function getItemArray(array $itemInfo) {
129 125
         return $this->newMagicMethods[$itemInfo['nameLc']];
130 126
     }
131 127
 
@@ -135,8 +131,7 @@  discard block
 block discarded – undo
135 131
      *
136 132
      * @return array
137 133
      */
138
-    protected function getNonVersionArrayKeys()
139
-    {
134
+    protected function getNonVersionArrayKeys() {
140 135
         return array('message');
141 136
     }
142 137
 
@@ -149,8 +144,7 @@  discard block
 block discarded – undo
149 144
      *
150 145
      * @return array
151 146
      */
152
-    public function getErrorInfo(array $itemArray, array $itemInfo)
153
-    {
147
+    public function getErrorInfo(array $itemArray, array $itemInfo) {
154 148
         $errorInfo            = parent::getErrorInfo($itemArray, $itemInfo);
155 149
         $errorInfo['error']   = false; // Warning, not error.
156 150
         $errorInfo['message'] = '';
@@ -168,8 +162,7 @@  discard block
 block discarded – undo
168 162
      *
169 163
      * @return string
170 164
      */
171
-    protected function getErrorMsgTemplate()
172
-    {
165
+    protected function getErrorMsgTemplate() {
173 166
         return 'The method %s() was not magical in PHP version %s and earlier. The associated magic functionality will not be invoked.';
174 167
     }
175 168
 
@@ -183,8 +176,7 @@  discard block
 block discarded – undo
183 176
      *
184 177
      * @return string
185 178
      */
186
-    protected function filterErrorMsg($error, array $itemInfo, array $errorInfo)
187
-    {
179
+    protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) {
188 180
         if ($errorInfo['message'] !== '') {
189 181
             $error = $errorInfo['message'];
190 182
         }
Please login to merge, or discard this patch.
Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,16 +24,14 @@  discard block
 block discarded – undo
24 24
  * @package  PHPCompatibility
25 25
  * @author   Koen Eelen <[email protected]>
26 26
  */
27
-class RemovedPHP4StyleConstructorsSniff extends Sniff
28
-{
27
+class RemovedPHP4StyleConstructorsSniff extends Sniff {
29 28
 
30 29
     /**
31 30
      * Returns an array of tokens this test wants to listen for.
32 31
      *
33 32
      * @return array
34 33
      */
35
-    public function register()
36
-    {
34
+    public function register() {
37 35
         return array(
38 36
             \T_CLASS,
39 37
             \T_INTERFACE,
@@ -49,8 +47,7 @@  discard block
 block discarded – undo
49 47
      *
50 48
      * @return void
51 49
      */
52
-    public function process(File $phpcsFile, $stackPtr)
53
-    {
50
+    public function process(File $phpcsFile, $stackPtr) {
54 51
         if ($this->supportsAbove('7.0') === false) {
55 52
             return;
56 53
         }
Please login to merge, or discard this patch.
Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,12 @@  discard block
 block discarded – undo
34 34
  * @package  PHPCompatibility
35 35
  * @author   Juliette Reinders Folmer <[email protected]>
36 36
  */
37
-class ReservedFunctionNamesSniff extends PHPCS_CamelCapsFunctionNameSniff
38
-{
37
+class ReservedFunctionNamesSniff extends PHPCS_CamelCapsFunctionNameSniff {
39 38
 
40 39
     /**
41 40
      * Overload the constructor to work round various PHPCS cross-version compatibility issues.
42 41
      */
43
-    public function __construct()
44
-    {
42
+    public function __construct() {
45 43
         $scopeTokens = array(\T_CLASS, \T_INTERFACE, \T_TRAIT);
46 44
         if (\defined('T_ANON_CLASS')) {
47 45
             $scopeTokens[] = \T_ANON_CLASS;
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      *
66 64
      * @return void
67 65
      */
68
-    protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope)
69
-    {
66
+    protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) {
70 67
         $tokens = $phpcsFile->getTokens();
71 68
 
72 69
         /*
@@ -120,8 +117,7 @@  discard block
 block discarded – undo
120 117
      *
121 118
      * @return void
122 119
      */
123
-    protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
124
-    {
120
+    protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) {
125 121
         $functionName = $phpcsFile->getDeclarationName($stackPtr);
126 122
         if ($functionName === null) {
127 123
             // Ignore closures.
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  * @package  PHPCompatibility
27 27
  * @author   Juliette Reinders Folmer <[email protected]>
28 28
  */
29
-class NewNegativeStringOffsetSniff extends AbstractFunctionCallParameterSniff
30
-{
29
+class NewNegativeStringOffsetSniff extends AbstractFunctionCallParameterSniff {
31 30
 
32 31
     /**
33 32
      * Functions to check for.
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      *
82 81
      * @return bool
83 82
      */
84
-    protected function bowOutEarly()
85
-    {
83
+    protected function bowOutEarly() {
86 84
         return ($this->supportsBelow('7.0') === false);
87 85
     }
88 86
 
@@ -97,8 +95,7 @@  discard block
 block discarded – undo
97 95
      * @return int|void Integer stack pointer to skip forward or void to continue
98 96
      *                  normal file processing.
99 97
      */
100
-    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)
101
-    {
98
+    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) {
102 99
         $functionLC = strtolower($functionName);
103 100
         foreach ($this->targetFunctions[$functionLC] as $pos => $name) {
104 101
             if (isset($parameters[$pos]) === false) {
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  * @package  PHPCompatibility
22 22
  * @author   Juliette Reinders Folmer <[email protected]>
23 23
  */
24
-class NewPCREModifiersSniff extends RemovedPCREModifiersSniff
25
-{
24
+class NewPCREModifiersSniff extends RemovedPCREModifiersSniff {
26 25
 
27 26
     /**
28 27
      * Functions to check for.
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
      *
63 62
      * @return bool
64 63
      */
65
-    protected function bowOutEarly()
66
-    {
64
+    protected function bowOutEarly() {
67 65
         // Version used here should be the highest version from the `$newModifiers` array,
68 66
         // i.e. the last PHP version in which a new modifier was introduced.
69 67
         return ($this->supportsBelow('7.2') === false);
@@ -81,8 +79,7 @@  discard block
 block discarded – undo
81 79
      *
82 80
      * @return void
83 81
      */
84
-    protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers)
85
-    {
82
+    protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) {
86 83
         $error = 'The PCRE regex modifier "%s" is not present in PHP version %s or earlier';
87 84
 
88 85
         foreach ($this->newModifiers as $modifier => $versionArray) {
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  * @package  PHPCompatibility
27 27
  * @author   Juliette Reinders Folmer <[email protected]>
28 28
  */
29
-class RemovedNonCryptoHashSniff extends AbstractFunctionCallParameterSniff
30
-{
29
+class RemovedNonCryptoHashSniff extends AbstractFunctionCallParameterSniff {
31 30
 
32 31
     /**
33 32
      * Functions to check for.
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
      *
64 63
      * @return bool
65 64
      */
66
-    protected function bowOutEarly()
67
-    {
65
+    protected function bowOutEarly() {
68 66
         return ($this->supportsAbove('7.2') === false);
69 67
     }
70 68
 
@@ -80,8 +78,7 @@  discard block
 block discarded – undo
80 78
      * @return int|void Integer stack pointer to skip forward or void to continue
81 79
      *                  normal file processing.
82 80
      */
83
-    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)
84
-    {
81
+    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) {
85 82
         if (isset($parameters[1]) === false) {
86 83
             return;
87 84
         }
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
  * @author    Wim Godden <[email protected]>
28 28
  * @copyright 2012 Cu.be Solutions bvba
29 29
  */
30
-class RemovedHashAlgorithmsSniff extends AbstractRemovedFeatureSniff
31
-{
30
+class RemovedHashAlgorithmsSniff extends AbstractRemovedFeatureSniff {
32 31
 
33 32
     /**
34 33
      * A list of removed hash algorithms, which were present in older versions.
@@ -52,8 +51,7 @@  discard block
 block discarded – undo
52 51
      *
53 52
      * @return array
54 53
      */
55
-    public function register()
56
-    {
54
+    public function register() {
57 55
         return array(\T_STRING);
58 56
     }
59 57
 
@@ -67,8 +65,7 @@  discard block
 block discarded – undo
67 65
      *
68 66
      * @return void
69 67
      */
70
-    public function process(File $phpcsFile, $stackPtr)
71
-    {
68
+    public function process(File $phpcsFile, $stackPtr) {
72 69
         $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr);
73 70
         if (empty($algo) || \is_string($algo) === false) {
74 71
             return;
@@ -93,8 +90,7 @@  discard block
 block discarded – undo
93 90
      *
94 91
      * @return array Version and other information about the item.
95 92
      */
96
-    public function getItemArray(array $itemInfo)
97
-    {
93
+    public function getItemArray(array $itemInfo) {
98 94
         return $this->removedAlgorithms[$itemInfo['name']];
99 95
     }
100 96
 
@@ -104,8 +100,7 @@  discard block
 block discarded – undo
104 100
      *
105 101
      * @return string
106 102
      */
107
-    protected function getErrorMsgTemplate()
108
-    {
103
+    protected function getErrorMsgTemplate() {
109 104
         return 'The %s hash algorithm is ';
110 105
     }
111 106
 }
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  * @package  PHPCompatibility
22 22
  * @author   Juliette Reinders Folmer <[email protected]>
23 23
  */
24
-class NewArrayReduceInitialTypeSniff extends AbstractFunctionCallParameterSniff
25
-{
24
+class NewArrayReduceInitialTypeSniff extends AbstractFunctionCallParameterSniff {
26 25
 
27 26
     /**
28 27
      * Functions to check for.
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
      *
55 54
      * @return bool
56 55
      */
57
-    protected function bowOutEarly()
58
-    {
56
+    protected function bowOutEarly() {
59 57
         return ($this->supportsBelow('5.2') === false);
60 58
     }
61 59
 
@@ -71,8 +69,7 @@  discard block
 block discarded – undo
71 69
      * @return int|void Integer stack pointer to skip forward or void to continue
72 70
      *                  normal file processing.
73 71
      */
74
-    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)
75
-    {
72
+    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) {
76 73
         if (isset($parameters[3]) === false) {
77 74
             return;
78 75
         }
Please login to merge, or discard this patch.
PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  * @package  PHPCompatibility
22 22
  * @author   Juliette Reinders Folmer <[email protected]>
23 23
  */
24
-class NewPackFormatSniff extends AbstractFunctionCallParameterSniff
25
-{
24
+class NewPackFormatSniff extends AbstractFunctionCallParameterSniff {
26 25
 
27 26
     /**
28 27
      * Functions to check for.
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
      *
60 59
      * @return bool
61 60
      */
62
-    protected function bowOutEarly()
63
-    {
61
+    protected function bowOutEarly() {
64 62
         return ($this->supportsBelow('7.1') === false);
65 63
     }
66 64
 
@@ -76,8 +74,7 @@  discard block
 block discarded – undo
76 74
      * @return int|void Integer stack pointer to skip forward or void to continue
77 75
      *                  normal file processing.
78 76
      */
79
-    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)
80
-    {
77
+    public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) {
81 78
         if (isset($parameters[1]) === false) {
82 79
             return;
83 80
         }
Please login to merge, or discard this patch.