Update Laravel to v12
This commit is contained in:
parent
f2025b801b
commit
1dfa17abca
83 changed files with 1324 additions and 2323 deletions
|
@ -21,7 +21,7 @@ class BookmarkService extends Service
|
|||
public function create(array $request, ?string $client = null): Bookmark
|
||||
{
|
||||
if (Arr::get($request, 'properties.bookmark-of.0')) {
|
||||
//micropub request
|
||||
// micropub request
|
||||
$url = normalize_url(Arr::get($request, 'properties.bookmark-of.0'));
|
||||
$name = Arr::get($request, 'properties.name.0');
|
||||
$content = Arr::get($request, 'properties.content.0');
|
||||
|
@ -61,7 +61,7 @@ class BookmarkService extends Service
|
|||
try {
|
||||
$response = $client->request('GET', 'https://web.archive.org/save/' . $url);
|
||||
} catch (ClientException $e) {
|
||||
//throw an exception to be caught
|
||||
// throw an exception to be caught
|
||||
throw new InternetArchiveException;
|
||||
}
|
||||
if ($response->hasHeader('Content-Location')) {
|
||||
|
@ -70,7 +70,7 @@ class BookmarkService extends Service
|
|||
}
|
||||
}
|
||||
|
||||
//throw an exception to be caught
|
||||
// throw an exception to be caught
|
||||
throw new InternetArchiveException;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class LikeService extends Service
|
|||
public function create(array $request, ?string $client = null): Like
|
||||
{
|
||||
if (Arr::get($request, 'properties.like-of.0')) {
|
||||
//micropub request
|
||||
// micropub request
|
||||
$url = normalize_url(Arr::get($request, 'properties.like-of.0'));
|
||||
}
|
||||
if (Arr::get($request, 'like-of')) {
|
||||
|
|
|
@ -20,7 +20,7 @@ class UpdateService
|
|||
{
|
||||
$urlPath = parse_url(Arr::get($request, 'url'), PHP_URL_PATH);
|
||||
|
||||
//is it a note we are updating?
|
||||
// is it a note we are updating?
|
||||
if (mb_substr($urlPath, 1, 5) !== 'notes') {
|
||||
return response()->json([
|
||||
'error' => 'invalid',
|
||||
|
@ -37,7 +37,7 @@ class UpdateService
|
|||
], 404);
|
||||
}
|
||||
|
||||
//got the note, are we dealing with a “replace” request?
|
||||
// got the note, are we dealing with a “replace” request?
|
||||
if (Arr::get($request, 'replace')) {
|
||||
foreach (Arr::get($request, 'replace') as $property => $value) {
|
||||
if ($property === 'content') {
|
||||
|
@ -64,7 +64,7 @@ class UpdateService
|
|||
]);
|
||||
}
|
||||
|
||||
//how about “add”
|
||||
// how about “add”
|
||||
if (Arr::get($request, 'add')) {
|
||||
foreach (Arr::get($request, 'add') as $property => $value) {
|
||||
if ($property === 'syndication') {
|
||||
|
|
|
@ -14,8 +14,8 @@ class PlaceService
|
|||
*/
|
||||
public function createPlace(array $data): Place
|
||||
{
|
||||
//obviously a place needs a lat/lng, but this could be sent in a geo-url
|
||||
//if no geo array key, we assume the array already has lat/lng values
|
||||
// obviously a place needs a lat/lng, but this could be sent in a geo-url
|
||||
// if no geo array key, we assume the array already has lat/lng values
|
||||
if (array_key_exists('geo', $data) && $data['geo'] !== null) {
|
||||
preg_match_all(
|
||||
'/([0-9\.\-]+)/',
|
||||
|
@ -40,7 +40,7 @@ class PlaceService
|
|||
*/
|
||||
public function createPlaceFromCheckin(array $checkin): Place
|
||||
{
|
||||
//check if the place exists if from swarm
|
||||
// check if the place exists if from swarm
|
||||
if (Arr::has($checkin, 'properties.url')) {
|
||||
$place = Place::whereExternalURL(Arr::get($checkin, 'properties.url.0'))->get();
|
||||
if (count($place) === 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue