comparison vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
12:7a779792577d 13:5fb285c0d0e3
1 <?php 1 <?php declare(strict_types=1);
2 2
3 namespace PhpParser; 3 namespace PhpParser;
4 4
5 class ParserFactory { 5 class ParserFactory
6 {
6 const PREFER_PHP7 = 1; 7 const PREFER_PHP7 = 1;
7 const PREFER_PHP5 = 2; 8 const PREFER_PHP5 = 2;
8 const ONLY_PHP7 = 3; 9 const ONLY_PHP7 = 3;
9 const ONLY_PHP5 = 4; 10 const ONLY_PHP5 = 4;
10 11
15 * @param Lexer|null $lexer Lexer to use. Defaults to emulative lexer when not specified 16 * @param Lexer|null $lexer Lexer to use. Defaults to emulative lexer when not specified
16 * @param array $parserOptions Parser options. See ParserAbstract::__construct() argument 17 * @param array $parserOptions Parser options. See ParserAbstract::__construct() argument
17 * 18 *
18 * @return Parser The parser instance 19 * @return Parser The parser instance
19 */ 20 */
20 public function create($kind, Lexer $lexer = null, array $parserOptions = array()) { 21 public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser {
21 if (null === $lexer) { 22 if (null === $lexer) {
22 $lexer = new Lexer\Emulative(); 23 $lexer = new Lexer\Emulative();
23 } 24 }
24 switch ($kind) { 25 switch ($kind) {
25 case self::PREFER_PHP7: 26 case self::PREFER_PHP7: