diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-01-16 13:20:23 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-01-16 15:13:06 +0000 |
| commit | 81083bd99d5befe23efe030034abf7249acecce6 (patch) | |
| tree | 0ab27f4b52ecd128bd9877bfe9219ebc6b814855 /vendor/illuminate | |
| parent | 0422c1fe06810b05ea48309b1f3ae558fb2153d0 (diff) | |
| download | webtrees-81083bd99d5befe23efe030034abf7249acecce6.tar.gz webtrees-81083bd99d5befe23efe030034abf7249acecce6.tar.bz2 webtrees-81083bd99d5befe23efe030034abf7249acecce6.zip | |
Replace webtrees resolver class with laravel container class
Diffstat (limited to 'vendor/illuminate')
22 files changed, 153 insertions, 87 deletions
diff --git a/vendor/illuminate/contracts/Validation/Validator.php b/vendor/illuminate/contracts/Validation/Validator.php index b69942b5f0..ead9eb8cc4 100644 --- a/vendor/illuminate/contracts/Validation/Validator.php +++ b/vendor/illuminate/contracts/Validation/Validator.php @@ -38,7 +38,7 @@ interface Validator extends MessageProvider public function sometimes($attribute, $rules, callable $callback); /** - * After an after validation callback. + * Add an after validation callback. * * @param callable|string $callback * @return $this diff --git a/vendor/illuminate/database/Console/Migrations/FreshCommand.php b/vendor/illuminate/database/Console/Migrations/FreshCommand.php index 83b6306897..28c1e9973f 100644 --- a/vendor/illuminate/database/Console/Migrations/FreshCommand.php +++ b/vendor/illuminate/database/Console/Migrations/FreshCommand.php @@ -47,13 +47,13 @@ class FreshCommand extends Command $this->info('Dropped all tables successfully.'); - $this->call('migrate', [ + $this->call('migrate', array_filter([ '--database' => $database, '--path' => $this->input->getOption('path'), '--realpath' => $this->input->getOption('realpath'), '--force' => true, '--step' => $this->option('step'), - ]); + ])); if ($this->needsSeeding()) { $this->runSeeder($database); @@ -104,11 +104,11 @@ class FreshCommand extends Command */ protected function runSeeder($database) { - $this->call('db:seed', [ + $this->call('db:seed', array_filter([ '--database' => $database, '--class' => $this->option('seeder') ?: 'DatabaseSeeder', - '--force' => $this->option('force'), - ]); + '--force' => true, + ])); } /** diff --git a/vendor/illuminate/database/Console/Migrations/MigrateCommand.php b/vendor/illuminate/database/Console/Migrations/MigrateCommand.php index 79d48146e2..ee61ac52aa 100755 --- a/vendor/illuminate/database/Console/Migrations/MigrateCommand.php +++ b/vendor/illuminate/database/Console/Migrations/MigrateCommand.php @@ -74,7 +74,7 @@ class MigrateCommand extends BaseCommand // Finally, if the "seed" option has been given, we will re-run the database // seed task to re-populate the database, which is convenient when adding // a migration and a seed at the same time, as it is only this command. - if ($this->option('seed')) { + if ($this->option('seed') && ! $this->option('pretend')) { $this->call('db:seed', ['--force' => true]); } } @@ -89,9 +89,9 @@ class MigrateCommand extends BaseCommand $this->migrator->setConnection($this->option('database')); if (! $this->migrator->repositoryExists()) { - $this->call( - 'migrate:install', ['--database' => $this->option('database')] - ); + $this->call('migrate:install', array_filter([ + '--database' => $this->option('database'), + ])); } } } diff --git a/vendor/illuminate/database/Console/Migrations/RefreshCommand.php b/vendor/illuminate/database/Console/Migrations/RefreshCommand.php index 0a03e5b2c1..d27bb15550 100755 --- a/vendor/illuminate/database/Console/Migrations/RefreshCommand.php +++ b/vendor/illuminate/database/Console/Migrations/RefreshCommand.php @@ -42,28 +42,26 @@ class RefreshCommand extends Command $path = $this->input->getOption('path'); - $force = $this->input->getOption('force'); - // If the "step" option is specified it means we only want to rollback a small // number of migrations before migrating again. For example, the user might // only rollback and remigrate the latest four migrations instead of all. $step = $this->input->getOption('step') ?: 0; if ($step > 0) { - $this->runRollback($database, $path, $step, $force); + $this->runRollback($database, $path, $step); } else { - $this->runReset($database, $path, $force); + $this->runReset($database, $path); } // The refresh command is essentially just a brief aggregate of a few other of // the migration commands and just provides a convenient wrapper to execute // them in succession. We'll also see if we need to re-seed the database. - $this->call('migrate', [ + $this->call('migrate', array_filter([ '--database' => $database, '--path' => $path, '--realpath' => $this->input->getOption('realpath'), - '--force' => $force, - ]); + '--force' => true, + ])); if ($this->needsSeeding()) { $this->runSeeder($database); @@ -75,19 +73,18 @@ class RefreshCommand extends Command * * @param string $database * @param string $path - * @param bool $step - * @param bool $force + * @param int $step * @return void */ - protected function runRollback($database, $path, $step, $force) + protected function runRollback($database, $path, $step) { - $this->call('migrate:rollback', [ + $this->call('migrate:rollback', array_filter([ '--database' => $database, '--path' => $path, '--realpath' => $this->input->getOption('realpath'), '--step' => $step, - '--force' => $force, - ]); + '--force' => true, + ])); } /** @@ -95,17 +92,16 @@ class RefreshCommand extends Command * * @param string $database * @param string $path - * @param bool $force * @return void */ - protected function runReset($database, $path, $force) + protected function runReset($database, $path) { - $this->call('migrate:reset', [ + $this->call('migrate:reset', array_filter([ '--database' => $database, '--path' => $path, '--realpath' => $this->input->getOption('realpath'), - '--force' => $force, - ]); + '--force' => true, + ])); } /** @@ -126,11 +122,11 @@ class RefreshCommand extends Command */ protected function runSeeder($database) { - $this->call('db:seed', [ + $this->call('db:seed', array_filter([ '--database' => $database, '--class' => $this->option('seeder') ?: 'DatabaseSeeder', - '--force' => $this->option('force'), - ]); + '--force' => true, + ])); } /** diff --git a/vendor/illuminate/database/DetectsLostConnections.php b/vendor/illuminate/database/DetectsLostConnections.php index b747d84d81..e1fe5e6f31 100644 --- a/vendor/illuminate/database/DetectsLostConnections.php +++ b/vendor/illuminate/database/DetectsLostConnections.php @@ -34,9 +34,10 @@ trait DetectsLostConnections 'reset by peer', 'Physical connection is not usable', 'TCP Provider: Error code 0x68', - 'Name or service not known', + 'php_network_getaddresses: getaddrinfo failed: Name or service not known', 'ORA-03114', 'Packets out of order. Expected', + 'Adaptive Server connection failed', ]); } } diff --git a/vendor/illuminate/database/Eloquent/Collection.php b/vendor/illuminate/database/Eloquent/Collection.php index 72d2d85154..44690fb1cf 100755 --- a/vendor/illuminate/database/Eloquent/Collection.php +++ b/vendor/illuminate/database/Eloquent/Collection.php @@ -118,10 +118,14 @@ class Collection extends BaseCollection implements QueueableCollection $segments[count($segments) - 1] .= ':'.explode(':', $key)[1]; } - $path = array_combine($segments, $segments); + $path = []; + + foreach ($segments as $segment) { + $path[] = [$segment => $segment]; + } if (is_callable($value)) { - $path[end($segments)] = $value; + $path[count($segments) - 1][end($segments)] = $value; } $this->loadMissingRelation($this, $path); @@ -139,7 +143,7 @@ class Collection extends BaseCollection implements QueueableCollection */ protected function loadMissingRelation(Collection $models, array $path) { - $relation = array_splice($path, 0, 1); + $relation = array_shift($path); $name = explode(':', key($relation))[0]; @@ -178,12 +182,8 @@ class Collection extends BaseCollection implements QueueableCollection ->groupBy(function ($model) { return get_class($model); }) - ->filter(function ($models, $className) use ($relations) { - return Arr::has($relations, $className); - }) ->each(function ($models, $className) use ($relations) { - $className::with($relations[$className]) - ->eagerLoadRelations($models->all()); + static::make($models)->load($relations[$className] ?? []); }); return $this; diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php index 6d144aba5c..8c6dc1fcf7 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php @@ -1043,7 +1043,7 @@ trait HasAttributes } /** - * Determine if the model or given attribute(s) have been modified. + * Determine if the model or any of the given attribute(s) have been modified. * * @param array|string|null $attributes * @return bool @@ -1056,7 +1056,7 @@ trait HasAttributes } /** - * Determine if the model or given attribute(s) have remained the same. + * Determine if the model and all the given attribute(s) have remained the same. * * @param array|string|null $attributes * @return bool @@ -1067,7 +1067,7 @@ trait HasAttributes } /** - * Determine if the model or given attribute(s) have been modified. + * Determine if the model or any of the given attribute(s) have been modified. * * @param array|string|null $attributes * @return bool @@ -1080,7 +1080,7 @@ trait HasAttributes } /** - * Determine if the given attributes were changed. + * Determine if any of the given attributes were changed. * * @param array $changes * @param array|string|null $attributes diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php b/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php index 4cd1f33254..3fbbe04047 100755 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php +++ b/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php @@ -75,6 +75,10 @@ class BelongsTo extends Relation */ public function getResults() { + if (is_null($this->child->{$this->foreignKey})) { + return $this->getDefaultFor($this->parent); + } + return $this->query->first() ?: $this->getDefaultFor($this->parent); } @@ -132,13 +136,6 @@ class BelongsTo extends Relation } } - // If there are no keys that were not null we will just return an array with null - // so this query wont fail plus returns zero results, which should be what the - // developer expects to happen in this situation. Otherwise we'll sort them. - if (count($keys) === 0) { - return [null]; - } - sort($keys); return array_values(array_unique($keys)); diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php index d502897510..2eebe42113 100755 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php @@ -559,7 +559,9 @@ class BelongsToMany extends Relation */ public function getResults() { - return $this->get(); + return ! is_null($this->parent->{$this->parentKey}) + ? $this->get() + : $this->related->newCollection(); } /** @@ -679,6 +681,32 @@ class BelongsToMany extends Relation } /** + * Chunk the results of a query by comparing numeric IDs. + * + * @param int $count + * @param callable $callback + * @param string|null $column + * @param string|null $alias + * @return bool + */ + public function chunkById($count, callable $callback, $column = null, $alias = null) + { + $this->query->addSelect($this->shouldSelect()); + + $column = $column ?? $this->getRelated()->qualifyColumn( + $this->getRelatedKeyName() + ); + + $alias = $alias ?? $this->getRelatedKeyName(); + + return $this->query->chunkById($count, function ($results) use ($callback) { + $this->hydratePivotRelation($results->all()); + + return $callback($results); + }, $column, $alias); + } + + /** * Execute a callback over each item while chunking. * * @param callable $callback diff --git a/vendor/illuminate/database/Eloquent/Relations/HasMany.php b/vendor/illuminate/database/Eloquent/Relations/HasMany.php index 6149e475ab..8971a7d2a4 100755 --- a/vendor/illuminate/database/Eloquent/Relations/HasMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasMany.php @@ -13,7 +13,9 @@ class HasMany extends HasOneOrMany */ public function getResults() { - return $this->query->get(); + return ! is_null($this->getParentKey()) + ? $this->query->get() + : $this->related->newCollection(); } /** diff --git a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php b/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php index 96a5420de3..3bb2f33c30 100644 --- a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php @@ -343,7 +343,9 @@ class HasManyThrough extends Relation */ public function getResults() { - return $this->get(); + return ! is_null($this->farParent->{$this->localKey}) + ? $this->get() + : $this->related->newCollection(); } /** @@ -428,6 +430,24 @@ class HasManyThrough extends Relation } /** + * Chunk the results of a query by comparing numeric IDs. + * + * @param int $count + * @param callable $callback + * @param string|null $column + * @param string|null $alias + * @return bool + */ + public function chunkById($count, callable $callback, $column = null, $alias = null) + { + $column = $column ?? $this->getRelated()->getQualifiedKeyName(); + + $alias = $alias ?? $this->getRelated()->getKeyName(); + + return $this->prepareQueryBuilder()->chunkById($count, $callback, $column, $alias); + } + + /** * Get a generator for the given query. * * @return \Generator diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOne.php b/vendor/illuminate/database/Eloquent/Relations/HasOne.php index 858e5d0705..e4763ff4d4 100755 --- a/vendor/illuminate/database/Eloquent/Relations/HasOne.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasOne.php @@ -17,6 +17,10 @@ class HasOne extends HasOneOrMany */ public function getResults() { + if (is_null($this->getParentKey())) { + return $this->getDefaultFor($this->parent); + } + return $this->query->first() ?: $this->getDefaultFor($this->parent); } diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php b/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php index ffcbb962a3..13e1bbae2f 100755 --- a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php @@ -311,21 +311,6 @@ abstract class HasOneOrMany extends Relation } /** - * Perform an update on all the related models. - * - * @param array $attributes - * @return int - */ - public function update(array $attributes) - { - if ($this->related->usesTimestamps() && ! is_null($this->relatedUpdatedAt())) { - $attributes[$this->relatedUpdatedAt()] = $this->related->freshTimestampString(); - } - - return $this->query->update($attributes); - } - - /** * Add the constraints for a relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphMany.php b/vendor/illuminate/database/Eloquent/Relations/MorphMany.php index e2a5c5a37c..a4c63763f3 100755 --- a/vendor/illuminate/database/Eloquent/Relations/MorphMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphMany.php @@ -13,7 +13,9 @@ class MorphMany extends MorphOneOrMany */ public function getResults() { - return $this->query->get(); + return ! is_null($this->getParentKey()) + ? $this->query->get() + : $this->related->newCollection(); } /** diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphOne.php b/vendor/illuminate/database/Eloquent/Relations/MorphOne.php index 520a7ec942..0327ffae05 100755 --- a/vendor/illuminate/database/Eloquent/Relations/MorphOne.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphOne.php @@ -17,6 +17,10 @@ class MorphOne extends MorphOneOrMany */ public function getResults() { + if (is_null($this->getParentKey())) { + return $this->getDefaultFor($this->parent); + } + return $this->query->first() ?: $this->getDefaultFor($this->parent); } diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphTo.php b/vendor/illuminate/database/Eloquent/Relations/MorphTo.php index 3a14973c64..8d2dc2365a 100644 --- a/vendor/illuminate/database/Eloquent/Relations/MorphTo.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphTo.php @@ -84,16 +84,6 @@ class MorphTo extends BelongsTo /** * Get the results of the relationship. * - * @return mixed - */ - public function getResults() - { - return $this->ownerKey ? parent::getResults() : null; - } - - /** - * Get the results of the relationship. - * * Called via eager load method of Eloquent query builder. * * @return mixed @@ -227,7 +217,7 @@ class MorphTo extends BelongsTo */ public function touch() { - if (! is_null($this->ownerKey)) { + if (! is_null($this->child->{$this->foreignKey})) { parent::touch(); } } diff --git a/vendor/illuminate/database/Query/Builder.php b/vendor/illuminate/database/Query/Builder.php index b774afd18e..b8332efe0e 100755 --- a/vendor/illuminate/database/Query/Builder.php +++ b/vendor/illuminate/database/Query/Builder.php @@ -382,7 +382,7 @@ class Builder */ public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false) { - $join = new JoinClause($this, $type, $table); + $join = $this->newJoinClause($this, $type, $table); // If the first "column" of the join is really a Closure instance the developer // is trying to build a join with a complex "on" clause containing more than @@ -550,12 +550,25 @@ class Builder return $this->join($table, $first, $operator, $second, 'cross'); } - $this->joins[] = new JoinClause($this, 'cross', $table); + $this->joins[] = $this->newJoinClause($this, 'cross', $table); return $this; } /** + * Get a new join clause. + * + * @param \Illuminate\Database\Query\Builder $parentQuery + * @param string $type + * @param string $table + * @return \Illuminate\Database\Query\JoinClause + */ + protected function newJoinClause(self $parentQuery, $type, $table) + { + return new JoinClause($parentQuery, $type, $table); + } + + /** * Merge an array of where clauses and bindings. * * @param array $wheres diff --git a/vendor/illuminate/database/Schema/Blueprint.php b/vendor/illuminate/database/Schema/Blueprint.php index 089fcd2279..ff58904aae 100755 --- a/vendor/illuminate/database/Schema/Blueprint.php +++ b/vendor/illuminate/database/Schema/Blueprint.php @@ -1284,7 +1284,7 @@ class Blueprint public function removeColumn($name) { $this->columns = array_values(array_filter($this->columns, function ($c) use ($name) { - return $c['attributes']['name'] != $name; + return $c['name'] != $name; })); return $this; diff --git a/vendor/illuminate/database/Schema/ColumnDefinition.php b/vendor/illuminate/database/Schema/ColumnDefinition.php index d6feac71bf..dbd3425b90 100644 --- a/vendor/illuminate/database/Schema/ColumnDefinition.php +++ b/vendor/illuminate/database/Schema/ColumnDefinition.php @@ -15,7 +15,7 @@ use Illuminate\Support\Fluent; * @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 index() Add an index + * @method ColumnDefinition index(string $indexName) 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 * @method ColumnDefinition spatialIndex() Add a spatial index diff --git a/vendor/illuminate/support/Collection.php b/vendor/illuminate/support/Collection.php index e9e073b418..7b5c58e68e 100644 --- a/vendor/illuminate/support/Collection.php +++ b/vendor/illuminate/support/Collection.php @@ -679,7 +679,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } /** - * Filter items where the given key between values. + * Filter items such that the value of the given key is between the given values. * * @param string $key * @param array $values @@ -691,6 +691,20 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } /** + * Filter items such that the value of the given key is not between the given values. + * + * @param string $key + * @param array $values + * @return static + */ + public function whereNotBetween($key, $values) + { + return $this->filter(function ($item) use ($key, $values) { + return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values); + }); + } + + /** * Filter items by the given key value pair. * * @param string $key diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php index 752a82de42..c67c6c25e5 100644 --- a/vendor/illuminate/support/Str.php +++ b/vendor/illuminate/support/Str.php @@ -428,7 +428,7 @@ class Str $title = str_replace('@', $separator.'at'.$separator, $title); // Remove all characters that are not the separator, letters, numbers, or whitespace. - $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); + $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title)); // Replace all separator characters and whitespace by a single separator $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); diff --git a/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/vendor/illuminate/support/Testing/Fakes/QueueFake.php index a231d6c0a4..14144c0de1 100644 --- a/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ b/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -328,6 +328,16 @@ class QueueFake extends QueueManager implements Queue } /** + * Get the jobs that have been pushed. + * + * @return array + */ + public function pushedJobs() + { + return $this->jobs; + } + + /** * Get the connection name for the queue. * * @return string |
