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
dd60e0dcc8059f700cc4c3c0679b1a13d0fae252.json
use method on app
src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
@@ -102,7 +102,7 @@ public function discoverEvents() protected function discoverEventsWithin() { return [ - app_path('Listeners'), + $this->app->path('Listeners'), ]; } }
false
Other
laravel
framework
b9de404ce384611e477e4fc5d8fca2a24f2ad562.json
change cache path
src/Illuminate/Foundation/Application.php
@@ -953,7 +953,7 @@ public function eventsAreCached() */ public function getCachedEventsPath() { - return $_ENV['APP_EVENTS_CACHE'] ?? $this->storagePath().'/framework/cache/events.php'; + return $_ENV['APP_EVENTS_CACHE'] ?? $this->bootstrapPath().'/cache/events.php'; } /**
false
Other
laravel
framework
fd53bf979f46e5c9841e07a44a49c7893be58f5c.json
Apply fixes from StyleCI (#28063)
src/Illuminate/Foundation/Console/EventCacheCommand.php
@@ -3,9 +3,6 @@ namespace Illuminate\Foundation\Console; use Illuminate\Console\Command; -use Illuminate\Support\Collection; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Finder\SplFileInfo; use Illuminate\Foundation\Support\Providers\EventServiceProvider; class EventCacheCommand extends Command
true
Other
laravel
framework
fd53bf979f46e5c9841e07a44a49c7893be58f5c.json
Apply fixes from StyleCI (#28063)
src/Illuminate/Foundation/Console/EventClearCommand.php
@@ -2,7 +2,6 @@ namespace Illuminate\Foundation\Console; -use RuntimeException; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem;
true
Other
laravel
framework
fd53bf979f46e5c9841e07a44a49c7893be58f5c.json
Apply fixes from StyleCI (#28063)
src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
@@ -25,9 +25,9 @@ use Illuminate\Foundation\Console\ViewCacheCommand; use Illuminate\Foundation\Console\ViewClearCommand; use Illuminate\Session\Console\SessionTableCommand; +use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate\Foundation\Console\EventCacheCommand; use Illuminate\Foundation\Console\...
true
Other
laravel
framework
4aeb89235e594f3b942fc6c136b76de4de7d65cc.json
Fix missed type declaration from base class
src/Illuminate/Http/Request.php
@@ -269,7 +269,7 @@ public function secure() /** * Get the client IP address. * - * @return string + * @return string|null */ public function ip() {
false
Other
laravel
framework
5681fdb9aa1ae1a8958a0bc8f7ed5761f0bdab0d.json
Accept throwable in report helper typehint
src/Illuminate/Foundation/helpers.php
@@ -659,7 +659,7 @@ function redirect($to = null, $status = 302, $headers = [], $secure = null) /** * Report an exception. * - * @param \Exception $exception + * @param \Throwable $exception * @return void */ function report($exception)
false
Other
laravel
framework
5df3cff39a6a3c1515f78ee6d8bb10f0368a3c1a.json
move test classes to their own files
tests/Database/DatabaseEloquentIntegrationTest.php
@@ -14,13 +14,13 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Pagination\LengthAwarePaginator; -use Illuminate\Tests\Integration\Database\Post; -use Illuminate\Tests\Integration\Database\User; use Illuminate\Database\Eloquent\Relations\Pivot; use Il...
true
Other
laravel
framework
5df3cff39a6a3c1515f78ee6d8bb10f0368a3c1a.json
move test classes to their own files
tests/Integration/Database/EloquentCollectionFreshTest.php
@@ -3,8 +3,8 @@ namespace Illuminate\Tests\Integration\Database; use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Tests\Integration\Database\Fixtures\User; /** * @group integration @@ -35,8 +35,3 @@ public function test_e...
true
Other
laravel
framework
5df3cff39a6a3c1515f78ee6d8bb10f0368a3c1a.json
move test classes to their own files
tests/Integration/Database/EloquentDeleteTest.php
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Tests\Integration\Database\Fixtures\Post; /** * @group integration @@ -80,11 +81,6 @@ public function testForceDeletedEventIsFired() } } -class ...
true
Other
laravel
framework
5df3cff39a6a3c1515f78ee6d8bb10f0368a3c1a.json
move test classes to their own files
tests/Integration/Database/Fixtures/Post.php
@@ -0,0 +1,10 @@ +<?php + +namespace Illuminate\Tests\Integration\Database\Fixtures; + +use Illuminate\Database\Eloquent\Model; + +class Post extends Model +{ + public $table = 'posts'; +}
true
Other
laravel
framework
5df3cff39a6a3c1515f78ee6d8bb10f0368a3c1a.json
move test classes to their own files
tests/Integration/Database/Fixtures/User.php
@@ -0,0 +1,10 @@ +<?php + +namespace Illuminate\Tests\Integration\Database\Fixtures; + +use Illuminate\Database\Eloquent\Model; + +class User extends Model +{ + protected $guarded = []; +}
true
Other
laravel
framework
9a4f743ad67073229d8fa1cec645c62d97265331.json
Remove unused methods
src/Illuminate/Database/Query/Builder.php
@@ -909,51 +909,6 @@ public function orWhereNotIn($column, $values) return $this->whereNotIn($column, $values, 'or'); } - /** - * Add a where in with a sub-select to the query. - * - * @param string $column - * @param \Closure $callback - * @param string $boolean - * @p...
true
Other
laravel
framework
9a4f743ad67073229d8fa1cec645c62d97265331.json
Remove unused methods
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -297,30 +297,6 @@ protected function whereNotInRaw(Builder $query, $where) return '1 = 1'; } - /** - * Compile a where in sub-select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function ...
true
Other
laravel
framework
70918d60c8923ffa03b29856a6ba4bf6b9575b0a.json
add forPageBeforeId method to query builder
src/Illuminate/Database/Query/Builder.php
@@ -1938,6 +1938,26 @@ public function forPage($page, $perPage = 15) return $this->skip(($page - 1) * $perPage)->take($perPage); } + /** + * Constrain the query to the previous "page" of results before a given ID. + * + * @param int $perPage + * @param int|null $lastId + * @pa...
true
Other
laravel
framework
70918d60c8923ffa03b29856a6ba4bf6b9575b0a.json
add forPageBeforeId method to query builder
tests/Database/DatabaseEloquentIntegrationTest.php
@@ -1090,6 +1090,20 @@ public function testGlobalScopeCanBeRemovedByOtherGlobalScope() $this->assertNotNull(EloquentTestUserWithGlobalScopeRemovingOtherScope::find($user->id)); } + public function testForPageBeforeIdCorrectlyPaginates() + { + EloquentTestUser::create(['id' => 1, 'email' => ...
true
Other
laravel
framework
9ac88d7a938deeae09584ccb35f69dc6c37af153.json
Pass ReflectionException as previous exception
src/Illuminate/Container/Container.php
@@ -795,7 +795,7 @@ public function build($concrete) try { $reflector = new ReflectionClass($concrete); } catch (ReflectionException $e) { - throw new BindingResolutionException("Target class [$concrete] does not exist."); + throw new BindingResolutionException("Targ...
false
Other
laravel
framework
93abbf579b18b28b70ba18db7468c1dc500b60da.json
Fix unique validation without ignored column
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
@@ -712,7 +712,9 @@ public function validateUnique($attribute, $value, $parameters) if (isset($parameters[2])) { [$idColumn, $id] = $this->getUniqueIds($parameters); - $id = stripslashes($id); + if (! is_null($id)) { + $id = stripslashes($id); + } ...
true
Other
laravel
framework
93abbf579b18b28b70ba18db7468c1dc500b60da.json
Fix unique validation without ignored column
tests/Validation/ValidationValidatorTest.php
@@ -1889,7 +1889,9 @@ public function testValidateUnique() $v = new Validator($trans, ['email' => 'foo'], ['email' => 'Unique:users,email_addr,NULL,id_col,foo,bar']); $mock = m::mock(PresenceVerifierInterface::class); $mock->shouldReceive('setConnection')->once()->with(null); - $mock->...
true
Other
laravel
framework
2edeb3ac8d840d26948df7f1a4362d11f0fb11a2.json
Add use Exception.
tests/Integration/Cache/RedisCacheLockTest.php
@@ -2,6 +2,7 @@ namespace Illuminate\Tests\Integration\Cache; +use Exception; use Illuminate\Support\Carbon; use Orchestra\Testbench\TestCase; use Illuminate\Support\Facades\Cache; @@ -80,9 +81,9 @@ public function test_redis_locks_with_failed_block_callback_are_released() try { $firstLo...
false
Other
laravel
framework
7a7cacc3fd02d7d4c596c1a0f8af3c5b7a2990b4.json
Use Null coalescing operator to refactor
src/Illuminate/Http/Concerns/InteractsWithInput.php
@@ -309,9 +309,7 @@ public function allFiles() { $files = $this->files->all(); - return $this->convertedFiles - ? $this->convertedFiles - : $this->convertedFiles = $this->convertUploadedFiles($files); + return $this->convertedFiles = $this->convertedFi...
false
Other
laravel
framework
20b12e7e5ef705633cea1eb768eca9b9578c3f0c.json
Correct collection sort key test
tests/Support/SupportCollectionTest.php
@@ -983,14 +983,20 @@ public function testSortKeys() { $data = new Collection(['b' => 'dayle', 'a' => 'taylor']); - $this->assertEquals(['a' => 'taylor', 'b' => 'dayle'], $data->sortKeys()->all()); + $sortData = $data->sortKeys()->all(); + + $this->assertEquals(['a' => 'taylor', 'b'...
false
Other
laravel
framework
d460423467951c935ef00288d04fe3fd04b1794e.json
Support nullable unique indexes in SQL Server
src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
@@ -105,10 +105,11 @@ public function compilePrimary(Blueprint $blueprint, Fluent $command) */ public function compileUnique(Blueprint $blueprint, Fluent $command) { - return sprintf('create unique index %s on %s (%s)', + return sprintf('create unique index %s on %s (%s) where "%s" is not ...
false
Other
laravel
framework
da4d4a468eee174bd619b4a04aab57e419d10ff4.json
remove commas from values
src/Illuminate/Validation/Rules/Unique.php
@@ -35,8 +35,8 @@ public function ignore($id, $idColumn = null) return $this->ignoreModel($id, $idColumn); } - $this->ignore = $id; - $this->idColumn = $idColumn ?? 'id'; + $this->ignore = str_replace(',', '', $id); + $this->idColumn = str_replace(',', '', $idColumn ?...
true
Other
laravel
framework
da4d4a468eee174bd619b4a04aab57e419d10ff4.json
remove commas from values
tests/Validation/ValidationUniqueRuleTest.php
@@ -17,7 +17,7 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule() $rule = new Unique('table', 'column'); $rule->ignore('Taylor, Otwell', 'id_column'); $rule->where('foo', 'bar'); - $this->assertEquals('unique:table,column,"Taylor, Otwell",id_column,foo,bar', (string) $r...
true
Other
laravel
framework
021b9158a1dd11bb32ee358de18eff06e883fa13.json
Avoid double path checking
src/Illuminate/Foundation/helpers.php
@@ -131,7 +131,7 @@ function app($abstract = null, array $parameters = []) */ function app_path($path = '') { - return app('path').($path ? DIRECTORY_SEPARATOR.$path : $path); + return app()->path($path); } } @@ -190,7 +190,7 @@ function back($status = 302, $headers = [], $fallback...
false
Other
laravel
framework
ad3bdfe0a7eeeacec18c1a6a73bcfe873e1c1edc.json
Fix updateOrInsert method for Query Builder Now it correctly works with empty values array. Before it created syntactically wrong SQL, now it simply returns 'true'.
src/Illuminate/Database/Query/Builder.php
@@ -2678,6 +2678,10 @@ public function updateOrInsert(array $attributes, array $values = []) return $this->insert(array_merge($attributes, $values)); } + if (empty($values)) { + return true; + } + return (bool) $this->take(1)->update($values); }
true
Other
laravel
framework
ad3bdfe0a7eeeacec18c1a6a73bcfe873e1c1edc.json
Fix updateOrInsert method for Query Builder Now it correctly works with empty values array. Before it created syntactically wrong SQL, now it simply returns 'true'.
tests/Database/DatabaseQueryBuilderTest.php
@@ -2003,6 +2003,34 @@ public function testUpdateOrInsertMethod() $this->assertTrue($builder->updateOrInsert(['email' => 'foo'], ['name' => 'bar'])); } + public function testUpdateOrInsertMethodWorksWithEmptyUpdateValues() + { + $builder = m::mock(Builder::class.'[where,exists,insert]', [ +...
true
Other
laravel
framework
cd9a86b4c0dfea64b59b56effacaca49769c5ed6.json
Correct phpDoc code style
src/Illuminate/Foundation/Testing/TestResponse.php
@@ -633,8 +633,8 @@ public function assertJsonCount(int $count, $key = null) /** * Assert that the response has the given JSON validation errors for the given keys. * - * @param string|array $keys - * @param string $responseKey + * @param string|array $keys + * @param string $r...
false
Other
laravel
framework
d0b1cfea1843bac76aabe55e3c3c35b727fd89bb.json
Add custom errors key to validation test
src/Illuminate/Foundation/Testing/TestResponse.php
@@ -633,27 +633,28 @@ public function assertJsonCount(int $count, $key = null) /** * Assert that the response has the given JSON validation errors for the given keys. * - * @param string|array $keys + * @param string|array $keys + * @param string $responseKey * @return $this ...
true
Other
laravel
framework
d0b1cfea1843bac76aabe55e3c3c35b727fd89bb.json
Add custom errors key to validation test
tests/Foundation/FoundationTestResponseTest.php
@@ -315,6 +315,20 @@ public function testAssertJsonValidationErrors() $testResponse->assertJsonValidationErrors('foo'); } + public function testAssertJsonValidationErrorsCustomErrorsName() + { + $data = [ + 'status' => 'ok', + 'data' => ['foo' => 'oops'], + ]; +...
true
Other
laravel
framework
bc53915ed5fa4d315ee6faa047c1762cc7d1454b.json
Restore maintenance message on error page
src/Illuminate/Foundation/Exceptions/views/503.blade.php
@@ -2,4 +2,4 @@ @section('title', __('Service Unavailable')) @section('code', '503') -@section('message', __('Service Unavailable')) +@section('message', __($exception->getMessage() ?: 'Service Unavailable'))
false
Other
laravel
framework
a32792233dd7db53a0177ac5a9ae3f3a13d53662.json
Add replacement for lower danish "æ"
src/Illuminate/Support/Str.php
@@ -723,8 +723,8 @@ protected static function languageSpecificCharsArray($language) ['h', 'H', 'sht', 'SHT', 'a', 'А', 'y', 'Y'], ], 'da' => [ - ['ø', 'å', 'Æ', 'Ø', 'Å'], - ['oe', 'aa', 'Ae', 'Oe', 'Aa'], + ...
false
Other
laravel
framework
d432cfcf57136129940d49be5ea37140e652d601.json
Add tests for count aggregate
tests/Integration/Database/EloquentPaginateTest.php
@@ -49,6 +49,7 @@ public function test_pagination_with_distinct() $query = Post::query()->distinct(); $this->assertEquals(6, $query->get()->count()); + $this->assertEquals(6, $query->count()); $this->assertEquals(6, $query->paginate()->total()); } @@ -63,6 +64,7 @@ public func...
false
Other
laravel
framework
dc263d4fe2580306ab35ecf164158863bc3d6958.json
Use correct syntax and move Postgres grammar
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -110,7 +110,7 @@ protected function compileAggregate(Builder $query, $aggregate) // we need to prepend "distinct" onto the column name so that the query takes // it into account when it performs the aggregating operations on the data. if (is_array($query->distinct)) { - $column ...
true
Other
laravel
framework
dc263d4fe2580306ab35ecf164158863bc3d6958.json
Use correct syntax and move Postgres grammar
src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
@@ -125,6 +125,33 @@ public function compileSelect(Builder $query) return $sql; } + /** + * Compile the "select *" portion of the query. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $columns + * @return string|null + */ + protected function ...
true
Other
laravel
framework
dc263d4fe2580306ab35ecf164158863bc3d6958.json
Use correct syntax and move Postgres grammar
tests/Database/DatabaseQueryBuilderTest.php
@@ -119,11 +119,15 @@ public function testBasicSelectDistinct() $this->assertEquals('select distinct "foo", "bar" from "users"', $builder->toSql()); } - public function testBasicSelectDistinctWithColumns() + public function testBasicSelectDistinctOnColumns() { $builder = $this->getBu...
true
Other
laravel
framework
67cb3a4695c71112810c0e010e7f35e3b439ac2c.json
Fix StyleCI warnings
src/Illuminate/Auth/Access/Gate.php
@@ -305,7 +305,7 @@ public function any($abilities, $arguments = []) public function none($abilities, $arguments = []) { return ! $this->any($abilities, $arguments); - } + } /** * Determine if the given ability should be granted for the current user.
false
Other
laravel
framework
203172477fc99d541a6def73449c8cacc3718ca6.json
fix whitespace errors
src/Illuminate/Auth/Access/Gate.php
@@ -295,7 +295,7 @@ public function any($abilities, $arguments = []) }); } - /** + /** * Determine if any one of the given abilities should be denied for the current user. * * @param iterable|string $abilities @@ -305,7 +305,7 @@ public function any($abilities, $arguments = []...
false
Other
laravel
framework
8412218059b94c3f781fdeee3f0eb507a66550d4.json
Create getter for the http route middlewares This getter allows to create tests for the route middlewares, which is currently not possible because the property is protected. For example, if you want to ensure that a route middleware has been registered, with this getter you can write: ```php /** @test */ public func...
src/Illuminate/Foundation/Http/Kernel.php
@@ -336,6 +336,16 @@ public function getMiddlewareGroups() return $this->middlewareGroups; } + /** + * Get the application's route middleware. + * + * @return array + */ + public function getRouteMiddleware() + { + return $this->routeMiddleware; + } + /** * ...
true
Other
laravel
framework
8412218059b94c3f781fdeee3f0eb507a66550d4.json
Create getter for the http route middlewares This getter allows to create tests for the route middlewares, which is currently not possible because the property is protected. For example, if you want to ensure that a route middleware has been registered, with this getter you can write: ```php /** @test */ public func...
tests/Foundation/Http/KernelTest.php
@@ -17,6 +17,13 @@ public function testGetMiddlewareGroups() $this->assertEquals([], $kernel->getMiddlewareGroups()); } + public function testGetRouteMiddleware() + { + $kernel = new Kernel($this->getApplication(), $this->getRouter()); + + $this->assertEquals([], $kernel->getRouteMid...
true
Other
laravel
framework
9bcad4a9b505188a6c4bbb684a42062f36eb60cc.json
Use latest versions
.github/ISSUE_TEMPLATE/1_Bug_report.md
@@ -1,6 +1,6 @@ --- name: "🐛 Bug Report" -about: 'Report a general framework issue. Please first check if your Laravel version is still supported: https://laravel.com/docs/5.8/releases#support-policy' +about: 'Report a general framework issue. Please first check if your Laravel version is still supported: https://la...
true
Other
laravel
framework
9bcad4a9b505188a6c4bbb684a42062f36eb60cc.json
Use latest versions
.github/PULL_REQUEST_TEMPLATE.md
@@ -1,7 +1,7 @@ <!-- -Please only send in a PR to branches which are currently supported: https://laravel.com/docs/5.8/releases#support-policy +Please only send in a PR to branches which are currently supported: https://laravel.com/docs/releases#support-policy -If you are unsure to which branch you want to send a ...
true
Other
laravel
framework
19206efaaf31ee3368a42c51d0825db03d8490d2.json
Use proper link in docs issue template
.github/ISSUE_TEMPLATE/4_Documentation_issue.md
@@ -1,6 +1,6 @@ --- name: "📚 Documentation Issue" -about: 'For documentation issues, see: https://github.com/laravel/docs/issues' +about: 'For documentation issues, open a pull request at https://github.com/laravel/docs' ---
false
Other
laravel
framework
bd76f38ec46e27f72c247636fbb49e3f5289606c.json
Clarify support policy in issue template
.github/ISSUE_TEMPLATE/1_Bug_report.md
@@ -1,11 +1,11 @@ --- name: "🐛 Bug Report" -about: Report a general framework issue +about: 'Report a general framework issue. We currently only offer support for Laravel 5.5 (LTS) and 5.8 as per our support policy: https://laravel.com/docs/5.8/releases#support-policy' --- - Laravel Version: #.#.# -- PHP Versi...
false
Other
laravel
framework
02623f89912017f4dcea3c040139544bb74c14fa.json
Fix DateTime typehints
src/Illuminate/Contracts/Mail/Mailable.php
@@ -25,7 +25,7 @@ public function queue(Queue $queue); /** * Deliver the queued message after the given delay. * - * @param \DateTime|int $delay + * @param \DateTimeInterface|\DateInterval|int $delay * @param \Illuminate\Contracts\Queue\Factory $queue * @return mixed */
true
Other
laravel
framework
02623f89912017f4dcea3c040139544bb74c14fa.json
Fix DateTime typehints
src/Illuminate/Foundation/Bus/PendingDispatch.php
@@ -79,7 +79,7 @@ public function allOnQueue($queue) /** * Set the desired delay for the job. * - * @param \DateTime|int|null $delay + * @param \DateTimeInterface|\DateInterval|int|null $delay * @return $this */ public function delay($delay)
true
Other
laravel
framework
02623f89912017f4dcea3c040139544bb74c14fa.json
Fix DateTime typehints
src/Illuminate/Support/Testing/Fakes/QueueFake.php
@@ -263,7 +263,7 @@ public function pushRaw($payload, $queue = null, array $options = []) /** * Push a new job onto the queue after a delay. * - * @param \DateTime|int $delay + * @param \DateTimeInterface|\DateInterval|int $delay * @param string $job * @param mixed $data ...
true
Other
laravel
framework
7b4e5acd0b067da29261d08b1c3fc83617e18348.json
Fix method signatures on Cache facade To bring them inline with the recent cache changes.
src/Illuminate/Support/Facades/Cache.php
@@ -8,12 +8,12 @@ * @method static bool missing(string $key) * @method static mixed get(string $key, mixed $default = null) * @method static mixed pull(string $key, mixed $default = null) - * @method static void put(string $key, $value, \DateTimeInterface|\DateInterval|int $seconds) - * @method static bool add(st...
false
Other
laravel
framework
153390164e8f93f6c7a49da03f244448f51c01c9.json
Extract a method
src/Illuminate/Session/Middleware/StartSession.php
@@ -62,7 +62,7 @@ public function handle($request, Closure $next) // Again, if the session has been configured we will need to close out the session // so that the attributes may be persisted to some storage medium. We will also // add the session identifier cookie to the application response...
false
Other
laravel
framework
7b8e123462675e1d7b319f61c895be7f61b15c71.json
Add `countBy` method to Collection
src/Illuminate/Support/Collection.php
@@ -1890,6 +1890,28 @@ public function count() return count($this->items); } + /** + * Count the number of items in the collection by some predicate. + * + * @param callable|null + * @return static + */ + public function countBy($predicate = null) + { + if (is_null($p...
true
Other
laravel
framework
7b8e123462675e1d7b319f61c895be7f61b15c71.json
Add `countBy` method to Collection
tests/Support/SupportCollectionTest.php
@@ -307,6 +307,31 @@ public function testCountable() $this->assertCount(2, $c); } + public function testCountableByWithoutPredicate() + { + $c = new Collection([ 'foo', 'foo', 'foo', 'bar', 'bar', 'foobar' ]); + $this->assertEquals([ 'foo' => 3, 'bar' => 2, 'foobar' => 1 ], $c->count...
true
Other
laravel
framework
6d700974d27da0af2729e68520ad901020acdf96.json
Add test for guesser callback transfer
tests/Auth/AuthAccessGateTest.php
@@ -507,6 +507,32 @@ public function test_for_user_method_attaches_a_new_user_to_a_new_gate_instance( $this->assertTrue($gate->forUser((object) ['id' => 2])->check('foo')); } + public function test_for_user_method_attaches_a_new_user_to_a_new_gate_instance_with_guess_callback() + { + $gate ...
false
Other
laravel
framework
2d7b81c3ada809d87a955556bac2299a02ba3035.json
add join method to collection
src/Illuminate/Support/Collection.php
@@ -296,6 +296,34 @@ public function containsStrict($key, $value = null) return in_array($key, $this->items, true); } + /** + * Join all items from the collection using a string. The final items can use a separate glue string. + * + * @param string $glue + * @param string $finalGl...
true
Other
laravel
framework
2d7b81c3ada809d87a955556bac2299a02ba3035.json
add join method to collection
tests/Support/SupportCollectionTest.php
@@ -878,6 +878,19 @@ public function testCollapseWithNestedCollections() $this->assertEquals([1, 2, 3, 4, 5, 6], $data->collapse()->all()); } + public function testJoin() + { + $this->assertEquals('a, b, c', (new Collection(['a', 'b', 'c']))->join(', ')); + + $this->assertEquals('a, ...
true
Other
laravel
framework
586345a52f6639dfcf5cba6effa87889b8862b4f.json
Fix StyleCI failure
tests/Notifications/NotificationSenderTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Notifications; -use Illuminate\Bus\Queueable; use Mockery as m; +use Illuminate\Bus\Queueable; use PHPUnit\Framework\TestCase; use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notification;
false
Other
laravel
framework
84b438c432531dc41d4d71f18d396636addebedb.json
Fix a bug with string via in queued notifications A queued notification with a string via currently fails because it's not converted to an array. I've added a test which proves the failure. Reported via https://github.com/laravel/docs/pull/5023
src/Illuminate/Notifications/NotificationSender.php
@@ -179,7 +179,7 @@ protected function queueNotification($notifiables, $notification) foreach ($notifiables as $notifiable) { $notificationId = Str::uuid()->toString(); - foreach ($original->via($notifiable) as $channel) { + foreach ((array) $original->via($notifiable) as $...
true
Other
laravel
framework
84b438c432531dc41d4d71f18d396636addebedb.json
Fix a bug with string via in queued notifications A queued notification with a string via currently fails because it's not converted to an array. I've added a test which proves the failure. Reported via https://github.com/laravel/docs/pull/5023
tests/Notifications/NotificationSenderTest.php
@@ -0,0 +1,54 @@ +<?php + +namespace Illuminate\Tests\Notifications; + +use Illuminate\Bus\Queueable; +use Mockery as m; +use PHPUnit\Framework\TestCase; +use Illuminate\Notifications\Notifiable; +use Illuminate\Notifications\Notification; +use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Notifications\Chann...
true
Other
laravel
framework
ed91b7ddaedcde80dcfda261d8f125fd1ee19c4f.json
Push 7th argument to new line
src/Illuminate/Auth/Access/Gate.php
@@ -703,7 +703,8 @@ public function forUser($user) return new static( $this->container, $callback, $this->abilities, - $this->policies, $this->beforeCallbacks, $this->afterCallbacks, $this->guessPolicyNamesUsingCallback + $this->policies, $this->beforeCallbacks, $this->afte...
false
Other
laravel
framework
887916ba7815e6bf7e2feec44e0d49d85e9ab671.json
Add support for single-quoted string
src/Illuminate/Support/helpers.php
@@ -662,7 +662,7 @@ function env($key, $default = null) return; } - if (($valueLength = strlen($value)) > 1 && $value[0] === '"' && $value[$valueLength - 1] === '"') { + if (($valueLength = strlen($value)) > 1 && ($value[0] === '"' && $value[$val...
true
Other
laravel
framework
887916ba7815e6bf7e2feec44e0d49d85e9ab671.json
Add support for single-quoted string
tests/Support/SupportHelpersTest.php
@@ -576,6 +576,9 @@ public function testEnvEscapedString() { $_SERVER['foo'] = '"null"'; $this->assertSame('null', env('foo')); + + $_SERVER['foo'] = "'null'"; + $this->assertSame('null', env('foo')); } public function testGetFromENVFirst()
true
Other
laravel
framework
b0d163f078145c6f1ae943bd487bb512b4e493b5.json
Add test for escaped environment variable string
tests/Support/SupportHelpersTest.php
@@ -572,6 +572,12 @@ public function testEnvNull() $this->assertNull(env('foo')); } + public function testEnvEscapedString() + { + $_SERVER['foo'] = '"null"'; + $this->assertSame('null', env('foo')); + } + public function testGetFromENVFirst() { $_ENV['foo'] = '...
false
Other
laravel
framework
8ab09fb6377eb5b6dab45ab38b0a62446b08e8ae.json
Update changelog 1 (#27682) [5.7] update changelog
CHANGELOG-5.7.md
@@ -3,7 +3,7 @@ ## [Unreleased](https://github.com/laravel/framework/compare/v5.7.28...5.7) -## [v5.7.28 (2019-02-28)](https://github.com/laravel/framework/compare/v5.7.27...v5.7.28) +## [v5.7.28 (2019-02-26)](https://github.com/laravel/framework/compare/v5.7.27...v5.7.28) ### Added - Add support for `Pheansta...
false
Other
laravel
framework
81895941a5ee83e89c1e707cdd5d06515d276b4d.json
Return fake objects from facades
src/Illuminate/Support/Facades/Bus.php
@@ -20,11 +20,13 @@ class Bus extends Facade /** * Replace the bound instance with a fake. * - * @return void + * @return BusFake */ public static function fake() { - static::swap(new BusFake); + static::swap($fake = new BusFake); + + return $fake; } ...
true
Other
laravel
framework
81895941a5ee83e89c1e707cdd5d06515d276b4d.json
Return fake objects from facades
src/Illuminate/Support/Facades/Event.php
@@ -24,13 +24,15 @@ class Event extends Facade * Replace the bound instance with a fake. * * @param array|string $eventsToFake - * @return void + * @return EventFake */ public static function fake($eventsToFake = []) { static::swap($fake = new EventFake(static::getFa...
true
Other
laravel
framework
81895941a5ee83e89c1e707cdd5d06515d276b4d.json
Return fake objects from facades
src/Illuminate/Support/Facades/Mail.php
@@ -31,11 +31,13 @@ class Mail extends Facade /** * Replace the bound instance with a fake. * - * @return void + * @return MailFake */ public static function fake() { - static::swap(new MailFake); + static::swap($fake = new MailFake); + + return $fake; ...
true
Other
laravel
framework
81895941a5ee83e89c1e707cdd5d06515d276b4d.json
Return fake objects from facades
src/Illuminate/Support/Facades/Queue.php
@@ -24,11 +24,13 @@ class Queue extends Facade /** * Replace the bound instance with a fake. * - * @return void + * @return QueueFake */ public static function fake() { - static::swap(new QueueFake(static::getFacadeApplication())); + static::swap($fake = new QueueF...
true
Other
laravel
framework
81895941a5ee83e89c1e707cdd5d06515d276b4d.json
Return fake objects from facades
src/Illuminate/Support/Facades/Storage.php
@@ -16,7 +16,7 @@ class Storage extends Facade * * @param string|null $disk * - * @return void + * @return Filesystem */ public static function fake($disk = null) { @@ -26,22 +26,26 @@ public static function fake($disk = null) $root = storage_path('framework/test...
true
Other
laravel
framework
fa51cef12c67cdc29cee3974943b0f00e8c80192.json
Remove unnecessary type attribute in link element
src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub
@@ -14,7 +14,7 @@ <!-- Fonts --> <link rel="dns-prefetch" href="//fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css"> + <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet"> <!-- Styles --> <link href="...
false
Other
laravel
framework
56f40cff16b2d0adbbd7fedb44015b3395e74b62.json
Change doctype to lowercase
src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub
@@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8">
false
Other
laravel
framework
970c9ed70b053aec7d69487a825577ed6f0329d1.json
remove broken code
src/Illuminate/Auth/RequestGuard.php
@@ -80,10 +80,6 @@ public function validate(array $credentials = []) */ public function setRequest(Request $request) { - if ($this->request !== $request) { - $this->user = null; - } - $this->request = $request; return $this;
false
Other
laravel
framework
d88dfe1e5925fa61f62837359e1b26f799e4110b.json
Support multiple guesses for Policy resolution
src/Illuminate/Auth/Access/Gate.php
@@ -538,8 +538,10 @@ public function getPolicyFor($class) return $this->resolvePolicy($this->policies[$class]); } - if (class_exists($guessedPolicy = $this->guessPolicyName($class))) { - return $this->resolvePolicy($guessedPolicy); + foreach ($this->guessPolicyName($clas...
true
Other
laravel
framework
d88dfe1e5925fa61f62837359e1b26f799e4110b.json
Support multiple guesses for Policy resolution
tests/Integration/Auth/GatePolicyResolutionTest.php
@@ -19,4 +19,31 @@ public function testPolicyCanBeGuessedUsingClassConventions() Gate::getPolicyFor(AuthenticationTestUser::class) ); } + + public function testPolicyCanBeGuessedUsingCallback() + { + Gate::guessPolicyNamesUsing(function () { + return AuthenticationTest...
true
Other
laravel
framework
604dfa79648e966a6511e08ad6b71cdd742bb282.json
Remove mock request and use an instance.
tests/Foundation/FoundationExceptionsHandlerTest.php
@@ -6,6 +6,7 @@ use Exception; use Mockery as m; use RuntimeException; +use Illuminate\Http\Request; use Psr\Log\LoggerInterface; use PHPUnit\Framework\TestCase; use Illuminate\Routing\Redirector; @@ -141,39 +142,40 @@ public function testValidateFileMethod() $argumentExpected = ['input' => 'My input val...
false
Other
laravel
framework
97b2899ed23cb2ddd679702c349108c375525c99.json
Use safe container getter on Pipeline carry
src/Illuminate/Pipeline/Pipeline.php
@@ -164,7 +164,7 @@ protected function carry() : $pipe(...$parameters); return $response instanceof Responsable - ? $response->toResponse($this->container->make(Request::class)) + ? $response->toResponse($this->get...
false
Other
laravel
framework
838a47599dd7fb0597656cf71ce4e18c7d9051b0.json
Fix BoundMethod dockblock
src/Illuminate/Container/BoundMethod.php
@@ -17,6 +17,9 @@ class BoundMethod * @param array $parameters * @param string|null $defaultMethod * @return mixed + * + * @throws \ReflectionException + * @throws \InvalidArgumentException */ public static function call($container, $callback, array $parameters = [], $defaul...
false
Other
laravel
framework
275dc0831fa39a70ab74a989b069cee659a14841.json
Move Arr tests to the right location
tests/Support/SupportArrTest.php
@@ -29,12 +29,18 @@ public function testAdd() { $array = Arr::add(['name' => 'Desk'], 'price', 100); $this->assertEquals(['name' => 'Desk', 'price' => 100], $array); + + $this->assertEquals(['surname' => 'Mövsümov'], Arr::add([], 'surname', 'Mövsümov')); + $this->assertEquals(['deve...
true
Other
laravel
framework
275dc0831fa39a70ab74a989b069cee659a14841.json
Move Arr tests to the right location
tests/Support/SupportHelpersTest.php
@@ -6,7 +6,6 @@ use ArrayAccess; use Mockery as m; use RuntimeException; -use Illuminate\Support\Arr; use PHPUnit\Framework\TestCase; use Illuminate\Support\Optional; use Illuminate\Contracts\Support\Htmlable; @@ -18,196 +17,6 @@ protected function tearDown(): void m::close(); } - public functi...
true
Other
laravel
framework
27164a6bdb0d5571d0d01abd92a53d321d729d26.json
Use proper method name for Pheanstalk
src/Illuminate/Queue/Connectors/BeanstalkdConnector.php
@@ -32,7 +32,7 @@ public function connect(array $config) */ protected function pheanstalk(array $config) { - return Pheanstalk::connect( + return Pheanstalk::create( $config['host'], $config['port'] ?? Pheanstalk::DEFAULT_PORT, $config['timeout'] ?? C...
false
Other
laravel
framework
09e9f8ee8132a727bfe4e0f1c8e36ed67952bad7.json
Apply fixes from StyleCI (#27629)
tests/Queue/QueueBeanstalkdQueueTest.php
@@ -9,7 +9,6 @@ use Illuminate\Container\Container; use Illuminate\Queue\BeanstalkdQueue; use Illuminate\Queue\Jobs\BeanstalkdJob; -use Pheanstalk\Contract\PheanstalkInterface; class QueueBeanstalkdQueueTest extends TestCase {
false
Other
laravel
framework
f0504da67feda7c77fcdddb5c3130d6308b50308.json
Apply fixes from StyleCI (#27628)
tests/Database/DatabaseEloquentModelTest.php
@@ -8,7 +8,6 @@ use Mockery as m; use LogicException; use ReflectionClass; -use RuntimeException; use DateTimeImmutable; use DateTimeInterface; use InvalidArgumentException;
false
Other
laravel
framework
db20d3d754fa212605fad0cbcba833c714fda2e9.json
Remove unused imports
tests/Support/SupportHelpersTest.php
@@ -7,7 +7,6 @@ use Mockery as m; use RuntimeException; use Illuminate\Support\Arr; -use Illuminate\Support\Str; use PHPUnit\Framework\TestCase; use Illuminate\Support\Optional; use Illuminate\Contracts\Support\Htmlable;
false
Other
laravel
framework
e70162b405a767d10b43e597c3de4753c9b87d83.json
Move str tests
tests/Support/SupportHelpersTest.php
@@ -209,48 +209,6 @@ public function testArrayFlatten() $this->assertEquals(['#foo', '#bar', '#baz'], Arr::flatten([['#foo', '#bar'], ['#baz']])); } - public function testStrIs() - { - $this->assertTrue(Str::is('*.dev', 'localhost.dev')); - $this->assertTrue(Str::is('a', 'a')); - ...
true
Other
laravel
framework
e70162b405a767d10b43e597c3de4753c9b87d83.json
Move str tests
tests/Support/SupportStrTest.php
@@ -145,6 +145,13 @@ public function testSlug() $this->assertEquals('سلام-دنیا', Str::slug('سلام دنیا', '-', null)); } + public function testStrStart() + { + $this->assertEquals('/test/string', Str::start('test/string', '/')); + $this->assertEquals('/test/string', Str::start('/test/s...
true
Other
laravel
framework
8cfb90fc06c3166f89ffe0e23c30d49a6453fac2.json
fix failing tests on windows
tests/Integration/Mail/RenderingMailWithLocaleTest.php
@@ -31,14 +31,14 @@ public function testMailableRendersInDefaultLocale() { $mail = new RenderedTestMail; - $this->assertStringContainsString("name\n", $mail->render()); + $this->assertStringContainsString('name'.PHP_EOL, $mail->render()); } public function testMailableRendersIn...
false
Other
laravel
framework
e2e3dffbe0b3062620b7f6fd1e25f04e4f461909.json
Use new fromShellCommandline method
src/Illuminate/Console/Scheduling/Event.php
@@ -208,9 +208,7 @@ protected function runCommandInForeground(Container $container) { $this->callBeforeCallbacks($container); - (new Process( - $this->buildCommand(), base_path(), null, null, null - ))->run(); + Process::fromShellCommandline($this->buildCommand(), base_pa...
false
Other
laravel
framework
9a9b43e610dbfbcab5b77d584539321f61883097.json
Fix incorrect param type
src/Illuminate/Queue/Listener.php
@@ -126,7 +126,7 @@ public function makeProcess($connection, $queue, ListenerOptions $options) /** * Add the environment option to the given command. * - * @param string $command + * @param array $command * @param \Illuminate\Queue\ListenerOptions $options * @return array ...
false
Other
laravel
framework
c821cbf6f20fca4c50aa9d8fb08f71425afc07b8.json
Add union and union all tests for Postgres
tests/Database/DatabaseQueryBuilderTest.php
@@ -772,6 +772,13 @@ public function testUnions() $this->assertEquals($expectedSql, $builder->toSql()); $this->assertEquals([0 => 10, 1 => 1, 2 => 11, 3 => 2], $builder->getBindings()); + $builder = $this->getPostgresBuilder(); + $expectedSql = '(select "name" from "users" where "id" =...
false
Other
laravel
framework
06d37a4ee79da306d30f7daa89a612a3f859b34a.json
Add union with limit and offset test for Postgres
tests/Database/DatabaseQueryBuilderTest.php
@@ -826,6 +826,20 @@ public function testUnionLimitsAndOffsets() $builder->union($this->getBuilder()->select('*')->from('dogs')); $builder->skip(5)->take(10); $this->assertEquals('select * from "users" union select * from "dogs" limit 10 offset 5', $builder->toSql()); + + $expectedSql ...
false
Other
laravel
framework
e7aa0e9785214aaeefb3c2822e35b84a2d944ba5.json
Improve union all queries in Postgres grammar
src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
@@ -8,6 +8,25 @@ class PostgresGrammar extends Grammar { + /** + * The components that make up a select clause. + * + * @var array + */ + protected $selectComponents = [ + 'aggregate', + 'columns', + 'from', + 'joins', + 'wheres', + 'groups', + ...
false
Other
laravel
framework
76c3d4cc2697c64d02e0e2239274ebf84656b857.json
return whatever the mailer returns
src/Illuminate/Mail/Mailable.php
@@ -147,10 +147,10 @@ class Mailable implements MailableContract, Renderable */ public function send(MailerContract $mailer) { - $this->withLocale($this->locale, function () use ($mailer) { + return $this->withLocale($this->locale, function () use ($mailer) { Container::getIns...
false
Other
laravel
framework
0c7879c305c2ad65fab1a617fabcee68d91cf6f5.json
update hash param
src/Illuminate/Auth/AuthManager.php
@@ -156,7 +156,8 @@ public function createTokenDriver($name, $config) $this->createUserProvider($config['provider'] ?? null), $this->app['request'], $config['input_key'] ?? 'api_token', - $config['storage_key'] ?? 'api_token' + $config['storage_key'] ?? 'api_...
false
Other
laravel
framework
fe1d67b0fbda54c78f3e1ee217a2fc36edd3c79c.json
Apply fixes from StyleCI (#27587)
tests/Auth/AuthTokenGuardTest.php
@@ -33,7 +33,6 @@ public function testUserCanBeRetrievedByQueryStringVariable() $this->assertEquals(1, $guard->id()); } - public function testTokenCanBeHashed() { $provider = m::mock(UserProvider::class);
false
Other
laravel
framework
e2e16744bea55dab43a4b2093f6de67720e6a28d.json
add support for sha256 hashing on token guard
src/Illuminate/Auth/TokenGuard.php
@@ -31,17 +31,31 @@ class TokenGuard implements Guard */ protected $storageKey; + /** + * Indicates if the API token is hashed in storage. + * + * @var bool + */ + protected $hash = false; + /** * Create a new authentication guard. * * @param \Illuminate\Contra...
true
Other
laravel
framework
e2e16744bea55dab43a4b2093f6de67720e6a28d.json
add support for sha256 hashing on token guard
tests/Auth/AuthTokenGuardTest.php
@@ -33,6 +33,25 @@ public function testUserCanBeRetrievedByQueryStringVariable() $this->assertEquals(1, $guard->id()); } + + public function testTokenCanBeHashed() + { + $provider = m::mock(UserProvider::class); + $user = new AuthTokenGuardTestUser; + $user->id = 1; + $...
true
Other
laravel
framework
1db746d0a8273720632f5cd46a32ef451111e8d5.json
Apply fixes from StyleCI (#27586)
src/Illuminate/Auth/TokenGuard.php
@@ -68,7 +68,7 @@ public function user() if (! empty($token)) { $user = $this->provider->retrieveByCredentials([ - $this->storageKey => $token + $this->storageKey => $token, ]); }
false
Other
laravel
framework
ad027d845fe3eec20cecdbe6f00d971a065d30c3.json
Allow configuration of token guard keys This change allows users to configure the token guard input and storage keys in the auth guard configuration. It's useful they want something else than the default `api_token` name.
src/Illuminate/Auth/AuthManager.php
@@ -154,7 +154,9 @@ public function createTokenDriver($name, $config) // user in the database or another persistence layer where users are. $guard = new TokenGuard( $this->createUserProvider($config['provider'] ?? null), - $this->app['request'] + $this->app['request'...
false
Other
laravel
framework
150a63d491c89f73a8153c4548406e776e5f150a.json
allow registration of guesser callback'
src/Illuminate/Auth/Access/Gate.php
@@ -64,6 +64,13 @@ class Gate implements GateContract */ protected $stringCallbacks = []; + /** + * The callback to be used to guess policy names. + * + * @var callable|null + */ + protected $guessPolicyNamesUsingCallback; + /** * Create a new gate instance. * @@ -550...
false
Other
laravel
framework
dee4d82e0259b270413573c7792d92d49b51fe2a.json
add tests for policy resolution
src/Illuminate/Auth/Access/Gate.php
@@ -550,7 +550,7 @@ public function getPolicyFor($class) */ protected function guessPolicyName($class) { - return dirname(str_replace('\\', '/', $class)).'\\Policies\\'.class_basename($class).'Policy'; + return str_replace('/', '\\', dirname(str_replace('\\', '/', $class)).'\\Policies\\'.c...
true
Other
laravel
framework
dee4d82e0259b270413573c7792d92d49b51fe2a.json
add tests for policy resolution
tests/Integration/Auth/Fixtures/Policies/AuthenticationTestUserPolicy.php
@@ -0,0 +1,8 @@ +<?php + +namespace Illuminate\Tests\Integration\Auth\Fixtures\Policies; + +class AuthenticationTestUserPolicy +{ + // +}
true