Skip to content

Commit

Permalink
formatting and conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 22, 2017
2 parents 29611a9 + b184213 commit 7580798
Show file tree
Hide file tree
Showing 36 changed files with 359 additions and 230 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ public function updateRememberToken(UserContract $user, $token)
*/
public function retrieveByCredentials(array $credentials)
{
if (empty($credentials) ||
(count($credentials) === 1 &&
array_key_exists('password', $credentials))) {
return;
}

// First we will add each credential element to the query as a where clause.
// Then we can execute the query and, if we found a user, return it in a
// generic "user" object that will be utilized by the Guard instances.
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ public function updateRememberToken(UserContract $user, $token)
*/
public function retrieveByCredentials(array $credentials)
{
if (empty($credentials)) {
if (empty($credentials) ||
(count($credentials) === 1 &&
array_key_exists('password', $credentials))) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/FactoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ protected function applyStates(array $definition, array $attributes = [])
/**
* Get the state attributes.
*
* @param string $state
* @param array $attributes
* @param string $state
* @param array $attributes
* @return array
*/
protected function stateAttributes($state, array $attributes)
Expand Down
13 changes: 13 additions & 0 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,19 @@ public function newQueryWithoutScope($scope)
return $builder->withoutGlobalScope($scope);
}

/**
* Get a new query to restore one or more models by their queueable IDs.
*
* @param array|int $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
public function newQueryForRestoration($ids)
{
return is_array($ids)
? $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids)
: $this->newQueryWithoutScopes()->whereKey($ids);
}

/**
* Create a new Eloquent query builder for the model.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Query/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ protected function compileOrders(Builder $query, $orders)
/**
* Compile the query orders to an array.
*
* @param \Illuminate\Database\Query\Builder
* @param \Illuminate\Database\Query\Builder $query
* @param array $orders
* @return array
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,11 +839,12 @@ public function time($column, $precision = 0)
* Create a new time column (with time zone) on the table.
*
* @param string $column
* @param int $precision
* @return \Illuminate\Support\Fluent
*/
public function timeTz($column)
public function timeTz($column, $precision = 0)
{
return $this->addColumn('timeTz', $column);
return $this->addColumn('timeTz', $column, compact('precision'));
}

/**
Expand Down
18 changes: 7 additions & 11 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -615,18 +615,18 @@ protected function typeDateTimeTz(Fluent $column)
*/
protected function typeTime(Fluent $column)
{
return 'time';
return $column->precision ? "time($column->precision)" : 'time';
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimeTz(Fluent $column)
{
return 'time';
return $this->typeTime($column);
}

/**
Expand All @@ -637,17 +637,13 @@ protected function typeTimeTz(Fluent $column)
*/
protected function typeTimestamp(Fluent $column)
{
if ($column->useCurrent) {
return $column->precision
? "timestamp($column->precision) default CURRENT_TIMESTAMP"
: 'timestamp default CURRENT_TIMESTAMP';
}
$columnType = $column->precision ? "timestamp($column->precision)" : 'timestamp';

return $column->precision ? "timestamp($column->precision)" : 'timestamp';
return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType;
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down
22 changes: 9 additions & 13 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -589,18 +589,18 @@ protected function typeDateTimeTz(Fluent $column)
*/
protected function typeTime(Fluent $column)
{
return 'time(0) without time zone';
return "time($column->precision) without time zone";
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimeTz(Fluent $column)
{
return 'time(0) with time zone';
return "time($column->precision) with time zone";
}

/**
Expand All @@ -611,26 +611,22 @@ protected function typeTimeTz(Fluent $column)
*/
protected function typeTimestamp(Fluent $column)
{
if ($column->useCurrent) {
return "timestamp($column->precision) without time zone default CURRENT_TIMESTAMP($column->precision)";
}
$columnType = "timestamp($column->precision) without time zone";

return "timestamp($column->precision) without time zone";
return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType;
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimestampTz(Fluent $column)
{
if ($column->useCurrent) {
return "timestamp($column->precision) with time zone default CURRENT_TIMESTAMP($column->precision)";
}
$columnType = "timestamp($column->precision) with time zone";

return "timestamp($column->precision) with time zone";
return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType;
}

/**
Expand Down
22 changes: 7 additions & 15 deletions src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* Note: "SQLite does not have a storage class set aside for storing dates and/or times."
* @link https://www.sqlite.org/datatype3.html
Expand All @@ -567,7 +567,7 @@ protected function typeDateTime(Fluent $column)
*/
protected function typeDateTimeTz(Fluent $column)
{
return 'datetime';
return $this->typeDateTime($column);
}

/**
Expand All @@ -582,14 +582,14 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimeTz(Fluent $column)
{
return 'time';
return $this->typeTime($column);
}

/**
Expand All @@ -600,26 +600,18 @@ protected function typeTimeTz(Fluent $column)
*/
protected function typeTimestamp(Fluent $column)
{
if ($column->useCurrent) {
return 'datetime default CURRENT_TIMESTAMP';
}

return 'datetime';
return $column->useCurrent ? 'datetime default CURRENT_TIMESTAMP' : 'datetime';
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimestampTz(Fluent $column)
{
if ($column->useCurrent) {
return 'datetime default CURRENT_TIMESTAMP';
}

return 'datetime';
return $this->typeTimestamp($column);
}

/**
Expand Down
24 changes: 10 additions & 14 deletions src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -518,18 +518,18 @@ protected function typeDateTimeTz(Fluent $column)
*/
protected function typeTime(Fluent $column)
{
return 'time';
return $column->precision ? "time($column->precision)" : 'time';
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
protected function typeTimeTz(Fluent $column)
{
return 'time';
return $this->typeTime($column);
}

/**
Expand All @@ -540,17 +540,13 @@ protected function typeTimeTz(Fluent $column)
*/
protected function typeTimestamp(Fluent $column)
{
if ($column->useCurrent) {
return $column->precision
? "datetime2($column->precision) default CURRENT_TIMESTAMP"
: 'datetime default CURRENT_TIMESTAMP';
}
$columnType = $column->precision ? "datetime2($column->precision)" : 'datetime';

return $column->precision ? "datetime2($column->precision)" : 'datetime';
return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType;
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @link https://msdn.microsoft.com/en-us/library/bb630289(v=sql.120).aspx
*
Expand All @@ -560,9 +556,9 @@ protected function typeTimestamp(Fluent $column)
protected function typeTimestampTz(Fluent $column)
{
if ($column->useCurrent) {
return $column->precision
? "datetimeoffset($column->precision) default CURRENT_TIMESTAMP"
: 'datetimeoffset default CURRENT_TIMESTAMP';
$columnType = $column->precision ? "datetimeoffset($column->precision)" : 'datetimeoffset';

return "$columnType default CURRENT_TIMESTAMP";
}

return "datetimeoffset($column->precision)";
Expand Down
14 changes: 6 additions & 8 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,11 @@ public function url($path)
*/
protected function getAwsUrl($adapter, $path)
{
$config = $this->driver->getConfig();

// If an explicit base URL has been set on the disk configuration then we will use
// it as the base URL instead of the default path. This allows the developer to
// have full control over the base path for this filesystem's generated URLs.
if (! is_null($url = $config->get('url'))) {
return $this->concatPathToUrl($url, $path);
if (! is_null($url = $this->driver->getConfig()->get('url'))) {
return $this->concatPathToUrl($url, $adapter->getPathPrefix().$path);
}

return $adapter->getClient()->getObjectUrl(
Expand Down Expand Up @@ -498,10 +496,10 @@ public function getAwsTemporaryUrl($adapter, $path, $expiration, $options)
/**
* Get a temporary URL for the file at the given path.
*
* @param \League\Flysystem\Rackspace\RackspaceAdapter $adapter
* @param string $path
* @param \DateTimeInterface $expiration
* @param $options
* @param \League\Flysystem\Rackspace\RackspaceAdapter $adapter
* @param string $path
* @param \DateTimeInterface $expiration
* @param array $options
* @return string
*/
public function getRackspaceTemporaryUrl($adapter, $path, $expiration, $options)
Expand Down
10 changes: 5 additions & 5 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected function bindPathsInContainer()
/**
* Get the path to the application "app" directory.
*
* @param string $path Optionally, a path to append to the app path
* @param string $path Optionally, a path to append to the app path
* @return string
*/
public function path($path = '')
Expand All @@ -310,7 +310,7 @@ public function path($path = '')
/**
* Get the base path of the Laravel installation.
*
* @param string $path Optionally, a path to append to the base path
* @param string $path Optionally, a path to append to the base path
* @return string
*/
public function basePath($path = '')
Expand All @@ -321,7 +321,7 @@ public function basePath($path = '')
/**
* Get the path to the bootstrap directory.
*
* @param string $path Optionally, a path to append to the bootstrap path
* @param string $path Optionally, a path to append to the bootstrap path
* @return string
*/
public function bootstrapPath($path = '')
Expand All @@ -332,7 +332,7 @@ public function bootstrapPath($path = '')
/**
* Get the path to the application configuration files.
*
* @param string $path Optionally, a path to append to the config path
* @param string $path Optionally, a path to append to the config path
* @return string
*/
public function configPath($path = '')
Expand All @@ -343,7 +343,7 @@ public function configPath($path = '')
/**
* Get the path to the database directory.
*
* @param string $path Optionally, a path to append to the database path
* @param string $path Optionally, a path to append to the database path
* @return string
*/
public function databasePath($path = '')
Expand Down
Loading

0 comments on commit 7580798

Please sign in to comment.