From be47adb2768189219040d03521f3f964f80b2f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 9 Dec 2022 13:39:10 +0000 Subject: [PATCH] Fix stub CS --- stubs/Attribute.stub | 9 +-- stubs/Collection.stub | 6 +- stubs/Conditionable.stub | 4 +- stubs/Database/ManagesTransactions.stub | 3 +- stubs/Factory.stub | 20 +++--- stubs/Foundation/Http/FormRequest.stub | 3 +- stubs/Helpers.stub | 44 +++++------- stubs/HigherOrderProxies.stub | 4 +- stubs/Http/Request.stub | 3 +- stubs/Mailable.stub | 6 +- stubs/QueryBuilder.stub | 90 +++++++++---------------- stubs/Route.stub | 2 +- stubs/Validation/Validator.stub | 3 +- 13 files changed, 71 insertions(+), 126 deletions(-) diff --git a/stubs/Attribute.stub b/stubs/Attribute.stub index 29e5d8f7f6..72ec09c0e8 100644 --- a/stubs/Attribute.stub +++ b/stubs/Attribute.stub @@ -31,8 +31,7 @@ class Attribute * @param (callable(TMakeSet, mixed=): mixed)|null $set * @return Attribute */ - public static function make(callable $get = null, callable $set = null) - {} + public static function make(callable $get = null, callable $set = null); /** * Create a new attribute accessor. @@ -41,8 +40,7 @@ class Attribute * @param callable(mixed, mixed=): T $get * @return Attribute */ - public static function get(callable $get) - {} + public static function get(callable $get); /** * Create a new attribute mutator. @@ -51,6 +49,5 @@ class Attribute * @param callable(T, mixed=): mixed $set * @return Attribute */ - public static function set(callable $set) - {} + public static function set(callable $set); } diff --git a/stubs/Collection.stub b/stubs/Collection.stub index 5f3d94f097..373e0e13bf 100644 --- a/stubs/Collection.stub +++ b/stubs/Collection.stub @@ -28,7 +28,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl * * @throws \InvalidArgumentException */ - public function random($number = null) {} + public function random($number = null); /** * Create a collection by using this collection for keys and another for its values. @@ -38,7 +38,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ - public function combine($values) {} + public function combine($values); } /** @@ -62,5 +62,5 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ - public function combine($values) {} + public function combine($values); } diff --git a/stubs/Conditionable.stub b/stubs/Conditionable.stub index 92081f969c..a36626334b 100644 --- a/stubs/Conditionable.stub +++ b/stubs/Conditionable.stub @@ -17,7 +17,7 @@ trait Conditionable * @param (callable($this, TWhenParameter): TWhenReturnType)|null $default * @return (TWhenReturnType is void|null ? $this : TWhenReturnType) */ - public function when($value, callable $callback = null, callable $default = null) {} + public function when($value, callable $callback = null, callable $default = null); /** * Apply the callback if the given "value" is (or resolves to) falsy. @@ -30,5 +30,5 @@ trait Conditionable * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default * @return (TUnlessReturnType is void|null ? $this : TUnlessReturnType) */ - public function unless($value, callable $callback = null, callable $default = null) {} + public function unless($value, callable $callback = null, callable $default = null); } diff --git a/stubs/Database/ManagesTransactions.stub b/stubs/Database/ManagesTransactions.stub index 51bce38c6d..109db96f89 100644 --- a/stubs/Database/ManagesTransactions.stub +++ b/stubs/Database/ManagesTransactions.stub @@ -15,6 +15,5 @@ trait ManagesTransactions * * @throws \Throwable */ - public function transaction(\Closure $callback, $attempts = 1) - {} + public function transaction(\Closure $callback, $attempts = 1); } diff --git a/stubs/Factory.stub b/stubs/Factory.stub index f592c57b27..4ac35e2263 100644 --- a/stubs/Factory.stub +++ b/stubs/Factory.stub @@ -20,7 +20,7 @@ class Factory * @param callable|array, mixed> $attributes * @return static */ - public static function new($attributes = []) {} + public static function new($attributes = []); /** * Create a single model and persist it to the database. @@ -28,7 +28,7 @@ class Factory * @param array, mixed> $attributes * @return TModel */ - public function createOne($attributes = []) {} + public function createOne($attributes = []); /** * Create a collection of models and persist them to the database. @@ -36,7 +36,7 @@ class Factory * @param iterable, mixed>> $records * @return \Illuminate\Database\Eloquent\Collection */ - public function createMany(iterable $records) {} + public function createMany(iterable $records); /** * Create a collection of models and persist them to the database. @@ -45,7 +45,7 @@ class Factory * @param \Illuminate\Database\Eloquent\Model|null $parent * @return \Illuminate\Database\Eloquent\Collection|TModel */ - public function create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null) {} + public function create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null); /** * Create a collection of models and persist them to the database without dispatching any model events. @@ -54,7 +54,7 @@ class Factory * @param \Illuminate\Database\Eloquent\Model|null $parent * @return \Illuminate\Database\Eloquent\Collection|TModel */ - public function createQuietly($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null) {} + public function createQuietly($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null); /** * Make a single instance of the model. @@ -62,7 +62,7 @@ class Factory * @param callable|array, mixed> $attributes * @return TModel */ - public function makeOne($attributes = []) {} + public function makeOne($attributes = []); /** * Create a collection of models. @@ -71,7 +71,7 @@ class Factory * @param \Illuminate\Database\Eloquent\Model|null $parent * @return \Illuminate\Database\Eloquent\Collection|TModel */ - public function make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null) {} + public function make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null); /** * Make an instance of the model with the given attributes. @@ -79,7 +79,7 @@ class Factory * @param \Illuminate\Database\Eloquent\Model|null $parent * @return TModel */ - protected function makeInstance(?\Illuminate\Database\Eloquent\Model $parent) {} + protected function makeInstance(?\Illuminate\Database\Eloquent\Model $parent); /** * Define the model's default state. @@ -94,7 +94,7 @@ class Factory * @param \Closure(TModel): mixed $callback * @return static */ - public function afterMaking(\Closure $callback) {} + public function afterMaking(\Closure $callback); /** * Add a new "after creating" callback to the model definition. @@ -102,5 +102,5 @@ class Factory * @param \Closure(TModel): mixed $callback * @return static */ - public function afterCreating(\Closure $callback) {} + public function afterCreating(\Closure $callback); } diff --git a/stubs/Foundation/Http/FormRequest.stub b/stubs/Foundation/Http/FormRequest.stub index 19898540dd..615e242f68 100644 --- a/stubs/Foundation/Http/FormRequest.stub +++ b/stubs/Foundation/Http/FormRequest.stub @@ -11,6 +11,5 @@ class FormRequest * * @return ($keys is null ? \Illuminate\Support\ValidatedInput : array) */ - public function safe(array $keys = null) - {} + public function safe(array $keys = null); } diff --git a/stubs/Helpers.stub b/stubs/Helpers.stub index 76419caf66..31a8b93f25 100644 --- a/stubs/Helpers.stub +++ b/stubs/Helpers.stub @@ -9,7 +9,7 @@ * @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. @@ -25,7 +25,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); /** * Log a debug message to the logs. @@ -34,7 +34,7 @@ function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain * @param mixed[] $context * @return ($message is null ? \Illuminate\Log\LogManager : null) */ -function logger($message = null, array $context = []) {} +function logger($message = null, array $context = []); /** * Get a log driver instance. @@ -42,7 +42,7 @@ function logger($message = null, array $context = []) {} * @param string|null $driver * @return ($driver is null ? \Illuminate\Log\LogManager : \Psr\Log\LoggerInterface&\Illuminate\Log\Logger ) */ -function logs($driver = null) {} +function logs($driver = null); /** * Get an instance of the redirector. @@ -53,7 +53,7 @@ function logs($driver = null) {} * @param bool|null $secure * @return ($to is null ? \Illuminate\Routing\Redirector : \Illuminate\Http\RedirectResponse) */ -function redirect($to = null, $status = 302, $headers = [], $secure = null) {} +function redirect($to = null, $status = 302, $headers = [], $secure = null); /** * Get an instance of the current request or an input item from the request. @@ -62,7 +62,7 @@ function redirect($to = null, $status = 302, $headers = [], $secure = 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); /** * Get / set the specified session value. @@ -73,7 +73,7 @@ function request($key = null, $default = null) {} * @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); /** * Generate a url for the application. @@ -83,7 +83,7 @@ function session($key = null, $default = null) {} * @param bool|null $secure * @return ($path is null ? \Illuminate\Contracts\Routing\UrlGenerator : string) */ -function url($path = null, $parameters = [], $secure = null) {} +function url($path = null, $parameters = [], $secure = null); /** * @template TValue @@ -94,9 +94,7 @@ function url($path = null, $parameters = [], $secure = 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 @@ -108,9 +106,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); /** * @template TValue @@ -118,9 +114,7 @@ function retry($times, callable $callback, $sleep = 0, $when = null) * @param null|callable(TValue): mixed $callback * @return mixed */ -function tap($value, $callback = null) -{ -} +function tap($value, $callback = null); /** * @param view-string|null $view @@ -128,9 +122,7 @@ function tap($value, $callback = null) * @param array $mergeData * @return mixed */ -function view($view = null, $data = [], $mergeData = []) -{ -} +function view($view = null, $data = [], $mergeData = []); /** * Translate the given message. @@ -140,9 +132,7 @@ function view($view = null, $data = [], $mergeData = []) * @param string|null $locale * @return ($key is null ? \Illuminate\Contracts\Translation\Translator : mixed) */ -function trans($key = null, $replace = [], $locale = null) -{ -} +function trans($key = null, $replace = [], $locale = null); /** * Translate the given message. @@ -152,9 +142,7 @@ function trans($key = null, $replace = [], $locale = null) * @param string|null $locale * @return ($key is null ? null : mixed) */ -function __($key = null, $replace = [], $locale = null) -{ -} +function __($key = null, $replace = [], $locale = null); /** * Provide access to optional objects. @@ -166,6 +154,4 @@ function __($key = null, $replace = [], $locale = null) * @param ?callable(TValue): TReturn $callback * @return ($callback is null ? mixed : ($value is null ? null : TReturn)) */ -function optional($value = null, callable $callback = null) -{ -} +function optional($value = null, callable $callback = null); diff --git a/stubs/HigherOrderProxies.stub b/stubs/HigherOrderProxies.stub index b3cf0f30af..e4076a8e9b 100644 --- a/stubs/HigherOrderProxies.stub +++ b/stubs/HigherOrderProxies.stub @@ -11,9 +11,7 @@ class HigherOrderTapProxy /** * @param TClass $target */ - public function __construct($target) - { - } + public function __construct($target); } /** diff --git a/stubs/Http/Request.stub b/stubs/Http/Request.stub index 55b0e96075..e0c67409e8 100644 --- a/stubs/Http/Request.stub +++ b/stubs/Http/Request.stub @@ -14,6 +14,5 @@ class Request { * * @return ($key is null ? array : string|TDefault) */ - public function header($key = null, $default = null) - {} + public function header($key = null, $default = null); } diff --git a/stubs/Mailable.stub b/stubs/Mailable.stub index e9a04f40d8..4a14c66ed2 100644 --- a/stubs/Mailable.stub +++ b/stubs/Mailable.stub @@ -9,14 +9,12 @@ class Mailable * @param array $data * @return $this */ - public function markdown($view, array $data = []) - {} + public function markdown($view, array $data = []); /** * @param view-string $view * @param array $data * @return $this */ - public function view($view, array $data = []) - {} + public function view($view, array $data = []); } diff --git a/stubs/QueryBuilder.stub b/stubs/QueryBuilder.stub index 3f9c89e697..9f4458b289 100644 --- a/stubs/QueryBuilder.stub +++ b/stubs/QueryBuilder.stub @@ -20,8 +20,7 @@ class Builder * * @throws \InvalidArgumentException */ - public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false) - {} + public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false); /** * Add a basic where clause to the query. @@ -32,8 +31,7 @@ class Builder * @param string $boolean * @return $this */ - public function where($column, $operator = null, $value = null, $boolean = 'and') - {} + public function where($column, $operator = null, $value = null, $boolean = 'and'); /** * Add an array of where clauses to the query. @@ -43,8 +41,7 @@ class Builder * @param string $method * @return $this */ - protected function addArrayOfWheres($column, $boolean, $method = 'where') - {} + protected function addArrayOfWheres($column, $boolean, $method = 'where'); /** * Add an "or where" clause to the query. @@ -54,8 +51,7 @@ class Builder * @param mixed $value * @return $this */ - public function orWhere($column, $operator = null, $value = null) - {} + public function orWhere($column, $operator = null, $value = null); /** * Add a "where" clause comparing two columns to the query. @@ -66,8 +62,7 @@ class Builder * @param string|null $boolean * @return $this */ - public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') - {} + public function whereColumn($first, $operator = null, $second = null, $boolean = 'and'); /** * Add a "where in raw" clause for integer values to the query. @@ -78,8 +73,7 @@ class Builder * @param bool $not * @return $this */ - public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) - {} + public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false); /** * Add an "or where in raw" clause for integer values to the query. @@ -88,8 +82,7 @@ class Builder * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ - public function orWhereIntegerInRaw($column, $values) - {} + public function orWhereIntegerInRaw($column, $values); /** * Add a "where not in raw" clause for integer values to the query. @@ -99,8 +92,7 @@ class Builder * @param string $boolean * @return $this */ - public function whereIntegerNotInRaw($column, $values, $boolean = 'and') - {} + public function whereIntegerNotInRaw($column, $values, $boolean = 'and'); /** * Add an "or where not in raw" clause for integer values to the query. @@ -109,8 +101,7 @@ class Builder * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ - public function orWhereIntegerNotInRaw($column, $values) - {} + public function orWhereIntegerNotInRaw($column, $values); /** * Add a "where null" clause to the query. @@ -120,8 +111,7 @@ class Builder * @param bool $not * @return $this */ - public function whereNull($columns, $boolean = 'and', $not = false) - {} + public function whereNull($columns, $boolean = 'and', $not = false); /** * Add a "where not null" clause to the query. @@ -130,8 +120,7 @@ class Builder * @param string $boolean * @return $this */ - public function whereNotNull($columns, $boolean = 'and') - {} + public function whereNotNull($columns, $boolean = 'and'); /** * Adds a where condition using row values. @@ -144,8 +133,7 @@ class Builder * * @throws \InvalidArgumentException */ - public function whereRowValues($columns, $operator, $values, $boolean = 'and') - {} + public function whereRowValues($columns, $operator, $values, $boolean = 'and'); /** * Adds a or where condition using row values. @@ -155,8 +143,7 @@ class Builder * @param array $values * @return $this */ - public function orWhereRowValues($columns, $operator, $values) - {} + public function orWhereRowValues($columns, $operator, $values); /** * Add a "having between " clause to the query. @@ -167,8 +154,7 @@ class Builder * @param bool $not * @return $this */ - public function havingBetween($column, array $values, $boolean = 'and', $not = false) - {} + public function havingBetween($column, array $values, $boolean = 'and', $not = false); /** * Add an "order by" clause to the query. @@ -180,8 +166,7 @@ class Builder * * @throws \InvalidArgumentException */ - public function orderBy($column, $direction = 'asc') - {} + public function orderBy($column, $direction = 'asc'); /** * Add a descending "order by" clause to the query. @@ -190,8 +175,7 @@ class Builder * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ - public function orderByDesc($column) - {} + public function orderByDesc($column); /** * Add a union statement to the query. @@ -201,8 +185,7 @@ class Builder * @param bool $all * @return $this */ - public function union($query, $all = false) - {} + public function union($query, $all = false); /** * Add a union all statement to the query. @@ -211,8 +194,7 @@ class Builder * @param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Closure $query * @return $this */ - public function unionAll($query) - {} + public function unionAll($query); /** * Execute a query for a single record by ID. @@ -221,8 +203,7 @@ class Builder * @param array $columns * @return mixed|static */ - public function find($id, $columns = ['*']) - {} + public function find($id, $columns = ['*']); /** * Get an array with the values of a given column. @@ -231,8 +212,7 @@ class Builder * @param string|null $key * @return \Illuminate\Support\Collection */ - public function pluck($column, $key = null) - {} + public function pluck($column, $key = null); /** * Execute an aggregate function on the database. @@ -241,8 +221,7 @@ class Builder * @param array $columns * @return mixed */ - public function aggregate($function, $columns = ['*']) - {} + public function aggregate($function, $columns = ['*']); /** * Execute a numeric aggregate function on the database. @@ -251,8 +230,7 @@ class Builder * @param array $columns * @return float|int */ - public function numericAggregate($function, $columns = ['*']) - {} + public function numericAggregate($function, $columns = ['*']); /** * Set the aggregate property without running the query. @@ -261,8 +239,7 @@ class Builder * @param array $columns * @return $this */ - protected function setAggregate($function, $columns) - {} + protected function setAggregate($function, $columns); /** * Execute the given callback while selecting the given columns. @@ -273,8 +250,7 @@ class Builder * @param callable $callback * @return mixed */ - protected function onceWithColumns($columns, $callback) - {} + protected function onceWithColumns($columns, $callback); /** * Insert a new record and get the value of the primary key. @@ -283,8 +259,7 @@ class Builder * @param string|null $sequence * @return int */ - public function insertGetId(array $values, $sequence = null) - {} + public function insertGetId(array $values, $sequence = null); /** * Insert new records into the table using a subquery. @@ -294,8 +269,7 @@ class Builder * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query * @return int */ - public function insertUsing(array $columns, $query) - {} + public function insertUsing(array $columns, $query); /** * Update a record in the database. @@ -303,8 +277,7 @@ class Builder * @param array $values * @return int */ - public function update(array $values) - {} + public function update(array $values); /** * Insert or update a record matching the attributes, and fill it with values. @@ -313,8 +286,7 @@ class Builder * @param array $values * @return bool */ - public function updateOrInsert(array $attributes, array $values = []) - {} + public function updateOrInsert(array $attributes, array $values = []); /** * Increment a column's value by a given amount. @@ -326,8 +298,7 @@ class Builder * * @throws \InvalidArgumentException */ - public function increment($column, $amount = 1, array $extra = []) - {} + public function increment($column, $amount = 1, array $extra = []); /** * Decrement a column's value by a given amount. @@ -339,6 +310,5 @@ class Builder * * @throws \InvalidArgumentException */ - public function decrement($column, $amount = 1, array $extra = []) - {} + public function decrement($column, $amount = 1, array $extra = []); } diff --git a/stubs/Route.stub b/stubs/Route.stub index 1cece2bbdb..4da9f5d2f1 100644 --- a/stubs/Route.stub +++ b/stubs/Route.stub @@ -10,5 +10,5 @@ class Route * @param string[]|string|null $middleware * @return ($middleware is null ? string[] : $this) */ - public function middleware($middleware = null) {} + public function middleware($middleware = null); } diff --git a/stubs/Validation/Validator.stub b/stubs/Validation/Validator.stub index 6881b0bad5..7c73a3564d 100644 --- a/stubs/Validation/Validator.stub +++ b/stubs/Validation/Validator.stub @@ -11,6 +11,5 @@ class Validator * * @return ($keys is null ? \Illuminate\Support\ValidatedInput : array) */ - public function safe(array $keys = null) - {} + public function safe(array $keys = null); }