Skip to content

Commit e0473af

Browse files
authored
Merge pull request #154 from php-school/php-parser-3
Php parser 3
2 parents 11c72ff + 1770ec4 commit e0473af

File tree

11 files changed

+320
-229
lines changed

11 files changed

+320
-229
lines changed

app/config.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Colors\Color;
44
use function DI\object;
55
use function DI\factory;
6+
use Kadet\Highlighter\KeyLighter;
67
use function PhpSchool\PhpWorkshop\Event\containerListener;
78
use Interop\Container\ContainerInterface;
89
use League\CommonMark\DocParser;
@@ -55,9 +56,7 @@
5556
use PhpSchool\PhpWorkshop\ResultRenderer\Cli\RequestFailureRenderer as CliRequestFailureRenderer;
5657
use PhpSchool\PhpWorkshop\ResultRenderer\Cgi\RequestFailureRenderer as CgiRequestFailureRenderer;
5758
use PhpSchool\PhpWorkshop\Utils\RequestRenderer;
58-
use PhpSchool\PSX\Factory as PsxFactory;
5959
use PhpSchool\PhpWorkshop\WorkshopType;
60-
use PhpSchool\PSX\SyntaxHighlighter;
6160
use PhpSchool\PhpWorkshop\Check\FileExistsCheck;
6261
use PhpSchool\PhpWorkshop\Check\FunctionRequirementsCheck;
6362
use PhpSchool\PhpWorkshop\Check\PhpLintCheck;
@@ -279,8 +278,6 @@
279278
UserState::class => function (ContainerInterface $c) {
280279
return $c->get(UserStateSerializer::class)->deSerialize();
281280
},
282-
SyntaxHighlighter::class => factory(PsxFactory::class),
283-
PsxFactory::class => object(),
284281
ResetProgress::class => function (ContainerInterface $c) {
285282
return new ResetProgress($c->get(UserStateSerializer::class));
286283
},
@@ -312,11 +309,15 @@ function (CgiResult $result) use ($c) {
312309
$c->get(Color::class),
313310
$c->get(TerminalInterface::class),
314311
$c->get(ExerciseRepository::class),
315-
$c->get(SyntaxHighlighter::class),
312+
$c->get(KeyLighter::class),
316313
$c->get(ResultRendererFactory::class)
317314
);
318315
},
319316

317+
KeyLighter::class => function () {
318+
return new KeyLighter;
319+
},
320+
320321
'coreContributors' => [
321322
'@AydinHassan' => 'Aydin Hassan',
322323
'@mikeymike' => 'Michael Woodward',

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"symfony/process": "^2.3|^3.0",
2424
"symfony/filesystem": "^2.3|^3.0",
2525
"fzaninotto/faker": "^1.5",
26-
"aydin-hassan/cli-md-renderer": "^2.1",
27-
"php-school/psx": "~1.0",
26+
"aydin-hassan/cli-md-renderer": "^2.2",
2827
"php-school/cli-menu": "^2.0",
2928
"beberlei/assert": "^2.4",
3029
"psr/http-message": "^1.0",
3130
"zendframework/zend-diactoros": "^1.3.6",
3231
"myclabs/php-enum": "^1.4",
33-
"nikic/php-parser": "^2.1"
32+
"kadet/keylighter": "^0.8.2",
33+
"nikic/php-parser": "^3.0"
3434
},
3535
"require-dev": {
3636
"composer/composer": "^1.2",

0 commit comments

Comments
 (0)