PHP Classes

File: vendor/php-parallel-lint/php-parallel-lint/bin/skip-linting.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Nolimitbuzz WP Theme   vendor/php-parallel-lint/php-parallel-lint/bin/skip-linting.php   Download  
File: vendor/php-parallel-lint/php-parallel-lint/bin/skip-linting.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Nolimitbuzz WP Theme
WordPress theme to used as start of new themes
Author: By
Last change:
Date: 1 month ago
Size: 629 bytes
 

Contents

Class file image Download
<?php
$stdin
= fopen('php://stdin', 'r');
$input = stream_get_contents($stdin);
fclose($stdin);

foreach (
explode(PHP_EOL, $input) as $file) {
   
$skip = false;
   
$f = @fopen($file, 'r');
    if (
$f) {
       
$firstLine = fgets($f);

       
// ignore shebang line
       
if (strpos($firstLine, '#!') === 0) {
           
$firstLine = fgets($f);
        }

        @
fclose($f);

        if (
preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
           
$skip = version_compare(PHP_VERSION, $m[2], $m[1]) === false;
        }
    }

    echo
$file . ';' . ($skip ? '1' : '0') . PHP_EOL;
}