Add type hints from DocBlocks
This commit is contained in:
@@ -126,7 +126,7 @@ class ArticleController extends ApiController
|
||||
* @throws BindingResolutionException
|
||||
* @throws InvalidCastException
|
||||
*/
|
||||
public function getAttachments(Request $request, Article $article)
|
||||
public function getAttachments(Request $request, Article $article): JsonResponse
|
||||
{
|
||||
if (ArticleConductor::viewable($article) === true) {
|
||||
$medium = $article->attachments->map(function ($attachment) {
|
||||
@@ -148,7 +148,7 @@ class ArticleController extends ApiController
|
||||
* @throws BindingResolutionException
|
||||
* @throws MassAssignmentException
|
||||
*/
|
||||
public function storeAttachment(Request $request, Article $article)
|
||||
public function storeAttachment(Request $request, Article $article): JsonResponse
|
||||
{
|
||||
if (ArticleConductor::updatable($article) === true) {
|
||||
if ($request->has("medium") && Media::find($request->medium)) {
|
||||
@@ -171,7 +171,7 @@ class ArticleController extends ApiController
|
||||
* @throws BindingResolutionException
|
||||
* @throws MassAssignmentException
|
||||
*/
|
||||
public function updateAttachments(Request $request, Article $article)
|
||||
public function updateAttachments(Request $request, Article $article): JsonResponse
|
||||
{
|
||||
if (ArticleConductor::updatable($article) === true) {
|
||||
$mediaIds = $request->attachments;
|
||||
@@ -219,7 +219,7 @@ class ArticleController extends ApiController
|
||||
* @return JsonResponse
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
public function deleteAttachment(Request $request, Article $article, Media $medium)
|
||||
public function deleteAttachment(Request $request, Article $article, Media $medium): JsonResponse
|
||||
{
|
||||
if (ArticleConductor::updatable($article) === true) {
|
||||
$attachments = $article->attachments;
|
||||
|
||||
Reference in New Issue
Block a user