11<?php
2- /*
3- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14- *
15- * This software consists of voluntary contributions made by many individuals
16- * and is licensed under the MIT license. For more information, see
17- * <http://www.doctrine-project.org>.
18- */
192
203declare (strict_types=1 );
214
@@ -39,9 +22,9 @@ final class ControlStructureSniff implements Sniff
3922 /**
4023 * Returns an array of tokens this test wants to listen for.
4124 *
42- * @return array
25+ * @return int[]
4326 */
44- public function register ()
27+ public function register () : array
4528 {
4629 return [
4730 \T_IF ,
@@ -57,7 +40,11 @@ public function register()
5740 ];
5841 }
5942
60- public function process (File $ phpcsFile , $ stackPtr )
43+ /**
44+ * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
45+ * @param int $stackPtr
46+ */
47+ public function process (File $ phpcsFile , $ stackPtr ) : void
6148 {
6249 $ tokens = $ phpcsFile ->getTokens ();
6350
@@ -72,6 +59,9 @@ public function process(File $phpcsFile, $stackPtr)
7259 $ this ->validateParenthesisCloser ($ phpcsFile , $ tokens , $ stackPtr , $ openerPosition , $ closerPosition );
7360 }
7461
62+ /**
63+ * @param mixed[] $tokens
64+ */
7565 private function validateParenthesisOpener (File $ file , array $ tokens , int $ position , int $ openerPosition ) : void
7666 {
7767 $ nextTokenPosition = $ openerPosition + 1 ;
@@ -100,6 +90,9 @@ private function validateParenthesisOpener(File $file, array $tokens, int $posit
10090 $ file ->fixer ->replaceToken ($ nextTokenPosition , '' );
10191 }
10292
93+ /**
94+ * @param mixed[][] $tokens
95+ */
10396 private function validateParenthesisCloser (
10497 File $ file ,
10598 array $ tokens ,
0 commit comments