Fix files with Laravel Pint

This commit is contained in:
Jonny Barnes 2022-07-09 10:08:26 +01:00
parent c714457604
commit e36f15d391
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
116 changed files with 409 additions and 378 deletions

View file

@ -43,8 +43,9 @@ class Handler extends ExceptionHandler
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param Throwable $throwable * @param Throwable $throwable
* @return void * @return void
*
* @throws Exception * @throws Exception
* @throws Throwable * @throws Throwable
*/ */
@ -87,9 +88,10 @@ class Handler extends ExceptionHandler
/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param Request $request * @param Request $request
* @param Throwable $throwable * @param Throwable $throwable
* @return Response * @return Response
*
* @throws Throwable * @throws Throwable
*/ */
public function render($request, Throwable $throwable) public function render($request, Throwable $throwable)

View file

@ -15,8 +15,8 @@ class ArticlesController extends Controller
/** /**
* Show all articles (with pagination). * Show all articles (with pagination).
* *
* @param int|null $year * @param int|null $year
* @param int|null $month * @param int|null $month
* @return View * @return View
*/ */
public function index(int $year = null, int $month = null): View public function index(int $year = null, int $month = null): View
@ -32,9 +32,9 @@ class ArticlesController extends Controller
/** /**
* Show a single article. * Show a single article.
* *
* @param int $year * @param int $year
* @param int $month * @param int $month
* @param string $slug * @param string $slug
* @return RedirectResponse|View * @return RedirectResponse|View
*/ */
public function show(int $year, int $month, string $slug) public function show(int $year, int $month, string $slug)
@ -59,7 +59,7 @@ class ArticlesController extends Controller
* We only have the ID, work out post title, year and month * We only have the ID, work out post title, year and month
* and redirect to it. * and redirect to it.
* *
* @param string $idFromUrl * @param string $idFromUrl
* @return RedirectResponse * @return RedirectResponse
*/ */
public function onlyIdInUrl(string $idFromUrl): RedirectResponse public function onlyIdInUrl(string $idFromUrl): RedirectResponse

View file

@ -24,7 +24,7 @@ class BookmarksController extends Controller
/** /**
* Show a single bookmark. * Show a single bookmark.
* *
* @param Bookmark $bookmark * @param Bookmark $bookmark
* @return View * @return View
*/ */
public function show(Bookmark $bookmark): View public function show(Bookmark $bookmark): View

View file

@ -34,7 +34,7 @@ class ContactsController extends Controller
/** /**
* Show a single contact. * Show a single contact.
* *
* @param Contact $contact * @param Contact $contact
* @return View * @return View
*/ */
public function show(Contact $contact): View public function show(Contact $contact): View

View file

@ -4,7 +4,8 @@ declare(strict_types=1);
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\{Article, Note}; use App\Models\Article;
use App\Models\Note;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Response; use Illuminate\Http\Response;

View file

@ -24,7 +24,7 @@ class LikesController extends Controller
/** /**
* Show a single like. * Show a single like.
* *
* @param Like $like * @param Like $like
* @return View * @return View
*/ */
public function show(Like $like): View public function show(Like $like): View

View file

@ -6,7 +6,9 @@ namespace App\Http\Controllers;
use App\Http\Responses\MicropubResponses; use App\Http\Responses\MicropubResponses;
use App\Models\Place; use App\Models\Place;
use App\Services\Micropub\{HCardService, HEntryService, UpdateService}; use App\Services\Micropub\HCardService;
use App\Services\Micropub\HEntryService;
use App\Services\Micropub\UpdateService;
use App\Services\TokenService; use App\Services\TokenService;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Lcobucci\JWT\Encoding\CannotDecodeContent; use Lcobucci\JWT\Encoding\CannotDecodeContent;
@ -18,8 +20,11 @@ use Monolog\Logger;
class MicropubController extends Controller class MicropubController extends Controller
{ {
protected TokenService $tokenService; protected TokenService $tokenService;
protected HEntryService $hentryService; protected HEntryService $hentryService;
protected HCardService $hcardService; protected HCardService $hcardService;
protected UpdateService $updateService; protected UpdateService $updateService;
public function __construct( public function __construct(
@ -168,6 +173,7 @@ class MicropubController extends Controller
* Determine the client id from the access token sent with the request. * Determine the client id from the access token sent with the request.
* *
* @return string * @return string
*
* @throws RequiredConstraintsViolated * @throws RequiredConstraintsViolated
*/ */
private function getClientId(): string private function getClientId(): string
@ -180,7 +186,7 @@ class MicropubController extends Controller
/** /**
* Save the details of the micropub request to a log file. * Save the details of the micropub request to a log file.
* *
* @param array $request This is the info from request()->all() * @param array $request This is the info from request()->all()
*/ */
private function logMicropubRequest(array $request) private function logMicropubRequest(array $request)
{ {

View file

@ -97,6 +97,7 @@ class MicropubMediaController extends Controller
* Process a media item posted to the media endpoint. * Process a media item posted to the media endpoint.
* *
* @return JsonResponse * @return JsonResponse
*
* @throws BindingResolutionException * @throws BindingResolutionException
* @throws Exception * @throws Exception
*/ */
@ -184,7 +185,7 @@ class MicropubMediaController extends Controller
/** /**
* Get the file type from the mime-type of the uploaded file. * Get the file type from the mime-type of the uploaded file.
* *
* @param string $mimeType * @param string $mimeType
* @return string * @return string
*/ */
private function getFileTypeFromMimeType(string $mimeType): string private function getFileTypeFromMimeType(string $mimeType): string
@ -229,8 +230,9 @@ class MicropubMediaController extends Controller
/** /**
* Save an uploaded file to the local disk. * Save an uploaded file to the local disk.
* *
* @param UploadedFile $file * @param UploadedFile $file
* @return string * @return string
*
* @throws Exception * @throws Exception
*/ */
private function saveFile(UploadedFile $file): string private function saveFile(UploadedFile $file): string

View file

@ -40,7 +40,7 @@ class NotesController extends Controller
/** /**
* Show a single note. * Show a single note.
* *
* @param string $urlId The id of the note * @param string $urlId The id of the note
* @return View|JsonResponse|Response * @return View|JsonResponse|Response
*/ */
public function show(string $urlId) public function show(string $urlId)
@ -61,7 +61,7 @@ class NotesController extends Controller
/** /**
* Redirect /note/{decID} to /notes/{nb60id}. * Redirect /note/{decID} to /notes/{nb60id}.
* *
* @param int $decId The decimal id of the note * @param int $decId The decimal id of the note
* @return RedirectResponse * @return RedirectResponse
*/ */
public function redirect(int $decId): RedirectResponse public function redirect(int $decId): RedirectResponse
@ -72,7 +72,7 @@ class NotesController extends Controller
/** /**
* Show all notes tagged with {tag}. * Show all notes tagged with {tag}.
* *
* @param string $tag * @param string $tag
* @return View * @return View
*/ */
public function tagged(string $tag): View public function tagged(string $tag): View

View file

@ -24,7 +24,7 @@ class PlacesController extends Controller
/** /**
* Show a specific place. * Show a specific place.
* *
* @param Place $place * @param Place $place
* @return View * @return View
*/ */
public function show(Place $place): View public function show(Place $place): View

View file

@ -23,8 +23,8 @@ class TokenEndpointController extends Controller
/** /**
* Inject the dependencies. * Inject the dependencies.
* *
* @param Client $client * @param Client $client
* @param TokenService $tokenService * @param TokenService $tokenService
*/ */
public function __construct( public function __construct(
Client $client, Client $client,

View file

@ -10,8 +10,8 @@ class CSPHeader
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param Request $request * @param Request $request
* @param Closure $next * @param Closure $next
* @return mixed * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)

View file

@ -23,7 +23,7 @@ class AddClientToDatabase implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param string $client_id * @param string $client_id
*/ */
public function __construct(string $client_id) public function __construct(string $client_id)
{ {

View file

@ -29,7 +29,7 @@ class DownloadWebMention implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param string $source * @param string $source
*/ */
public function __construct(string $source) public function __construct(string $source)
{ {
@ -39,7 +39,8 @@ class DownloadWebMention implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Client $guzzle * @param Client $guzzle
*
* @throws GuzzleException * @throws GuzzleException
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
@ -81,7 +82,7 @@ class DownloadWebMention implements ShouldQueue
/** /**
* Create a file path from a URL. This is used when caching the HTML response. * Create a file path from a URL. This is used when caching the HTML response.
* *
* @param string $url * @param string $url
* @return string The path name * @return string The path name
*/ */
private function createFilenameFromURL(string $url) private function createFilenameFromURL(string $url)

View file

@ -26,7 +26,7 @@ class ProcessBookmark implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param Bookmark $bookmark * @param Bookmark $bookmark
*/ */
public function __construct(Bookmark $bookmark) public function __construct(Bookmark $bookmark)
{ {

View file

@ -31,7 +31,7 @@ class ProcessLike implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param Like $like * @param Like $like
*/ */
public function __construct(Like $like) public function __construct(Like $like)
{ {
@ -41,9 +41,10 @@ class ProcessLike implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Client $client * @param Client $client
* @param Authorship $authorship * @param Authorship $authorship
* @return int * @return int
*
* @throws GuzzleException * @throws GuzzleException
*/ */
public function handle(Client $client, Authorship $authorship): int public function handle(Client $client, Authorship $authorship): int

View file

@ -26,7 +26,7 @@ class ProcessMedia implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param string $filename * @param string $filename
*/ */
public function __construct(string $filename) public function __construct(string $filename)
{ {
@ -36,7 +36,7 @@ class ProcessMedia implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param ImageManager $manager * @param ImageManager $manager
*/ */
public function handle(ImageManager $manager) public function handle(ImageManager $manager)
{ {

View file

@ -5,13 +5,15 @@ declare(strict_types=1);
namespace App\Jobs; namespace App\Jobs;
use App\Exceptions\RemoteContentNotFoundException; use App\Exceptions\RemoteContentNotFoundException;
use App\Models\{Note, WebMention}; use App\Models\Note;
use App\Models\WebMention;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\RequestException;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\{InteractsWithQueue, SerializesModels}; use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Jonnybarnes\WebmentionsParser\Exceptions\InvalidMentionException; use Jonnybarnes\WebmentionsParser\Exceptions\InvalidMentionException;
use Jonnybarnes\WebmentionsParser\Parser; use Jonnybarnes\WebmentionsParser\Parser;
use Mf2; use Mf2;
@ -31,8 +33,8 @@ class ProcessWebMention implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param Note $note * @param Note $note
* @param string $source * @param string $source
*/ */
public function __construct(Note $note, string $source) public function __construct(Note $note, string $source)
{ {
@ -43,8 +45,9 @@ class ProcessWebMention implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Parser $parser * @param Parser $parser
* @param Client $guzzle * @param Client $guzzle
*
* @throws RemoteContentNotFoundException * @throws RemoteContentNotFoundException
* @throws GuzzleException * @throws GuzzleException
* @throws InvalidMentionException * @throws InvalidMentionException

View file

@ -25,7 +25,7 @@ class SaveProfileImage implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param array $microformats * @param array $microformats
*/ */
public function __construct(array $microformats) public function __construct(array $microformats)
{ {
@ -35,7 +35,7 @@ class SaveProfileImage implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Authorship $authorship * @param Authorship $authorship
*/ */
public function handle(Authorship $authorship) public function handle(Authorship $authorship)
{ {

View file

@ -28,7 +28,7 @@ class SendWebMentions implements ShouldQueue
/** /**
* Create the job instance, inject dependencies. * Create the job instance, inject dependencies.
* *
* @param Note $note * @param Note $note
*/ */
public function __construct(Note $note) public function __construct(Note $note)
{ {
@ -65,7 +65,7 @@ class SendWebMentions implements ShouldQueue
/** /**
* Discover if a URL has a webmention endpoint. * Discover if a URL has a webmention endpoint.
* *
* @param string $url * @param string $url
* @return string|null * @return string|null
*/ */
public function discoverWebmentionEndpoint(string $url): ?string public function discoverWebmentionEndpoint(string $url): ?string
@ -108,7 +108,7 @@ class SendWebMentions implements ShouldQueue
/** /**
* Get the URLs from a note. * Get the URLs from a note.
* *
* @param string|null $html * @param string|null $html
* @return array * @return array
*/ */
public function getLinks(?string $html): array public function getLinks(?string $html): array
@ -133,8 +133,8 @@ class SendWebMentions implements ShouldQueue
* *
* @todo Update deprecated resolve method * @todo Update deprecated resolve method
* *
* @param string $url * @param string $url
* @param string $base The base of the URL * @param string $base The base of the URL
* @return string * @return string
*/ */
public function resolveUri(string $url, string $base): string public function resolveUri(string $url, string $base): string

View file

@ -26,7 +26,7 @@ class SyndicateBookmarkToTwitter implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param Bookmark $bookmark * @param Bookmark $bookmark
*/ */
public function __construct(Bookmark $bookmark) public function __construct(Bookmark $bookmark)
{ {
@ -36,7 +36,8 @@ class SyndicateBookmarkToTwitter implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Client $guzzle * @param Client $guzzle
*
* @throws GuzzleException * @throws GuzzleException
*/ */
public function handle(Client $guzzle) public function handle(Client $guzzle)

View file

@ -24,7 +24,7 @@ class SyndicateNoteToTwitter implements ShouldQueue
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @param Note $note * @param Note $note
*/ */
public function __construct(Note $note) public function __construct(Note $note)
{ {
@ -34,7 +34,8 @@ class SyndicateNoteToTwitter implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
* *
* @param Client $guzzle * @param Client $guzzle
*
* @throws GuzzleException * @throws GuzzleException
*/ */
public function handle(Client $guzzle) public function handle(Client $guzzle)

View file

@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment\Environment; use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode; use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
@ -128,9 +127,9 @@ class Article extends Model
/** /**
* Scope a query to only include articles from a particular year/month. * Scope a query to only include articles from a particular year/month.
* *
* @param Builder $query * @param Builder $query
* @param int|null $year * @param int|null $year
* @param int|null $month * @param int|null $month
* @return Builder * @return Builder
*/ */
public function scopeDate(Builder $query, int $year = null, int $month = null): Builder public function scopeDate(Builder $query, int $year = null, int $month = null): Builder

View file

@ -26,6 +26,7 @@ use Illuminate\Support\Carbon;
* @property-read string $longurl * @property-read string $longurl
* @property-read Collection|Tag[] $tags * @property-read Collection|Tag[] $tags
* @property-read int|null $tags_count * @property-read int|null $tags_count
*
* @method static Builder|Bookmark newModelQuery() * @method static Builder|Bookmark newModelQuery()
* @method static Builder|Bookmark newQuery() * @method static Builder|Bookmark newQuery()
* @method static Builder|Bookmark query() * @method static Builder|Bookmark query()

View file

@ -30,7 +30,7 @@ class Contact extends Model
{ {
$photo = '/assets/profile-images/default-image'; $photo = '/assets/profile-images/default-image';
if (array_key_exists('homepage', $this->attributes) && !empty($this->attributes['homepage'])) { if (array_key_exists('homepage', $this->attributes) && ! empty($this->attributes['homepage'])) {
$host = parse_url($this->attributes['homepage'], PHP_URL_HOST); $host = parse_url($this->attributes['homepage'], PHP_URL_HOST);
if (file_exists(public_path() . '/assets/profile-images/' . $host . '/image')) { if (file_exists(public_path() . '/assets/profile-images/' . $host . '/image')) {
$photo = '/assets/profile-images/' . $host . '/image'; $photo = '/assets/profile-images/' . $host . '/image';

View file

@ -5,11 +5,9 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use App\Traits\FilterHtml; use App\Traits\FilterHtml;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Mf2; use Mf2;
class Like extends Model class Like extends Model
@ -32,7 +30,7 @@ class Like extends Model
/** /**
* Normalize the URL of the author of the like. * Normalize the URL of the author of the like.
* *
* @param string|null $value The authors url * @param string|null $value The authors url
*/ */
public function setAuthorUrlAttribute(?string $value) public function setAuthorUrlAttribute(?string $value)
{ {
@ -42,7 +40,7 @@ class Like extends Model
/** /**
* If the content contains HTML, filter it. * If the content contains HTML, filter it.
* *
* @param string|null $value The content of the like * @param string|null $value The content of the like
* @return string|null * @return string|null
*/ */
public function getContentAttribute(?string $value): ?string public function getContentAttribute(?string $value): ?string

View file

@ -4,11 +4,9 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Media extends Model class Media extends Model
@ -82,7 +80,7 @@ class Media extends Model
/** /**
* Give the real part of a filename, i.e. strip the file extension. * Give the real part of a filename, i.e. strip the file extension.
* *
* @param string $path * @param string $path
* @return string * @return string
*/ */
public function getBasename(string $path): string public function getBasename(string $path): string
@ -100,7 +98,7 @@ class Media extends Model
/** /**
* Get the extension from a given filename. * Get the extension from a given filename.
* *
* @param string $path * @param string $path
* @return string * @return string
*/ */
public function getExtension(string $path): string public function getExtension(string $path): string

View file

@ -4,12 +4,9 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Carbon;
class MicropubClient extends Model class MicropubClient extends Model
{ {

View file

@ -10,8 +10,14 @@ use App\Exceptions\TwitterContentException;
use Codebird\Codebird; use Codebird\Codebird;
use Exception; use Exception;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\{Builder, Factories\HasFactory, Model, SoftDeletes}; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany}; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\ArrayShape;
use Jonnybarnes\IndieWeb\Numbers; use Jonnybarnes\IndieWeb\Numbers;
@ -24,7 +30,8 @@ use League\CommonMark\Extension\Mention\Mention;
use League\CommonMark\Extension\Mention\MentionExtension; use League\CommonMark\Extension\Mention\MentionExtension;
use League\CommonMark\MarkdownConverter; use League\CommonMark\MarkdownConverter;
use Normalizer; use Normalizer;
use Spatie\CommonMarkHighlighter\{FencedCodeRenderer, IndentedCodeRenderer}; use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
class Note extends Model class Note extends Model
{ {
@ -46,7 +53,7 @@ class Note extends Model
/** /**
* Set our contacts variable to null. * Set our contacts variable to null.
* *
* @param array $attributes * @param array $attributes
*/ */
public function __construct(array $attributes = []) public function __construct(array $attributes = [])
{ {
@ -134,7 +141,7 @@ class Note extends Model
* *
* @return array * @return array
*/ */
#[ArrayShape(['note' => "null|string"])] #[ArrayShape(['note' => 'null|string'])]
public function toSearchableArray(): array public function toSearchableArray(): array
{ {
return [ return [
@ -145,7 +152,7 @@ class Note extends Model
/** /**
* Normalize the note to Unicode FORM C. * Normalize the note to Unicode FORM C.
* *
* @param string|null $value * @param string|null $value
*/ */
public function setNoteAttribute(?string $value): void public function setNoteAttribute(?string $value): void
{ {
@ -161,7 +168,7 @@ class Note extends Model
/** /**
* Pre-process notes for web-view. * Pre-process notes for web-view.
* *
* @param string|null $value * @param string|null $value
* @return string|null * @return string|null
*/ */
public function getNoteAttribute(?string $value): ?string public function getNoteAttribute(?string $value): ?string
@ -339,7 +346,7 @@ class Note extends Model
{ {
if ( if (
$this->in_reply_to === null || $this->in_reply_to === null ||
!$this->isTwitterLink($this->in_reply_to) ! $this->isTwitterLink($this->in_reply_to)
) { ) {
return null; return null;
} }
@ -375,6 +382,7 @@ class Note extends Model
* That is we swap the contacts names for their known Twitter handles. * That is we swap the contacts names for their known Twitter handles.
* *
* @return string * @return string
*
* @throws TwitterContentException * @throws TwitterContentException
*/ */
public function getTwitterContentAttribute(): string public function getTwitterContentAttribute(): string
@ -419,8 +427,8 @@ class Note extends Model
/** /**
* Scope a query to select a note via a NewBase60 id. * Scope a query to select a note via a NewBase60 id.
* *
* @param Builder $query * @param Builder $query
* @param string $nb60id * @param string $nb60id
* @return Builder * @return Builder
*/ */
public function scopeNb60(Builder $query, string $nb60id): Builder public function scopeNb60(Builder $query, string $nb60id): Builder
@ -436,7 +444,7 @@ class Note extends Model
* due to lack of contact info, we assume @username is a twitter handle and link it * due to lack of contact info, we assume @username is a twitter handle and link it
* as such. * as such.
* *
* @param string $text * @param string $text
* @return string * @return string
*/ */
private function makeHCards(string $text): string private function makeHCards(string $text): string
@ -507,7 +515,7 @@ class Note extends Model
* `#[\-_a-zA-Z0-9]+` and wraps them in an `a` element with * `#[\-_a-zA-Z0-9]+` and wraps them in an `a` element with
* `rel=tag` set and a `href` of 'section/tagged/' + tagname without the #. * `rel=tag` set and a `href` of 'section/tagged/' + tagname without the #.
* *
* @param string $note * @param string $note
* @return string * @return string
*/ */
public function autoLinkHashtag(string $note): string public function autoLinkHashtag(string $note): string
@ -526,7 +534,7 @@ class Note extends Model
/** /**
* Pass a note through the commonmark library. * Pass a note through the commonmark library.
* *
* @param string $note * @param string $note
* @return string * @return string
*/ */
private function convertMarkdown(string $note): string private function convertMarkdown(string $note): string
@ -534,8 +542,8 @@ class Note extends Model
$config = [ $config = [
'mentions' => [ 'mentions' => [
'contacts_handle' => [ 'contacts_handle' => [
'prefix' => '@', 'prefix' => '@',
'pattern' => '[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)', 'pattern' => '[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)',
'generator' => new ContactMentionGenerator(), 'generator' => new ContactMentionGenerator(),
], ],
], ],
@ -556,8 +564,8 @@ class Note extends Model
/** /**
* Do a reverse geocode lookup of a `lat,lng` value. * Do a reverse geocode lookup of a `lat,lng` value.
* *
* @param float $latitude * @param float $latitude
* @param float $longitude * @param float $longitude
* @return string * @return string
*/ */
public function reverseGeoCode(float $latitude, float $longitude): string public function reverseGeoCode(float $latitude, float $longitude): string

View file

@ -5,9 +5,10 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use Cviebrock\EloquentSluggable\Sluggable; use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
use Illuminate\Support\Carbon;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Place extends Model class Place extends Model
@ -70,9 +71,9 @@ class Place extends Model
/** /**
* Select places near a given location. * Select places near a given location.
* *
* @param Builder $query * @param Builder $query
* @param object $location * @param object $location
* @param int $distance * @param int $distance
* @return Builder * @return Builder
*/ */
public function scopeNear(Builder $query, object $location, int $distance = 1000): Builder public function scopeNear(Builder $query, object $location, int $distance = 1000): Builder
@ -93,8 +94,8 @@ class Place extends Model
/** /**
* Select places based on a URL. * Select places based on a URL.
* *
* @param Builder $query * @param Builder $query
* @param string $url * @param string $url
* @return Builder * @return Builder
*/ */
public function scopeWhereExternalURL(Builder $query, string $url): Builder public function scopeWhereExternalURL(Builder $query, string $url): Builder

View file

@ -4,12 +4,9 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Tag extends Model class Tag extends Model
@ -46,7 +43,7 @@ class Tag extends Model
/** /**
* When creating a Tag model instance, invoke the nomralize method on the tag. * When creating a Tag model instance, invoke the nomralize method on the tag.
* *
* @param string $value * @param string $value
*/ */
public function setTagAttribute(string $value) public function setTagAttribute(string $value)
{ {
@ -57,7 +54,7 @@ class Tag extends Model
* This method actually normalizes a tag. That means lowercase-ing and * This method actually normalizes a tag. That means lowercase-ing and
* removing fancy diatric characters. * removing fancy diatric characters.
* *
* @param string $tag * @param string $tag
* @return string * @return string
*/ */
public static function normalize(string $tag): string public static function normalize(string $tag): string

View file

@ -4,13 +4,9 @@ declare(strict_types=1);
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Notifications\DatabaseNotificationCollection;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Carbon;
class User extends Authenticatable class User extends Authenticatable
{ {

View file

@ -6,12 +6,10 @@ namespace App\Models;
use App\Traits\FilterHtml; use App\Traits\FilterHtml;
use Codebird\Codebird; use Codebird\Codebird;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Filesystem\Filesystem; use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Jonnybarnes\WebmentionsParser\Authorship; use Jonnybarnes\WebmentionsParser\Authorship;
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException; use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
@ -49,6 +47,7 @@ class WebMention extends Model
* Get the author of the webmention. * Get the author of the webmention.
* *
* @return array * @return array
*
* @throws AuthorshipParserException * @throws AuthorshipParserException
*/ */
public function getAuthorAttribute(): array public function getAuthorAttribute(): array
@ -115,7 +114,7 @@ class WebMention extends Model
/** /**
* Create the photo link. * Create the photo link.
* *
* @param string $url * @param string $url
* @return string * @return string
*/ */
public function createPhotoLink(string $url): string public function createPhotoLink(string $url): string

View file

@ -4,15 +4,17 @@ declare(strict_types=1);
namespace App\Observers; namespace App\Observers;
use App\Models\{Note, Tag}; use App\Models\Note;
use Illuminate\Support\{Arr, Collection}; use App\Models\Tag;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
class NoteObserver class NoteObserver
{ {
/** /**
* Listen to the Note created event. * Listen to the Note created event.
* *
* @param Note $note * @param Note $note
*/ */
public function created(Note $note) public function created(Note $note)
{ {
@ -36,7 +38,7 @@ class NoteObserver
/** /**
* Listen to the Note updated event. * Listen to the Note updated event.
* *
* @param Note $note * @param Note $note
*/ */
public function updated(Note $note) public function updated(Note $note)
{ {
@ -62,7 +64,7 @@ class NoteObserver
/** /**
* Listen to the Note deleting event. * Listen to the Note deleting event.
* *
* @param Note $note * @param Note $note
*/ */
public function deleting(Note $note) public function deleting(Note $note)
{ {
@ -72,7 +74,7 @@ class NoteObserver
/** /**
* Retrieve the tags from a notes text, tag for form #tag. * Retrieve the tags from a notes text, tag for form #tag.
* *
* @param string $note * @param string $note
* @return Collection * @return Collection
*/ */
private function getTagsFromNote(string $note): Collection private function getTagsFromNote(string $note): Collection

View file

@ -62,10 +62,10 @@ class AppServiceProvider extends ServiceProvider
/** /**
* Paginate a standard Laravel Collection. * Paginate a standard Laravel Collection.
* *
* @param int $perPage * @param int $perPage
* @param int $total * @param int $total
* @param int $page * @param int $page
* @param string $pageName * @param string $pageName
* @return array * @return array
*/ */
Collection::macro('paginate', function ($perPage, $total = null, $page = null, $pageName = 'page') { Collection::macro('paginate', function ($perPage, $total = null, $page = null, $pageName = 'page') {

View file

@ -7,10 +7,12 @@ namespace App\Services;
use App\Exceptions\InternetArchiveException; use App\Exceptions\InternetArchiveException;
use App\Jobs\ProcessBookmark; use App\Jobs\ProcessBookmark;
use App\Jobs\SyndicateBookmarkToTwitter; use App\Jobs\SyndicateBookmarkToTwitter;
use App\Models\{Bookmark, Tag}; use App\Models\Bookmark;
use App\Models\Tag;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ClientException;
use Illuminate\Support\{Arr, Str}; use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Spatie\Browsershot\Browsershot; use Spatie\Browsershot\Browsershot;
use Spatie\Browsershot\Exceptions\CouldNotTakeBrowsershot; use Spatie\Browsershot\Exceptions\CouldNotTakeBrowsershot;
@ -20,7 +22,7 @@ class BookmarkService
/** /**
* Create a new Bookmark. * Create a new Bookmark.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return Bookmark * @return Bookmark
*/ */
public function createBookmark(array $request): Bookmark public function createBookmark(array $request): Bookmark
@ -81,8 +83,9 @@ class BookmarkService
/** /**
* Given a URL, use `browsershot` to save an image of the page. * Given a URL, use `browsershot` to save an image of the page.
* *
* @param string $url * @param string $url
* @return string The uuid for the screenshot * @return string The uuid for the screenshot
*
* @throws CouldNotTakeBrowsershot * @throws CouldNotTakeBrowsershot
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
@ -104,8 +107,9 @@ class BookmarkService
/** /**
* Given a URL, attempt to save it to the Internet Archive. * Given a URL, attempt to save it to the Internet Archive.
* *
* @param string $url * @param string $url
* @return string * @return string
*
* @throws InternetArchiveException * @throws InternetArchiveException
*/ */
public function getArchiveLink(string $url): string public function getArchiveLink(string $url): string

View file

@ -13,7 +13,7 @@ class LikeService
/** /**
* Create a new Like. * Create a new Like.
* *
* @param array $request * @param array $request
* @return Like $like * @return Like $like
*/ */
public function createLike(array $request): Like public function createLike(array $request): Like

View file

@ -4,7 +4,9 @@ declare(strict_types=1);
namespace App\Services\Micropub; namespace App\Services\Micropub;
use App\Services\{BookmarkService, LikeService, NoteService}; use App\Services\BookmarkService;
use App\Services\LikeService;
use App\Services\NoteService;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
class HEntryService class HEntryService

View file

@ -4,9 +4,11 @@ declare(strict_types=1);
namespace App\Services\Micropub; namespace App\Services\Micropub;
use App\Models\{Media, Note}; use App\Models\Media;
use App\Models\Note;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\{Arr, Str}; use Illuminate\Support\Arr;
use Illuminate\Support\Str;
class UpdateService class UpdateService
{ {

View file

@ -4,9 +4,13 @@ declare(strict_types=1);
namespace App\Services; namespace App\Services;
use App\Jobs\{SendWebMentions, SyndicateNoteToTwitter}; use App\Jobs\SendWebMentions;
use App\Models\{Media, Note, Place}; use App\Jobs\SyndicateNoteToTwitter;
use Illuminate\Support\{Arr, Str}; use App\Models\Media;
use App\Models\Note;
use App\Models\Place;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
class NoteService class NoteService
{ {
@ -61,7 +65,7 @@ class NoteService
/** /**
* Get the content from the request to create a new note. * Get the content from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getContent(array $request): ?string private function getContent(array $request): ?string
@ -79,7 +83,7 @@ class NoteService
/** /**
* Get the in-reply-to from the request to create a new note. * Get the in-reply-to from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getInReplyTo(array $request): ?string private function getInReplyTo(array $request): ?string
@ -94,7 +98,7 @@ class NoteService
/** /**
* Get the published time from the request to create a new note. * Get the published time from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getPublished(array $request): ?string private function getPublished(array $request): ?string
@ -113,7 +117,7 @@ class NoteService
/** /**
* Get the location data from the request to create a new note. * Get the location data from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getLocation(array $request): ?string private function getLocation(array $request): ?string
@ -135,7 +139,7 @@ class NoteService
/** /**
* Get the checkin data from the request to create a new note. This will be a Place. * Get the checkin data from the request to create a new note. This will be a Place.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return Place|null * @return Place|null
*/ */
private function getCheckin(array $request): ?Place private function getCheckin(array $request): ?Place
@ -181,7 +185,7 @@ class NoteService
/** /**
* Get the Swarm URL from the syndication data in the request to create a new note. * Get the Swarm URL from the syndication data in the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getSwarmUrl(array $request): ?string private function getSwarmUrl(array $request): ?string
@ -196,7 +200,7 @@ class NoteService
/** /**
* Get the syndication targets from the request to create a new note. * Get the syndication targets from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return array * @return array
*/ */
private function getSyndicationTargets(array $request): array private function getSyndicationTargets(array $request): array
@ -225,7 +229,7 @@ class NoteService
/** /**
* Get the media URLs from the request to create a new note. * Get the media URLs from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return array * @return array
*/ */
private function getMedia(array $request): array private function getMedia(array $request): array
@ -255,7 +259,7 @@ class NoteService
/** /**
* Get the Instagram photo URL from the request to create a new note. * Get the Instagram photo URL from the request to create a new note.
* *
* @param array $request Data from request()->all() * @param array $request Data from request()->all()
* @return string|null * @return string|null
*/ */
private function getInstagramUrl(array $request): ?string private function getInstagramUrl(array $request): ?string

View file

@ -12,7 +12,7 @@ class PlaceService
/** /**
* Create a place. * Create a place.
* *
* @param array $data * @param array $data
* @return Place * @return Place
*/ */
public function createPlace(array $data): Place public function createPlace(array $data): Place

View file

@ -6,7 +6,8 @@ namespace App\Services;
use App\Jobs\AddClientToDatabase; use App\Jobs\AddClientToDatabase;
use DateTimeImmutable; use DateTimeImmutable;
use Lcobucci\JWT\{Configuration, Token}; use Lcobucci\JWT\Configuration;
use Lcobucci\JWT\Token;
class TokenService class TokenService
{ {

View file

@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -26,12 +26,12 @@ return array(
| can also be used. For PDO, run the package migrations first. | can also be used. For PDO, run the package migrations first.
| |
*/ */
'storage' => array( 'storage' => [
'enabled' => true, 'enabled' => true,
'driver' => 'file', // redis, file, pdo 'driver' => 'file', // redis, file, pdo
'path' => storage_path() . '/debugbar', // For file driver 'path' => storage_path() . '/debugbar', // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO) 'connection' => null, // Leave null for default connection (Redis/PDO)
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -70,27 +70,27 @@ return array(
| |
*/ */
'collectors' => array( 'collectors' => [
'phpinfo' => true, // Php version 'phpinfo' => true, // Php version
'messages' => true, // Messages 'messages' => true, // Messages
'time' => true, // Time Datalogger 'time' => true, // Time Datalogger
'memory' => true, // Memory usage 'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer 'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled) 'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings 'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data 'views' => true, // Views with their data
'route' => true, // Current route information 'route' => true, // Current route information
'laravel' => false, // Laravel version and environment 'laravel' => false, // Laravel version and environment
'events' => false, // All events fired 'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger 'default_request' => false, // Regular or special Symfony request logger
'symfony_request' => true, // Only one can be enabled.. 'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages 'mail' => true, // Catch mail messages
'logs' => false, // Add the latest log messages 'logs' => false, // Add the latest log messages
'files' => false, // Show the included files 'files' => false, // Show the included files
'config' => false, // Display config settings 'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status 'auth' => false, // Display Laravel authentication status
'session' => false, // Display session data in a separate tab 'session' => false, // Display session data in a separate tab
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -101,33 +101,33 @@ return array(
| |
*/ */
'options' => array( 'options' => [
'auth' => array( 'auth' => [
'show_name' => false, // Also show the users name/email in the debugbar 'show_name' => false, // Also show the users name/email in the debugbar
), ],
'db' => array( 'db' => [
'with_params' => true, // Render SQL with the parameters substituted 'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline 'timeline' => false, // Add the queries to the timeline
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files. 'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries 'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
'enabled' => false, 'enabled' => false,
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+ 'types' => ['SELECT'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
), ],
'hints' => true, // Show hints for common mistakes 'hints' => true, // Show hints for common mistakes
), ],
'mail' => array( 'mail' => [
'full_log' => false 'full_log' => false,
), ],
'views' => array( 'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large.. 'data' => false, //Note: Can slow down the application, because the data can be quite large..
), ],
'route' => array( 'route' => [
'label' => true // show complete route on bar 'label' => true, // show complete route on bar
), ],
'logs' => array( 'logs' => [
'file' => null 'file' => null,
), ],
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -142,4 +142,4 @@ return array(
'inject' => true, 'inject' => true,
); ];

View file

@ -67,7 +67,7 @@ return [
'media' => [ 'media' => [
'driver' => 'local', 'driver' => 'local',
'root' => public_path() . '/media', 'root' => public_path() . '/media',
], ],
], ],

View file

@ -11,8 +11,8 @@ return [
| |
*/ */
'filename' => '_ide_helper', 'filename' => '_ide_helper',
'format' => 'php', 'format' => 'php',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View file

@ -17,7 +17,6 @@ return [
* *
* Defaults to null, which uses the toString() method on your model. * Defaults to null, which uses the toString() method on your model.
*/ */
'source' => null, 'source' => null,
/** /**
@ -25,7 +24,6 @@ return [
* no length restrictions are enforced. Set it to a positive integer if you * no length restrictions are enforced. Set it to a positive integer if you
* want to make sure your slugs aren't too long. * want to make sure your slugs aren't too long.
*/ */
'maxLength' => null, 'maxLength' => null,
/** /**
@ -43,13 +41,11 @@ return [
* *
* 'method' => array('Str','slug'), * 'method' => array('Str','slug'),
*/ */
'method' => null, 'method' => null,
/** /**
* Separator to use when generating slugs. Defaults to a hyphen. * Separator to use when generating slugs. Defaults to a hyphen.
*/ */
'separator' => '-', 'separator' => '-',
/** /**
@ -61,7 +57,6 @@ return [
* my-slug-1 * my-slug-1
* my-slug-2 * my-slug-2
*/ */
'unique' => true, 'unique' => true,
/** /**
@ -72,7 +67,6 @@ return [
* "similar" slugs. The closure should return the new unique * "similar" slugs. The closure should return the new unique
* suffix to append to the slug. * suffix to append to the slug.
*/ */
'uniqueSuffix' => null, 'uniqueSuffix' => null,
/** /**
@ -81,7 +75,6 @@ return [
* If set to "false", then a new slug could duplicate one that exists on a trashed model. * If set to "false", then a new slug could duplicate one that exists on a trashed model.
* If set to "true", then uniqueness is enforced across trashed and existing models. * If set to "true", then uniqueness is enforced across trashed and existing models.
*/ */
'includeTrashed' => false, 'includeTrashed' => false,
/** /**
@ -107,7 +100,6 @@ return [
* *
* and continue from there. * and continue from there.
*/ */
'reserved' => null, 'reserved' => null,
/** /**
@ -120,7 +112,6 @@ return [
* is probably not a good idea from an SEO point of view. * is probably not a good idea from an SEO point of view.
* Only set this to true if you understand the possible consequences. * Only set this to true if you understand the possible consequences.
*/ */
'onUpdate' => false, 'onUpdate' => false,
]; ];

View file

@ -22,5 +22,5 @@ return [
'photo' => 'https://pbs.twimg.com/profile_images/875422855932121089/W628ZI8w_400x400.jpg', 'photo' => 'https://pbs.twimg.com/profile_images/875422855932121089/W628ZI8w_400x400.jpg',
], ],
], ],
] ],
]; ];

View file

@ -2,17 +2,17 @@
// You can find the keys here : https://dev.twitter.com/ // You can find the keys here : https://dev.twitter.com/
return [ return [
'API_URL' => 'api.twitter.com', 'API_URL' => 'api.twitter.com',
'API_VERSION' => '1.1', 'API_VERSION' => '1.1',
'AUTHENTICATE_URL' => 'https://api.twitter.com/oauth/authenticate', 'AUTHENTICATE_URL' => 'https://api.twitter.com/oauth/authenticate',
'AUTHORIZE_URL' => 'https://api.twitter.com/oauth/authorize', 'AUTHORIZE_URL' => 'https://api.twitter.com/oauth/authorize',
'ACCESS_TOKEN_URL' => 'oauth/access_token', 'ACCESS_TOKEN_URL' => 'oauth/access_token',
'REQUEST_TOKEN_URL' => 'oauth/request_token', 'REQUEST_TOKEN_URL' => 'oauth/request_token',
'USE_SSL' => true, 'USE_SSL' => true,
'CONSUMER_KEY' => env('TWITTER_CONSUMER_KEY'), 'CONSUMER_KEY' => env('TWITTER_CONSUMER_KEY'),
'CONSUMER_SECRET' => env('TWITTER_CONSUMER_SECRET'), 'CONSUMER_SECRET' => env('TWITTER_CONSUMER_SECRET'),
'ACCESS_TOKEN' => env('TWITTER_ACCESS_TOKEN'), 'ACCESS_TOKEN' => env('TWITTER_ACCESS_TOKEN'),
'ACCESS_TOKEN_SECRET' => env('TWITTER_ACCESS_TOKEN_SECRET'), 'ACCESS_TOKEN_SECRET' => env('TWITTER_ACCESS_TOKEN_SECRET'),
]; ];

View file

@ -7,5 +7,5 @@
return [ return [
'longurl' => env('APP_LONGURL', 'jonnybarnes.uk'), 'longurl' => env('APP_LONGURL', 'jonnybarnes.uk'),
'shorturl' => env('APP_SHORTURL', 'jmb.lv') 'shorturl' => env('APP_SHORTURL', 'jmb.lv'),
]; ];

View file

@ -20,6 +20,7 @@ class NoteFactory extends Factory
* Define the model's default state. * Define the model's default state.
* *
* @return array * @return array
*
* @throws Exception * @throws Exception
*/ */
public function definition() public function definition()

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateArticlesTable extends Migration class CreateArticlesTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateNotesTable extends Migration class CreateNotesTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagsTable extends Migration class CreateTagsTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateNoteTagTable extends Migration class CreateNoteTagTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateContactsTable extends Migration class CreateContactsTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateWebMentionsTable extends Migration class CreateWebMentionsTable extends Migration
{ {
@ -12,8 +12,7 @@ class CreateWebMentionsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('webmentions', function (Blueprint $table) Schema::create('webmentions', function (Blueprint $table) {
{
$table->increments('id'); $table->increments('id');
$table->string('source'); $table->string('source');
$table->string('target'); $table->string('target');

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateClientsTable extends Migration class CreateClientsTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateFailedJobsTable extends Migration class CreateFailedJobsTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMediaTable extends Migration class CreateMediaTable extends Migration
{ {
@ -25,6 +25,7 @@ class CreateMediaTable extends Migration
$table->timestamps(); $table->timestamps();
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePlacesTable extends Migration class CreatePlacesTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddPlaceRelationToNotes extends Migration class AddPlaceRelationToNotes extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddJsonbMf2ColumnToWebmentionsTable extends Migration class AddJsonbMf2ColumnToWebmentionsTable extends Migration
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddExceptionColumnToFailedJobsTable extends Migration class AddExceptionColumnToFailedJobsTable extends Migration
{ {

View file

@ -1,8 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
class CascadeDeleteNoteTags extends Migration class CascadeDeleteNoteTags extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFacebookUrlColumnToNotes extends Migration class AddFacebookUrlColumnToNotes extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFacebookToContacts extends Migration class AddFacebookToContacts extends Migration
{ {

View file

@ -1,9 +1,9 @@
<?php <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSearchToNotes extends Migration class AddSearchToNotes extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIconToPlaces extends Migration class AddIconToPlaces extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMediaEndpointTable extends Migration class CreateMediaEndpointTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIndieWebUsersTable extends Migration class CreateIndieWebUsersTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateNotesTableAddSwarmUrl extends Migration class UpdateNotesTableAddSwarmUrl extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdatePlacesTableAddFoursquareColumn extends Migration class UpdatePlacesTableAddFoursquareColumn extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateNotesTableAddInstagramUrl extends Migration class UpdateNotesTableAddInstagramUrl extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdatePlacesTableAddExternalUrls extends Migration class UpdatePlacesTableAddExternalUrls extends Migration
{ {

View file

@ -1,9 +1,9 @@
<?php <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AllowEmptyNoteContent extends Migration class AllowEmptyNoteContent extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateMediaEndpointTableAddNullableImageWidthColumn extends Migration class UpdateMediaEndpointTableAddNullableImageWidthColumn extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLikesTable extends Migration class CreateLikesTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookmarksTable extends Migration class CreateBookmarksTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookmarkTagPivotTable extends Migration class CreateBookmarkTagPivotTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateModelsReferenceInWebmentionsTable extends Migration class UpdateModelsReferenceInWebmentionsTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTelescopeEntriesTable extends Migration class CreateTelescopeEntriesTable extends Migration
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration class CreateUsersTable extends Migration
{ {

View file

@ -3,8 +3,8 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\Article; use App\Models\Article;
use Illuminate\Support\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
class ArticlesTableSeeder extends Seeder class ArticlesTableSeeder extends Seeder
@ -28,7 +28,7 @@ class ArticlesTableSeeder extends Seeder
->update(['updated_at' => $now->toDateTimeString()]); ->update(['updated_at' => $now->toDateTimeString()]);
$now = Carbon::now()->subHours(2)->subMinutes(25); $now = Carbon::now()->subHours(2)->subMinutes(25);
$articleWithCode = <<<EOF $articleWithCode = <<<'EOF'
I wrote some code. I wrote some code.
I liked writing this: I liked writing this:

View file

@ -2,7 +2,8 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\{Bookmark, Tag}; use App\Models\Bookmark;
use App\Models\Tag;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class BookmarksTableSeeder extends Seeder class BookmarksTableSeeder extends Seeder

View file

@ -28,7 +28,7 @@ class ContactsTableSeeder extends Seeder
'facebook' => '123456', 'facebook' => '123456',
]); ]);
$fs = new FileSystem(); $fs = new FileSystem();
if (!$fs->exists(public_path('assets/profile-images/aaronparecki.com'))) { if (! $fs->exists(public_path('assets/profile-images/aaronparecki.com'))) {
$fs->makeDirectory(public_path('assets/profile-images/aaronparecki.com')); $fs->makeDirectory(public_path('assets/profile-images/aaronparecki.com'));
} }
$fs->copy( $fs->copy(

View file

@ -4,8 +4,8 @@ namespace Database\Seeders;
use App\Models\Like; use App\Models\Like;
use Faker\Generator; use Faker\Generator;
use Illuminate\Support\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
class LikesTableSeeder extends Seeder class LikesTableSeeder extends Seeder

View file

@ -2,10 +2,12 @@
namespace Database\Seeders; namespace Database\Seeders;
use Illuminate\Support\Carbon; use App\Models\Media;
use App\Models\Note;
use App\Models\Place;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\Models\{Media, Note, Place};
use SplFileInfo; use SplFileInfo;
class NotesTableSeeder extends Seeder class NotesTableSeeder extends Seeder
@ -184,7 +186,7 @@ class NotesTableSeeder extends Seeder
->update(['updated_at' => $now->toDateTimeString()]); ->update(['updated_at' => $now->toDateTimeString()]);
$now = Carbon::now()->subHours(2); $now = Carbon::now()->subHours(2);
$noteWithCodeContent = <<<EOF $noteWithCodeContent = <<<'EOF'
A note with some code: A note with some code:
```php ```php
<?php <?php
@ -203,7 +205,7 @@ EOF;
$noteWithLongUrl = Note::create([ $noteWithLongUrl = Note::create([
'note' => 'Best site: https://example.org/posts/some-really-long-slug-that-is-too-wide-on-mobile', 'note' => 'Best site: https://example.org/posts/some-really-long-slug-that-is-too-wide-on-mobile',
'created_at' => $now, 'created_at' => $now,
'client_id' => 'https://beta.indigenous.abode.pub/ios/' 'client_id' => 'https://beta.indigenous.abode.pub/ios/',
]); ]);
DB::table('notes') DB::table('notes')
->where('id', $noteWithLongUrl->id) ->where('id', $noteWithLongUrl->id)

View file

@ -21,7 +21,7 @@ class WebMentionsTableSeeder extends Seeder
'commentable_id' => '14', 'commentable_id' => '14',
'commentable_type' => 'App\Models\Note', 'commentable_type' => 'App\Models\Note',
'type' => 'in-reply-to', 'type' => 'in-reply-to',
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}' 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}',
]); ]);
// WebMention Tantek // WebMention Tantek
WebMention::create([ WebMention::create([
@ -30,7 +30,7 @@ class WebMentionsTableSeeder extends Seeder
'commentable_id' => '13', 'commentable_id' => '13',
'commentable_type' => 'App\Models\Note', 'commentable_type' => 'App\Models\Note',
'type' => 'in-reply-to', 'type' => 'in-reply-to',
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["http://tantek.com/"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["http://tantek.com/"], "name": ["Tantek Celik"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["' . config('app.url') . '/notes/D"]}}]}' 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["http://tantek.com/"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["http://tantek.com/"], "name": ["Tantek Celik"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["' . config('app.url') . '/notes/D"]}}]}',
]); ]);
} }
} }

View file

@ -68,7 +68,7 @@ if (! function_exists('normalize_url')) {
$url['path'] = preg_replace_callback( $url['path'] = preg_replace_callback(
array_map( array_map(
function ($str) { function ($str) {
return "/%" . strtoupper($str) . "/x"; return '/%' . strtoupper($str) . '/x';
}, },
$u $u
), ),
@ -78,10 +78,10 @@ if (! function_exists('normalize_url')) {
$url['path'] $url['path']
); );
// Remove directory index // Remove directory index
$defaultIndexes = ["/default\.aspx/" => 'default.aspx/', "/default\.asp/" => 'default.asp/', $defaultIndexes = ["/default\.aspx/" => 'default.aspx/', "/default\.asp/" => 'default.asp/',
"/index\.html/" => 'index.html/', "/index\.htm/" => 'index.htm/', "/index\.html/" => 'index.html/', "/index\.htm/" => 'index.htm/',
"/default\.html/" => 'default.html/', "/default\.htm/" => 'default.htm/', "/default\.html/" => 'default.html/', "/default\.htm/" => 'default.htm/',
"/index\.php/" => 'index.php/', "/index\.jsp/" => 'index.jsp/', ]; "/index\.php/" => 'index.php/', "/index\.jsp/" => 'index.jsp/', ];
foreach ($defaultIndexes as $index => $strip) { foreach ($defaultIndexes as $index => $strip) {
if (preg_match($index, $url['path'])) { if (preg_match($index, $url['path'])) {
$url['path'] = str_replace($strip, '', $url['path']); $url['path'] = str_replace($strip, '', $url['path']);

View file

@ -29,7 +29,6 @@ use App\Http\Controllers\MicropubController;
use App\Http\Controllers\MicropubMediaController; use App\Http\Controllers\MicropubMediaController;
use App\Http\Controllers\NotesController; use App\Http\Controllers\NotesController;
use App\Http\Controllers\PlacesController; use App\Http\Controllers\PlacesController;
use App\Http\Controllers\SearchController;
use App\Http\Controllers\ShortURLsController; use App\Http\Controllers\ShortURLsController;
use App\Http\Controllers\TokenEndpointController; use App\Http\Controllers\TokenEndpointController;
use App\Http\Controllers\WebMentionsController; use App\Http\Controllers\WebMentionsController;
@ -167,7 +166,7 @@ Route::group(['domain' => config('url.longurl')], function () {
Route::get('api/post', [MicropubController::class, 'get'])->middleware('micropub.token'); Route::get('api/post', [MicropubController::class, 'get'])->middleware('micropub.token');
Route::post('api/post', [MicropubController::class, 'post'])->middleware('micropub.token'); Route::post('api/post', [MicropubController::class, 'post'])->middleware('micropub.token');
Route::get('api/media', [MicropubMediaController::class, 'getHandler'])->middleware('micropub.token'); Route::get('api/media', [MicropubMediaController::class, 'getHandler'])->middleware('micropub.token');
Route::post('api/media', [MicropubMediaController:: class, 'media']) Route::post('api/media', [MicropubMediaController::class, 'media'])
->middleware('micropub.token', 'cors') ->middleware('micropub.token', 'cors')
->name('media-endpoint'); ->name('media-endpoint');
Route::options('/api/media', [MicropubMediaController::class, 'mediaOptionsResponse'])->middleware('cors'); Route::options('/api/media', [MicropubMediaController::class, 'mediaOptionsResponse'])->middleware('cors');

View file

@ -3,10 +3,8 @@
/** /**
* Laravel - A PHP Framework For Web Artisans * Laravel - A PHP Framework For Web Artisans
* *
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com> * @author Taylor Otwell <taylor@laravel.com>
*/ */
$uri = urldecode( $uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
); );

View file

@ -2,9 +2,8 @@
namespace Tests\Browser; namespace Tests\Browser;
use Tests\DuskTestCase;
use Laravel\Dusk\Browser; use Laravel\Dusk\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations; use Tests\DuskTestCase;
class ExampleTest extends DuskTestCase class ExampleTest extends DuskTestCase
{ {

View file

@ -3,7 +3,6 @@
namespace Tests\Browser; namespace Tests\Browser;
use Tests\DuskTestCase; use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class NotesTest extends DuskTestCase class NotesTest extends DuskTestCase
{ {

View file

@ -2,10 +2,10 @@
namespace Tests; namespace Tests;
use Laravel\Dusk\TestCase as BaseTestCase;
use Facebook\WebDriver\Chrome\ChromeOptions; use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Laravel\Dusk\TestCase as BaseTestCase;
abstract class DuskTestCase extends BaseTestCase abstract class DuskTestCase extends BaseTestCase
{ {
@ -15,6 +15,7 @@ abstract class DuskTestCase extends BaseTestCase
* Prepare for Dusk test execution. * Prepare for Dusk test execution.
* *
* @beforeClass * @beforeClass
*
* @return void * @return void
*/ */
public static function prepare() public static function prepare()
@ -34,7 +35,7 @@ abstract class DuskTestCase extends BaseTestCase
$options = new ChromeOptions(); $options = new ChromeOptions();
$options->addArguments([ $options->addArguments([
'headless', 'headless',
'disable-gpu' 'disable-gpu',
]); ]);
$desiredCapabilities->setCapability(ChromeOptions::CAPABILITY, $options); $desiredCapabilities->setCapability(ChromeOptions::CAPABILITY, $options);

View file

@ -53,8 +53,8 @@ class ActivityStreamTest extends TestCase
], ],
'object' => [ 'object' => [
'type' => 'Note', 'type' => 'Note',
'name' => strip_tags($note->note) 'name' => strip_tags($note->note),
] ],
]); ]);
} }
} }

View file

@ -43,7 +43,7 @@ class ArticlesTest extends TestCase
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog', [ ->post('/admin/blog', [
'title' => 'Test Title', 'title' => 'Test Title',
'main' => 'Article content' 'main' => 'Article content',
]); ]);
$this->assertDatabaseHas('articles', ['title' => 'Test Title']); $this->assertDatabaseHas('articles', ['title' => 'Test Title']);
} }
@ -63,8 +63,8 @@ class ArticlesTest extends TestCase
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog', [ ->post('/admin/blog', [
'title' => 'Uploaded Article', 'title' => 'Uploaded Article',
'article' => $file, 'article' => $file,
]); ]);
$this->assertDatabaseHas('articles', [ $this->assertDatabaseHas('articles', [

View file

@ -41,11 +41,11 @@ class ClientsTest extends TestCase
$this->actingAs($user) $this->actingAs($user)
->post('/admin/clients', [ ->post('/admin/clients', [
'client_name' => 'Micropublish', 'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net' 'client_url' => 'https://micropublish.net',
]); ]);
$this->assertDatabaseHas('clients', [ $this->assertDatabaseHas('clients', [
'client_name' => 'Micropublish', 'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net' 'client_url' => 'https://micropublish.net',
]); ]);
} }

View file

@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Tests\Feature\Admin; namespace Tests\Feature\Admin;
use App\Models\User;
use App\Models\Contact; use App\Models\Contact;
use App\Models\User;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack; use GuzzleHttp\HandlerStack;
@ -58,7 +58,7 @@ class ContactsTest extends TestCase
$this->assertDatabaseHas('contacts', [ $this->assertDatabaseHas('contacts', [
'name' => 'Fred Bloggs', 'name' => 'Fred Bloggs',
'nick' => 'fred', 'nick' => 'fred',
'homepage' => 'https://fred.blog/gs' 'homepage' => 'https://fred.blog/gs',
]); ]);
} }
@ -135,7 +135,7 @@ class ContactsTest extends TestCase
/** @test */ /** @test */
public function adminCanTriggerRetrievalOfRemoteAvatar(): void public function adminCanTriggerRetrievalOfRemoteAvatar(): void
{ {
$html = <<<HTML $html = <<<'HTML'
<div class="h-card"> <div class="h-card">
<img class="u-photo" alt="" src="http://tantek.com/tantek.png"> <img class="u-photo" alt="" src="http://tantek.com/tantek.png">
</div> </div>
@ -181,7 +181,7 @@ class ContactsTest extends TestCase
/** @test */ /** @test */
public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void
{ {
$html = <<<HTML $html = <<<'HTML'
<div class="h-card"> <div class="h-card">
<img class="u-photo" src="http://tantek.com/tantek.png"> <img class="u-photo" src="http://tantek.com/tantek.png">
</div> </div>

View file

@ -43,10 +43,10 @@ class LikesTest extends TestCase
$this->actingAs($user) $this->actingAs($user)
->post('/admin/likes', [ ->post('/admin/likes', [
'like_url' => 'https://example.com' 'like_url' => 'https://example.com',
]); ]);
$this->assertDatabaseHas('likes', [ $this->assertDatabaseHas('likes', [
'url' => 'https://example.com' 'url' => 'https://example.com',
]); ]);
Queue::assertPushed(ProcessLike::class); Queue::assertPushed(ProcessLike::class);
} }

View file

@ -70,7 +70,7 @@ class FeedsTest extends TestCase
'children' => [[ 'children' => [[
'type' => 'entry', 'type' => 'entry',
'post-type' => 'article', 'post-type' => 'article',
]] ]],
]); ]);
} }
@ -131,7 +131,7 @@ class FeedsTest extends TestCase
'children' => [[ 'children' => [[
'type' => 'entry', 'type' => 'entry',
'post-type' => 'note', 'post-type' => 'note',
]] ]],
]); ]);
} }

Some files were not shown because too many files have changed in this diff Show more