From c9bff19efa3e59cca32b190a422f5aa38aea42a2 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 12 Dec 2016 14:03:31 +0000 Subject: [PATCH] Fix phpcs issues --- app/Http/Controllers/NotesController.php | 24 +++++++++++++++++++----- app/Note.php | 6 +++++- app/Services/NoteService.php | 12 ++++++------ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/NotesController.php b/app/Http/Controllers/NotesController.php index 631f3573..c63c029c 100644 --- a/app/Http/Controllers/NotesController.php +++ b/app/Http/Controllers/NotesController.php @@ -109,16 +109,22 @@ class NotesController extends Controller case 'in-reply-to': $content['source'] = $webmention->source; if (isset($microformats['items'][0]['properties']['published'][0])) { - $content['date'] = $carbon->parse($microformats['items'][0]['properties']['published'][0])->toDayDateTimeString(); + $content['date'] = $carbon->parse( + $microformats['items'][0]['properties']['published'][0] + )->toDayDateTimeString(); } else { $content['date'] = $webmention->updated_at->toDayDateTimeString(); } - $content['reply'] = $this->filterHTML($microformats['items'][0]['properties']['content'][0]['html']); + $content['reply'] = $this->filterHTML( + $microformats['items'][0]['properties']['content'][0]['html'] + ); $replies[] = $content; break; case 'repost-of': - $content['date'] = $carbon->parse($microformats['items'][0]['properties']['published'][0])->toDayDateTimeString(); + $content['date'] = $carbon->parse( + $microformats['items'][0]['properties']['published'][0] + )->toDayDateTimeString(); $content['source'] = $webmention->source; $reposts[] = $content; break; @@ -311,7 +317,11 @@ class NotesController extends Controller ]); $json = json_decode($response->getBody()); if (isset($json->address->town)) { - $address = '' . $json->address->town . ', ' . $json->address->country . ''; + $address = '' + . $json->address->town + . ', ' + . $json->address->country + . ''; Cache::forever($latlng, $address); return $address; @@ -323,7 +333,11 @@ class NotesController extends Controller return $address; } if (isset($json->address->county)) { - $address = '' . $json->address->county . ', ' . $json->address->country . ''; + $address = '' + . $json->address->county + . ', ' + . $json->address->country + . ''; Cache::forever($latlng, $address); return $address; diff --git a/app/Note.php b/app/Note.php index fad7fede..5f03bc4b 100644 --- a/app/Note.php +++ b/app/Note.php @@ -235,7 +235,11 @@ class Note extends Model implements HasMedia foreach ($matches[0] as $name) { $name = str_replace('#', '', $name); $replacements[$name] = - ''; + ''; } // Replace #tags with valid microformat-enabled link diff --git a/app/Services/NoteService.php b/app/Services/NoteService.php index df736091..7d4d7fd8 100644 --- a/app/Services/NoteService.php +++ b/app/Services/NoteService.php @@ -73,23 +73,23 @@ class NoteService //syndication targets //string sent from either local admin CP or micropub - if ($request->input('twitter') == true || $request->input('syndicate-to') == 'https://twitter.com/jonnybarnes') { + if ($request->input('twitter') == true + || $request->input('syndicate-to') == 'https://twitter.com/jonnybarnes') { dispatch(new SyndicateToTwitter($note)); } - if ($request->input('facebook') == true || $request->input('syndicate-to') == 'https://facebook.com/jonnybarnes') { + if ($request->input('facebook') == true + || $request->input('syndicate-to') == 'https://facebook.com/jonnybarnes') { dispatch(new SyndicateToFacebook($note)); } //micropub request, syndication sent as array - if ( - (is_array($request->input('syndicate-to'))) + if ((is_array($request->input('syndicate-to'))) && (in_array('https://twitter.com/jonnybarnes', $request->input('syndicate-to'))) ) { dispatch(new SyndicateToTwitter($note)); } - if ( - (is_array($request->input('syndicate-to'))) + if ((is_array($request->input('syndicate-to'))) && (in_array('https://facebook.com/jonnybarnes', $request->input('syndicate-to'))) ) {