mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-26 20:34:48 +01:00
fix: split Builder/HasOneOrMany diffs into 6/8 stubs
This commit is contained in:
parent
25a9bf7ef0
commit
98a7bd56b1
25
stubs/6/EloquentBuilder.stubphp
Normal file
25
stubs/6/EloquentBuilder.stubphp
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Database\Eloquent;
|
||||
/**
|
||||
* @template-covariant TModel of \Illuminate\Database\Eloquent\Model
|
||||
* @property-read HigherOrderBuilderProxy $orWhere
|
||||
*
|
||||
* @mixin \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
class Builder
|
||||
{
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes, array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes, array $values = []) { }
|
||||
}
|
27
stubs/6/HasOneOrMany.stubphp
Normal file
27
stubs/6/HasOneOrMany.stubphp
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Database\Eloquent\Relations;
|
||||
|
||||
/**
|
||||
* @template TRelatedModel of Model
|
||||
* @template-extends Relation<TRelatedModel>
|
||||
* @mixin \Illuminate\Database\Eloquent\Builder<TRelatedModel>
|
||||
*/
|
||||
abstract class HasOneOrMany extends Relation
|
||||
{
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes, array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes, array $values = []) { }
|
||||
}
|
26
stubs/8/EloquentBuilder.stubphp
Normal file
26
stubs/8/EloquentBuilder.stubphp
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Database\Eloquent;
|
||||
|
||||
/**
|
||||
* @template-covariant TModel of \Illuminate\Database\Eloquent\Model
|
||||
* @property-read HigherOrderBuilderProxy $orWhere
|
||||
*
|
||||
* @mixin \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
class Builder
|
||||
{
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes = [], array $values = []) { }
|
||||
}
|
30
stubs/8/HasOneOrMany.stubphp
Normal file
30
stubs/8/HasOneOrMany.stubphp
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Database\Eloquent\Relations;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
/**
|
||||
* @template TRelatedModel of Model
|
||||
* @template-extends Relation<TRelatedModel>
|
||||
* @mixin \Illuminate\Database\Eloquent\Builder<TRelatedModel>
|
||||
*/
|
||||
abstract class HasOneOrMany extends Relation
|
||||
{
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes = [], array $values = []) { }
|
||||
}
|
@ -136,20 +136,6 @@ class Builder
|
||||
*/
|
||||
public function findOrNew($id, $columns = ['*']) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return TModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
|
@ -4,7 +4,6 @@ namespace Illuminate\Database\Eloquent\Relations;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
/**
|
||||
* @template TRelatedModel of Model
|
||||
@ -46,22 +45,6 @@ abstract class HasOneOrMany extends Relation
|
||||
*/
|
||||
public function findOrNew($id, $columns = ['*']) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrNew(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @psalm-return TRelatedModel
|
||||
*/
|
||||
public function firstOrCreate(array $attributes = [], array $values = []) { }
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
|
Loading…
Reference in New Issue
Block a user