File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 34
34
'produces ' => [
35
35
// 'application/json',
36
36
],
37
+
38
+ /*
39
+ |--------------------------------------------------------------------------
40
+ | Ignore methods
41
+ |--------------------------------------------------------------------------
42
+ |
43
+ | Methods in the following array will be ignored in the paths array
44
+ |
45
+ */
46
+
47
+ 'ignoredMethods ' => [
48
+ 'head ' ,
49
+ ],
37
50
];
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ public function generate()
43
43
foreach ($ methods as $ method ) {
44
44
$ this ->method = strtolower ($ method );
45
45
46
+ if (in_array ($ this ->method , $ this ->config ['ignoredMethods ' ])) continue ;
47
+
46
48
$ this ->generatePath ();
47
49
}
48
50
}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public function testHasPaths($docs)
54
54
public function testPathData ($ paths )
55
55
{
56
56
$ this ->assertArrayHasKey ('get ' , $ paths ['/users ' ]);
57
+ $ this ->assertArrayNotHasKey ('head ' , $ paths ['/users ' ]);
57
58
$ this ->assertArrayHasKey ('post ' , $ paths ['/users ' ]);
58
59
59
60
$ this ->assertArrayHasKey ('description ' , $ paths ['/users ' ]['get ' ]);
@@ -65,6 +66,15 @@ public function testPathData($paths)
65
66
$ this ->assertArrayHasKey ('parameters ' , $ paths ['/users ' ]['post ' ]);
66
67
}
67
68
69
+ public function testOverwriteIgnoreMethods ()
70
+ {
71
+ $ this ->config ['ignoredMethods ' ] = [];
72
+
73
+ $ docs = (new Generator ($ this ->config ))->generate ();
74
+
75
+ $ this ->assertArrayHasKey ('head ' , $ docs ['paths ' ]['/users ' ]);
76
+ }
77
+
68
78
public function testOptionalData ()
69
79
{
70
80
$ optionalData = [
You can’t perform that action at this time.
0 commit comments