Skip to content

Commit

Permalink
Merge pull request #281 from lptn/use-contracts-intsead-implementation
Browse files Browse the repository at this point in the history
Use contracts instead implementations
  • Loading branch information
lptn authored Jan 22, 2023
2 parents f1a1240 + a54800a commit 1186dc7
Showing 1 changed file with 14 additions and 50 deletions.
64 changes: 14 additions & 50 deletions stubs/helpers.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
/**
* Return a new response from the application.
*
* @param \Illuminate\View\View|string|array|null $content
* @param \Illuminate\Contracts\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 = [])
{

}
function response($content = '', $status = 200, array $headers = []) {}

/**
* Throw an HttpException with the given data if the given condition is true.
Expand All @@ -28,10 +25,7 @@ function response($content = '', $status = 200, array $headers = [])
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
function abort_if($boolean, $code, $message = '', array $headers = [])
{

}
function abort_if($boolean, $code, $message = '', array $headers = []) {}

/**
* @see https://github.com/vimeo/psalm/issues/4816 for why this hack exists
Expand Down Expand Up @@ -76,10 +70,7 @@ function head($array)
* @param TParam $array
* @return (TParam is non-empty-array ? TValue : false)
*/
function last($array)
{

}
function last($array) {}

/**
* Provide access to optional objects.
Expand All @@ -94,10 +85,7 @@ function last($array)
: ( TCallback is null ? TValue : TResult )
)
*/
function optional($value = null, callable $callback = null)
{

}
function optional($value = null, callable $callback = null) {}

/**
* Log a debug message to the logs.
Expand Down Expand Up @@ -125,10 +113,7 @@ function logger($message = null, array $context = [])
* @param mixed $default
* @return ($key is null ? \Illuminate\Config\Repository : ($key is array ? null : mixed))
*/
function config($key = null, $default = null)
{

}
function config($key = null, $default = null) {}

/**
* Create a new cookie instance.
Expand All @@ -144,10 +129,7 @@ function config($key = null, $default = null)
* @param string|null $sameSite
* @return ($name is null ? \Illuminate\Cookie\CookieJar : \Symfony\Component\HttpFoundation\Cookie)
*/
function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null)
{

}
function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null) {}

/**
* Get / set the specified session value.
Expand All @@ -158,10 +140,7 @@ function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain
* @param mixed $default
* @return ($key is null ? \Illuminate\Session\SessionManager : ($key is array ? null : mixed))
*/
function session($key = null, $default = null)
{

}
function session($key = null, $default = null) {}

/**
* @template TValue
Expand All @@ -172,10 +151,7 @@ function session($key = null, $default = null)
* @param bool $report
* @return TValue|TDefault
*/
function rescue(callable $callback, $rescue = null, $report = true)
{

}
function rescue(callable $callback, $rescue = null, $report = true) {}

/**
* @template TValue
Expand All @@ -187,10 +163,7 @@ function rescue(callable $callback, $rescue = null, $report = true)
*
* @throws \Exception
*/
function retry($times, callable $callback, $sleep = 0, $when = null)
{

}
function retry($times, callable $callback, $sleep = 0, $when = null) {}

/**
* Get an instance of the current request or an input item from the request.
Expand All @@ -199,21 +172,15 @@ function retry($times, callable $callback, $sleep = 0, $when = null)
* @param mixed $default
* @return ($key is null ? \Illuminate\Http\Request : ($key is array ? string[] : mixed))
*/
function request($key = null, $default = null)
{

}
function request($key = null, $default = null) {}

/**
* @template TValue
* @param TValue $value
* @param null|callable(TValue): void $callback
* @return TValue
*/
function tap($value, $callback = null)
{

}
function tap($value, $callback = null) {}

/**
* Create a new Validator instance.
Expand All @@ -230,7 +197,7 @@ function validator(array $data = [], array $rules = [], array $messages = [], ar
* @param string|null $view
* @param \Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<string, mixed> $data
* @param array<string, mixed> $mergeData
* @return ($view is null ? \Illuminate\Contracts\View\Factory : \Illuminate\View\View)
* @return ($view is null ? \Illuminate\Contracts\View\Factory : \Illuminate\Contracts\View\View)
*/
function view($view = null, $data = [], $mergeData = []) {}

Expand All @@ -242,7 +209,4 @@ function view($view = null, $data = [], $mergeData = []) {}
* @param string|null $locale
* @return ($key is null ? null : mixed)
*/
function __($key = null, $replace = [], $locale = null)
{

}
function __($key = null, $replace = [], $locale = null) {}

0 comments on commit 1186dc7

Please sign in to comment.