PHP 8.2.31
Preview: DisallowInlineIfSniff.php Size: 1.34 KB
//opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php

<?php
/**
 * Stops inline IF statements from being used.
 *
 * @author    Greg Sherwood <gsherwood@squiz.net>
 * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
 * @license   https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
 */

namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP;

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;

class DisallowInlineIfSniff implements Sniff
{

    /**
     * A list of tokenizers this sniff supports.
     *
     * @var array
     */
    public $supportedTokenizers = [
        'PHP',
        'JS',
    ];


    /**
     * Returns an array of tokens this test wants to listen for.
     *
     * @return array<int|string>
     */
    public function register()
    {
        return [T_INLINE_THEN];

    }//end register()


    /**
     * Processes this test, when one of its tokens is encountered.
     *
     * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
     * @param int                         $stackPtr  The position of the current token
     *                                               in the stack passed in $tokens.
     *
     * @return void
     */
    public function process(File $phpcsFile, $stackPtr)
    {
        $phpcsFile->addError('Inline IF statements are not allowed', $stackPtr, 'Found');

    }//end process()


}//end class

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
9.26 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.74 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
3.51 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.34 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
6.99 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
3.57 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1013 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
22.87 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.18 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.45 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.31 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.08 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
5.17 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
11.59 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).