Fixing various phpcs issues

This commit is contained in:
Jonny Barnes 2019-10-27 19:31:33 +00:00
parent 21c89f721c
commit ef03d2209f
18 changed files with 148 additions and 90 deletions

View file

@ -14,9 +14,9 @@ class ArticlesController extends Controller
/**
* Show all articles (with pagination).
*
* @param int $year
* @param int $month
* @return \Illuminate\View\View
* @param int $year
* @param int $month
* @return View
*/
public function index(int $year = null, int $month = null): View
{
@ -31,10 +31,10 @@ class ArticlesController extends Controller
/**
* Show a single article.
*
* @param int $year
* @param int $month
* @param string $slug
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
* @param int $year
* @param int $month
* @param string $slug
* @return RedirectResponse|View
*/
public function show(int $year, int $month, string $slug)
{
@ -43,7 +43,7 @@ class ArticlesController extends Controller
return redirect('/blog/'
. $article->updated_at->year
. '/' . $article->updated_at->format('m')
.'/' . $slug);
. '/' . $slug);
}
return view('articles.show', compact('article'));
@ -53,8 +53,8 @@ class ArticlesController extends Controller
* We only have the ID, work out post title, year and month
* and redirect to it.
*
* @param int $idFromUrl
* @return \Illuminte\Http\RedirectResponse
* @param int $idFromUrl
* @return RedirectResponse
*/
public function onlyIdInUrl(int $idFromUrl): RedirectResponse
{

View file

@ -9,5 +9,7 @@ use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}

View file

@ -6,8 +6,10 @@ namespace App\Http\Controllers;
use App\Models\Note;
use App\Services\ActivityStreamsService;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\View\View;
use Jonnybarnes\IndieWeb\Numbers;
@ -18,12 +20,12 @@ class NotesController extends Controller
/**
* Show all the notes. This is also the homepage.
*
* @return \Illuminate\View\View|\Illuminate\Http\JsonResponse
* @return ViewFactory|View|Response
*/
public function index()
{
if (request()->wantsActivityStream()) {
return (new ActivityStreamsService)->siteOwnerResponse();
return (new ActivityStreamsService())->siteOwnerResponse();
}
$notes = Note::latest()
@ -38,15 +40,15 @@ class NotesController extends Controller
/**
* Show a single note.
*
* @param string $urlId The id of the note
* @return \Illuminate\View\View|\Illuminate\Http\JsonResponse
* @param string $urlId The id of the note
* @return View|JsonResponse|Response
*/
public function show(string $urlId)
{
$note = Note::nb60($urlId)->with('webmentions')->firstOrFail();
if (request()->wantsActivityStream()) {
return (new ActivityStreamsService)->singleNoteResponse($note);
return (new ActivityStreamsService())->singleNoteResponse($note);
}
return view('notes.show', compact('note'));
@ -55,8 +57,8 @@ class NotesController extends Controller
/**
* Redirect /note/{decID} to /notes/{nb60id}.
*
* @param int $decId The decimal id of the note
* @return \Illuminate\Http\RedirectResponse
* @param int $decId The decimal id of the note
* @return RedirectResponse
*/
public function redirect(int $decId): RedirectResponse
{
@ -66,8 +68,8 @@ class NotesController extends Controller
/**
* Show all notes tagged with {tag}.
*
* @param string $tag
* @return \Illuminate\View\View
* @param string $tag
* @return View
*/
public function tagged(string $tag): View
{

View file

@ -65,12 +65,12 @@ block-all-mixed-content; \
report-to csp-endpoint; \
report-uri https://jonnybarnes.report-uri.io/r/default/csp/enforce;")
)->header(
'Report-To',
'{' .
'Report-To',
'{' .
"'url': 'https://jonnybarnes.report-uri.io/r/default/csp/enforce', " .
"'group': 'csp-endpoint'," .
"'max-age': 10886400" .
'}'
);
'}'
);
}
}