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

@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
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.
*
* @param Builder $query
* @param int|null $year
* @param int|null $month
* @param Builder $query
* @param int|null $year
* @param int|null $month
* @return 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 Collection|Tag[] $tags
* @property-read int|null $tags_count
*
* @method static Builder|Bookmark newModelQuery()
* @method static Builder|Bookmark newQuery()
* @method static Builder|Bookmark query()

View file

@ -30,7 +30,7 @@ class Contact extends Model
{
$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);
if (file_exists(public_path() . '/assets/profile-images/' . $host . '/image')) {
$photo = '/assets/profile-images/' . $host . '/image';

View file

@ -5,11 +5,9 @@ declare(strict_types=1);
namespace App\Models;
use App\Traits\FilterHtml;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Mf2;
class Like extends Model
@ -32,7 +30,7 @@ class Like extends Model
/**
* 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)
{
@ -42,7 +40,7 @@ class Like extends Model
/**
* 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
*/
public function getContentAttribute(?string $value): ?string

View file

@ -4,11 +4,9 @@ declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
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.
*
* @param string $path
* @param string $path
* @return string
*/
public function getBasename(string $path): string
@ -100,7 +98,7 @@ class Media extends Model
/**
* Get the extension from a given filename.
*
* @param string $path
* @param string $path
* @return string
*/
public function getExtension(string $path): string

View file

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

View file

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

View file

@ -5,9 +5,10 @@ declare(strict_types=1);
namespace App\Models;
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\{Builder, Collection, Factories\HasFactory, Model};
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
class Place extends Model
@ -70,9 +71,9 @@ class Place extends Model
/**
* Select places near a given location.
*
* @param Builder $query
* @param object $location
* @param int $distance
* @param Builder $query
* @param object $location
* @param int $distance
* @return 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.
*
* @param Builder $query
* @param string $url
* @param Builder $query
* @param string $url
* @return Builder
*/
public function scopeWhereExternalURL(Builder $query, string $url): Builder

View file

@ -4,12 +4,9 @@ declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
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.
*
* @param string $value
* @param 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
* removing fancy diatric characters.
*
* @param string $tag
* @param string $tag
* @return string
*/
public static function normalize(string $tag): string

View file

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

View file

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