language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
laravel
framework
854e6b231484715df2eb325ebf7ebd1b11cd8adf.json
Create access admission and unauthorized exception
src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
@@ -3,6 +3,7 @@ namespace Illuminate\Foundation\Auth\Access; use Illuminate\Contracts\Auth\Access\Gate; +use Illuminate\Auth\Access\UnauthorizedException; use Symfony\Component\HttpKernel\Exception\HttpException; trait AuthorizesRequests @@ -20,9 +21,7 @@ public function authorize($ability, $arguments = []) ...
true
Other
laravel
framework
854e6b231484715df2eb325ebf7ebd1b11cd8adf.json
Create access admission and unauthorized exception
src/Illuminate/Foundation/Exceptions/Handler.php
@@ -5,6 +5,7 @@ use Exception; use Psr\Log\LoggerInterface; use Illuminate\Http\Response; +use Illuminate\Auth\Access\UnauthorizedException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Console\Application as ConsoleApplication; use Symfony\Component\Debug\ExceptionHandler as Sy...
true
Other
laravel
framework
ca66631b916063c1be8a594c58035e8e432c0277.json
Add depth and collection support to Arr::flatten
src/Illuminate/Support/Arr.php
@@ -149,15 +149,26 @@ public static function last($array, callable $callback, $default = null) * Flatten a multi-dimensional array into a single level. * * @param array $array + * @param int $depth * @return array */ - public static function flatten($array) + public static fu...
true
Other
laravel
framework
ca66631b916063c1be8a594c58035e8e432c0277.json
Add depth and collection support to Arr::flatten
src/Illuminate/Support/Collection.php
@@ -204,17 +204,7 @@ public function first(callable $callback = null, $default = null) */ public function flatten($depth = INF) { - return $this->reduce(function ($return, $item) use ($depth) { - if ($item instanceof self || is_array($item)) { - if ($depth === 1) { - ...
true
Other
laravel
framework
ca66631b916063c1be8a594c58035e8e432c0277.json
Add depth and collection support to Arr::flatten
src/Illuminate/Support/helpers.php
@@ -163,11 +163,12 @@ function array_last($array, $callback, $default = null) * Flatten a multi-dimensional array into a single level. * * @param array $array + * @param int $depth * @return array */ - function array_flatten($array) + function array_flatten($array, $depth = I...
true
Other
laravel
framework
ca66631b916063c1be8a594c58035e8e432c0277.json
Add depth and collection support to Arr::flatten
tests/Support/SupportArrTest.php
@@ -1,6 +1,7 @@ <?php use Illuminate\Support\Arr; +use Illuminate\Support\Collection; class SupportArrTest extends PHPUnit_Framework_TestCase { @@ -50,9 +51,51 @@ public function testLast() public function testFlatten() { - $array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']]; - ...
true
Other
laravel
framework
73301e3c5e8bbcdbdbd43706a13ccd644c0b8ba2.json
Add depth parameter doc block
src/Illuminate/Support/Collection.php
@@ -199,6 +199,7 @@ public function first(callable $callback = null, $default = null) /** * Get a flattened array of the items in the collection. * + * @param int $depth * @return static */ public function flatten($depth = INF)
false
Other
laravel
framework
605668517da68b4d58e94d966a41dc044271639c.json
Remove duplicated tests
tests/Support/SupportCollectionTest.php
@@ -221,14 +221,6 @@ public function testFlatten() // Nested arrays containing collections containing arrays are flattened $c = new Collection([['#foo', new Collection(['#bar', ['#zap']])], ['#baz']]); $this->assertEquals(['#foo', '#bar', '#zap', '#baz'], $c->flatten()->all()); - - // ...
false
Other
laravel
framework
86d36fa12f19720c9e018db647812eb3d02ebaab.json
Use array as is
src/Illuminate/Support/Collection.php
@@ -206,7 +206,7 @@ public function flatten($depth = INF) return $this->reduce(function ($return, $item) use ($depth) { if ($item instanceof self || is_array($item)) { if ($depth === 1) { - return $return->merge(new static($item)); + return $r...
false
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Container/BindingResolutionException.php
@@ -9,4 +9,5 @@ */ class BindingResolutionException extends Exception { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Bus/SelfHandling.php
@@ -4,4 +4,5 @@ interface SelfHandling { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Container/BindingResolutionException.php
@@ -6,4 +6,5 @@ class BindingResolutionException extends BaseException { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Encryption/DecryptException.php
@@ -6,4 +6,5 @@ class DecryptException extends RuntimeException { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Encryption/EncryptException.php
@@ -6,4 +6,5 @@ class EncryptException extends RuntimeException { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Filesystem/Cloud.php
@@ -4,4 +4,5 @@ interface Cloud extends Filesystem { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Filesystem/FileNotFoundException.php
@@ -6,4 +6,5 @@ class FileNotFoundException extends Exception { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Queue/ShouldBeQueued.php
@@ -7,4 +7,5 @@ */ interface ShouldBeQueued extends ShouldQueue { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Queue/ShouldQueue.php
@@ -4,4 +4,5 @@ interface ShouldQueue { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Contracts/Validation/UnauthorizedException.php
@@ -6,4 +6,5 @@ class UnauthorizedException extends RuntimeException { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Database/Eloquent/MassAssignmentException.php
@@ -6,4 +6,5 @@ class MassAssignmentException extends RuntimeException { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Http/Exception/PostTooLargeException.php
@@ -6,4 +6,5 @@ class PostTooLargeException extends Exception { + // }
true
Other
laravel
framework
0f4325eb7fa4b2cf5a2fd91cfb1299d64d88f09f.json
Add empty comments to empty classes
src/Illuminate/Session/TokenMismatchException.php
@@ -6,4 +6,5 @@ class TokenMismatchException extends Exception { + // }
true
Other
laravel
framework
1361c23a1be302e0bed34add6c07adacfe8b5aa2.json
Remove deprecated file from symfony/finder See symfony/Finder@2c3faa7 Signed-off-by: crynobone <crynobone@gmail.com>
src/Illuminate/Foundation/Console/Optimize/config.php
@@ -194,13 +194,6 @@ $basePath.'/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php', $basePath.'/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php', $basePath.'/vendor/symfony/finder/Iterator/FilenameFilterIterator.php', - $basePath.'/vendor/symfony/finder/Shell/Shell.php', - $b...
false
Other
laravel
framework
52d126abce14b9b2152b74318f7e1f0e260c5246.json
Use is_callable() in Gate::resolvePolicyCallback() The `method_exists()` function only checks for hard coded methods on objects. However using the `is_callable()` function will consider methods added to policies using `__call()`.
src/Illuminate/Auth/Access/Gate.php
@@ -275,7 +275,7 @@ protected function resolvePolicyCallback($user, $ability, array $arguments) } } - if (! method_exists($instance, $ability)) { + if (! is_callable([$instance, $ability])) { return false; }
false
Other
laravel
framework
2c3d10f41bbb8e960375df51d89d5c0d95330714.json
Add getAuthIdentifierName to Authenticable trait
src/Illuminate/Auth/Authenticatable.php
@@ -4,6 +4,16 @@ trait Authenticatable { + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName() + { + return $this->getKeyName(); + } + /** * Get the unique identifier for the user. *
true
Other
laravel
framework
2c3d10f41bbb8e960375df51d89d5c0d95330714.json
Add getAuthIdentifierName to Authenticable trait
src/Illuminate/Auth/EloquentUserProvider.php
@@ -59,7 +59,7 @@ public function retrieveByToken($identifier, $token) $model = $this->createModel(); return $model->newQuery() - ->where($model->getKeyName(), $identifier) + ->where($model->getAuthIdentifierName(), $identifier) ->where($model->getRememberTokenName...
true
Other
laravel
framework
2c3d10f41bbb8e960375df51d89d5c0d95330714.json
Add getAuthIdentifierName to Authenticable trait
src/Illuminate/Auth/GenericUser.php
@@ -24,14 +24,26 @@ public function __construct(array $attributes) $this->attributes = $attributes; } + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName() + { + return 'id'; + } + /** ...
true
Other
laravel
framework
2c3d10f41bbb8e960375df51d89d5c0d95330714.json
Add getAuthIdentifierName to Authenticable trait
src/Illuminate/Contracts/Auth/Authenticatable.php
@@ -4,6 +4,13 @@ interface Authenticatable { + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName(); + /** * Get the unique identifier for the user. *
true
Other
laravel
framework
b590a56904f1f79fa90d2d995b8ac49f51beb2a6.json
set the date format as the mock doesnt have one
tests/Database/DatabaseEloquentModelTest.php
@@ -1148,6 +1148,7 @@ public function testTimestampsAreNotUpdatedWithTimestampsFalseSaveOption() public function testModelAttributesAreCastedWhenPresentInCastsArray() { $model = new EloquentModelCastingStub; + $model->setDateFormat('Y-m-d H:i:s'); $model->first = '3'; $model-...
false
Other
laravel
framework
867135e52d1b4245d0bce393200723183fed37cd.json
Use FQCNs for DocBlocks
src/Illuminate/Routing/Console/stubs/controller.plain.stub
@@ -3,7 +3,6 @@ namespace DummyNamespace; use Illuminate\Http\Request; - use DummyRootNamespaceHttp\Requests; use DummyRootNamespaceHttp\Controllers\Controller;
true
Other
laravel
framework
867135e52d1b4245d0bce393200723183fed37cd.json
Use FQCNs for DocBlocks
src/Illuminate/Routing/Console/stubs/controller.stub
@@ -3,7 +3,6 @@ namespace DummyNamespace; use Illuminate\Http\Request; - use DummyRootNamespaceHttp\Requests; use DummyRootNamespaceHttp\Controllers\Controller; @@ -12,7 +11,7 @@ class DummyClass extends Controller /** * Display a listing of the resource. * - * @return Response + * @ret...
true
Other
laravel
framework
9a3704826187a2983911144c584f7acf83ffa06f.json
Add some common files to the compile config
src/Illuminate/Foundation/Console/Optimize/config.php
@@ -32,9 +32,11 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/View/View.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Http/Kernel.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Guard.php', + $basePath.'/vendor/laravel/framework/src/Ill...
false
Other
laravel
framework
f51a59e7e18262874a4af20634da34430100876f.json
change method order.
src/Illuminate/Queue/SyncQueue.php
@@ -90,45 +90,45 @@ protected function resolveJob($payload) } /** - * Handle the failed job. + * Raise the after queue job event. * * @param \Illuminate\Contracts\Queue\Job $job - * @return array + * @return void */ - protected function handleFailedJob(Job $job) + p...
false
Other
laravel
framework
82068c2bfef86119434208a01bcf1f4fc3b03e1b.json
Add Request tests.
tests/Http/HttpRequestTest.php
@@ -537,4 +537,27 @@ public function testCreateFromBase() $this->assertEquals($request->request->all(), $body); } + + public function testHttpRequestFlashCallsSessionFlashInputWithInputData() + { + $session = m::mock('Illuminate\Session\Store'); + $session->shouldReceive('flashInput'...
false
Other
laravel
framework
d51029a0870e874eff69ad91a5e36dc4d4595a44.json
Add pipeline test. Fix style
tests/Pipeline/PipelineTest.php
@@ -43,6 +43,18 @@ public function testPipelineUsageWithParameters() unset($_SERVER['__test.pipe.parameters']); } + + public function testPipelineViaChangesTheMethodBeingCalledOnThePipes() + { + $pipelineInstance = new Pipeline(new Illuminate\Container\Container); + $result = $pipeli...
false
Other
laravel
framework
1ffca77780e279b4160283dce7d88d203c4c8581.json
Fix tiny integer docs Fix tiny integer docs
src/Illuminate/Database/Schema/Blueprint.php
@@ -535,7 +535,7 @@ public function bigInteger($column, $autoIncrement = false, $unsigned = false) } /** - * Create a new unsigned small integer (2-byte) column on the table. + * Create a new unsigned tiny integer (1-byte) column on the table. * * @param string $column * @param ...
false
Other
laravel
framework
a0673f2ac215066c80a4945c3c6510ab6aedb57a.json
Fix Pivot When Is Force Filled This is related to Issue [#10243](https://github.com/laravel/framework/issues/10243). When an instance of Pivot is created and date attributes such as created_at and updated_at at passed it tried to convert those to a Carbon instance using the connection’s sql grammar from the parent. ...
src/Illuminate/Database/Eloquent/Relations/Pivot.php
@@ -51,14 +51,14 @@ public function __construct(Model $parent, $attributes, $table, $exists = false) // The pivot model is a "dynamic" model since we will set the tables dynamically // for the instance. This allows it work for any intermediate tables for the // many to many relationship that ...
true
Other
laravel
framework
a0673f2ac215066c80a4945c3c6510ab6aedb57a.json
Fix Pivot When Is Force Filled This is related to Issue [#10243](https://github.com/laravel/framework/issues/10243). When an instance of Pivot is created and date attributes such as created_at and updated_at at passed it tried to convert those to a Carbon instance using the connection’s sql grammar from the parent. ...
tests/Database/DatabaseEloquentPivotTest.php
@@ -14,9 +14,9 @@ public function testPropertiesAreSetCorrectly() { $parent = m::mock('Illuminate\Database\Eloquent\Model[getConnectionName]'); $parent->shouldReceive('getConnectionName')->once()->andReturn('connection'); - $pivot = new Pivot($parent, ['foo' => 'bar'], 'table', true); + ...
true
Other
laravel
framework
22126ac39c371adca21698535020bc61aa19a3ad.json
Add Container flush test. Style fix.
tests/Container/ContainerTest.php
@@ -493,6 +493,23 @@ public function testForgetInstancesForgetsAllInstances() $this->assertFalse($container->isShared('Instance2')); $this->assertFalse($container->isShared('Instance3')); } + + public function testContainerFlushFlushesAllBindingsAliasesAndResolvedInstances() + { + $c...
false
Other
laravel
framework
e0fef32f5167e764fdd09ff882fd947800edbeaf.json
Remove extraneous docs
src/Illuminate/Database/Query/JoinClause.php
@@ -55,10 +55,10 @@ public function __construct($type, $table) * * on `contacts`.`user_id` = `users`.`id` and `contacts`.`info_id` = `info`.`id` * - * @param string $first The first argument (column) to compare with - * @param string $operator The comparator - * @param string $sec...
false
Other
laravel
framework
6bffe4eb623ec9235f4e290bb4a7c95dd25e4a76.json
Add Container tests. Add testForgetInstanceForgetsInstance testForgetInstancesForgetsAllInstances Style fixes.
tests/Container/ContainerTest.php
@@ -54,7 +54,6 @@ public function testSharedConcreteResolution() { $container = new Container; $container->singleton('ContainerConcreteStub'); - $bindings = $container->getBindings(); $var1 = $container->make('ContainerConcreteStub'); $var2 = $container->make('Container...
false
Other
laravel
framework
b57eb65a6f499e5c32b80eccd2dd25935aba7f4d.json
Remove unused import Based on changes 996d6c3 Signed-off-by: crynobone <crynobone@gmail.com>
src/Illuminate/Cache/CacheServiceProvider.php
@@ -4,7 +4,6 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Cache\Console\ClearCommand; -use Illuminate\Cache\Console\CacheTableCommand; class CacheServiceProvider extends ServiceProvider {
true
Other
laravel
framework
b57eb65a6f499e5c32b80eccd2dd25935aba7f4d.json
Remove unused import Based on changes 996d6c3 Signed-off-by: crynobone <crynobone@gmail.com>
src/Illuminate/Database/MigrationServiceProvider.php
@@ -6,12 +6,11 @@ use Illuminate\Database\Migrations\Migrator; use Illuminate\Database\Migrations\MigrationCreator; use Illuminate\Database\Console\Migrations\ResetCommand; -use Illuminate\Database\Console\Migrations\RefreshCommand; +use Illuminate\Database\Console\Migrations\StatusCommand; use Illuminate\Database\...
true
Other
laravel
framework
b57eb65a6f499e5c32b80eccd2dd25935aba7f4d.json
Remove unused import Based on changes 996d6c3 Signed-off-by: crynobone <crynobone@gmail.com>
src/Illuminate/Database/SeedServiceProvider.php
@@ -4,7 +4,6 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Database\Console\Seeds\SeedCommand; -use Illuminate\Database\Console\Seeds\SeederMakeCommand; class SeedServiceProvider extends ServiceProvider {
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Auth/GeneratorServiceProvider.php
@@ -1,65 +0,0 @@ -<?php - -namespace Illuminate\Auth; - -use Illuminate\Support\ServiceProvider; -use Illuminate\Auth\Console\ClearResetsCommand; - -class GeneratorServiceProvider extends ServiceProvider -{ - /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - protec...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Cache/CacheServiceProvider.php
@@ -48,11 +48,7 @@ public function registerCommands() return new ClearCommand($app['cache']); }); - $this->app->singleton('command.cache.table', function ($app) { - return new CacheTableCommand($app['files'], $app['composer']); - }); - - $this->commands('command.c...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Database/MigrationServiceProvider.php
@@ -37,6 +37,8 @@ public function register() // so that they may be easily accessed for registering with the consoles. $this->registerMigrator(); + $this->registerCreator(); + $this->registerCommands(); } @@ -71,14 +73,26 @@ protected function registerMigrator() }); ...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Database/SeedServiceProvider.php
@@ -22,15 +22,13 @@ class SeedServiceProvider extends ServiceProvider */ public function register() { - $this->registerSeedCommand(); - - $this->registerMakeCommand(); - $this->app->singleton('seeder', function () { return new Seeder; }); - $this->co...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
@@ -3,9 +3,12 @@ namespace Illuminate\Foundation\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Queue\Console\TableCommand; use Illuminate\Foundation\Console\UpCommand; use Illuminate\Foundation\Console\DownCommand; use Illuminate\Foundation\Console\ServeCommand; +use Illuminate\Cache\Console...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php
@@ -19,13 +19,10 @@ class ConsoleSupportServiceProvider extends AggregateServiceProvider * @var array */ protected $providers = [ - 'Illuminate\Auth\GeneratorServiceProvider', 'Illuminate\Console\ScheduleServiceProvider', 'Illuminate\Database\MigrationServiceProvider', ...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Queue/ConsoleServiceProvider.php
@@ -3,11 +3,9 @@ namespace Illuminate\Queue; use Illuminate\Support\ServiceProvider; -use Illuminate\Queue\Console\TableCommand; use Illuminate\Queue\Console\RetryCommand; use Illuminate\Queue\Console\ListFailedCommand; use Illuminate\Queue\Console\FlushFailedCommand; -use Illuminate\Queue\Console\FailedTableCom...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Routing/GeneratorServiceProvider.php
@@ -1,67 +0,0 @@ -<?php - -namespace Illuminate\Routing; - -use Illuminate\Support\ServiceProvider; -use Illuminate\Routing\Console\MiddlewareMakeCommand; -use Illuminate\Routing\Console\ControllerMakeCommand; - -class GeneratorServiceProvider extends ServiceProvider -{ - /** - * Indicates if loading of the prov...
true
Other
laravel
framework
996d6c3677c560d369dde4b932778022556f1d41.json
Remove dev commands from prod console.
src/Illuminate/Session/CommandsServiceProvider.php
@@ -1,40 +0,0 @@ -<?php - -namespace Illuminate\Session; - -use Illuminate\Support\ServiceProvider; -use Illuminate\Session\Console\SessionTableCommand; - -class CommandsServiceProvider extends ServiceProvider -{ - /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - ...
true
Other
laravel
framework
66102c18d2cdb1fad4a37b311c4fc1e722535a34.json
Add testBeforeBootstrappingAddsClosure test.
tests/Foundation/FoundationApplicationTest.php
@@ -132,6 +132,16 @@ public function testMethodAfterLoadingEnvironmentAddsClosure() $this->assertArrayHasKey(0, $app['events']->getListeners('bootstrapped: Illuminate\Foundation\Bootstrap\DetectEnvironment')); $this->assertSame($closure, $app['events']->getListeners('bootstrapped: Illuminate\Foundatio...
false
Other
laravel
framework
a75a9cdadac503b7c2d6e03ccd5d67b38d25d6fc.json
Fix bug with assigning middleware.
src/Illuminate/Routing/Route.php
@@ -271,7 +271,9 @@ public function middleware($middleware = null) $middleware = [$middleware]; } - $this->action['middleware'] = array_merge($this->action['middleware'], $middleware); + $this->action['middleware'] = array_merge( + array_get($this->action['middleware'], ...
false
Other
laravel
framework
1c095f839d3b983784b360a4899a743a0a472243.json
Add some fluent methods to routes
src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php
@@ -28,6 +28,12 @@ public function boot(Router $router) $this->loadCachedRoutes(); } else { $this->loadRoutes(); + + // We still want name look-ups to be fast, even if names were specified fluently + // on the route itself. This will update the name look-up table...
true
Other
laravel
framework
1c095f839d3b983784b360a4899a743a0a472243.json
Add some fluent methods to routes
src/Illuminate/Routing/Route.php
@@ -256,13 +256,25 @@ protected function extractOptionalParameters() } /** - * Get the middlewares attached to the route. + * Set or get the middlewares attached to the route. + * + * @param array|string|null $middleware * * @return array */ - public function middleware(...
true
Other
laravel
framework
1c095f839d3b983784b360a4899a743a0a472243.json
Add some fluent methods to routes
src/Illuminate/Routing/RouteCollection.php
@@ -98,6 +98,22 @@ protected function addLookups($route) } } + /** + * Refresh the name look-up table, in case any names have been defined fluently. + * + * @return void + */ + public function refreshNameLookup() + { + $this->nameList = []; + + foreach ($this->allR...
true
Other
laravel
framework
d110568342f42a92b9bdd045f074756cf18f0ba3.json
Use assertArrayHasKey instead of isset.
tests/Foundation/FoundationApplicationTest.php
@@ -129,7 +129,7 @@ public function testMethodAfterLoadingEnvironmentAddsClosure() $app = new Application; $closure = function () {}; $app->afterLoadingEnvironment($closure); - $this->assertTrue(isset($app['events']->getListeners('bootstrapped: Illuminate\Foundation\Bootstrap\DetectEnv...
false
Other
laravel
framework
daa6894a628f596f79edf861ef4f11ba69ef2be4.json
Add afterLoadingEnvironment() test.
tests/Foundation/FoundationApplicationTest.php
@@ -123,6 +123,17 @@ public function testEnvironment() $this->assertFalse($app->environment('qux', 'bar')); $this->assertFalse($app->environment(['qux', 'bar'])); } + + public function testMethodAfterLoadingEnvironmentAddsClosure() + { + $app = new Application; + $closure =...
false
Other
laravel
framework
6d33dca4bd09829bb0de4b6e3e3f6f067c5579ba.json
Fix return value for getRelatedIds
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -528,7 +528,7 @@ public function touch() /** * Get all of the IDs for the related models. * - * @return array + * @return Illuminate\Support\Collection */ public function getRelatedIds() {
false
Other
laravel
framework
cf2a9386b31b28019f744c66ba995ee6ae149aff.json
Use table name as default for morph map
src/Illuminate/Database/Eloquent/Relations/Relation.php
@@ -3,6 +3,7 @@ namespace Illuminate\Database\Eloquent\Relations; use Closure; +use Illuminate\Support\Arr; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\Expression; @@ -288,13 +289,34 @@ public function wrap($value) */ public static fu...
true
Other
laravel
framework
cf2a9386b31b28019f744c66ba995ee6ae149aff.json
Use table name as default for morph map
tests/Database/DatabaseEloquentRelationTest.php
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; class DatabaseEloquentRelationTest extends PHPUnit_Fram...
true
Other
laravel
framework
a51d068a3a3f1acc547a9802f247917bd4a11bd4.json
Reset morph map after each test
tests/Database/DatabaseEloquentMorphTest.php
@@ -10,6 +10,8 @@ class DatabaseEloquentMorphTest extends PHPUnit_Framework_TestCase { public function tearDown() { + Relation::morphMap([], false); + m::close(); }
false
Other
laravel
framework
9faca8e8e126222371314686729c05129d431420.json
Add trailing period in `seeLink` & `dontSeeLink` See PR #10164.
src/Illuminate/Foundation/Testing/CrawlerTrait.php
@@ -300,13 +300,13 @@ protected function dontSee($text) */ public function seeLink($text, $url = null) { - $message = "No links were found with expected text [{$text}]."; + $message = "No links were found with expected text [{$text}]"; if ($url) { $message .= " and ...
false
Other
laravel
framework
7154df4686249e83da85c3239fcea7a604518f91.json
Move ability check into the backtrace method
src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
@@ -10,17 +10,15 @@ trait AuthorizesRequests /** * Authorize a given action against a set of arguments. * - * @param string $ability + * @param mixed $ability * @param mixed|array $arguments * @return void * * @throws \Symfony\Component\HttpKernel\Exception\HttpExc...
false
Other
laravel
framework
ca6e89710a9a4d8956268cc9477162f46865976a.json
Fix code explanation Since we are in the `rememberForever()` method, it is incorrect to say that data will be stored for a given amount of minutes.
src/Illuminate/Cache/TaggedCache.php
@@ -199,7 +199,7 @@ public function rememberForever($key, Closure $callback) { // If the item exists in the cache we will just return this immediately // otherwise we will execute the given Closure and cache the result - // of that execution for the given number of minutes. It's easy. + ...
false
Other
laravel
framework
9c41aa0d53412e3008285e89ff9764fa51b42469.json
Add @cannot Blade directive
src/Illuminate/View/Compilers/BladeCompiler.php
@@ -550,6 +550,17 @@ protected function compileCan($expression) return "<?php if (Gate::check{$expression}): ?>"; } + /** + * Compile the cannot statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileCannot($expression...
true
Other
laravel
framework
9c41aa0d53412e3008285e89ff9764fa51b42469.json
Add @cannot Blade directive
tests/View/ViewBladeCompilerTest.php
@@ -233,6 +233,18 @@ public function testCanStatementsAreCompiled() $this->assertEquals($expected, $compiler->compileString($string)); } + public function testCannotStatementsAreCompiled() + { + $compiler = new BladeCompiler($this->getFiles(), __DIR__); + $string = '@cannot (\'update...
true
Other
laravel
framework
d3f083a892e753bf4bd68e6dd1d30ffcb0fcbadd.json
Guess ability name for authorizeForUser
src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
@@ -19,9 +19,7 @@ trait AuthorizesRequests public function authorize($ability, $arguments = []) { if (func_num_args() === 1) { - $arguments = $ability; - - $ability = debug_backtrace(false, 2)[1]['function']; + list($arguments, $ability) = [$ability, $this->guessAbili...
false
Other
laravel
framework
cbe2a6acc94c96a39003b1509fdfe5b1546b5217.json
remove scrutinizer file
.scrutinizer.yml
@@ -1,55 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - code_rating: true - duplication: true - variable_existence: true - useless_calls: true - use_statement_alias_conflict: true - unused_variables: true - unused_properties: true - unused_...
false
Other
laravel
framework
30c032849e083e01cd8042091ddded72bf7cf8d4.json
Add missing throws in docblock
src/Illuminate/Foundation/helpers.php
@@ -712,6 +712,8 @@ function event($event, $payload = [], $halt = false) * * @param string $file * @return string + * + * @throws \InvalidArgumentException */ function elixir($file) {
false
Other
laravel
framework
f25833f216ca208550b00cf19ae5806cbe419822.json
extract method for readability
src/Illuminate/Auth/Access/Gate.php
@@ -156,8 +156,8 @@ public function check($ability, $arguments = []) $arguments = [$arguments]; } - if (isset($arguments[0]) && isset($this->policies[$argumentClass = get_class($arguments[0])])) { - $callback = [$this->resolvePolicy($this->policies[$argumentClass]), $ability]; ...
false
Other
laravel
framework
8327416018d07568b39aeddc8a594eb7f430090b.json
Use user resolver.
src/Illuminate/Auth/Access/Gate.php
@@ -16,11 +16,11 @@ class Gate implements GateContract protected $container; /** - * The user instance. + * The user resolver callable. * - * @var \Illuminate\Contracts\Auth\Authenticatable + * @var callable */ - protected $user; + protected $userResolver; /** ...
true
Other
laravel
framework
8327416018d07568b39aeddc8a594eb7f430090b.json
Use user resolver.
src/Illuminate/Auth/AuthServiceProvider.php
@@ -65,7 +65,7 @@ protected function registerUserResolver() protected function registerAccessGate() { $this->app->singleton(GateContract::class, function ($app) { - return new Gate($app, $app['auth']->user()); + return new Gate($app, function () use ($app) { return $app['auth']-...
true
Other
laravel
framework
8327416018d07568b39aeddc8a594eb7f430090b.json
Use user resolver.
tests/Auth/AuthAccessGateTest.php
@@ -83,7 +83,7 @@ public function test_for_user_method_attaches_a_new_user_to_a_new_gate_instance( protected function getBasicGate() { - return new Gate(new Container, (object) ['id' => 1]); + return new Gate(new Container, function () { return (object) ['id' => 1]; }); } }
true
Other
laravel
framework
b1c79a9a8478b8950d1d23ffbea7eaba3dfc1d2e.json
Add an authorizable contract.
src/Illuminate/Contracts/Auth/Access/Authorizable.php
@@ -0,0 +1,15 @@ +<?php + +namespace Illuminate\Contracts\Auth\Access; + +interface Authorizable +{ + /** + * Determine if the entity has a given ability. + * + * @param string $ability + * @param array|mixed $arguments + * @return bool + */ + public function can($ability, $arguments =...
false
Other
laravel
framework
49dd3461d5ce49de98d570a128f11a8ac5c1974a.json
Ignore .editorconfig and .php_cs
.gitattributes
@@ -2,8 +2,10 @@ /build export-ignore /tests export-ignore +.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.php_cs export-ignore .scrutinizer.yml export-ignore .travis.yml export-ignore phpunit.php export-ignore
false
Other
laravel
framework
b5f48a89525550a6ece15c52af0e4758c0cc90a8.json
Clarify documentation of Collection diff method The documentation was previously not clear about whether diff computes the symmetric or asymmetric difference.
src/Illuminate/Support/Collection.php
@@ -86,7 +86,7 @@ public function contains($key, $value = null) } /** - * Diff the collection with the given items. + * Get the items in the collection that are not present in the given items. * * @param mixed $items * @return static
false
Other
laravel
framework
4684c8a48705c78aed2ad3c891429569d2e381a0.json
Ignore .editorconfig and .php_cs
.gitattributes
@@ -2,8 +2,10 @@ /build export-ignore /tests export-ignore +.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.php_cs export-ignore .scrutinizer.yml export-ignore .travis.yml export-ignore phpunit.php export-ignore
false
Other
laravel
framework
e569dc47a72fd2b4d322c5a96b2ca334ac18c89f.json
adjust comment spacing
src/Illuminate/Database/Schema/Grammars/Grammar.php
@@ -327,7 +327,7 @@ protected function getTableWithColumnChanges(Blueprint $blueprint, Table $table) $column = $this->getDoctrineColumnForChange($table, $fluent); // Here we will spin through each fluent column definition and map it to the proper - // Doctrine column definitions, ...
false
Other
laravel
framework
e38782302566cbe42262e15411f00f0e9769017e.json
Fix double word in comments
src/Illuminate/Container/Container.php
@@ -185,8 +185,8 @@ public function bind($abstract, $concrete = null, $shared = false) } // If the factory is not a Closure, it means it is just a class name which is - // is bound into this container to the abstract type and we will just wrap - // it up inside a Closure to make things...
false
Other
laravel
framework
9611a25144f5bb23a72b75e7029fb0d1dd64a116.json
Fix tests for collection reverse
tests/Support/SupportCollectionTest.php
@@ -345,12 +345,12 @@ public function testReverse() $data = new Collection(['zaeed', 'alan']); $reversed = $data->reverse(); - $this->assertEquals(['alan', 'zaeed'], array_values($reversed->all())); + $this->assertSame([1 => 'alan', 0 => 'zaeed'], $reversed->all()); - $data = ...
false
Other
laravel
framework
85a96a40833289b6419661b3df46466304f4436e.json
Fix PHP cs
src/Illuminate/Database/Eloquent/Builder.php
@@ -3,9 +3,9 @@ namespace Illuminate\Database\Eloquent; use Closure; -use InvalidArgumentException; use Illuminate\Support\Arr; use Illuminate\Support\Str; +use InvalidArgumentException; use Illuminate\Pagination\Paginator; use Illuminate\Database\Query\Expression; use Illuminate\Pagination\LengthAwarePaginato...
false
Other
laravel
framework
812bbd7525166b2fecbb10f66b7eaaae7e4ea378.json
Add dontSeeJson() to CrawlerTrait
src/Illuminate/Foundation/Testing/CrawlerTrait.php
@@ -511,9 +511,10 @@ public function seeJsonEquals(array $data) * Assert that the response contains JSON. * * @param array|null $data + * @param bool $negate * @return $this */ - public function seeJson(array $data = null) + public function seeJson(array $data = null, $negate...
false
Other
laravel
framework
5836395757e7e5f595be072876920e6ad8449b3a.json
Fix PHP cs
src/Illuminate/Database/Eloquent/Builder.php
@@ -298,8 +298,6 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page') { - - $page = Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->ge...
false
Other
laravel
framework
94e55961871d1f0be8869efecb55e5089de26dc0.json
Fix PHP cs
src/Illuminate/Database/Eloquent/Builder.php
@@ -271,7 +271,7 @@ public function lists($column, $key = null) */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { - if( $perPage <= 0) { + if ($perPage <= 0) { throw new InvalidArgumentException("Negative values can't be used to...
false
Other
laravel
framework
2c76a733715b8754d8752658f743032947cf746c.json
Fix negative validation for pagination
src/Illuminate/Database/Eloquent/Builder.php
@@ -3,6 +3,7 @@ namespace Illuminate\Database\Eloquent; use Closure; +use InvalidArgumentException; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Pagination\Paginator; @@ -265,9 +266,15 @@ public function lists($column, $key = null) * @param string $pageName * @param int|n...
false
Other
laravel
framework
b0ad3f667b1b9bfbab4a8d6903488acf0194f042.json
Fix json validator
src/Illuminate/Validation/Validator.php
@@ -837,7 +837,8 @@ protected function validateString($attribute, $value) */ protected function validateJson($attribute, $value) { - return ! is_null(json_decode($value)); + json_decode($value); + return json_last_error() === JSON_ERROR_NONE; } /**
false
Other
laravel
framework
3919621558e1635db4327c4b54cafa4f9cba9c82.json
revert some unnecessary changes
src/Illuminate/Database/Query/Builder.php
@@ -189,7 +189,7 @@ class Builder '&', '|', '^', '<<', '>>', 'rlike', 'regexp', 'not regexp', '~', '~*', '!~', '!~*', 'similar to', - 'not similar to', + 'not similar to', ]; /** @@ -1400,14 +1400,13 @@ protected function runSelect() */ public func...
false
Other
laravel
framework
fb665f526ceb4bb1e21166911e8924ad2be99c57.json
Add id() method to Guard interface
src/Illuminate/Contracts/Auth/Guard.php
@@ -25,6 +25,13 @@ public function guest(); */ public function user(); + /** + * Get the ID for the currently authenticated user. + * + * @return int|null + */ + public function id(); + /** * Log a user into the application without sessions or cookies. *
false
Other
laravel
framework
53c6e48ed030f9c8a4d79579b9f411e937967581.json
add page argument on paginate
src/Illuminate/Database/Query/Builder.php
@@ -173,7 +173,7 @@ class Builder /** * The binding backups currently in use. - * + * * @var array */ protected $bindingBackups = []; @@ -1395,17 +1395,19 @@ protected function runSelect() * @param int $perPage * @param array $columns * @param string $pageN...
false
Other
laravel
framework
8ea72714480e03c0288f80ac0bed5265381222ba.json
Prevent repeated calls Remove unnecessary repeated call to formatToExpectedJson().
src/Illuminate/Foundation/Testing/CrawlerTrait.php
@@ -415,7 +415,7 @@ protected function seeJsonContains(array $data) $expected = $this->formatToExpectedJson($key, $value); $this->assertTrue( - Str::contains($actual, $this->formatToExpectedJson($key, $value)), + Str::contains($actual, $expected), ...
false
Other
laravel
framework
0dd091ed8f8c2416628bf245d0bc6e81232a9a07.json
Provide hook into job creation for SQS.
src/Illuminate/Queue/SqsQueue.php
@@ -22,6 +22,13 @@ class SqsQueue extends Queue implements QueueContract */ protected $default; + /** + * The job creator callback. + * + * @var callable|null + */ + protected $jobCreator; + /** * Create a new Amazon SQS queue instance. * @@ -100,10 +107,27 @@ public ...
true
Other
laravel
framework
0dd091ed8f8c2416628bf245d0bc6e81232a9a07.json
Provide hook into job creation for SQS.
tests/Queue/QueueSqsQueueTest.php
@@ -54,6 +54,17 @@ public function testPopProperlyPopsJobOffOfSqs() $this->assertInstanceOf('Illuminate\Queue\Jobs\SqsJob', $result); } + public function testPopProperlyPopsJobOffOfSqsWithCustomJobCreator() + { + $queue = $this->getMock('Illuminate\Queue\SqsQueue', ['getQueue'], [$this->sqs...
true
Other
laravel
framework
9032d1aa4583c6de258f54aa7b67f05897b45bf3.json
Add more methods to collection
src/Illuminate/Support/Collection.php
@@ -113,6 +113,37 @@ public function each(callable $callback) return $this; } + /** + * Create a new collection consisting of even elements. + * + * @return static + */ + public function even() + { + return $this->every(2); + } + + /** + * Create a new collectio...
true
Other
laravel
framework
9032d1aa4583c6de258f54aa7b67f05897b45bf3.json
Add more methods to collection
tests/Support/SupportCollectionTest.php
@@ -369,6 +369,37 @@ public function testChunk() $this->assertEquals([10], $data[3]->toArray()); } + public function testEven() + { + $data = new Collection(['a', 'b', 'c', 'd', 'e', 'f']); + + $this->assertEquals(['a', 'c', 'e'], $data->even()->all()); + } + + public function ...
true
Other
laravel
framework
3b65a33206f426612d68eba7fb0e501833a1651d.json
Preserve keys in collection reverse
src/Illuminate/Support/Collection.php
@@ -564,11 +564,12 @@ public function reject($callback) /** * Reverse items order. * + * @param bool $preserveKeys * @return static */ - public function reverse() + public function reverse($preserveKeys = false) { - return new static(array_reverse($this->items)); + ...
true
Other
laravel
framework
3b65a33206f426612d68eba7fb0e501833a1651d.json
Preserve keys in collection reverse
tests/Support/SupportCollectionTest.php
@@ -346,6 +346,11 @@ public function testReverse() $reversed = $data->reverse(); $this->assertEquals(['alan', 'zaeed'], array_values($reversed->all())); + + $data = new Collection(['zaeed', 'alan']); + $reversed = $data->reverse(true); + + $this->assertEquals([1 => 'alan', 0 => ...
true
Other
laravel
framework
ef359c9845e1850af7d3b58779c8b84ba4d3dff9.json
Add getters and setters to EloquentUserProvider
src/Illuminate/Auth/EloquentUserProvider.php
@@ -125,4 +125,50 @@ public function createModel() return new $class; } + + /** + * Gets the hasher implementation. + * + * @return \Illuminate\Contracts\Hashing\Hasher + */ + public function getHasher() + { + return $this->hasher; + } + + /** + * Sets the hashe...
false