Skip to content

Commit 7c66b32

Browse files
committed
[!!!TASK] Make all classes final
This library has a very large number of extension points via interfaces and abstract classes. All other classes should not be extended by users and shall theirfor be marked as final. There are a few classes left that should also be marked as final but those require some extra attention.
1 parent 95c8b78 commit 7c66b32

File tree

114 files changed

+114
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+114
-113
lines changed

src/RestructuredText/DependencyInjection/Compiler/TextRolePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\DependencyInjection\Reference;
2020

21-
class TextRolePass implements CompilerPassInterface
21+
final class TextRolePass implements CompilerPassInterface
2222
{
2323
public function process(ContainerBuilder $container): void
2424
{

src/RestructuredText/Directives/AdmonitionDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @see https://docutils.sourceforge.io/docs/ref/rst/directives.html#generic-admonition
3636
*/
37-
class AdmonitionDirective extends SubDirective
37+
final class AdmonitionDirective extends SubDirective
3838
{
3939
public function getName(): string
4040
{

src/RestructuredText/Directives/AttentionDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;
1717

18-
class AttentionDirective extends AbstractAdmonitionDirective
18+
final class AttentionDirective extends AbstractAdmonitionDirective
1919
{
2020
public function __construct(protected Rule $startingRule)
2121
{

src/RestructuredText/Directives/BreadcrumbDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* .. breadcrumb::
3131
* ```
3232
*/
33-
class BreadcrumbDirective extends BaseDirective
33+
final class BreadcrumbDirective extends BaseDirective
3434
{
3535
public function getName(): string
3636
{

src/RestructuredText/Directives/CautionDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;
1717

18-
class CautionDirective extends AbstractAdmonitionDirective
18+
final class CautionDirective extends AbstractAdmonitionDirective
1919
{
2020
public function __construct(protected Rule $startingRule)
2121
{

src/RestructuredText/Directives/ClassDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use function array_merge;
2626
use function explode;
2727

28-
class ClassDirective extends SubDirective
28+
final class ClassDirective extends SubDirective
2929
{
3030
public function getName(): string
3131
{

src/RestructuredText/Directives/CodeBlockDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*
3636
* @link https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block
3737
*/
38-
class CodeBlockDirective extends BaseDirective
38+
final class CodeBlockDirective extends BaseDirective
3939
{
4040
/** @see https://regex101.com/r/I3KttH/1 */
4141
public const LINE_NUMBER_RANGES_REGEX = '/^\d+(-\d+)?(?:,\s*\d+(-\d+)?)*$/';

src/RestructuredText/Directives/ContainerDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @link https://docutils.sourceforge.io/docs/ref/rst/directives.html#container
2626
*/
27-
class ContainerDirective extends SubDirective
27+
final class ContainerDirective extends SubDirective
2828
{
2929
public function getName(): string
3030
{

src/RestructuredText/Directives/ContentsDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* Displays a table of content of the current page
2727
*/
28-
class ContentsDirective extends BaseDirective
28+
final class ContentsDirective extends BaseDirective
2929
{
3030
public function __construct(
3131
private readonly DocumentNameResolverInterface $documentNameResolver,

src/RestructuredText/Directives/DangerDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;
1717

18-
class DangerDirective extends AbstractAdmonitionDirective
18+
final class DangerDirective extends AbstractAdmonitionDirective
1919
{
2020
public function __construct(protected Rule $startingRule)
2121
{

0 commit comments

Comments
 (0)