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()
271271 $ collection ->put ('datetime ' , $ datetime = new DateTimeExtractor ());
272272 $ collection ->put ('object ' , $ object = new ObjectExtractor ());
273273 $ 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));
275275
276276 $ collection ->put ('assoc ' , $ assoc = new AssocExtractor ());
277277 $ collection ->put ('json ' , $ json = new JsonExtractor ());
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class ParameterSpecBuilder implements ParameterSpecBuilderInterface
6060 \s*
6161 \:
6262 \s*
63- (?<type>(\w *(?:\(.*\))?(?:\[\s*\])?)(?:\s*\|\s*(?-1))*)
63+ (?<type>([\w\-] *(?:\(.*\))?(?:\[\s*\])?)(?:\s*\|\s*(?-1))*)
6464 \s*
6565 )?
6666 $
Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ public function testBuildingMandatoryParameter()
9797 $ this ->assertInstanceOf (ExtractorDefinitionInterface::class, $ spec ->getExtractorDefinition ());
9898 }
9999
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+
100112 public function testBuildingMandatoryParameterWithComplexType ()
101113 {
102114 $ this ->extractorDefinitionShouldBuildOn ('instance( Some\Class ) ' );
You can’t perform that action at this time.
0 commit comments