Skip to content

Commit a5c3213

Browse files
committed
Uppercase HTTP methods for the operation method resolver
1 parent cdd1050 commit a5c3213

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Api/OperationMethodResolverInterface.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
use ApiPlatform\Core\Exception\RuntimeException;
1717

1818
/**
19-
* Resolves the HTTP method associated with an operation.
19+
* Resolves the uppercased HTTP method associated with an operation.
2020
*
2121
* @author Kévin Dunglas <[email protected]>
2222
*/
2323
interface OperationMethodResolverInterface
2424
{
2525
/**
26+
* Resolves the uppercased HTTP method associated with a collection operation.
27+
*
2628
* @param string $resourceClass
2729
* @param string $operationName
2830
*
@@ -33,6 +35,8 @@ interface OperationMethodResolverInterface
3335
public function getCollectionOperationMethod(string $resourceClass, string $operationName): string;
3436

3537
/**
38+
* Resolves the uppercased HTTP method associated with an item operation.
39+
*
3640
* @param string $resourceClass
3741
* @param string $operationName
3842
*

src/Bridge/Symfony/Routing/OperationMethodResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function getOperationMethod(string $resourceClass, string $operationName
8989
}
9090

9191
if (null !== $method) {
92-
return $method;
92+
return strtoupper($method);
9393
}
9494

9595
if (null === $routeName = $this->getRouteName($resourceMetadata, $operationName, $operationType)) {

0 commit comments

Comments
 (0)