1 | <?php |
||
18 | class ContentfulSyncController extends Controller |
||
19 | { |
||
20 | |||
21 | protected const TOPIC_CONTENT_MANAGEMENT_ASSET_PUBLISH = 'ContentManagement.Asset.publish'; |
||
22 | protected const TOPIC_CONTENT_MANAGEMENT_ASSET_UNPUBLISH = 'ContentManagement.Asset.unpublish'; |
||
23 | protected const TOPIC_CONTENT_MANAGEMENT_ASSET_DELETE = 'ContentManagement.Asset.delete'; |
||
24 | protected const TOPIC_CONTENT_MANAGEMENT_ENTRY_PUBLISH = 'ContentManagement.Entry.publish'; |
||
25 | protected const TOPIC_CONTENT_MANAGEMENT_ENTRY_UNPUBLISH = 'ContentManagement.Entry.unpublish'; |
||
26 | protected const TOPIC_CONTENT_MANAGEMENT_ENTRY_DELETE = 'ContentManagement.Entry.delete'; |
||
27 | |||
28 | /** |
||
29 | * @var ContentfulService |
||
30 | */ |
||
31 | private $contentfulService; |
||
32 | |||
33 | /** |
||
34 | * @var AbstractContentfulSyncService |
||
35 | */ |
||
36 | private $contentfulSyncService; |
||
37 | |||
38 | /** |
||
39 | * ContentfulSyncController constructor. |
||
40 | * |
||
41 | * @param ContentfulService $contentfulService |
||
42 | * @param AbstractContentfulSyncService $contentfulSyncService |
||
43 | */ |
||
44 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * @param Request $request |
||
54 | * |
||
55 | * @return Response |
||
56 | * |
||
57 | * @throws ContentfulSyncException if the webhook cannot be handled |
||
58 | */ |
||
59 | public function handleIncomingWebhook(Request $request): Response |
||
98 | |||
99 | /** |
||
100 | * @param Request $request |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | private function getContentfulTopic(Request $request): string |
||
108 | } |
||
109 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.