Skip to content

Commit

Permalink
Merge remote-tracking branch 'laravel/master' into mix-refactoring
Browse files Browse the repository at this point in the history
* laravel/master: (519 commits)
  [5.5] Remove useless variables. (laravel#19866)
  Ensure a 304 response is properly returned. (laravel#19867)
  Apply fixes from StyleCI (laravel#19876)
  Stay consistant with expected exceptions and test messages. (laravel#19873)
  formatting
  formatting
  Improve ThrottleRequests.
  Allow passing of data to the view
  Apply fixes from StyleCI (laravel#19852)
  Testing existing feature (laravel#19847)
  verison
  Call parent::handle command (laravel#19839)
  Update ViewController.php
  Apply fixes from StyleCI (laravel#19836)
  Update CallbackEvent.php (laravel#19834)
  Add Route::view() helper
  Use proper assertions. (laravel#19831)
  Make illuminate/container require psr-11 (laravel#19829)
  Fix some docblocks and missing properties. (laravel#19825)
  formatting
  ...

# Conflicts:
#	src/Illuminate/Foundation/helpers.php
  • Loading branch information
mathieutu committed Jul 3, 2017
2 parents c16c217 + b77a8ce commit 32d322b
Show file tree
Hide file tree
Showing 511 changed files with 10,133 additions and 4,158 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
* text=auto

/.github export-ignore
/build export-ignore
/tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
Expand Down
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.6
- 7.0
- 7.1

Expand All @@ -12,9 +11,13 @@ env:
matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.0
env: setup=lowest
- php: 5.6
- php: 7.0
env: setup=stable
- php: 7.1
env: setup=lowest
- php: 7.1
env: setup=stable

sudo: false
Expand All @@ -28,9 +31,8 @@ services:
- redis-server

before_install:
- if [[ $TRAVIS_PHP_VERSION != 7.1 ]] ; then phpenv config-rm xdebug.ini; fi
- phpenv config-rm xdebug.ini
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- pecl install -f redis
- travis_retry composer self-update

install:
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG-5.4.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Release Notes for 5.4.x

## [Unreleased]

### Added
- Added `avg()` and `average()` as higher order proxies ([#19628](https://github.com/laravel/framework/pull/19628))
- Added `fresh()` method to Eloquent collection ([#19616](https://github.com/laravel/framework/pull/19616), [#19671](https://github.com/laravel/framework/pull/19671))
- Added ability to remove a global scope with another global scope ([#19657](https://github.com/laravel/framework/pull/19657))
- Added `Collection::intersectKey()` method ([#19683](https://github.com/laravel/framework/pull/19683))
- Support setting queue name via `broadcastQueue()` method ([#19703](https://github.com/laravel/framework/pull/19703), [#19708](https://github.com/laravel/framework/pull/19708))

### Changed
- Escape default value passed to `@yield` directive ([#19643](https://github.com/laravel/framework/pull/19643))
- Support passing multiple fields to `different` validation rule ([#19637](https://github.com/laravel/framework/pull/19637))
- Only dispatch the `MessageSent` event if mails should be sent ([#19690](https://github.com/laravel/framework/pull/19690))

### Fixed
- Fixed `BelongsTo` bug with incrementing keys ([#19631](https://github.com/laravel/framework/pull/19631))
- Fixed PDO return value bug in `unprepared()` ([#19667](https://github.com/laravel/framework/pull/19667))
- Don't use `event()` helper in `Http\Kernel` ([#19688](https://github.com/laravel/framework/pull/19688))


## v5.4.27 (2017-06-15)

### Added
- Added `Collection::diffAssoc()` method ([#19604](https://github.com/laravel/framework/pull/19604))

### Changed
- Updated PHPUnit whitelist ([#19609](https://github.com/laravel/framework/pull/19609))

### Fixed
- Update timestamps on soft delete only when they are used ([#19627](https://github.com/laravel/framework/pull/19627))


## v5.4.26 (2017-06-13)

### Added
Expand Down
192 changes: 192 additions & 0 deletions CHANGELOG-5.5.md

Large diffs are not rendered by default.

58 changes: 0 additions & 58 deletions build/illuminate-split-faster.sh

This file was deleted.

29 changes: 0 additions & 29 deletions build/illuminate-split-full.sh

This file was deleted.

29 changes: 0 additions & 29 deletions build/illuminate-split.sh

This file was deleted.

40 changes: 21 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@
}
],
"require": {
"php": ">=5.6.4",
"php": ">=7.0",
"ext-mbstring": "*",
"ext-openssl": "*",
"doctrine/inflector": "~1.0",
"erusev/parsedown": "~1.6",
"filp/whoops": "~2.0",
"league/flysystem": "~1.0",
"monolog/monolog": "~1.11",
"monolog/monolog": "~1.12",
"mtdowling/cron-expression": "~1.0",
"nesbot/carbon": "~1.20",
"paragonie/random_compat": "~1.4|~2.0",
"psr/container": "~1.0",
"ramsey/uuid": "~3.0",
"swiftmailer/swiftmailer": "~5.4",
"symfony/console": "~3.2",
"symfony/debug": "~3.2",
"symfony/finder": "~3.2",
"symfony/http-foundation": "~3.2",
"symfony/http-kernel": "~3.2",
"symfony/process": "~3.2",
"symfony/routing": "~3.2",
"symfony/var-dumper": "~3.2",
"swiftmailer/swiftmailer": "~6.0",
"symfony/console": "~3.3",
"symfony/debug": "~3.3",
"symfony/finder": "~3.3",
"symfony/http-foundation": "~3.3",
"symfony/http-kernel": "~3.3",
"symfony/process": "~3.3",
"symfony/routing": "~3.3",
"symfony/var-dumper": "~3.3",
"tijsverkoyen/css-to-inline-styles": "~2.2",
"vlucas/phpdotenv": "~2.2"
},
Expand Down Expand Up @@ -74,11 +75,12 @@
"aws/aws-sdk-php": "~3.0",
"doctrine/dbal": "~2.5",
"mockery/mockery": "~0.9.4",
"orchestra/testbench-core": "3.5.*",
"pda/pheanstalk": "~3.0",
"phpunit/phpunit": "~5.7",
"predis/predis": "~1.0",
"symfony/css-selector": "~3.2",
"symfony/dom-crawler": "~3.2"
"phpunit/phpunit": "~6.0",
"predis/predis": "^1.1.1",
"symfony/css-selector": "~3.3",
"symfony/dom-crawler": "~3.3"
},
"autoload": {
"files": [
Expand All @@ -99,7 +101,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.4-dev"
"dev-master": "5.5-dev"
}
},
"suggest": {
Expand All @@ -114,8 +116,8 @@
"pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).",
"predis/predis": "Required to use the redis cache and queue drivers (~1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.3).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.3).",
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)."
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
Expand Down
29 changes: 21 additions & 8 deletions src/Illuminate/Auth/Access/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Auth\Access;

use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use InvalidArgumentException;
use Illuminate\Contracts\Container\Container;
Expand Down Expand Up @@ -78,12 +79,20 @@ public function __construct(Container $container, callable $userResolver, array
/**
* Determine if a given ability has been defined.
*
* @param string $ability
* @param string|array $ability
* @return bool
*/
public function has($ability)
{
return isset($this->abilities[$ability]);
$abilities = is_array($ability) ? $ability : func_get_args();

foreach ($abilities as $ability) {
if (! isset($this->abilities[$ability])) {
return false;
}
}

return true;
}

/**
Expand Down Expand Up @@ -260,7 +269,7 @@ protected function raw($ability, $arguments = [])
return false;
}

$arguments = array_wrap($arguments);
$arguments = Arr::wrap($arguments);

// First we will call the "before" callbacks for the Gate. If any of these give
// back a non-null response, we will immediately return that result in order
Expand Down Expand Up @@ -345,10 +354,10 @@ protected function callAfterCallbacks($user, $ability, array $arguments, $result
*/
protected function resolveAuthCallback($user, $ability, array $arguments)
{
if (isset($arguments[0])) {
if (! is_null($policy = $this->getPolicyFor($arguments[0]))) {
return $this->resolvePolicyCallback($user, $ability, $arguments, $policy);
}
if (isset($arguments[0]) &&
! is_null($policy = $this->getPolicyFor($arguments[0])) &&
$callback = $this->resolvePolicyCallback($user, $ability, $arguments, $policy)) {
return $callback;
}

if (isset($this->abilities[$ability])) {
Expand Down Expand Up @@ -405,10 +414,14 @@ public function resolvePolicy($class)
* @param string $ability
* @param array $arguments
* @param mixed $policy
* @return callable
* @return bool|callable
*/
protected function resolvePolicyCallback($user, $ability, array $arguments, $policy)
{
if (! is_callable([$policy, $this->formatAbilityToMethod($ability)])) {
return false;
}

return function () use ($user, $ability, $arguments, $policy) {
// This callback will be responsible for calling the policy's before method and
// running this policy method if necessary. This is used to when objects are
Expand Down
7 changes: 4 additions & 3 deletions src/Illuminate/Auth/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Auth;

use Closure;
use Illuminate\Support\Arr;
use InvalidArgumentException;
use Illuminate\Contracts\Auth\Factory as FactoryContract;

Expand Down Expand Up @@ -120,7 +121,7 @@ protected function callCustomCreator($name, array $config)
*/
public function createSessionDriver($name, $config)
{
$provider = $this->createUserProvider($config['provider']);
$provider = $this->createUserProvider(Arr::get($config, 'provider'));

$guard = new SessionGuard($name, $provider, $this->app['session.store']);

Expand Down Expand Up @@ -155,7 +156,7 @@ public function createTokenDriver($name, $config)
// that takes an API token field from the request and matches it to the
// user in the database or another persistence layer where users are.
$guard = new TokenGuard(
$this->createUserProvider($config['provider']),
$this->createUserProvider(Arr::get($config, 'provider')),
$this->app['request']
);

Expand Down Expand Up @@ -223,7 +224,7 @@ public function setDefaultDriver($name)
public function viaRequest($driver, callable $callback)
{
return $this->extend($driver, function () use ($callback) {
$guard = new RequestGuard($callback, $this->app['request']);
$guard = new RequestGuard($callback, $this->app['request'], $this->createUserProvider());

$this->app->refresh('request', $guard, 'setRequest');

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Auth/Console/ClearResetsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ClearResetsCommand extends Command
*
* @return void
*/
public function fire()
public function handle()
{
$this->laravel['auth.password']->broker($this->argument('name'))->getRepository()->deleteExpired();

Expand Down
Loading

0 comments on commit 32d322b

Please sign in to comment.