File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 6464 "minimum-stability" : " dev" ,
6565 "prefer-stable" : true ,
6666 "config" : {
67- "sort-packages" : true
67+ "sort-packages" : true ,
68+ "allow-plugins" : {
69+ "dealerdirect/phpcodesniffer-composer-installer" : true
70+ }
6871 },
6972 "extra" : {
7073 "branch-alias" : {
Original file line number Diff line number Diff line change @@ -313,15 +313,15 @@ private function generatePattern(): string
313313
314314 if ($ suffixes ) {
315315 return sprintf (
316- '#%s ' . // Always start with raw pattern
316+ '#^ %s ' . // Always start with raw pattern
317317 '(%s)?$#U ' , // Optionally followed by one of suffixes
318318 $ rawPattern ,
319319 implode ('| ' , array_map ('preg_quote ' , $ suffixes ))
320320 );
321321 }
322322
323323 return sprintf (
324- '#%s$# ' , // Exactly match raw pattern
324+ '#^ %s$# ' , // Exactly match raw pattern
325325 $ rawPattern
326326 );
327327 }
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ test(function (): void {
6767 Assert::count (4 , $ schema ->getEndpoints ());
6868 Assert::equal (['GET ' ], $ schema ->getEndpoints ()[0 ]->getMethods ());
6969 Assert::equal ('/api/v1/foobar/baz1 ' , $ schema ->getEndpoints ()[0 ]->getMask ());
70- Assert::equal ('#/api/v1/foobar/baz1$# ' , $ schema ->getEndpoints ()[0 ]->getPattern ());
70+ Assert::equal ('#^ /api/v1/foobar/baz1$# ' , $ schema ->getEndpoints ()[0 ]->getPattern ());
7171 Assert::equal ([], $ schema ->getEndpoints ()[0 ]->getParameters ());
7272 Assert::equal (AnnotationFoobarController::class, $ schema ->getEndpoints ()[0 ]->getHandler ()->getClass ());
7373 Assert::equal ('baz1 ' , $ schema ->getEndpoints ()[0 ]->getHandler ()->getMethod ());
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ test(function (): void {
9191 Assert::same ('/group1-path/group2-path/c1-path/m2-path ' , $ endpoint1 ->getMask ());
9292 Assert::same ('/group1-path/group2-path/c1-path/m2-path ' , $ endpoint1 ->getAttribute ('pattern ' ));
9393 Assert::same (null , $ endpoint1 ->getAttribute ('missing ' ));
94- Assert::same ('#/group1-path/group2-path/c1-path/m2-path$# ' , $ endpoint1 ->getPattern ());
94+ Assert::same ('#^ /group1-path/group2-path/c1-path/m2-path$# ' , $ endpoint1 ->getPattern ());
9595 Assert::same ([], $ endpoint1 ->getParameters ());
9696 Assert::same ([], $ endpoint1 ->getNegotiations ());
9797
@@ -114,7 +114,7 @@ test(function (): void {
114114 Assert::same ('/group1-path/group2-path/c1-path/m3-path/{m3-p1} ' , $ endpoint2 ->getMask ());
115115 Assert::same ('/group1-path/group2-path/c1-path/m3-path/(?P<m3-p1>[^/]+) ' , $ endpoint2 ->getAttribute ('pattern ' ));
116116 Assert::same (null , $ endpoint2 ->getAttribute ('missing ' ));
117- Assert::same ('#/group1-path/group2-path/c1-path/m3-path/(?P<m3-p1>[^/]+)(json|xml)?$#U ' , $ endpoint2 ->getPattern ());
117+ Assert::same ('#^ /group1-path/group2-path/c1-path/m3-path/(?P<m3-p1>[^/]+)(json|xml)?$#U ' , $ endpoint2 ->getPattern ());
118118
119119 Assert::same (null , $ endpoint2 ->getRequestBody ());
120120
You can’t perform that action at this time.
0 commit comments