Fix phpcs issues

This commit is contained in:
Jonny Barnes 2016-12-12 14:03:31 +00:00
parent 7706a7cf62
commit c9bff19efa
3 changed files with 30 additions and 12 deletions

View file

@ -109,16 +109,22 @@ class NotesController extends Controller
case 'in-reply-to': case 'in-reply-to':
$content['source'] = $webmention->source; $content['source'] = $webmention->source;
if (isset($microformats['items'][0]['properties']['published'][0])) { 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 { } else {
$content['date'] = $webmention->updated_at->toDayDateTimeString(); $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; $replies[] = $content;
break; break;
case 'repost-of': 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; $content['source'] = $webmention->source;
$reposts[] = $content; $reposts[] = $content;
break; break;
@ -311,7 +317,11 @@ class NotesController extends Controller
]); ]);
$json = json_decode($response->getBody()); $json = json_decode($response->getBody());
if (isset($json->address->town)) { if (isset($json->address->town)) {
$address = '<span class="p-locality">' . $json->address->town . '</span>, <span class="p-country-name">' . $json->address->country . '</span>'; $address = '<span class="p-locality">'
. $json->address->town
. '</span>, <span class="p-country-name">'
. $json->address->country
. '</span>';
Cache::forever($latlng, $address); Cache::forever($latlng, $address);
return $address; return $address;
@ -323,7 +333,11 @@ class NotesController extends Controller
return $address; return $address;
} }
if (isset($json->address->county)) { if (isset($json->address->county)) {
$address = '<span class="p-region">' . $json->address->county . '</span>, <span class="p-country-name">' . $json->address->country . '</span>'; $address = '<span class="p-region">'
. $json->address->county
. '</span>, <span class="p-country-name">'
. $json->address->country
. '</span>';
Cache::forever($latlng, $address); Cache::forever($latlng, $address);
return $address; return $address;

View file

@ -235,7 +235,11 @@ class Note extends Model implements HasMedia
foreach ($matches[0] as $name) { foreach ($matches[0] as $name) {
$name = str_replace('#', '', $name); $name = str_replace('#', '', $name);
$replacements[$name] = $replacements[$name] =
'<a rel="tag" class="p-category" href="/notes/tagged/' . Tag::normalizeTag($name) . '">#' . $name . '</a>'; '<a rel="tag" class="p-category" href="/notes/tagged/'
. Tag::normalizeTag($name)
. '">#'
. $name
. '</a>';
} }
// Replace #tags with valid microformat-enabled link // Replace #tags with valid microformat-enabled link

View file

@ -73,23 +73,23 @@ class NoteService
//syndication targets //syndication targets
//string sent from either local admin CP or micropub //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)); 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)); dispatch(new SyndicateToFacebook($note));
} }
//micropub request, syndication sent as array //micropub request, syndication sent as array
if ( if ((is_array($request->input('syndicate-to')))
(is_array($request->input('syndicate-to')))
&& &&
(in_array('https://twitter.com/jonnybarnes', $request->input('syndicate-to'))) (in_array('https://twitter.com/jonnybarnes', $request->input('syndicate-to')))
) { ) {
dispatch(new SyndicateToTwitter($note)); dispatch(new SyndicateToTwitter($note));
} }
if ( if ((is_array($request->input('syndicate-to')))
(is_array($request->input('syndicate-to')))
&& &&
(in_array('https://facebook.com/jonnybarnes', $request->input('syndicate-to'))) (in_array('https://facebook.com/jonnybarnes', $request->input('syndicate-to')))
) { ) {