|
5 | 5 |
|
6 | 6 | use Exception;
|
7 | 7 | use LanguageServer\Index\Index;
|
8 |
| -use LanguageServer\ParserKind; |
9 | 8 | use LanguageServer\PhpDocument;
|
10 | 9 | use LanguageServer\DefinitionResolver;
|
11 | 10 | use Microsoft\PhpParser;
|
|
32 | 31 | throw new Exception("ERROR: Validation testsuite frameworks not found - run `git submodule update --init --recursive` to download.");
|
33 | 32 | }
|
34 | 33 |
|
| 34 | + $start = microtime(true); |
35 | 35 |
|
36 |
| - $parserKinds = [ParserKind::PHP_PARSER, ParserKind::TOLERANT_PHP_PARSER]; |
37 |
| - foreach ($parserKinds as $kind) { |
38 |
| - $start = microtime(true); |
39 |
| - |
40 |
| - foreach ($testProviderArray as $idx => $testCaseFile) { |
41 |
| - if (filesize($testCaseFile) > 10000) { |
42 |
| - continue; |
43 |
| - } |
44 |
| - if ($idx % 1000 === 0) { |
45 |
| - echo "$idx\n"; |
46 |
| - } |
| 36 | + foreach ($testProviderArray as $idx => $testCaseFile) { |
| 37 | + if (filesize($testCaseFile) > 10000) { |
| 38 | + continue; |
| 39 | + } |
| 40 | + if ($idx % 1000 === 0) { |
| 41 | + echo "$idx\n"; |
| 42 | + } |
47 | 43 |
|
48 |
| - $fileContents = file_get_contents($testCaseFile); |
| 44 | + $fileContents = file_get_contents($testCaseFile); |
49 | 45 |
|
50 |
| - $docBlockFactory = DocBlockFactory::createInstance(); |
51 |
| - $index = new Index; |
52 |
| - $maxRecursion = []; |
53 |
| - $definitions = []; |
| 46 | + $docBlockFactory = DocBlockFactory::createInstance(); |
| 47 | + $index = new Index; |
| 48 | + $maxRecursion = []; |
| 49 | + $definitions = []; |
54 | 50 |
|
55 |
| - $definitionResolver = new DefinitionResolver($index); |
56 |
| - $parser = new PhpParser\Parser(); |
| 51 | + $definitionResolver = new DefinitionResolver($index); |
| 52 | + $parser = new PhpParser\Parser(); |
57 | 53 |
|
58 |
| - try { |
59 |
| - $document = new PhpDocument($testCaseFile, $fileContents, $index, $parser, $docBlockFactory, $definitionResolver); |
60 |
| - } catch (\Throwable $e) { |
61 |
| - continue; |
62 |
| - } |
| 54 | + try { |
| 55 | + $document = new PhpDocument($testCaseFile, $fileContents, $index, $parser, $docBlockFactory, $definitionResolver); |
| 56 | + } catch (\Throwable $e) { |
| 57 | + continue; |
63 | 58 | }
|
| 59 | + } |
64 | 60 |
|
65 |
| - echo "------------------------------\n"; |
66 |
| - |
67 |
| - echo "Time [$framework, $kind]: " . (microtime(true) - $start) . PHP_EOL; |
| 61 | + echo "------------------------------\n"; |
68 | 62 |
|
69 |
| - } |
| 63 | + echo "Time [$framework]: " . (microtime(true) - $start) . PHP_EOL; |
70 | 64 | }
|
71 | 65 |
|
0 commit comments