File tree Expand file tree Collapse file tree 4 files changed +3
-78
lines changed Expand file tree Collapse file tree 4 files changed +3
-78
lines changed Original file line number Diff line number Diff line change 99 "issues" : " https://github.com/php-type-language/phpdoc-parser/issues"
1010 },
1111 "require" : {
12- "php" : " ^8.1" ,
13- "type-lang/parser" : " ^1.0"
12+ "php" : " ^8.1"
1413 },
1514 "autoload" : {
1615 "psr-4" : {
Original file line number Diff line number Diff line change 44
55namespace TypeLang \PHPDoc ;
66
7- use TypeLang \Parser \Node \SerializableInterface ;
87use TypeLang \PHPDoc \Tag \Description \Description ;
98use TypeLang \PHPDoc \Tag \Description \DescriptionInterface ;
109use TypeLang \PHPDoc \Tag \TagInterface ;
1413/**
1514 * @template-implements \IteratorAggregate<array-key, TagInterface>
1615 */
17- final class DocBlock implements
18- TagProviderInterface,
19- SerializableInterface,
20- \IteratorAggregate
16+ final class DocBlock implements TagProviderInterface, \IteratorAggregate
2117{
2218 use TagProvider;
2319
@@ -30,35 +26,4 @@ public function __construct(
3026 ) {
3127 $ this ->bootTagProvider ($ tags );
3228 }
33-
34- /**
35- * @return array{
36- * description: array<array-key, mixed>,
37- * tags: list<array<array-key, mixed>>
38- * }
39- */
40- public function toArray (): array
41- {
42- $ tags = [];
43-
44- foreach ($ this ->tags as $ tag ) {
45- $ tags [] = $ tag ->toArray ();
46- }
47-
48- return [
49- 'description ' => $ this ->description ->toArray (),
50- 'tags ' => $ tags ,
51- ];
52- }
53-
54- /**
55- * @return array{
56- * description: array<array-key, mixed>,
57- * tags: list<array<array-key, mixed>>
58- * }
59- */
60- public function jsonSerialize (): array
61- {
62- return $ this ->toArray ();
63- }
6429}
Original file line number Diff line number Diff line change 44
55namespace TypeLang \PHPDoc \Tag \Description ;
66
7- use TypeLang \Parser \Node \SerializableInterface ;
87use TypeLang \PHPDoc \Tag \TagInterface ;
98use TypeLang \PHPDoc \Tag \TagProvider ;
109use TypeLang \PHPDoc \Tag \TagProviderInterface ;
@@ -55,42 +54,6 @@ public function getTemplate(): string|\Stringable
5554 return $ this ->template ;
5655 }
5756
58- /**
59- * @return array{
60- * template: array|string,
61- * tags: list<array>
62- * }
63- */
64- public function toArray (): array
65- {
66- $ tags = [];
67-
68- foreach ($ this ->tags as $ tag ) {
69- $ tags [] = $ tag ->toArray ();
70- }
71-
72- $ template = $ this ->template ;
73-
74- return [
75- 'template ' => match (true ) {
76- $ template instanceof SerializableInterface => $ template ->toArray (),
77- default => (string ) $ template ,
78- },
79- 'tags ' => $ tags ,
80- ];
81- }
82-
83- /**
84- * @return array{
85- * template: array|string,
86- * tags: list<array>
87- * }
88- */
89- public function jsonSerialize (): array
90- {
91- return $ this ->toArray ();
92- }
93-
9457 /**
9558 * @psalm-immutable
9659 */
Original file line number Diff line number Diff line change 44
55namespace TypeLang \PHPDoc \Tag \Description ;
66
7- use TypeLang \Parser \Node \SerializableInterface ;
8-
9- interface DescriptionInterface extends SerializableInterface, \Stringable {}
7+ interface DescriptionInterface extends \Stringable {}
You can’t perform that action at this time.
0 commit comments