larastan level 2

pull/7362/head
Your Name 5 days ago
parent bb430cf77a
commit e2b76dba99

@ -16,6 +16,9 @@ use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin \App\Models\Status
*/
class StatusStateless extends JsonResource
{
/**

@ -5,6 +5,11 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property-read \App\Models\Status|null $status
* @property-read int $count aggregate/computed alias
* @property-read string $month_year aggregate/computed alias
*/
class AccountInterstitial extends Model
{
public const JSON_MESSAGE = 'Please use web browser to proceed.';

@ -5,6 +5,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* @property-read bool $recentlyCreated computed/dynamic attribute
*/
class Avatar extends Model
{
use SoftDeletes;

@ -5,6 +5,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property-read \App\Models\Group|null $group
*/
class GroupMember extends Model
{
use HasFactory;

@ -5,6 +5,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property-read int $total aggregate/computed alias
*/
class GroupReport extends Model
{
use HasFactory;

@ -4,6 +4,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property-read \App\Models\Status|null $status
*/
class MediaTag extends Model
{
protected $guarded = [];

@ -4,6 +4,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property bool $published computed/dynamic attribute
*/
class Newsroom extends Model
{
protected $table = 'newsroom';

@ -6,6 +6,9 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* @property-read \App\Models\Profile|null $actor
*/
class Notification extends Model
{
use SoftDeletes;

@ -34,6 +34,9 @@ use Illuminate\Support\Facades\Storage;
* @property Carbon|null $deleted_at
* @property-read User|null $user
* @property-read Avatar $avatar
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ProfileAlias> $aliases
* @property-read bool $is_followed computed/dynamic attribute
* @property-read int $profile_id joined-column alias (followers.profile_id)
*/
class Profile extends Model
{

@ -5,6 +5,10 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property-read \App\Models\Profile|null $profile
* @property-read \App\Models\Profile|null $target
*/
class ProfileMigration extends Model
{
use HasFactory;

@ -35,14 +35,18 @@ use Illuminate\Support\Str;
* @property int $reblogs_count
* @property int $reply_count
* @property bool $local
* @property string|null $place
* @property int|null $place_id
* @property-read \App\Models\Place|null $place
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
* @property Carbon|null $edited_at
* @property-read Profile $profile
* @property-read Collection<int, Media> $media
* @property-read Collection<int, Mention> $mentions
* @property-read Collection<int, Profile> $mentions
* @property-read \App\Models\Poll|null $poll
* @property-read int $count aggregate/computed alias
* @property-read int $pc aggregate/computed alias
*/
class Status extends Model
{

@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
/**
* @property-read int $count aggregate/computed alias
* @property-read int $total aggregate/computed alias
*/
class StatusHashtag extends Model
{
public $fillable = [

@ -14,6 +14,8 @@ use Pixelfed\Snowflake\HasSnowflakePrimary;
* @property Carbon|null $expires_at
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $type
* @property-read \App\Models\Story|null $story
*/
class StoryItem extends Model
{

@ -13,6 +13,9 @@ use Laravel\Passport\Contracts\OAuthenticatable;
use Laravel\Passport\HasApiTokens;
use NotificationChannels\WebPush\HasPushSubscriptions;
/**
* @property-read \App\Models\UserSetting|null $settings
*/
class User extends Authenticatable implements OAuthenticatable
{
use HasApiTokens, HasFactory, HasPushSubscriptions, Notifiable, SoftDeletes, UserRateLimit;

@ -5,6 +5,9 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property-read \App\Models\User|null $user
*/
class UserOidcMapping extends Model
{
use HasFactory;

File diff suppressed because it is too large Load Diff

@ -1,10 +1,9 @@
includes:
- vendor/larastan/larastan/extension.neon
- vendor/nesbot/carbon/extension.neon
- phpstan-baseline.neon
parameters:
level: 5 #Larascan supports 0-9. 10 is not required
level: 2 #Larascan supports 0-9. 10 is not required
paths:
- app/
@ -80,4 +79,36 @@ parameters:
- app/Http/Controllers/StoryComposeController.php
- app/Util/Lexer/Validator.php
# Deprecated command references the avatars.thumb_path column, which was
# dropped in migration 2021_01_25_011355. The command is dead/legacy.
-
message: '#Access to an undefined property App\\Models\\Avatar::\$thumb_path#'
path: app/Console/Commands/Deprecated/AvatarDefaultMigration.php
# Eloquent/Query magic that Larastan cannot statically resolve when a
# value is typed as the base Model/Builder rather than a concrete model.
# See https://github.com/larastan/larastan/blob/3.x/docs/errors-to-ignore.md
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$#'
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder<[^>]+>::#'
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Model::#'
- '#Call to an undefined method Illuminate\\Database\\Query\\Builder::#'
- '#Call to an undefined method Illuminate\\Support\\HigherOrder#'
# find()/findOrFail() widen to Model|Collection because the id arg could
# be an array; callers here pass a scalar id, so it is a single model.
- '#Access to an undefined property App\\Models\\[A-Za-z]+\|Illuminate\\Database\\Eloquent\\Collection#'
# Model query scopes (whereScope, whereIsNsfw, ...) called through a
# relation object; valid at runtime, unresolvable statically.
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::where\w+\(\)#'
# Vendor/framework contracts whose concrete runtime types expose these
# members but whose interfaces/stubs do not declare them.
- '#Access to (an undefined|protected) property Laravel\\Passport\\#'
- '#Call to an undefined method Illuminate\\Contracts\\Auth\\StatefulGuard::#'
- '#Call to an undefined method Illuminate\\Contracts\\Pagination\\CursorPaginator::#'
- '#Access to an undefined property Illuminate\\Support\\ValidatedInput::#'
- '#Call to an undefined static method Illuminate\\Database\\Eloquent\\Model::withTrashed\(\)#'
- '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Response::withHeaders\(\)#'
reportUnmatchedIgnoredErrors: false

Loading…
Cancel
Save