This repository was archived by the owner on Mar 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ protected function registerExtractor()
271
271
$ collection ->put ('datetime ' , $ datetime = new DateTimeExtractor ());
272
272
$ collection ->put ('object ' , $ object = new ObjectExtractor ());
273
273
$ collection ->put ('function ' , $ function = new FunctionExtractor ());
274
- $ collection ->put ('native_object ' , $ instance = $ app ->make (NativeObjectExtractor::class));
274
+ $ collection ->put ('native-object ' , $ instance = $ app ->make (NativeObjectExtractor::class));
275
275
276
276
$ collection ->put ('assoc ' , $ assoc = new AssocExtractor ());
277
277
$ collection ->put ('json ' , $ json = new JsonExtractor ());
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class ParameterSpecBuilder implements ParameterSpecBuilderInterface
60
60
\s*
61
61
\:
62
62
\s*
63
- (?<type>(\w *(?:\(.*\))?(?:\[\s*\])?)(?:\s*\|\s*(?-1))*)
63
+ (?<type>([\w\-] *(?:\(.*\))?(?:\[\s*\])?)(?:\s*\|\s*(?-1))*)
64
64
\s*
65
65
)?
66
66
$
Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ public function testBuildingMandatoryParameter()
97
97
$ this ->assertInstanceOf (ExtractorDefinitionInterface::class, $ spec ->getExtractorDefinition ());
98
98
}
99
99
100
+ public function testBuildingMandatoryParameterWithDashedType ()
101
+ {
102
+ $ this ->extractorDefinitionShouldBuildOn ('type-dash ' );
103
+
104
+ $ spec = $ this ->builder ->build ('param: type-dash ' );
105
+
106
+ $ this ->assertInstanceOf (MandatoryParameterSpec::class, $ spec );
107
+
108
+ $ this ->assertSame ('param ' , $ spec ->getName ());
109
+ $ this ->assertInstanceOf (ExtractorDefinitionInterface::class, $ spec ->getExtractorDefinition ());
110
+ }
111
+
100
112
public function testBuildingMandatoryParameterWithComplexType ()
101
113
{
102
114
$ this ->extractorDefinitionShouldBuildOn ('instance( Some\Class ) ' );
You can’t perform that action at this time.
0 commit comments