Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CS #1450

Merged
merged 4 commits into from Dec 9, 2022
Merged

Fix CS #1450

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions stubs/Attribute.stub
Expand Up @@ -31,8 +31,7 @@ class Attribute
* @param (callable(TMakeSet, mixed=): mixed)|null $set
* @return Attribute<TMakeGet, TMakeSet>
*/
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.
Expand All @@ -41,8 +40,7 @@ class Attribute
* @param callable(mixed, mixed=): T $get
* @return Attribute<T, never>
*/
public static function get(callable $get)
{}
public static function get(callable $get);

/**
* Create a new attribute mutator.
Expand All @@ -51,6 +49,5 @@ class Attribute
* @param callable(T, mixed=): mixed $set
* @return Attribute<never, T>
*/
public static function set(callable $set)
{}
public static function set(callable $set);
}
6 changes: 3 additions & 3 deletions stubs/Collection.stub
Expand Up @@ -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.
Expand All @@ -38,7 +38,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
* @return static<array-key, TCombineValue>
*/
public function combine($values) {}
public function combine($values);
}

/**
Expand All @@ -62,5 +62,5 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
* @return static<array-key, TCombineValue>
*/
public function combine($values) {}
public function combine($values);
}
4 changes: 2 additions & 2 deletions stubs/Conditionable.stub
Expand Up @@ -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.
Expand All @@ -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);
}
3 changes: 1 addition & 2 deletions stubs/Database/ManagesTransactions.stub
Expand Up @@ -15,6 +15,5 @@ trait ManagesTransactions
*
* @throws \Throwable
*/
public function transaction(\Closure $callback, $attempts = 1)
{}
public function transaction(\Closure $callback, $attempts = 1);
}
2 changes: 1 addition & 1 deletion stubs/Enumerable.stub
Expand Up @@ -18,7 +18,7 @@ interface Enumerable extends \Countable, \IteratorAggregate, \JsonSerializable
*
* @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.
Expand Down
20 changes: 10 additions & 10 deletions stubs/Factory.stub
Expand Up @@ -20,23 +20,23 @@ class Factory
* @param callable|array<model-property<TModel>, mixed> $attributes
* @return static
*/
public static function new($attributes = []) {}
public static function new($attributes = []);

/**
* Create a single model and persist it to the database.
*
* @param array<model-property<TModel>, mixed> $attributes
* @return TModel
*/
public function createOne($attributes = []) {}
public function createOne($attributes = []);

/**
* Create a collection of models and persist them to the database.
*
* @param iterable<callable|array<model-property<TModel>, mixed>> $records
* @return \Illuminate\Database\Eloquent\Collection<int, TModel>
*/
public function createMany(iterable $records) {}
public function createMany(iterable $records);

/**
* Create a collection of models and persist them to the database.
Expand All @@ -45,7 +45,7 @@ class Factory
* @param \Illuminate\Database\Eloquent\Model|null $parent
* @return \Illuminate\Database\Eloquent\Collection<int, TModel>|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.
Expand All @@ -54,15 +54,15 @@ class Factory
* @param \Illuminate\Database\Eloquent\Model|null $parent
* @return \Illuminate\Database\Eloquent\Collection<int, TModel>|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.
*
* @param callable|array<model-property<TModel>, mixed> $attributes
* @return TModel
*/
public function makeOne($attributes = []) {}
public function makeOne($attributes = []);

/**
* Create a collection of models.
Expand All @@ -71,15 +71,15 @@ class Factory
* @param \Illuminate\Database\Eloquent\Model|null $parent
* @return \Illuminate\Database\Eloquent\Collection<int, TModel>|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.
*
* @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.
Expand All @@ -94,13 +94,13 @@ 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.
*
* @param \Closure(TModel): mixed $callback
* @return static
*/
public function afterCreating(\Closure $callback) {}
public function afterCreating(\Closure $callback);
}
3 changes: 1 addition & 2 deletions stubs/Foundation/Http/FormRequest.stub
Expand Up @@ -11,6 +11,5 @@ class FormRequest
*
* @return ($keys is null ? \Illuminate\Support\ValidatedInput : array<string, mixed>)
*/
public function safe(array $keys = null)
{}
public function safe(array $keys = null);
}
28 changes: 7 additions & 21 deletions stubs/Helpers.stub
Expand Up @@ -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
Expand All @@ -108,29 +106,23 @@ 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
* @param TValue $value
* @param null|callable(TValue): mixed $callback
* @return mixed
*/
function tap($value, $callback = null)
{
}
function tap($value, $callback = null) {}

/**
* @param view-string|null $view
* @param \Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<string, mixed> $data
* @param array<string, mixed> $mergeData
* @return mixed
*/
function view($view = null, $data = [], $mergeData = [])
{
}
function view($view = null, $data = [], $mergeData = []) {}

/**
* Translate the given message.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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) {}
4 changes: 1 addition & 3 deletions stubs/HigherOrderProxies.stub
Expand Up @@ -11,9 +11,7 @@ class HigherOrderTapProxy
/**
* @param TClass $target
*/
public function __construct($target)
{
}
public function __construct($target);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions stubs/Http/Request.stub
Expand Up @@ -14,6 +14,5 @@ class Request {
*
* @return ($key is null ? array<string, string> : string|TDefault)
*/
public function header($key = null, $default = null)
{}
public function header($key = null, $default = null);
}
6 changes: 2 additions & 4 deletions stubs/Mailable.stub
Expand Up @@ -9,14 +9,12 @@ class Mailable
* @param array<string, mixed> $data
* @return $this
*/
public function markdown($view, array $data = [])
{}
public function markdown($view, array $data = []);

/**
* @param view-string $view
* @param array<string, mixed> $data
* @return $this
*/
public function view($view, array $data = [])
{}
public function view($view, array $data = []);
}