1 | <?php |
||
36 | class ShowThreadController |
||
37 | { |
||
38 | /** |
||
39 | * A reply message form factory instance. |
||
40 | * |
||
41 | * @var ReplyMessageFormFactory |
||
42 | */ |
||
43 | protected $formFactory; |
||
44 | |||
45 | /** |
||
46 | * A new reply form handler instance. |
||
47 | * |
||
48 | * @var NewReplyFormHandler |
||
49 | */ |
||
50 | protected $formHandler; |
||
51 | |||
52 | /** |
||
53 | * A secure thread provider instance. |
||
54 | * |
||
55 | * @var SecureThreadProviderInterface |
||
56 | */ |
||
57 | protected $threadProvider; |
||
58 | |||
59 | /** |
||
60 | * A templating instance. |
||
61 | * |
||
62 | * @var EngineInterface |
||
63 | */ |
||
64 | protected $templating; |
||
65 | |||
66 | /** |
||
67 | * A participant provider instance. |
||
68 | * |
||
69 | * @var ParticipantProviderInterface |
||
70 | */ |
||
71 | protected $participantProvider; |
||
72 | |||
73 | /** |
||
74 | * A read status manager instance. |
||
75 | * |
||
76 | * @var ReadStatusManagerInterface |
||
77 | */ |
||
78 | protected $readStatusManager; |
||
79 | |||
80 | /** |
||
81 | * A router instance. |
||
82 | * |
||
83 | * @var RouterInterface |
||
84 | */ |
||
85 | protected $router; |
||
86 | |||
87 | /** |
||
88 | * Constructor. |
||
89 | * |
||
90 | * @param ReplyMessageFormFactory $formFactory A reply form factory |
||
91 | * @param NewReplyFormHandler $formHandler A reply form handler |
||
92 | * @param SecureThreadProviderInterface $threadProvider A secure thread provider instance |
||
93 | * @param EngineInterface $templating A templating engine |
||
94 | * @param ParticipantProviderInterface $participantProvider A participant provider |
||
95 | * @param ReadStatusManagerInterface $readStatusManager A read status manager instance |
||
96 | * @param RouterInterface $router A router instance |
||
97 | */ |
||
98 | public function __construct( |
||
115 | |||
116 | /** |
||
117 | * Shows a single thread and allows the user to reply on it |
||
118 | * |
||
119 | * @param integer $threadId The unique thread id |
||
120 | * |
||
121 | * @throws NotFoundHttpException |
||
122 | * |
||
123 | * @return Response |
||
124 | */ |
||
125 | public function showAction($threadId) |
||
143 | |||
144 | /** |
||
145 | * Gets the thread for the logged in user. |
||
146 | * |
||
147 | * This function gets the thread for the logged in user and throws an exception when no thread is found. |
||
148 | * |
||
149 | * @param ParticipantInterface $loggedInUser The user for whom we lookup the thread |
||
150 | * @param integer $threadId The unique thread id |
||
151 | * |
||
152 | * @return ThreadInterface The thread |
||
153 | * |
||
154 | * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException |
||
155 | */ |
||
156 | protected function getThreadForLoggedInUser(ParticipantInterface $loggedInUser, $threadId) |
||
165 | |||
166 | /** |
||
167 | * Checks if the form is valid returns a redirect response if valid or false if not submitted or not valid |
||
168 | * |
||
169 | * @param FormInterface $form The form we process |
||
170 | * @param integer $threadId The unique thread id |
||
171 | * |
||
172 | * @return RedirectResponse|false |
||
173 | */ |
||
174 | protected function maybeProcessForm(FormInterface $form, $threadId) |
||
185 | |||
186 | /** |
||
187 | * doThreadProcessing. |
||
188 | * |
||
189 | * Here we do some thread actions before sending it to the view. |
||
190 | * |
||
191 | * We are marking the messages of the thread as read since we'll show those messages to the user. |
||
192 | * |
||
193 | * @param ParticipantInterface $loggedInUser |
||
194 | * @param ThreadInterface $thread |
||
195 | * |
||
196 | * @return threadInterface |
||
|
|||
197 | */ |
||
198 | protected function doThreadProcessing(ParticipantInterface $loggedInUser, ThreadInterface $thread) |
||
208 | |||
209 | /** |
||
210 | * Creates the response. |
||
211 | * |
||
212 | * @param ThreadInterface $thread |
||
213 | * @param FormInterface $form |
||
214 | * |
||
215 | * @return Response |
||
216 | */ |
||
217 | protected function createResponse(ThreadInterface $thread, FormInterface $form) |
||
227 | } |
||
228 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.