2020-04-28 15:25:24 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @template TModel of \Illuminate\Database\Eloquent\Model
|
|
|
|
* @template TNameOrCountOrNull of string|int|null
|
|
|
|
* @template TCountOrNull of int|null
|
|
|
|
*
|
|
|
|
* @param class-string<TModel> $modelClassName
|
|
|
|
* @param TNameOrCountOrNull $nameOrCount
|
|
|
|
* @param TCountOrNull $count
|
|
|
|
*
|
|
|
|
* @return (
|
|
|
|
TCountOrNull is int
|
|
|
|
? Illuminate\Database\Eloquent\FactoryBuilder<TModel, TCountOrNull>
|
|
|
|
: (
|
|
|
|
TNameOrCountOrNull is int
|
|
|
|
? Illuminate\Database\Eloquent\FactoryBuilder<TModel, TNameOrCountOrNull>
|
|
|
|
: Illuminate\Database\Eloquent\FactoryBuilder<TModel, 1>
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
*/
|
|
|
|
function factory(string $modelClassName, $nameOrCount = null, $count = null)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2020-05-24 00:34:43 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a new response from the application.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\View\View|string|array|null $content
|
|
|
|
* @param int $status
|
|
|
|
* @param array $headers
|
|
|
|
* @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
|
|
|
|
* @psalm-return (func_num_args() is 0 ? \Illuminate\Contracts\Routing\ResponseFactory : \Illuminate\Http\Response)
|
|
|
|
*/
|
|
|
|
function response($content = '', $status = 200, array $headers = [])
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2020-07-20 20:56:35 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Throw an HttpException with the given data if the given condition is true.
|
|
|
|
*
|
|
|
|
* @param bool $boolean
|
|
|
|
* @psalm-assert falsy $boolean
|
2021-06-23 07:16:47 -04:00
|
|
|
* @psalm-return ($boolean is false ? never-return : void )
|
2020-07-20 20:56:35 -07:00
|
|
|
* @param int $code
|
|
|
|
* @param string $message
|
|
|
|
* @param array $headers
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
|
|
|
|
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
|
|
|
|
*/
|
|
|
|
function abort_if($boolean, $code, $message = '', array $headers = [])
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2021-06-28 23:56:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see https://github.com/vimeo/psalm/issues/4816 for why this hack exists
|
|
|
|
*/
|
|
|
|
|
|
|
|
class NullObject {
|
|
|
|
/**
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function __call(string $_name, array $args) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function __get(string $s) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __set(string $_name, string $_value) : void {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provide access to optional objects.
|
|
|
|
*
|
|
|
|
* @template TValue
|
|
|
|
* @template TResult
|
|
|
|
* @template TCallback of null|callable(TValue): TResult
|
|
|
|
* @psalm-param TValue $value
|
|
|
|
* @psalm-return (
|
|
|
|
TValue is null
|
|
|
|
? NullObject
|
|
|
|
: ( TCallback is null ? TValue : TResult )
|
|
|
|
)
|
|
|
|
*/
|
|
|
|
function optional($value = null, callable $callback = null)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|