composeer update

This commit is contained in:
2019-06-23 11:49:01 +00:00
parent fc2380d68c
commit e9efe70112
327 changed files with 5194 additions and 2278 deletions

View File

@@ -38,7 +38,7 @@ In order to ensure that the Laravel community is welcoming to all, please review
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
Please review [our security policy](https://github.com/laravel/framework/security/policy) on how to report security vulnerabilities.
## License

View File

@@ -1,5 +1,7 @@
# Security Policy
**PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, [SEE BELOW](#reporting-a-vulnerability).**
## Supported Versions
Version | Security Fixes Until
@@ -17,3 +19,84 @@ Version | Security Fixes Until
## Reporting a Vulnerability
If you discover a security vulnerability within Laravel, please send an email to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
### Public PGP Key
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP v2.0.8
Comment: https://sela.io/pgp/
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
WBGOG/qJGDlNiqBYYt2xNqzHCJoC
=zXOv
-----END PGP PUBLIC KEY BLOCK-----
```

View File

@@ -150,10 +150,11 @@ class Gate implements GateContract
public function resource($name, $class, array $abilities = null)
{
$abilities = $abilities ?: [
'view' => 'view',
'create' => 'create',
'update' => 'update',
'delete' => 'delete',
'viewAny' => 'viewAny',
'view' => 'view',
'create' => 'create',
'update' => 'update',
'delete' => 'delete',
];
foreach ($abilities as $ability => $method) {

View File

@@ -58,7 +58,7 @@ class AuthManager implements FactoryContract
/**
* Attempt to get the guard from the local cache.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
*/
public function guard($name = null)

View File

@@ -13,7 +13,7 @@ class EnsureEmailIsVerified
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string $redirectToRoute
* @param string|null $redirectToRoute
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle($request, Closure $next, $redirectToRoute = null)

View File

@@ -132,7 +132,7 @@ class BroadcastManager implements FactoryContract
/**
* Get a driver instance.
*
* @param string $driver
* @param string|null $driver
* @return mixed
*/
public function connection($driver = null)

View File

@@ -451,7 +451,7 @@ class Command extends SymfonyCommand
* Write a string as standard output.
*
* @param string $string
* @param string $style
* @param string|null $style
* @param int|string|null $verbosity
* @return void
*/

View File

@@ -22,7 +22,7 @@ trait ConfirmableTrait
$shouldConfirm = $callback instanceof Closure ? call_user_func($callback) : $callback;
if ($shouldConfirm) {
if ($this->option('force')) {
if ($this->hasOption('force') && $this->option('force')) {
return true;
}

View File

@@ -155,7 +155,7 @@ class Event
*
* @param \Illuminate\Console\Scheduling\EventMutex $mutex
* @param string $command
* @param \DateTimeZone|string $timezone
* @param \DateTimeZone|string|null $timezone
* @return void
*/
public function __construct(EventMutex $mutex, $command, $timezone = null)

View File

@@ -10,8 +10,8 @@ interface Factory
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
@@ -25,8 +25,8 @@ interface Factory
*
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
@@ -39,8 +39,8 @@ interface Factory
* Expire the given cookie.
*
* @param string $name
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forget($name, $path = null, $domain = null);

View File

@@ -9,7 +9,7 @@ interface Encrypter
*
* @param mixed $value
* @param bool $serialize
* @return mixed
* @return string
*
* @throws \Illuminate\Contracts\Encryption\EncryptException
*/
@@ -18,7 +18,7 @@ interface Encrypter
/**
* Decrypt the given value.
*
* @param mixed $payload
* @param string $payload
* @param bool $unserialize
* @return mixed
*

View File

@@ -7,7 +7,7 @@ interface Factory
/**
* Get a filesystem implementation.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
public function disk($name = null);

View File

@@ -8,7 +8,7 @@ interface MailQueue
* Queue a new e-mail message for sending.
*
* @param string|array|\Illuminate\Contracts\Mail\Mailable $view
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function queue($view, $queue = null);
@@ -18,7 +18,7 @@ interface MailQueue
*
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string|array|\Illuminate\Contracts\Mail\Mailable $view
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $view, $queue = null);

View File

@@ -34,7 +34,7 @@ interface Mailer
*
* @param string|array|\Illuminate\Contracts\Mail\Mailable $view
* @param array $data
* @param \Closure|string $callback
* @param \Closure|string|null $callback
* @return void
*/
public function send($view, array $data = [], $callback = null);

View File

@@ -7,7 +7,7 @@ interface Factory
/**
* Resolve a queue connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Queue\Queue
*/
public function connection($name = null);

View File

@@ -7,7 +7,7 @@ interface Queue
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null);
@@ -17,7 +17,7 @@ interface Queue
*
* @param string|object $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null);
@@ -36,7 +36,7 @@ interface Queue
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -48,7 +48,7 @@ interface Queue
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string|object $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null);
@@ -69,7 +69,7 @@ interface Queue
*
* @param array $jobs
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function bulk($jobs, $data = '', $queue = null);

View File

@@ -7,7 +7,7 @@ interface Factory
/**
* Get a Redis connection by name.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Redis\Connections\Connection
*/
public function connection($name = null);

View File

@@ -24,7 +24,7 @@ interface UrlGenerator
*
* @param string $path
* @param mixed $extra
* @param bool $secure
* @param bool|null $secure
* @return string
*/
public function to($path, $extra = [], $secure = null);
@@ -42,7 +42,7 @@ interface UrlGenerator
* Generate the URL to an application asset.
*
* @param string $path
* @param bool $secure
* @param bool|null $secure
* @return string
*/
public function asset($path, $secure = null);

View File

@@ -36,7 +36,7 @@ interface Session
/**
* Save the session data to storage.
*
* @return bool
* @return void
*/
public function save();

View File

@@ -39,8 +39,8 @@ interface MessageBag extends Arrayable
/**
* Get the first message from the bag for a given key.
*
* @param string $key
* @param string $format
* @param string|null $key
* @param string|null $format
* @return string
*/
public function first($key = null, $format = null);
@@ -49,7 +49,7 @@ interface MessageBag extends Arrayable
* Get all of the messages from the bag for a given key.
*
* @param string $key
* @param string $format
* @param string|null $format
* @return array
*/
public function get($key, $format = null);
@@ -57,7 +57,7 @@ interface MessageBag extends Arrayable
/**
* Get all of the messages for every key in the bag.
*
* @param string $format
* @param string|null $format
* @return array
*/
public function all($format = null);

View File

@@ -8,7 +8,7 @@ interface Responsable
* Create an HTTP response that represents the object.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
* @return \Symfony\Component\HttpFoundation\Response
*/
public function toResponse($request);
}

View File

@@ -9,7 +9,7 @@ interface Loader
*
* @param string $locale
* @param string $group
* @param string $namespace
* @param string|null $namespace
* @return array
*/
public function load($locale, $group, $namespace = null);

View File

@@ -9,7 +9,7 @@ interface Translator
*
* @param string $key
* @param array $replace
* @param string $locale
* @param string|null $locale
* @return mixed
*/
public function trans($key, array $replace = [], $locale = null);
@@ -20,7 +20,7 @@ interface Translator
* @param string $key
* @param int|array|\Countable $number
* @param array $replace
* @param string $locale
* @param string|null $locale
* @return string
*/
public function transChoice($key, $number, array $replace = [], $locale = null);

View File

@@ -20,7 +20,7 @@ interface Factory
*
* @param string $rule
* @param \Closure|string $extension
* @param string $message
* @param string|null $message
* @return void
*/
public function extend($rule, $extension, $message = null);
@@ -30,7 +30,7 @@ interface Factory
*
* @param string $rule
* @param \Closure|string $extension
* @param string $message
* @param string|null $message
* @return void
*/
public function extendImplicit($rule, $extension, $message = null);

View File

@@ -53,8 +53,8 @@ class CookieJar implements JarContract
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
@@ -75,8 +75,8 @@ class CookieJar implements JarContract
*
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
@@ -92,8 +92,8 @@ class CookieJar implements JarContract
* Expire the given cookie.
*
* @param string $name
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forget($name, $path = null, $domain = null)
@@ -158,7 +158,7 @@ class CookieJar implements JarContract
* @param string $path
* @param string $domain
* @param bool|null $secure
* @param string $sameSite
* @param string|null $sameSite
* @return array
*/
protected function getPathAndDomain($path, $domain, $secure = null, $sameSite = null)
@@ -172,7 +172,7 @@ class CookieJar implements JarContract
* @param string $path
* @param string $domain
* @param bool $secure
* @param string $sameSite
* @param string|null $sameSite
* @return $this
*/
public function setDefaultPathAndDomain($path, $domain, $secure = false, $sameSite = null)

View File

@@ -66,7 +66,7 @@ class Manager
/**
* Get a connection instance from the global manager.
*
* @param string $connection
* @param string|null $connection
* @return \Illuminate\Database\Connection
*/
public static function connection($connection = null)
@@ -89,7 +89,7 @@ class Manager
/**
* Get a schema builder instance.
*
* @param string $connection
* @param string|null $connection
* @return \Illuminate\Database\Schema\Builder
*/
public static function schema($connection = null)
@@ -100,7 +100,7 @@ class Manager
/**
* Get a registered connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\Connection
*/
public function getConnection($name = null)

View File

@@ -82,7 +82,7 @@ trait BuildsQueries
*
* @param mixed $value
* @param callable $callback
* @param callable $default
* @param callable|null $default
* @return mixed|$this
*/
public function when($value, $callback, $default = null)
@@ -112,7 +112,7 @@ trait BuildsQueries
*
* @param mixed $value
* @param callable $callback
* @param callable $default
* @param callable|null $default
* @return mixed|$this
*/
public function unless($value, $callback, $default = null)

View File

@@ -700,15 +700,15 @@ class Connection implements ConnectionInterface
/**
* Handle a query exception.
*
* @param \Exception $e
* @param \Illuminate\Database\QueryException $e
* @param string $query
* @param array $bindings
* @param \Closure $callback
* @return mixed
*
* @throws \Exception
* @throws \Illuminate\Database\QueryException
*/
protected function handleQueryException($e, $query, $bindings, Closure $callback)
protected function handleQueryException(QueryException $e, $query, $bindings, Closure $callback)
{
if ($this->transactions >= 1) {
throw $e;

View File

@@ -34,7 +34,7 @@ class ConnectionResolver implements ConnectionResolverInterface
/**
* Get a database connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\ConnectionInterface
*/
public function connection($name = null)

View File

@@ -7,7 +7,7 @@ interface ConnectionResolverInterface
/**
* Get a database connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\ConnectionInterface
*/
public function connection($name = null);

View File

@@ -36,7 +36,7 @@ class ConnectionFactory
* Establish a PDO connection based on the configuration.
*
* @param array $config
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\Connection
*/
public function make(array $config, $name = null)

View File

@@ -17,7 +17,8 @@ class MigrateMakeCommand extends BaseCommand
{--create= : The table to be created}
{--table= : The table to migrate}
{--path= : The location where the migration file should be created}
{--realpath : Indicate any provided migration file paths are pre-resolved absolute paths}';
{--realpath : Indicate any provided migration file paths are pre-resolved absolute paths}
{--fullpath : Output the full path of the migration}';
/**
* The console command description.
@@ -105,9 +106,13 @@ class MigrateMakeCommand extends BaseCommand
*/
protected function writeMigration($name, $table, $create)
{
$file = pathinfo($this->creator->create(
$file = $this->creator->create(
$name, $this->getMigrationPath(), $table, $create
), PATHINFO_FILENAME);
);
if (! $this->option('fullpath')) {
$file = pathinfo($file, PATHINFO_FILENAME);
}
$this->line("<info>Created Migration:</info> {$file}");
}

View File

@@ -69,7 +69,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* Get a database connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\Connection
*/
public function connection($name = null)
@@ -186,7 +186,7 @@ class DatabaseManager implements ConnectionResolverInterface
* Prepare the read / write mode for database connection instance.
*
* @param \Illuminate\Database\Connection $connection
* @param string $type
* @param string|null $type
* @return \Illuminate\Database\Connection
*/
protected function setPdoForType(Connection $connection, $type = null)
@@ -203,7 +203,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* Disconnect from the given database and remove from local cache.
*
* @param string $name
* @param string|null $name
* @return void
*/
public function purge($name = null)
@@ -218,7 +218,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* Disconnect from the given database.
*
* @param string $name
* @param string|null $name
* @return void
*/
public function disconnect($name = null)
@@ -231,7 +231,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* Reconnect to the given database.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Database\Connection
*/
public function reconnect($name = null)

View File

@@ -71,7 +71,7 @@ class Builder
* @var array
*/
protected $passthru = [
'insert', 'insertGetId', 'getBindings', 'toSql',
'insert', 'insertGetId', 'getBindings', 'toSql', 'dump', 'dd',
'exists', 'doesntExist', 'count', 'min', 'max', 'avg', 'average', 'sum', 'getConnection',
];
@@ -643,7 +643,7 @@ class Builder
public function cursor()
{
foreach ($this->applyScopes()->query->cursor() as $record) {
yield $this->model->newFromBuilder($record);
yield $this->newModelInstance()->newFromBuilder($record);
}
}
@@ -966,7 +966,7 @@ class Builder
continue;
}
$builder->callScope(function (Builder $builder) use ($scope) {
$builder->callScope(function (self $builder) use ($scope) {
// If the scope is a Closure we will just go ahead and call the scope with the
// builder instance. The "callScope" method will properly group the clauses
// that are added to this query so "where" clauses maintain proper logic.

View File

@@ -17,7 +17,7 @@ class Collection extends BaseCollection implements QueueableCollection
*
* @param mixed $key
* @param mixed $default
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model|static|null
*/
public function find($key, $default = null)
{

View File

@@ -413,6 +413,12 @@ trait HasAttributes
$relation = $this->$method();
if (! $relation instanceof Relation) {
if (is_null($relation)) {
throw new LogicException(sprintf(
'%s::%s must return a relationship instance, but "null" was returned. Was the "return" keyword used?', static::class, $method
));
}
throw new LogicException(sprintf(
'%s::%s must return a relationship instance.', static::class, $method
));

View File

@@ -294,6 +294,10 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
{
$class = $class ?: static::class;
if (! get_class_vars($class)['timestamps'] || ! $class::UPDATED_AT) {
return true;
}
foreach (static::$ignoreOnTouch as $ignoredClass) {
if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) {
return true;

View File

@@ -256,7 +256,7 @@ trait AsPivot
/**
* Get a new query to restore one or more models by their queueable IDs.
*
* @param array<int> $ids
* @param int[]|string[]|string $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
public function newQueryForRestoration($ids)
@@ -279,7 +279,7 @@ trait AsPivot
/**
* Get a new query to restore multiple models by their queueable IDs.
*
* @param array|int $ids
* @param int[]|string[] $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
protected function newQueryForCollectionRestoration(array $ids)

View File

@@ -37,6 +37,13 @@ class MorphTo extends BelongsTo
*/
protected $macroBuffer = [];
/**
* A map of relations to load for each individual morph type.
*
* @var array
*/
protected $morphableEagerLoads = [];
/**
* Create a new morph to relationship instance.
*
@@ -111,7 +118,10 @@ class MorphTo extends BelongsTo
$query = $this->replayMacros($instance->newQuery())
->mergeConstraintsFrom($this->getQuery())
->with($this->getQuery()->getEagerLoads());
->with(array_merge(
$this->getQuery()->getEagerLoads(),
(array) ($this->morphableEagerLoads[get_class($instance)] ?? [])
));
return $query->whereIn(
$instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type)
@@ -253,6 +263,21 @@ class MorphTo extends BelongsTo
return $this->dictionary;
}
/**
* Specify which relations to load for a given morph type.
*
* @param array $with
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/
public function morphWith(array $with)
{
$this->morphableEagerLoads = array_merge(
$this->morphableEagerLoads, $with
);
return $this;
}
/**
* Replay stored macro calls on the actual related instance.
*

View File

@@ -6,7 +6,6 @@ namespace Illuminate\Database\Eloquent;
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed()
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyTrashed()
* @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withoutTrashed()
* @method bool restore()
*/
trait SoftDeletes
{

View File

@@ -39,7 +39,7 @@ class MigrationCreator
*
* @param string $name
* @param string $path
* @param string $table
* @param string|null $table
* @param bool $create
* @return string
*
@@ -85,7 +85,7 @@ class MigrationCreator
/**
* Get the migration stub file.
*
* @param string $table
* @param string|null $table
* @param bool $create
* @return string
*/
@@ -108,7 +108,7 @@ class MigrationCreator
*
* @param string $name
* @param string $stub
* @param string $table
* @param string|null $table
* @return string
*/
protected function populateStub($name, $stub, $table)
@@ -151,7 +151,7 @@ class MigrationCreator
/**
* Fire the registered post create hooks.
*
* @param string $table
* @param string|null $table
* @return void
*/
protected function firePostCreateHooks($table)

View File

@@ -71,7 +71,7 @@ class Migrator
* @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository
* @param \Illuminate\Database\ConnectionResolverInterface $resolver
* @param \Illuminate\Filesystem\Filesystem $files
* @param \Illuminate\Contracts\Events\Dispatcher $dispatcher
* @param \Illuminate\Contracts\Events\Dispatcher|null $dispatcher
* @return void
*/
public function __construct(MigrationRepositoryInterface $repository,
@@ -94,8 +94,6 @@ class Migrator
*/
public function run($paths = [], array $options = [])
{
$this->notes = [];
// Once we grab all of the migration files for the path, we will compare them
// against the migrations that have already been run for this package then
// run each of the outstanding migrations against a database connection.
@@ -213,8 +211,6 @@ class Migrator
*/
public function rollback($paths = [], array $options = [])
{
$this->notes = [];
// We want to pull in the last batch of migrations that ran on the previous
// migration operation. We'll then reverse those migrations and run each
// of them "down" to reverse the last migration "operation" which ran.
@@ -294,8 +290,6 @@ class Migrator
*/
public function reset($paths = [], $pretend = false)
{
$this->notes = [];
// Next, we will reverse the migration list so we can run them back in the
// correct order for resetting this database. This will allow us to get
// the database back into its "empty" state ready for the migrations.

View File

@@ -1106,7 +1106,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1128,7 +1128,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orWhereDate($column, $operator, $value = null)
@@ -1145,7 +1145,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1167,7 +1167,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orWhereTime($column, $operator, $value = null)
@@ -1184,7 +1184,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1208,7 +1208,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orWhereDay($column, $operator, $value = null)
@@ -1225,7 +1225,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1249,7 +1249,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string $value
* @param \DateTimeInterface|string|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orWhereMonth($column, $operator, $value = null)
@@ -1266,7 +1266,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|int $value
* @param \DateTimeInterface|string|int|null $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1288,7 +1288,7 @@ class Builder
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|int $value
* @param \DateTimeInterface|string|int|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orWhereYear($column, $operator, $value = null)
@@ -1609,7 +1609,7 @@ class Builder
* Handles dynamic "where" clauses to the query.
*
* @param string $method
* @param string $parameters
* @param array $parameters
* @return $this
*/
public function dynamicWhere($method, $parameters)

View File

@@ -259,7 +259,7 @@ class MySqlGrammar extends Grammar
*
* @param \Illuminate\Database\Query\Builder $query
* @param string $table
* @param array $where
* @param string $where
* @return string
*/
protected function compileDeleteWithoutJoins($query, $table, $where)
@@ -285,7 +285,7 @@ class MySqlGrammar extends Grammar
*
* @param \Illuminate\Database\Query\Builder $query
* @param string $table
* @param array $where
* @param string $where
* @return string
*/
protected function compileDeleteWithJoins($query, $table, $where)

View File

@@ -12,7 +12,7 @@ class PostgresProcessor extends Processor
* @param \Illuminate\Database\Query\Builder $query
* @param string $sql
* @param array $values
* @param string $sequence
* @param string|null $sequence
* @return int
*/
public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)

View File

@@ -24,7 +24,7 @@ class Processor
* @param \Illuminate\Database\Query\Builder $query
* @param string $sql
* @param array $values
* @param string $sequence
* @param string|null $sequence
* @return int
*/
public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)

View File

@@ -14,7 +14,7 @@ class SqlServerProcessor extends Processor
* @param \Illuminate\Database\Query\Builder $query
* @param string $sql
* @param array $values
* @param string $sequence
* @param string|null $sequence
* @return int
*/
public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)

View File

@@ -323,7 +323,7 @@ class Blueprint
/**
* Indicate that the given primary key should be dropped.
*
* @param string|array $index
* @param string|array|null $index
* @return \Illuminate\Support\Fluent
*/
public function dropPrimary($index = null)
@@ -468,7 +468,7 @@ class Blueprint
* Specify the primary key(s) for the table.
*
* @param string|array $columns
* @param string $name
* @param string|null $name
* @param string|null $algorithm
* @return \Illuminate\Support\Fluent
*/
@@ -481,7 +481,7 @@ class Blueprint
* Specify a unique index for the table.
*
* @param string|array $columns
* @param string $name
* @param string|null $name
* @param string|null $algorithm
* @return \Illuminate\Support\Fluent
*/
@@ -494,7 +494,7 @@ class Blueprint
* Specify an index for the table.
*
* @param string|array $columns
* @param string $name
* @param string|null $name
* @param string|null $algorithm
* @return \Illuminate\Support\Fluent
*/
@@ -507,7 +507,7 @@ class Blueprint
* Specify a spatial index for the table.
*
* @param string|array $columns
* @param string $name
* @param string|null $name
* @return \Illuminate\Support\Fluent
*/
public function spatialIndex($columns, $name = null)
@@ -519,7 +519,7 @@ class Blueprint
* Specify a foreign key for the table.
*
* @param string|array $columns
* @param string $name
* @param string|null $name
* @return \Illuminate\Support\Fluent|\Illuminate\Database\Schema\ForeignKeyDefinition
*/
public function foreign($columns, $name = null)
@@ -597,7 +597,7 @@ class Blueprint
* Create a new char column on the table.
*
* @param string $column
* @param int $length
* @param int|null $length
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function char($column, $length = null)
@@ -611,7 +611,7 @@ class Blueprint
* Create a new string column on the table.
*
* @param string $column
* @param int $length
* @param int|null $length
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function string($column, $length = null)

View File

@@ -3,6 +3,7 @@
namespace Illuminate\Database\Schema;
use Illuminate\Support\Fluent;
use Illuminate\Database\Query\Expression;
/**
* @method ColumnDefinition after(string $column) Place the column "after" another column (MySQL)
@@ -14,7 +15,7 @@ use Illuminate\Support\Fluent;
* @method ColumnDefinition comment(string $comment) Add a comment to the column (MySQL)
* @method ColumnDefinition default(mixed $value) Specify a "default" value for the column
* @method ColumnDefinition first() Place the column "first" in the table (MySQL)
* @method ColumnDefinition generatedAs(string $expression) Create a SQL compliant identity column (PostgreSQL)
* @method ColumnDefinition generatedAs(string|Expression $expression = null) Create a SQL compliant identity column (PostgreSQL)
* @method ColumnDefinition index(string $indexName = null) Add an index
* @method ColumnDefinition nullable(bool $value = true) Allow NULL values to be inserted into the column
* @method ColumnDefinition primary() Add a primary index

View File

@@ -200,7 +200,7 @@ class PostgresGrammar extends Grammar
/**
* Compile the SQL needed to drop all tables.
*
* @param string $tables
* @param array $tables
* @return string
*/
public function compileDropAllTables($tables)
@@ -211,7 +211,7 @@ class PostgresGrammar extends Grammar
/**
* Compile the SQL needed to drop all views.
*
* @param string $views
* @param array $views
* @return string
*/
public function compileDropAllViews($views)

View File

@@ -312,6 +312,21 @@ class SqlServerGrammar extends Grammar
return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";';
}
/**
* Compile the command to drop all foreign keys.
*
* @return string
*/
public function compileDropAllForeignKeys()
{
return "DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql += 'ALTER TABLE ' + QUOTENAME(OBJECT_NAME(parent_object_id))
+ ' DROP CONSTRAINT ' + QUOTENAME(name) + ';'
FROM sys.foreign_keys;
EXEC sp_executesql @sql;";
}
/**
* Create the column definition for a char type.
*

View File

@@ -11,10 +11,8 @@ class SqlServerBuilder extends Builder
*/
public function dropAllTables()
{
$this->disableForeignKeyConstraints();
$this->connection->statement($this->grammar->compileDropAllForeignKeys());
$this->connection->statement($this->grammar->compileDropAllTables());
$this->enableForeignKeyConstraints();
}
}

View File

@@ -125,7 +125,7 @@ class Encrypter implements EncrypterContract
/**
* Decrypt the given value.
*
* @param mixed $payload
* @param string $payload
* @param bool $unserialize
* @return mixed
*

View File

@@ -178,7 +178,7 @@ class Filesystem
* Get or set UNIX mode of a file or directory.
*
* @param string $path
* @param int $mode
* @param int|null $mode
* @return mixed
*/
public function chmod($path, $mode = null)
@@ -488,7 +488,7 @@ class Filesystem
*
* @param string $directory
* @param string $destination
* @param int $options
* @param int|null $options
* @return bool
*/
public function copyDirectory($directory, $destination, $options = null)

View File

@@ -59,7 +59,7 @@ class FilesystemManager implements FactoryContract
/**
* Get a filesystem instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
public function drive($name = null)
@@ -70,7 +70,7 @@ class FilesystemManager implements FactoryContract
/**
* Get a filesystem instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
public function disk($name = null)

View File

@@ -29,7 +29,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*
* @var string
*/
const VERSION = '5.8.19';
const VERSION = '5.8.24';
/**
* The base path for the Laravel installation.
@@ -1128,7 +1128,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
public function registerCoreContainerAliases()
{
foreach ([
'app' => [\Illuminate\Foundation\Application::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'app' => [self::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'auth' => [\Illuminate\Auth\AuthManager::class, \Illuminate\Contracts\Auth\Factory::class],
'auth.driver' => [\Illuminate\Contracts\Auth\Guard::class],
'blade.compiler' => [\Illuminate\View\Compilers\BladeCompiler::class],

View File

@@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\InteractsWithTime;
@@ -28,16 +29,23 @@ class DownCommand extends Command
/**
* Execute the console command.
*
* @return void
* @return int
*/
public function handle()
{
file_put_contents(
storage_path('framework/down'),
json_encode($this->getDownFilePayload(), JSON_PRETTY_PRINT)
);
try {
file_put_contents(storage_path('framework/down'),
json_encode($this->getDownFilePayload(),
JSON_PRETTY_PRINT));
$this->comment('Application is now in maintenance mode.');
$this->comment('Application is now in maintenance mode.');
} catch (Exception $e) {
$this->error('Failed to enter maintenance mode.');
$this->error($e->getMessage());
return 1;
}
}
/**

View File

@@ -122,7 +122,7 @@ class Kernel implements KernelContract
* Run the console application.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Symfony\Component\Console\Output\OutputInterface|null $output
* @return int
*/
public function handle($input, $output = null)
@@ -263,7 +263,7 @@ class Kernel implements KernelContract
*
* @param string $command
* @param array $parameters
* @param \Symfony\Component\Console\Output\OutputInterface $outputBuffer
* @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
* @return int
*
* @throws \Symfony\Component\Console\Exception\CommandNotFoundException

View File

@@ -86,7 +86,9 @@ class ServeCommand extends Command
*/
protected function port()
{
return $this->input->getOption('port') + $this->portOffset;
$port = $this->input->getOption('port') ?: 8000;
return $port + $this->portOffset;
}
/**
@@ -96,7 +98,8 @@ class ServeCommand extends Command
*/
protected function canTryAnotherPort()
{
return $this->input->getOption('tries') > $this->portOffset;
return is_null($this->input->getOption('port')) &&
($this->input->getOption('tries') > $this->portOffset);
}
/**
@@ -109,7 +112,7 @@ class ServeCommand extends Command
return [
['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on', '127.0.0.1'],
['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on', 8000],
['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on', $_ENV['SERVER_PORT'] ?? null],
['tries', null, InputOption::VALUE_OPTIONAL, 'The max number of ports to attempt to serve from', 10],
];

View File

@@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
class UpCommand extends Command
@@ -23,12 +24,26 @@ class UpCommand extends Command
/**
* Execute the console command.
*
* @return void
* @return int
*/
public function handle()
{
@unlink(storage_path('framework/down'));
try {
if (! file_exists(storage_path('framework/down'))) {
$this->comment('Application is already up.');
$this->info('Application is now live.');
return true;
}
unlink(storage_path('framework/down'));
$this->info('Application is now live.');
} catch (Exception $e) {
$this->error('Failed to disable maintenance mode.');
$this->error($e->getMessage());
return 1;
}
}
}

View File

@@ -9,6 +9,17 @@ use Illuminate\Auth\Access\HandlesAuthorization;
class DummyClass
{
use HandlesAuthorization;
/**
* Determine whether the user can view any DocDummyPluralModel.
*
* @param \NamespacedDummyUserModel $user
* @return mixed
*/
public function viewAny(DummyUser $user)
{
//
}
/**
* Determine whether the user can view the DocDummyModel.

View File

@@ -3,7 +3,6 @@
namespace Illuminate\Foundation;
use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
class EnvironmentDetector
@@ -48,7 +47,7 @@ class EnvironmentDetector
// and if it was that automatically overrides as the environment. Otherwise, we
// will check the environment as a "web" request like a typical HTTP request.
if (! is_null($value = $this->getEnvironmentArgument($args))) {
return head(array_slice(explode('=', $value), 1));
return $value;
}
return $this->detectWebEnvironment($callback);
@@ -62,8 +61,14 @@ class EnvironmentDetector
*/
protected function getEnvironmentArgument(array $args)
{
return Arr::first($args, function ($value) {
return Str::startsWith($value, '--env');
});
foreach ($args as $i => $value) {
if ($value === '--env') {
return $args[$i + 1] ?? null;
}
if (Str::startsWith($value, '--env')) {
return head(array_slice(explode('=', $value), 1));
}
}
}
}

View File

@@ -31,6 +31,7 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerContract;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpFoundation\RedirectResponse as SymfonyRedirectResponse;
class Handler implements ExceptionHandlerContract
@@ -60,6 +61,7 @@ class Handler implements ExceptionHandlerContract
HttpException::class,
HttpResponseException::class,
ModelNotFoundException::class,
SuspiciousOperationException::class,
TokenMismatchException::class,
ValidationException::class,
];
@@ -202,6 +204,8 @@ class Handler implements ExceptionHandlerContract
$e = new AccessDeniedHttpException($e->getMessage(), $e);
} elseif ($e instanceof TokenMismatchException) {
$e = new HttpException(419, $e->getMessage(), $e);
} elseif ($e instanceof SuspiciousOperationException) {
$e = new NotFoundHttpException(null, $e);
}
return $e;

View File

@@ -15,7 +15,7 @@ trait InteractsWithDatabase
*
* @param string $table
* @param array $data
* @param string $connection
* @param string|null $connection
* @return $this
*/
protected function assertDatabaseHas($table, array $data, $connection = null)
@@ -32,7 +32,7 @@ trait InteractsWithDatabase
*
* @param string $table
* @param array $data
* @param string $connection
* @param string|null $connection
* @return $this
*/
protected function assertDatabaseMissing($table, array $data, $connection = null)
@@ -51,7 +51,7 @@ trait InteractsWithDatabase
*
* @param string|\Illuminate\Database\Eloquent\Model $table
* @param array $data
* @param string $connection
* @param string|null $connection
* @return $this
*/
protected function assertSoftDeleted($table, array $data = [], $connection = null)

View File

@@ -87,7 +87,7 @@ trait MakesHttpRequests
/**
* Disable middleware for the test.
*
* @param string|array $middleware
* @param string|array|null $middleware
* @return $this
*/
public function withoutMiddleware($middleware = null)
@@ -113,7 +113,7 @@ trait MakesHttpRequests
/**
* Enable the given middleware for the test.
*
* @param string|array $middleware
* @param string|array|null $middleware
* @return $this
*/
public function withMiddleware($middleware = null)
@@ -329,7 +329,7 @@ trait MakesHttpRequests
* @param array $cookies
* @param array $files
* @param array $server
* @param string $content
* @param string|null $content
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)

View File

@@ -118,6 +118,23 @@ class TestResponse
return $this;
}
/**
* Assert that the response has an unauthorized status code.
*
* @return $this
*/
public function assertUnauthorized()
{
$actual = $this->getStatusCode();
PHPUnit::assertTrue(
401 === $actual,
'Response status code ['.$actual.'] is not an unauthorized status code.'
);
return $this;
}
/**
* Assert that the response has the given status code.
*
@@ -139,7 +156,7 @@ class TestResponse
/**
* Assert whether the response is redirecting to a given URI.
*
* @param string $uri
* @param string|null $uri
* @return $this
*/
public function assertRedirect($uri = null)
@@ -631,30 +648,42 @@ class TestResponse
}
/**
* Assert that the response has the given JSON validation errors for the given keys.
* Assert that the response has the given JSON validation errors.
*
* @param string|array $keys
* @param string|array $errors
* @return $this
*/
public function assertJsonValidationErrors($keys)
public function assertJsonValidationErrors($errors)
{
$keys = Arr::wrap($keys);
$errors = Arr::wrap($errors);
PHPUnit::assertNotEmpty($keys, 'No keys were provided.');
PHPUnit::assertNotEmpty($errors, 'No validation errors were provided.');
$errors = $this->json()['errors'] ?? [];
$jsonErrors = $this->json()['errors'] ?? [];
$errorMessage = $errors
$errorMessage = $jsonErrors
? 'Response has the following JSON validation errors:'.
PHP_EOL.PHP_EOL.json_encode($errors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE).PHP_EOL
PHP_EOL.PHP_EOL.json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE).PHP_EOL
: 'Response does not have JSON validation errors.';
foreach ($keys as $key) {
foreach ($errors as $key => $value) {
PHPUnit::assertArrayHasKey(
$key,
$errors,
"Failed to find a validation error in the response for key: '{$key}'".PHP_EOL.PHP_EOL.$errorMessage
(is_int($key)) ? $value : $key,
$jsonErrors,
"Failed to find a validation error in the response for key: '{$value}'".PHP_EOL.PHP_EOL.$errorMessage
);
if (! is_int($key)) {
foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) {
if (Str::contains($jsonErrorMessage, $value)) {
return $this;
}
}
PHPUnit::fail(
"Failed to find a validation error in the response for key and message: '$key' => '$value'".PHP_EOL.PHP_EOL.$errorMessage
);
}
}
return $this;
@@ -663,7 +692,7 @@ class TestResponse
/**
* Assert that the response has no JSON validation errors for the given keys.
*
* @param string|array $keys
* @param string|array|null $keys
* @return $this
*/
public function assertJsonMissingValidationErrors($keys = null)
@@ -849,6 +878,8 @@ class TestResponse
$this->session()->has($key),
"Session is missing expected key [{$key}]."
);
} elseif ($value instanceof Closure) {
PHPUnit::assertTrue($value($this->session()->get($key)));
} else {
PHPUnit::assertEquals($value, $this->session()->get($key));
}
@@ -906,7 +937,7 @@ class TestResponse
* Assert that the session is missing the given errors.
*
* @param string|array $keys
* @param string $format
* @param string|null $format
* @param string $errorBag
* @return $this
*/

View File

@@ -26,7 +26,7 @@ trait WithFaker
/**
* Get the default Faker instance for a given locale.
*
* @param string $locale
* @param string|null $locale
* @return \Faker\Generator
*/
protected function faker($locale = null)
@@ -37,7 +37,7 @@ trait WithFaker
/**
* Create a Faker instance for the given locale.
*
* @param string $locale
* @param string|null $locale
* @return \Faker\Generator
*/
protected function makeFaker($locale = null)

View File

@@ -108,7 +108,7 @@ if (! function_exists('app')) {
/**
* Get the available container instance.
*
* @param string $abstract
* @param string|null $abstract
* @param array $parameters
* @return mixed|\Illuminate\Contracts\Foundation\Application
*/
@@ -140,7 +140,7 @@ if (! function_exists('asset')) {
* Generate an asset path for the application.
*
* @param string $path
* @param bool $secure
* @param bool|null $secure
* @return string
*/
function asset($path, $secure = null)
@@ -266,7 +266,7 @@ if (! function_exists('config')) {
*
* If an array is passed as the key, we will assume you want to set an array of values.
*
* @param array|string $key
* @param array|string|null $key
* @param mixed $default
* @return mixed|\Illuminate\Config\Repository
*/
@@ -301,11 +301,11 @@ if (! function_exists('cookie')) {
/**
* Create a new cookie instance.
*
* @param string $name
* @param string $value
* @param string|null $name
* @param string|null $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param string|null $path
* @param string|null $domain
* @param bool $secure
* @param bool $httpOnly
* @param bool $raw
@@ -524,7 +524,7 @@ if (! function_exists('logger')) {
/**
* Log a debug message to the logs.
*
* @param string $message
* @param string|null $message
* @param array $context
* @return \Illuminate\Log\LogManager|null
*/
@@ -542,7 +542,7 @@ if (! function_exists('logs')) {
/**
* Get a log driver instance.
*
* @param string $driver
* @param string|null $driver
* @return \Illuminate\Log\LogManager|\Psr\Log\LoggerInterface
*/
function logs($driver = null)
@@ -597,7 +597,7 @@ if (! function_exists('old')) {
/**
* Retrieve an old input item.
*
* @param string $key
* @param string|null $key
* @param mixed $default
* @return mixed
*/
@@ -642,7 +642,7 @@ if (! function_exists('redirect')) {
* @param string|null $to
* @param int $status
* @param array $headers
* @param bool $secure
* @param bool|null $secure
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
*/
function redirect($to = null, $status = 302, $headers = [], $secure = null)
@@ -677,7 +677,7 @@ if (! function_exists('request')) {
/**
* Get an instance of the current request or an input item from the request.
*
* @param array|string $key
* @param array|string|null $key
* @param mixed $default
* @return \Illuminate\Http\Request|string|array
*/
@@ -816,7 +816,7 @@ if (! function_exists('session')) {
*
* If an array is passed as the key, we will assume you want to set an array of values.
*
* @param array|string $key
* @param array|string|null $key
* @param mixed $default
* @return mixed|\Illuminate\Session\Store|\Illuminate\Session\SessionManager
*/
@@ -864,9 +864,9 @@ if (! function_exists('trans')) {
/**
* Translate the given message.
*
* @param string $key
* @param string|null $key
* @param array $replace
* @param string $locale
* @param string|null $locale
* @return \Illuminate\Contracts\Translation\Translator|string|array|null
*/
function trans($key = null, $replace = [], $locale = null)
@@ -886,7 +886,7 @@ if (! function_exists('trans_choice')) {
* @param string $key
* @param int|array|\Countable $number
* @param array $replace
* @param string $locale
* @param string|null $locale
* @return string
*/
function trans_choice($key, $number, array $replace = [], $locale = null)
@@ -901,7 +901,7 @@ if (! function_exists('__')) {
*
* @param string $key
* @param array $replace
* @param string $locale
* @param string|null $locale
* @return string|array|null
*/
function __($key, $replace = [], $locale = null)
@@ -916,7 +916,7 @@ if (! function_exists('url')) {
*
* @param string $path
* @param mixed $parameters
* @param bool $secure
* @param bool|null $secure
* @return \Illuminate\Contracts\Routing\UrlGenerator|string
*/
function url($path = null, $parameters = [], $secure = null)
@@ -955,7 +955,7 @@ if (! function_exists('view')) {
/**
* Get the evaluated view contents for the given view.
*
* @param string $view
* @param string|null $view
* @param \Illuminate\Contracts\Support\Arrayable|array $data
* @param array $mergeData
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory

View File

@@ -7,7 +7,7 @@ trait InteractsWithFlashData
/**
* Retrieve an old input item.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
* @return string|array
*/

View File

@@ -13,7 +13,7 @@ trait InteractsWithInput
/**
* Retrieve a server variable from the request.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
* @return string|array|null
*/
@@ -36,7 +36,7 @@ trait InteractsWithInput
/**
* Retrieve a header from the request.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
* @return string|array|null
*/
@@ -176,7 +176,7 @@ trait InteractsWithInput
/**
* Get all of the input and files for the request.
*
* @param array|mixed $keys
* @param array|mixed|null $keys
* @return array
*/
public function all($keys = null)
@@ -255,7 +255,7 @@ trait InteractsWithInput
/**
* Retrieve a query string item from the request.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
* @return string|array|null
*/
@@ -267,9 +267,8 @@ trait InteractsWithInput
/**
* Retrieve a request payload item from the request.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
*
* @return string|array|null
*/
public function post($key = null, $default = null)
@@ -291,7 +290,7 @@ trait InteractsWithInput
/**
* Retrieve a cookie from the request.
*
* @param string $key
* @param string|null $key
* @param string|array|null $default
* @return string|array|null
*/
@@ -366,7 +365,7 @@ trait InteractsWithInput
/**
* Retrieve a file from the request.
*
* @param string $key
* @param string|null $key
* @param mixed $default
* @return \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null
*/

View File

@@ -36,7 +36,7 @@ trait FileHelpers
/**
* Get a filename for the file.
*
* @param string $path
* @param string|null $path
* @return string
*/
public function hashName($path = null)

View File

@@ -339,7 +339,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
/**
* Get the JSON payload for the request.
*
* @param string $key
* @param string|null $key
* @param mixed $default
* @return \Symfony\Component\HttpFoundation\ParameterBag|mixed
*/

View File

@@ -795,7 +795,7 @@ class MimeType
/**
* Get the MIME type for a given extension or return all mimes.
*
* @param string $extension
* @param string|null $extension
* @return string|array
*/
public static function get($extension = null)

View File

@@ -756,7 +756,7 @@ class Mailable implements MailableContract, Renderable
* Attach a file to the message from storage.
*
* @param string $path
* @param string $name
* @param string|null $name
* @param array $options
* @return $this
*/
@@ -770,7 +770,7 @@ class Mailable implements MailableContract, Renderable
*
* @param string $disk
* @param string $path
* @param string $name
* @param string|null $name
* @param array $options
* @return $this
*/

View File

@@ -220,7 +220,7 @@ class Mailer implements MailerContract, MailQueueContract
*
* @param string|array|\Illuminate\Contracts\Mail\Mailable $view
* @param array $data
* @param \Closure|string $callback
* @param \Closure|string|null $callback
* @return void
*/
public function send($view, array $data = [], $callback = null)

View File

@@ -50,7 +50,7 @@ class SendQueuedNotifications implements ShouldQueue
*
* @param \Illuminate\Support\Collection $notifiables
* @param \Illuminate\Notifications\Notification $notification
* @param array $channels
* @param array|null $channels
* @return void
*/
public function __construct($notifiables, $notification, array $channels = null)

View File

@@ -57,7 +57,7 @@ class BeanstalkdQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -72,7 +72,7 @@ class BeanstalkdQueue extends Queue implements QueueContract
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null)
@@ -84,7 +84,7 @@ class BeanstalkdQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -101,7 +101,7 @@ class BeanstalkdQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -119,7 +119,7 @@ class BeanstalkdQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null)

View File

@@ -25,7 +25,7 @@ class Manager
/**
* Create a new queue capsule manager.
*
* @param \Illuminate\Container\Container $container
* @param \Illuminate\Container\Container|null $container
* @return void
*/
public function __construct(Container $container = null)
@@ -77,7 +77,7 @@ class Manager
/**
* Get a connection instance from the global manager.
*
* @param string $connection
* @param string|null $connection
* @return \Illuminate\Contracts\Queue\Queue
*/
public static function connection($connection = null)
@@ -90,8 +90,8 @@ class Manager
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string $connection
* @param string|null $queue
* @param string|null $connection
* @return mixed
*/
public static function push($job, $data = '', $queue = null, $connection = null)
@@ -104,8 +104,8 @@ class Manager
*
* @param array $jobs
* @param mixed $data
* @param string $queue
* @param string $connection
* @param string|null $queue
* @param string|null $connection
* @return mixed
*/
public static function bulk($jobs, $data = '', $queue = null, $connection = null)
@@ -119,8 +119,8 @@ class Manager
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string $connection
* @param string|null $queue
* @param string|null $connection
* @return mixed
*/
public static function later($delay, $job, $data = '', $queue = null, $connection = null)
@@ -131,7 +131,7 @@ class Manager
/**
* Get a registered connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Queue\Queue
*/
public function getConnection($name = null)

View File

@@ -58,7 +58,7 @@ class DatabaseQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -73,7 +73,7 @@ class DatabaseQueue extends Queue implements QueueContract
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null)
@@ -87,7 +87,7 @@ class DatabaseQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -102,7 +102,7 @@ class DatabaseQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return void
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -117,7 +117,7 @@ class DatabaseQueue extends Queue implements QueueContract
*
* @param array $jobs
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function bulk($jobs, $data = '', $queue = null)
@@ -186,7 +186,7 @@ class DatabaseQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*
* @throws \Exception|\Throwable

View File

@@ -38,7 +38,7 @@ trait InteractsWithQueue
/**
* Fail the job from the queue.
*
* @param \Throwable $exception
* @param \Throwable|null $exception
* @return void
*/
public function fail($exception = null)

View File

@@ -14,7 +14,7 @@ class ListenerOptions extends WorkerOptions
/**
* Create a new listener options instance.
*
* @param string $environment
* @param string|null $environment
* @param int $delay
* @param int $memory
* @param int $timeout

View File

@@ -9,7 +9,7 @@ class NullQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -22,7 +22,7 @@ class NullQueue extends Queue implements QueueContract
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null)
@@ -34,7 +34,7 @@ class NullQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -49,7 +49,7 @@ class NullQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -60,7 +60,7 @@ class NullQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null)

View File

@@ -63,7 +63,7 @@ abstract class Queue
*
* @param array $jobs
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return void
*/
public function bulk($jobs, $data = '', $queue = null)

View File

@@ -113,7 +113,7 @@ class QueueManager implements FactoryContract, MonitorContract
/**
* Determine if the driver is connected.
*
* @param string $name
* @param string|null $name
* @return bool
*/
public function connected($name = null)
@@ -124,7 +124,7 @@ class QueueManager implements FactoryContract, MonitorContract
/**
* Resolve a queue connection instance.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Queue\Queue
*/
public function connection($name = null)
@@ -238,7 +238,7 @@ class QueueManager implements FactoryContract, MonitorContract
/**
* Get the full name for the given connection.
*
* @param string $connection
* @param string|null $connection
* @return string
*/
public function getName($connection = null)

View File

@@ -49,7 +49,7 @@ class RedisQueue extends Queue implements QueueContract
*
* @param \Illuminate\Contracts\Redis\Factory $redis
* @param string $default
* @param string $connection
* @param string|null $connection
* @param int $retryAfter
* @param int|null $blockFor
* @return void
@@ -66,7 +66,7 @@ class RedisQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -83,7 +83,7 @@ class RedisQueue extends Queue implements QueueContract
*
* @param object|string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null)
@@ -95,7 +95,7 @@ class RedisQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -115,7 +115,7 @@ class RedisQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param object|string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -128,7 +128,7 @@ class RedisQueue extends Queue implements QueueContract
*
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $payload
* @param string $queue
* @param string|null $queue
* @return mixed
*/
protected function laterRaw($delay, $payload, $queue = null)
@@ -159,7 +159,7 @@ class RedisQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null)

View File

@@ -47,7 +47,7 @@ class SqsQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -67,7 +67,7 @@ class SqsQueue extends Queue implements QueueContract
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null)
@@ -79,7 +79,7 @@ class SqsQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -96,7 +96,7 @@ class SqsQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -111,7 +111,7 @@ class SqsQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null)

View File

@@ -14,7 +14,7 @@ class SyncQueue extends Queue implements QueueContract
/**
* Get the size of the queue.
*
* @param string $queue
* @param string|null $queue
* @return int
*/
public function size($queue = null)
@@ -27,7 +27,7 @@ class SyncQueue extends Queue implements QueueContract
*
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*
* @throws \Exception|\Throwable
@@ -125,7 +125,7 @@ class SyncQueue extends Queue implements QueueContract
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string $queue
* @param string|null $queue
* @param array $options
* @return mixed
*/
@@ -140,7 +140,7 @@ class SyncQueue extends Queue implements QueueContract
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string $job
* @param mixed $data
* @param string $queue
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
@@ -151,7 +151,7 @@ class SyncQueue extends Queue implements QueueContract
/**
* Pop the next job off of the queue.
*
* @param string $queue
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null)

View File

@@ -4,7 +4,7 @@ namespace Illuminate\Redis\Connections;
use Closure;
use Predis\Command\ServerFlushDatabase;
use Predis\Connection\Aggregate\PredisCluster;
use Predis\Connection\Aggregate\ClusterInterface;
use Illuminate\Contracts\Redis\Connection as ConnectionContract;
/**
@@ -53,7 +53,7 @@ class PredisConnection extends Connection implements ConnectionContract
*/
public function flushdb()
{
if (! $this->client->getConnection() instanceof PredisCluster) {
if (! $this->client->getConnection() instanceof ClusterInterface) {
return $this->command('flushdb');
}

View File

@@ -118,7 +118,9 @@ class RedisManager implements Factory
protected function resolveCluster($name)
{
return $this->connector()->connectToCluster(
$this->parseConnectionConfiguration($this->config['clusters'][$name]),
array_map(function ($config) {
return $this->parseConnectionConfiguration($config);
}, $this->config['clusters'][$name]),
$this->config['clusters']['options'] ?? [],
$this->config['options'] ?? []
);
@@ -168,7 +170,7 @@ class RedisManager implements Factory
$parsed = (new ConfigurationUrlParser)->parseConfiguration($config);
return array_filter($parsed, function ($key) {
return ! in_array($key, ['driver', 'username']);
return ! in_array($key, ['driver', 'username'], true);
}, ARRAY_FILTER_USE_KEY);
}

View File

@@ -77,7 +77,7 @@ class Redirector
* @param string $path
* @param int $status
* @param array $headers
* @param bool $secure
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function guest($path, $status = 302, $headers = [], $secure = null)
@@ -101,7 +101,7 @@ class Redirector
* @param string $default
* @param int $status
* @param array $headers
* @param bool $secure
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function intended($default = '/', $status = 302, $headers = [], $secure = null)
@@ -128,7 +128,7 @@ class Redirector
* @param string $path
* @param int $status
* @param array $headers
* @param bool $secure
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function to($path, $status = 302, $headers = [], $secure = null)

View File

@@ -489,7 +489,7 @@ class Route
* Set a regular expression requirement on the route.
*
* @param array|string $name
* @param string $expression
* @param string|null $expression
* @return $this
*/
public function where($name, $expression = null)

View File

@@ -12,7 +12,7 @@ class RouteSignatureParameters
* Extract the route action's signature parameters.
*
* @param array $action
* @param string $subClass
* @param string|null $subClass
* @return array
*/
public static function fromAction(array $action, $subClass = null)

View File

@@ -1011,7 +1011,7 @@ class Router implements RegistrarContract, BindingRegistrar
* Get a route parameter for the current route.
*
* @param string $key
* @param string $default
* @param string|null $default
* @return mixed
*/
public function input($key, $default = null)

View File

@@ -113,7 +113,7 @@ class UrlGenerator implements UrlGeneratorContract
*
* @param \Illuminate\Routing\RouteCollection $routes
* @param \Illuminate\Http\Request $request
* @param string $assetRoot
* @param string|null $assetRoot
* @return void
*/
public function __construct(RouteCollection $routes, Request $request, $assetRoot = null)
@@ -311,7 +311,7 @@ class UrlGenerator implements UrlGeneratorContract
*
* @param string $name
* @param array $parameters
* @param \DateTimeInterface|\DateInterval|int $expiration
* @param \DateTimeInterface|\DateInterval|int|null $expiration
* @param bool $absolute
* @return string
*/
@@ -484,7 +484,7 @@ class UrlGenerator implements UrlGeneratorContract
* Get the base URL for the request.
*
* @param string $scheme
* @param string $root
* @param string|null $root
* @return string
*/
public function formatRoot($scheme, $root = null)

View File

@@ -119,7 +119,7 @@ class Store implements Session
/**
* Save the session data to storage.
*
* @return bool
* @return void
*/
public function save()
{
@@ -211,7 +211,7 @@ class Store implements Session
* Get the value of a given key and then forget it.
*
* @param string $key
* @param string $default
* @param string|null $default
* @return mixed
*/
public function pull($key, $default = null)
@@ -222,7 +222,7 @@ class Store implements Session
/**
* Determine if the session contains old input.
*
* @param string $key
* @param string|null $key
* @return bool
*/
public function hasOldInput($key = null)
@@ -235,7 +235,7 @@ class Store implements Session
/**
* Get the requested item from the flashed input array.
*
* @param string $key
* @param string|null $key
* @param mixed $default
* @return mixed
*/

View File

@@ -55,10 +55,10 @@ class Arr
continue;
}
$results = array_merge($results, $values);
$results[] = $values;
}
return $results;
return array_merge([], ...$results);
}
/**
@@ -275,7 +275,7 @@ class Arr
* Get an item from an array using "dot" notation.
*
* @param \ArrayAccess|array $array
* @param string $key
* @param string|int $key
* @param mixed $default
* @return mixed
*/

View File

@@ -804,7 +804,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
}
/**
* Get the first item from the collection.
* Get the first item from the collection passing the given truth test.
*
* @param callable|null $callback
* @param mixed $default

View File

@@ -134,7 +134,6 @@ class DateFactory
/**
* Use the default date class when generating dates.
*
* @param callable $callable
* @return void
*/
public static function useDefault()

View File

@@ -5,15 +5,42 @@ namespace Illuminate\Support\Facades;
/**
* @method static string version()
* @method static string basePath()
* @method static string environment()
* @method static string bootstrapPath(string $path = '')
* @method static string configPath(string $path = '')
* @method static string databasePath(string $path = '')
* @method static string environmentPath()
* @method static string resourcePath(string $path = '')
* @method static string storagePath(string $path = '')
* @method static string|bool environment(string|array ...$environments)
* @method static bool runningInConsole()
* @method static bool runningUnitTests()
* @method static bool isDownForMaintenance()
* @method static void registerConfiguredProviders()
* @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, array $options = [], bool $force = false)
* @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, bool $force = false)
* @method static void registerDeferredProvider(string $provider, string $service = null)
* @method static \Illuminate\Support\ServiceProvider resolveProvider(string $provider)
* @method static void boot()
* @method static void booting(mixed $callback)
* @method static void booted(mixed $callback)
* @method static void booting(callable $callback)
* @method static void booted(callable $callback)
* @method static void bootstrapWith(array $bootstrappers)
* @method static bool configurationIsCached()
* @method static string detectEnvironment(callable $callback)
* @method static string environmentFile()
* @method static string environmentFilePath()
* @method static string getCachedConfigPath()
* @method static string getCachedServicesPath()
* @method static string getCachedPackagesPath()
* @method static string getCachedRoutesPath()
* @method static string getLocale()
* @method static string getNamespace()
* @method static array getProviders(\Illuminate\Support\ServiceProvider|string $provider)
* @method static bool hasBeenBootstrapped()
* @method static void loadDeferredProviders()
* @method static \Illuminate\Contracts\Foundation\Application loadEnvironmentFrom(string $file)
* @method static bool routesAreCached()
* @method static void setLocale(string $locale)
* @method static bool shouldSkipMiddleware()
* @method static void terminate()
*
* @see \Illuminate\Contracts\Foundation\Application
*/

View File

@@ -5,11 +5,12 @@ namespace Illuminate\Support\Facades;
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
/**
* @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output = null)
* @method static int call(string $command, array $parameters = [], $outputBuffer = null)
* @method static int queue(string $command, array $parameters = [])
* @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface|null $output = null)
* @method static int call(string $command, array $parameters = [], \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer = null)
* @method static \Illuminate\Foundation\Bus\PendingDispatch queue(string $command, array $parameters = [])
* @method static array all()
* @method static string output()
* @method static void terminate(\Symfony\Component\Console\Input\InputInterface $input, int $status)
*
* @see \Illuminate\Contracts\Console\Kernel
*/

Some files were not shown because too many files have changed in this diff Show More