Nelmio\Alice\Parser\Chainable\PhpParser::canParse PHP Method

canParse() public method

public canParse ( string $file ) : boolean
$file string
return boolean
    public function canParse(string $file) : bool
    {
        if (false === stream_is_local($file)) {
            return false;
        }
        return 1 === preg_match(self::REGEX, $file);
    }

Usage Example

Example #1
0
 /**
  * @dataProvider provideUnsupportedList
  */
 public function testCannotParseUnsupportedFiles(string $file)
 {
     $actual = $this->parser->canParse($file);
     $this->assertFalse($actual);
 }