Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 19, 2017
2 parents 182027d + 0607db0 commit f678516
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG-5.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
- Added `tap()` method to query builder ([#18284](https://github.com/laravel/framework/pull/18284))
- Added `orderByDesc()` methods to query builder ([#18292](https://github.com/laravel/framework/pull/18292))
- Added `Container::makeWith()` method ([#18271](https://github.com/laravel/framework/pull/18271), [#18320](https://github.com/laravel/framework/pull/18320))
- Added `InteractsWithDatabase::assertSoftDeleted()` ([#18328](https://github.com/laravel/framework/pull/18328), [2d4e1f0](https://github.com/laravel/framework/commit/2d4e1f0fe0bae3c7e3304317a69d619e71e476cc), [f89f917](https://github.com/laravel/framework/commit/f89f917b256ad79df786c688b11247ce1e48299a))
- Added ability to set queue parameters inside queued listeners ([#18375](https://github.com/laravel/framework/pull/18375), [cf461e2](https://github.com/laravel/framework/commit/cf461e23b6123ba6ed084d2fb8e8306482973b88))
- Added `-q` shorthand for `make:listener --queued` ([#18362](https://github.com/laravel/framework/pull/18362))
- Added `Model::setKeyType()` ([#18354](https://github.com/laravel/framework/pull/18354))
- Output migration name before starting a migration or rollback ([#18379](https://github.com/laravel/framework/pull/18379), [e47e8b1](https://github.com/laravel/framework/commit/e47e8b16c1e65d752943faaa65db14ca323f5feb))

### Changed
- Throw exception when `bootstrap/cache` directory is not writable ([#18188](https://github.com/laravel/framework/pull/18188), [b4f0005](https://github.com/laravel/framework/commit/b4f000516166b0694e842d64f5b2fde1167d4690))
Expand All @@ -26,13 +31,18 @@
- Prevent `make:auth` from overwriting existing views ([#18319](https://github.com/laravel/framework/pull/18319), [bef8f35](https://github.com/laravel/framework/commit/bef8f35694b7c22516a27929dbfc4c49032f78c6))
- Ensure Mailable view data is not overridden by order of operations ([#18322](https://github.com/laravel/framework/pull/18322))
- Use `getAuthIdentifier()` method in broadcasters ([#18351](https://github.com/laravel/framework/pull/18351))
- Use atomic cache operation when checking for event overlaps ([8ebb5b8](https://github.com/laravel/framework/commit/8ebb5b859ae8f2382a1836a83a47542de234d63a))
- Return pretty JSON response from `HasInDatabase::failureDescription()` ([#18377](https://github.com/laravel/framework/pull/18377))

### Fixed
- Fixed an issue with slots when passed content equals `null` ([#18246](https://github.com/laravel/framework/pull/18246))
- Do require `Closure` in `orWhereHas()` ([#18277](https://github.com/laravel/framework/pull/18277))
- Let PHP parse `@includeWhen` directive ([#18285](https://github.com/laravel/framework/pull/18285))
- Only include `.php` files when loading database factories ([#18336](https://github.com/laravel/framework/pull/18336))
- Fixed PHP 5.6 issue in `FileFactory::generateImage()` ([#18345](https://github.com/laravel/framework/pull/18345))
- Allow `ImplicitRouteBinding` to match camelcase method parameter names ([#18307](https://github.com/laravel/framework/pull/18307), [4ae31a1](https://github.com/laravel/framework/commit/4ae31a154f81c2d76c7397dbdebfcac0e74e4ccd))
- Fixing weird behaviour of `Connection::getConfig()` when `null` was passed ([#18356](https://github.com/laravel/framework/pull/18356))
- Attempt to solve an issue with using `required_*` rules while the `ConvertEmptyStringToNull` middleware is applied ([#18376](https://github.com/laravel/framework/pull/18376))


## v5.4.15 (2017-03-02)
Expand Down
21 changes: 20 additions & 1 deletion src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ protected function fireModelEvent($event, $halt = true)
// returns a result we can return that result, or we'll call the string events.
$method = $halt ? 'until' : 'fire';

$result = $this->fireCustomModelEvent($event, $method);
$result = $this->filterModelEventResults(
$this->fireCustomModelEvent($event, $method)
);

if ($result === false) {
return false;
Expand Down Expand Up @@ -167,6 +169,23 @@ protected function fireCustomModelEvent($event, $method)
}
}

/**
* Filter the model event results.
*
* @param mixed $result
* @return mixed
*/
protected function filterModelEventResults($result)
{
if (is_array($result)) {
$result = array_filter($result, function ($response) {
return ! is_null($response);
});
}

return $result;
}

/**
* Register a saving model event with the dispatcher.
*
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ protected function runUp($file, $batch, $pretend)
return $this->pretendToRun($migration, 'up');
}

$this->note("<comment>Migrating:</comment> {$name}");

$this->runMigration($migration, 'up');

// Once we have run a migrations class, we will log that it was run in this
Expand Down Expand Up @@ -317,6 +319,8 @@ protected function runDown($file, $migration, $pretend)
$name = $this->getMigrationName($file)
);

$this->note("<comment>Rolling back:</comment> {$name}");

if ($pretend) {
return $this->pretendToRun($instance, 'down');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ListenerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function getOptions()
return [
['event', 'e', InputOption::VALUE_REQUIRED, 'The event class being listened for.'],

['queued', 'q', InputOption::VALUE_NONE, 'Indicates the event listener should be queued.'],
['queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued.'],
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function failureDescription($table)
{
return sprintf(
"a row in the table [%s] matches the attributes %s.\n\n%s",
$table, $this->toString(), $this->getAdditionalInfo($table)
$table, $this->toString(JSON_PRETTY_PRINT), $this->getAdditionalInfo($table)
);
}

Expand Down Expand Up @@ -93,10 +93,11 @@ protected function getAdditionalInfo($table)
/**
* Get a string representation of the object.
*
* @param int $options
* @return string
*/
public function toString()
public function toString($options = 0)
{
return json_encode($this->data);
return json_encode($this->data, $options);
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Facades/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @method static int|null id()
* @method static bool validate(array $credentials = [])
* @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user)
* @method static bool attempt(array $credentials = [], bool $remember = false, bool $login = true)
* @method static bool attempt(array $credentials = [], bool $remember = false)
* @method static bool once(array $credentials = [])
* @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false)
* @method static \Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember = false)
Expand Down
5 changes: 4 additions & 1 deletion src/Illuminate/Support/Facades/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Support\Facades;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Testing\Fakes\EventFake;

/**
Expand All @@ -16,7 +17,9 @@ class Event extends Facade
*/
public static function fake()
{
static::swap(new EventFake);
static::swap($fake = new EventFake);

Model::setEventDispatcher($fake);
}

/**
Expand Down
1 change: 0 additions & 1 deletion tests/Foundation/FoundationInteractsWithDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public function testDontSeeInDatabaseDoesNotFindResults()

/**
* @expectedException \PHPUnit\Framework\ExpectationFailedException
* @expectedExceptionMessage a row in the table [products] does not match the attributes {"title":"Spark"}
*/
public function testDontSeeInDatabaseFindsResults()
{
Expand Down

0 comments on commit f678516

Please sign in to comment.