File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 66
77interface AttributeExtract
88{
9- /** @return array<string, mixed> */
9+ /** @return array<int, array< string, mixed> > */
1010 public function extract (): array ;
1111}
Original file line number Diff line number Diff line change 44
55namespace DenisKorbakov \LaravelDataScribe \Extractors \Attributes ;
66
7+ use Knuckles \Scribe \Attributes \BodyParam ;
78use ReflectionAttribute ;
89
910/** Extracts Body Param attribute from method attributes */
@@ -15,9 +16,19 @@ public function __construct(
1516 ) {
1617 }
1718
18- /** @return array<string, string> Get array arguments or empty array */
19+ /** @return array<int, array< string, mixed>> Get array arguments or empty array */
1920 public function extract (): array
2021 {
21- return ['test ' => 'test ' ];
22+ $ arguments = [];
23+
24+ foreach ($ this ->attributes as $ attribute ) {
25+ if ($ attribute instanceof ReflectionAttribute) {
26+ if (is_a ($ attribute ->getName (), BodyParam::class, true )) {
27+ $ arguments [] = $ attribute ->getArguments ();
28+ }
29+ }
30+ }
31+
32+ return $ arguments ;
2233 }
2334}
You can’t perform that action at this time.
0 commit comments