1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +00:00

phpstan fixes

This commit is contained in:
Samuel Štancl 2025-01-05 15:50:30 +01:00
parent 3c183e45d9
commit f955b38e2b
12 changed files with 24 additions and 21 deletions

View file

@ -17,9 +17,9 @@ use Stancl\Tenancy\Events\PullingPendingTenant;
/**
* @property ?Carbon $pending_since
*
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withPending(bool $withPending = true)
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyPending()
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withoutPending()
* @method static static|\Illuminate\Database\Eloquent\Builder<static>|\Illuminate\Database\Query\Builder withPending(bool $withPending = true)
* @method static static|\Illuminate\Database\Eloquent\Builder<static>|\Illuminate\Database\Query\Builder onlyPending()
* @method static static|\Illuminate\Database\Eloquent\Builder<static>|\Illuminate\Database\Query\Builder withoutPending()
*/
trait HasPending
{

View file

@ -10,6 +10,7 @@ use Stancl\Tenancy\Database\TenantDatabaseManagers\TenantDatabaseManager;
/**
* @method \Illuminate\Database\Connection database()
* @mixin TenantDatabaseManager
* @phpstan-require-extends TenantDatabaseManager
*/
trait ManagesPostgresUsers
{
@ -40,8 +41,6 @@ trait ManagesPostgresUsers
public function deleteUser(DatabaseConfig $databaseConfig): bool
{
/** @var TenantDatabaseManager $this */
// Tenant DB username
$username = $databaseConfig->getUsername();

View file

@ -5,8 +5,12 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Database\Concerns;
use Closure;
use Illuminate\Foundation\Bus\PendingDispatch;
use Stancl\Tenancy\Contracts\Tenant;
/**
* @phpstan-require-implements Tenant
*/
trait TenantRun
{
/**
@ -16,11 +20,10 @@ trait TenantRun
*
* @template T
* @param Closure(Tenant): T $callback
* @return T
* @return (T is PendingDispatch ? null : T)
*/
public function run(Closure $callback): mixed
{
/** @var Tenant $this */
return tenancy()->run($this, $callback);
}
}