From f8b49b22294240062fdcf01a63d79319d3416c10 Mon Sep 17 00:00:00 2001 From: Andrew Aitken-Fincham Date: Thu, 17 Dec 2020 21:38:17 +1300 Subject: [PATCH] fix use statement to render proper class flags --- .gitignore | 1 + conf/themes/silverstripe/class.twig | 1 + src/Parser/SilverStripeNodeVisitor.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fcf7549..5cbdcc6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /en/ /htdocs /data +/.vagrant/ diff --git a/conf/themes/silverstripe/class.twig b/conf/themes/silverstripe/class.twig index b7e03b3..4f7b44e 100644 --- a/conf/themes/silverstripe/class.twig +++ b/conf/themes/silverstripe/class.twig @@ -80,6 +80,7 @@ {% endblock %} {% block class_signature -%} + {% if class.final %}final {% endif %} {% if not class.interface and class.abstract %}abstract {% endif %} {{ class_category_name(class.getCategoryId()) }} {{ class.shortname|raw }} diff --git a/src/Parser/SilverStripeNodeVisitor.php b/src/Parser/SilverStripeNodeVisitor.php index 0dd223a..60f5c11 100644 --- a/src/Parser/SilverStripeNodeVisitor.php +++ b/src/Parser/SilverStripeNodeVisitor.php @@ -2,7 +2,7 @@ namespace SilverStripe\ApiDocs\Parser; -use Prophecy\Doubler\Generator\Node\ClassNode; +use PhpParser\Node\Stmt\Class_ as ClassNode; use Doctum\Parser\NodeVisitor; use PhpParser\Node\Stmt\ClassLike as ClassLikeNode; use PhpParser\Node\Stmt\Property as PropertyNode;