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
6d5377bb0f04da3e9e233292ea7fc49e4ab02d3d.json
Apply fixes from StyleCI
tests/Support/SupportHelpersTest.php
@@ -600,6 +600,7 @@ public function testRetryWithPassingSleepCallback() throw new RuntimeException; }, function ($attempt, $exception) { $this->assertInstanceOf(RuntimeException::class, $exception); + return $attempt * 100; });
false
Other
laravel
framework
105037b619bb1e180e79e2e0c634294d1859b406.json
Apply fixes from StyleCI
src/Illuminate/Foundation/Testing/DatabaseTransactions.php
@@ -20,7 +20,7 @@ public function beginDatabaseTransaction() $connection->unsetEventDispatcher(); $connection->beginTransaction(); $connection->setEventDispatcher($dispatcher); - + if ($this->app->resolved('db.transactions')) { $this->app-...
false
Other
laravel
framework
21959000a2d64e1aae8d8c12d256c0a0234715f2.json
Add missing docblock (#42501)
src/Illuminate/Support/Facades/Http.php
@@ -21,6 +21,7 @@ * @method static \Illuminate\Http\Client\PendingRequest dd() * @method static \Illuminate\Http\Client\PendingRequest dump() * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleepMilliseconds = 0, ?callable $when = null, bool $throw = true) + * @method static \Illumi...
false
Other
laravel
framework
ffa6cca4285f87cf19b6dbc9986fb73fca04abd6.json
Introduce Arr::prependKeysWith helper (#42448) * Adding new Arr helper to prepend all associative array key names with a provided prefix. * Undoing incorrect delete of phpunit.xml.dist * use Collections for mapping the keys. * replace helper function by Collection class * typo * fix styleCI issues * ...
src/Illuminate/Collections/Arr.php
@@ -466,6 +466,20 @@ public static function keyBy($array, $keyBy) return Collection::make($array)->keyBy($keyBy)->all(); } + /** + * Prepend the key names of an associative array. + * + * @param array $array + * @param string $prependWith + * @return array + */ + public...
true
Other
laravel
framework
ffa6cca4285f87cf19b6dbc9986fb73fca04abd6.json
Introduce Arr::prependKeysWith helper (#42448) * Adding new Arr helper to prepend all associative array key names with a provided prefix. * Undoing incorrect delete of phpunit.xml.dist * use Collections for mapping the keys. * replace helper function by Collection class * typo * fix styleCI issues * ...
tests/Support/SupportArrTest.php
@@ -1076,4 +1076,25 @@ public function testKeyBy() '498' => ['id' => '498', 'data' => 'hgi'], ], Arr::keyBy($array, 'id')); } + + public function testPrependKeysWith() + { + $array = [ + 'id' => '123', + 'data' => '456', + 'list' => [1, 2, 3], + ...
true
Other
laravel
framework
55a6f1cdb4b107d31ca5e0d4b35cfd0f76dbb6d9.json
enhance docblocks of Validation Factory (#42407)
src/Illuminate/Validation/Factory.php
@@ -34,35 +34,35 @@ class Factory implements FactoryContract /** * All of the custom validator extensions. * - * @var array + * @var array<string, \Closure|string> */ protected $extensions = []; /** * All of the custom implicit validator extensions. * - * @var ...
false
Other
laravel
framework
afb46417b352e6b6693af591497fe2752f3d83af.json
Update email.blade.php (#42388) * Update email.blade.php Change switch to match * Update email.blade.php * Update src/Illuminate/Notifications/resources/views/email.blade.php Co-authored-by: Faissal Wahabali <fwahabali@gmail.com> Co-authored-by: Faissal Wahabali <fwahabali@gmail.com>
src/Illuminate/Notifications/resources/views/email.blade.php
@@ -19,14 +19,10 @@ {{-- Action Button --}} @isset($actionText) <?php - switch ($level) { - case 'success': - case 'error': - $color = $level; - break; - default: - $color = 'primary'; - } + $color = match ($level) { + 'success', 'error' => $level...
false
Other
laravel
framework
dc724350ac1e9bf5491c6cc1e436b38f6f0973df.json
add missing onLastPage to CursorPaginator (#42301)
src/Illuminate/Pagination/CursorPaginator.php
@@ -121,6 +121,16 @@ public function onFirstPage() return is_null($this->cursor) || ($this->cursor->pointsToPreviousItems() && ! $this->hasMore); } + /** + * Determine if the paginator is on the last page. + * + * @return bool + */ + public function onLastPage() + { + ret...
true
Other
laravel
framework
dc724350ac1e9bf5491c6cc1e436b38f6f0973df.json
add missing onLastPage to CursorPaginator (#42301)
tests/Pagination/CursorPaginatorTest.php
@@ -78,6 +78,24 @@ public function testCanTransformPaginatorItems() $this->assertSame([['id' => 6], ['id' => 7]], $p->items()); } + public function testLengthAwarePaginatorisOnFirstAndLastPage() + { + $paginator = new CursorPaginator([['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4]], 2, ...
true
Other
laravel
framework
c51ef988d8c6d10d5613dc58f4fdd255edf70216.json
Fix issue with pusher channel (#42287)
src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php
@@ -4,6 +4,7 @@ use Illuminate\Broadcasting\BroadcastException; use Illuminate\Support\Arr; +use Illuminate\Support\Collection; use Pusher\ApiErrorException; use Pusher\Pusher; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; @@ -118,10 +119,12 @@ public function broadcast(array $channels, $...
false
Other
laravel
framework
e022b2cd73e2f32d90c2b1bfbdad80d6d21b6c43.json
remove unneeded check
src/Illuminate/Auth/DatabaseUserProvider.php
@@ -115,10 +115,6 @@ public function retrieveByCredentials(array $credentials) $query = $this->connection->table($this->table); foreach ($credentials as $key => $value) { - if (str_contains($key, 'password')) { - continue; - } - if (is_array($value) ...
false
Other
laravel
framework
e3d6e82c095d29ef85bfd41e4f28f25093bf49b2.json
Apply fixes from StyleCI
tests/Auth/AuthDatabaseUserProviderTest.php
@@ -142,7 +142,7 @@ public function testRetrieveByCredentialsWithMultiplyPasswordsReturnsNull() $provider = new DatabaseUserProvider($conn, $hasher, 'foo'); $user = $provider->retrieveByCredentials([ 'password' => 'dayle', - 'password2' => 'night' + 'password2' => 'n...
true
Other
laravel
framework
e3d6e82c095d29ef85bfd41e4f28f25093bf49b2.json
Apply fixes from StyleCI
tests/Auth/AuthEloquentUserProviderTest.php
@@ -122,7 +122,7 @@ public function testRetrieveByCredentialsWithMultiplyPasswordsReturnsNull() $provider = $this->getProviderMock(); $user = $provider->retrieveByCredentials([ 'password' => 'dayle', - 'password2' => 'night' + 'password2' => 'night', ]); ...
true
Other
laravel
framework
d323312a15d7f18fe04dfdb298340f234ad28ff1.json
Apply fixes from StyleCI
src/Illuminate/Database/Eloquent/Factories/Factory.php
@@ -465,7 +465,7 @@ protected function expandAttributes(array $definition) } $definition[$key] = $attribute; - + return $attribute; }) ->all();
false
Other
laravel
framework
6e0fb37ca7d432e95d1386bdb1dab56b9b36ffd7.json
Apply fixes from StyleCI
src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php
@@ -66,7 +66,8 @@ protected function withoutExceptionHandling(array $except = []) $this->originalExceptionHandler = app(ExceptionHandler::class); } - $this->app->instance(ExceptionHandler::class, new class($this->originalExceptionHandler, $except) implements ExceptionHandler { + $t...
false
Other
laravel
framework
a880574f5ada4c9aa0c9353a8cfae3e71f981e7a.json
Apply fixes from StyleCI
tests/Foundation/Bootstrap/HandleExceptionsTest.php
@@ -7,7 +7,6 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Bootstrap\HandleExceptions; use Illuminate\Log\LogManager; -use Illuminate\Support\Str; use Mockery as m; use Monolog\Handler\NullHandler; use PHPUnit\Framework\TestCase; @@ -52,7 +51,7 @@ public function testPhpDeprecations() ...
false
Other
laravel
framework
618114204c2be4e1e305cb1ed502d16e0ec1f0c7.json
fix docblock of database component (#42182)
src/Illuminate/Database/Connection.php
@@ -167,7 +167,7 @@ class Connection implements ConnectionInterface /** * All of the callbacks that should be invoked before a query is executed. * - * @var array + * @var \Closure[] */ protected $beforeExecutingCallbacks = []; @@ -181,14 +181,14 @@ class Connection implements Conn...
true
Other
laravel
framework
618114204c2be4e1e305cb1ed502d16e0ec1f0c7.json
fix docblock of database component (#42182)
src/Illuminate/Database/ConnectionResolver.php
@@ -7,7 +7,7 @@ class ConnectionResolver implements ConnectionResolverInterface /** * All of the registered connections. * - * @var array + * @var \Illuminate\Database\ConnectionInterface[] */ protected $connections = []; @@ -21,7 +21,7 @@ class ConnectionResolver implements Connec...
true
Other
laravel
framework
618114204c2be4e1e305cb1ed502d16e0ec1f0c7.json
fix docblock of database component (#42182)
src/Illuminate/Database/DatabaseManager.php
@@ -38,14 +38,14 @@ class DatabaseManager implements ConnectionResolverInterface /** * The active connection instances. * - * @var array + * @var array<string, \Illuminate\Database\Connection> */ protected $connections = []; /** * The custom connection resolvers. *...
true
Other
laravel
framework
ad18afca429e8e2c5ba9eb00eceb0de1572a0d96.json
Add test for empty middleware groups (#42188)
tests/Integration/Routing/FluentRoutingTest.php
@@ -46,6 +46,21 @@ public function testMiddlewareRunWhenRegisteredAsArrayOrParams() $this->assertSame('1_2', $this->get('before_after')->content()); $this->assertSame('1_2', $this->get('both_before')->content()); $this->assertSame('1_2', $this->get('both_after')->content()); + $this->a...
false
Other
laravel
framework
6741fa8ffb5ec4339eff98132518d6f6c501eca6.json
Fix deprecation with empty rules (#42213)
src/Illuminate/Validation/ValidationRuleParser.php
@@ -97,7 +97,7 @@ protected function explodeExplicitRule($rule, $attribute) return array_map( [$this, 'prepareRule'], $rule, - array_fill(array_key_first($rule), count($rule), $attribute) + array_fill((int) array_key_first($rule), count($rule), $attribute) ...
true
Other
laravel
framework
6741fa8ffb5ec4339eff98132518d6f6c501eca6.json
Fix deprecation with empty rules (#42213)
tests/Validation/ValidationRuleParserTest.php
@@ -55,6 +55,13 @@ public function testEmptyRulesArePreserved() ], $rules); } + public function testEmptyRulesCanBeExploded() + { + $parser = new ValidationRuleParser(['foo' => 'bar']); + + $this->assertIsObject($parser->explode(['foo' => []])); + } + public function testCond...
true
Other
laravel
framework
f6e9f54385f167a17b25445f8d855e754a4f50d6.json
Fix deprecation issue with translator (#42216)
src/Illuminate/Translation/Translator.php
@@ -218,8 +218,8 @@ protected function makeReplacements($line, array $replace) $shouldReplace = []; foreach ($replace as $key => $value) { - $shouldReplace[':'.Str::ucfirst($key)] = Str::ucfirst($value); - $shouldReplace[':'.Str::upper($key)] = Str::upper($value); + ...
true
Other
laravel
framework
f6e9f54385f167a17b25445f8d855e754a4f50d6.json
Fix deprecation issue with translator (#42216)
tests/Translation/TranslationTranslatorTest.php
@@ -203,6 +203,14 @@ public function testGetJsonForNonExistingReturnsSameKeyAndReplaces() $this->assertSame('foo baz', $t->get('foo :message', ['message' => 'baz'])); } + public function testEmptyFallbacks() + { + $t = new Translator($this->getLoader(), 'en'); + $t->getLoader()->shou...
true
Other
laravel
framework
832d1df73034e298f86124feae695203521ed57e.json
Fix refresh during down (#42217)
src/Illuminate/Foundation/Console/stubs/maintenance-mode.stub
@@ -69,6 +69,10 @@ if (isset($data['retry'])) { header('Retry-After: '.$data['retry']); } +if (isset($data['refresh'])) { + header('Refresh: '.$data['refresh']); +} + echo $data['template']; exit;
false
Other
laravel
framework
48fbd8dae0edbec88d7afe03cb8d6e500d2121d6.json
Update request.stub (#42154)
src/Illuminate/Foundation/Console/stubs/request.stub
@@ -19,7 +19,7 @@ class {{ class }} extends FormRequest /** * Get the validation rules that apply to the request. * - * @return array + * @return array<string, mixed> */ public function rules() {
false
Other
laravel
framework
d787947998089e6eac4883d90418601fdb5c529d.json
Fix typo in Factory::state (#42144)
src/Illuminate/Database/Eloquent/Factories/Factory.php
@@ -467,7 +467,7 @@ protected function expandAttributes(array $definition) /** * Add a new state transformation to the model definition. * - * @param (callable(array<string, mixed>, \Illuminate\Database\Eloquent\Model|null=): array<string, mixed>)|array<string, mixed> $state + * @param (call...
false
Other
laravel
framework
6b87641b7a9db734059b557a3808b8ae18b200f1.json
throw deadlock exception (#42129)
src/Illuminate/Database/Concerns/ManagesTransactions.php
@@ -3,6 +3,7 @@ namespace Illuminate\Database\Concerns; use Closure; +use Illuminate\Database\DeadlockException; use RuntimeException; use Throwable; @@ -87,7 +88,11 @@ protected function handleTransactionException(Throwable $e, $currentAttempt, $ma $this->getName(), $this->transactions ...
true
Other
laravel
framework
6b87641b7a9db734059b557a3808b8ae18b200f1.json
throw deadlock exception (#42129)
src/Illuminate/Database/DeadlockException.php
@@ -0,0 +1,10 @@ +<?php + +namespace Illuminate\Database; + +use PDOException; + +class DeadlockException extends PDOException +{ + // +}
true
Other
laravel
framework
c9d34b7be0611d26f3e46669934cf542cc5e9e21.json
Add str() and string() to request object
src/Illuminate/Http/Concerns/InteractsWithInput.php
@@ -542,4 +542,28 @@ public function dump($keys = []) return $this; } + + /** + * Retrieve input from the request as a stringable. + * + * @param string $key + * @param mixed $default + * @return \Illuminate\Support\Stringable + */ + public function str($key, $default =...
false
Other
laravel
framework
10061f1fb7977bc6b66da690f1d4b34b3a924982.json
Apply fixes from StyleCI
tests/Filesystem/FilesystemAdapterTest.php
@@ -456,6 +456,6 @@ public function testGetAllFiles() $filesystemAdapter = new FilesystemAdapter($this->filesystem, $this->adapter); - $this->assertSame($filesystemAdapter->files(),['body.txt','existing.txt','file.txt','file1.txt']); + $this->assertSame($filesystemAdapter->files(), ['body.txt...
false
Other
laravel
framework
d3634359a13a078839363cf34ab24d197ffe4a69.json
fix array keys from cached routes (#42078) Introduced by https://github.com/laravel/framework/pull/35714. Removed the slash to match the same array key as in src/Illuminate/Routing/RouteCollection.php:60
src/Illuminate/Routing/CompiledRouteCollection.php
@@ -252,11 +252,7 @@ public function getRoutesByMethod() }) ->map(function (Collection $routes) { return $routes->mapWithKeys(function (Route $route) { - if ($domain = $route->getDomain()) { - return [$domain.'/'.$route->uri => $route]...
true
Other
laravel
framework
d3634359a13a078839363cf34ab24d197ffe4a69.json
fix array keys from cached routes (#42078) Introduced by https://github.com/laravel/framework/pull/35714. Removed the slash to match the same array key as in src/Illuminate/Routing/RouteCollection.php:60
tests/Integration/Routing/CompiledRouteCollectionTest.php
@@ -527,13 +527,13 @@ public function testRouteWithSamePathAndSameMethodButDiffDomainNameWithOptionsMe $this->assertEquals([ 'HEAD' => [ - 'foo.localhost/same/path' => $routes['foo_domain'], - 'bar.localhost/same/path' => $routes['bar_domain'], + 'foo...
true
Other
laravel
framework
7ae798c938b0a530af82b5bdb607230d3da4f7ca.json
remove unused private method (#42115)
src/Illuminate/Redis/Connections/PhpRedisConnection.php
@@ -553,19 +553,6 @@ public function disconnect() $this->client->close(); } - /** - * Apply a prefix to the given key if necessary. - * - * @param string $key - * @return string - */ - private function applyPrefix($key) - { - $prefix = (string) $this->client->getOpt...
false
Other
laravel
framework
c4354923bc7642aa87827c45f4112c5bec8cff77.json
fix php 8.2 deprication (#42117)
src/Illuminate/Database/Eloquent/SoftDeletes.php
@@ -199,7 +199,7 @@ public function isForceDeleting() */ public function getDeletedAtColumn() { - return defined('static::DELETED_AT') ? static::DELETED_AT : 'deleted_at'; + return defined(static::class.'::DELETED_AT') ? static::DELETED_AT : 'deleted_at'; } /**
false
Other
laravel
framework
f1d20b859edb2b2868871e25bad21541b442b705.json
Apply fixes from StyleCI
src/Illuminate/Session/Store.php
@@ -189,7 +189,7 @@ protected function prepareErrorBagForSerialization() foreach ($this->attributes['errors']->getBags() as $key => $value) { $errors[$key] = [ 'format' => $value->getFormat(), - 'messages' => $value->getMessages() + 'messages' => $val...
false
Other
laravel
framework
2fb344e80838297c358b6a5800601a9b0e1ece1b.json
Apply fixes from StyleCI
src/Illuminate/Database/Connection.php
@@ -20,7 +20,6 @@ use Illuminate\Database\Schema\Builder as SchemaBuilder; use Illuminate\Support\Arr; use Illuminate\Support\Traits\Macroable; -use LogicException; use PDO; use PDOStatement; use RuntimeException;
false
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
src/Illuminate/Database/Eloquent/Builder.php
@@ -498,6 +498,29 @@ public function findOrNew($id, $columns = ['*']) return $this->newModelInstance(); } + /** + * Find a model by its primary key or call a callback. + * + * @param mixed $id + * @param \Closure|array $columns + * @param \Closure|null $callback + * @ret...
true
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -711,6 +711,37 @@ public function findOrFail($id, $columns = ['*']) throw (new ModelNotFoundException)->setModel(get_class($this->related), $id); } + /** + * Find a related model by its primary key or call a callback. + * + * @param mixed $id + * @param \Closure|array $columns ...
true
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php
@@ -388,6 +388,37 @@ public function findOrFail($id, $columns = ['*']) throw (new ModelNotFoundException)->setModel(get_class($this->related), $id); } + /** + * Find a related model by its primary key or call a callback. + * + * @param mixed $id + * @param \Closure|array $columns ...
true
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
tests/Database/DatabaseEloquentBuilderTest.php
@@ -154,6 +154,75 @@ public function testFindOrFailMethodWithManyUsingCollectionThrowsModelNotFoundEx $builder->findOrFail(new Collection([1, 2]), ['column']); } + public function testFindOrMethod() + { + $builder = m::mock(Builder::class.'[first]', [$this->getMockQueryBuilder()]); + ...
true
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
tests/Database/DatabaseEloquentHasManyThroughIntegrationTest.php
@@ -201,6 +201,80 @@ public function testFindOrFailWithManyUsingCollectionThrowsAnException() HasManyThroughTestCountry::first()->posts()->findOrFail(new Collection([1, 2])); } + public function testFindOrMethod() + { + HasManyThroughTestCountry::create(['id' => 1, 'name' => 'United States ...
true
Other
laravel
framework
b062355f05f07f72119d868e065aac0c0c958ffd.json
Add a `findOr` method to Eloquent (#42092) * Add a `findOr` method to Eloquent * Linting
tests/Integration/Database/EloquentBelongsToManyTest.php
@@ -413,6 +413,77 @@ public function testFindOrNewMethod() $this->assertInstanceOf(Tag::class, $post->tags()->findOrNew(666)); } + public function testFindOrMethod() + { + $post = Post::create(['title' => Str::random()]); + $post->tags()->create(['name' => Str::random()]); + + ...
true
Other
laravel
framework
8c737f054fe54076556870ae6a5b4745b554a063.json
add the beforeRefreshingDatabase function (#42073)
src/Illuminate/Foundation/Testing/RefreshDatabase.php
@@ -16,6 +16,8 @@ trait RefreshDatabase */ public function refreshDatabase() { + $this->beforeRefreshingDatabase(); + $this->usingInMemoryDatabase() ? $this->refreshInMemoryDatabase() : $this->refreshTestDatabase(); @@ -126,6 +128,16 @@ p...
false
Other
laravel
framework
73f7cd4772584bcb5dc297c9350a722d26f1248a.json
Apply fixes from StyleCI
src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php
@@ -54,7 +54,7 @@ public function handle() $executions[] = $execution = new Process([ PHP_BINARY, defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', - 'schedule:run' + 'schedule:run', ]); ...
false
Other
laravel
framework
6fea6c271086e2ad017a6078e1ee457a2b8c398e.json
Apply fixes from StyleCI
src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php
@@ -41,7 +41,7 @@ public function handle() $executions[] = $execution = new Process([ PHP_BINARY, defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', - 'schedule:run' + 'schedule:run', ]); ...
false
Other
laravel
framework
b18678b80d6379edd15a841d90c7be8c7d20a734.json
Remove redundant collection (#42074)
src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
@@ -62,7 +62,7 @@ protected function cleanArray(array $data, $keyPrefix = '') $data[$key] = $this->cleanValue($keyPrefix.$key, $value); } - return collect($data)->all(); + return $data; } /**
false
Other
laravel
framework
300c66f08d030f242ba4c719bddd63e1d7f5a200.json
Update docblock (#42029)
src/Illuminate/Foundation/Exceptions/Handler.php
@@ -54,7 +54,7 @@ class Handler implements ExceptionHandlerContract /** * A list of the exception types that are not reported. * - * @var string[] + * @var array<int, class-string<\Throwable>> */ protected $dontReport = []; @@ -108,7 +108,7 @@ class Handler implements ExceptionHand...
false
Other
laravel
framework
57de940b4242a606ca5af61453bf401e369f460b.json
Update Container.php (#41992) Optimize repeat
src/Illuminate/Container/Container.php
@@ -426,9 +426,7 @@ public function scoped($abstract, $concrete = null) public function scopedIf($abstract, $concrete = null) { if (! $this->bound($abstract)) { - $this->scopedInstances[] = $abstract; - - $this->singleton($abstract, $concrete); + $this->scoped($abstra...
false
Other
laravel
framework
e9e805f36f767ace53791e88830042fcf69b7513.json
Update Blade.php (#41990)
src/Illuminate/Support/Facades/Blade.php
@@ -17,7 +17,7 @@ * @method static void compile(string|null $path = null) * @method static void component(string $class, string|null $alias = null, string $prefix = '') * @method static void components(array $components, string $prefix = '') - * @method static void anonymousComponentNamespace(string $directory, s...
false
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Bus/DatabaseBatchRepository.php
@@ -286,9 +286,7 @@ public function pruneUnfinished(DateTimeInterface $before) */ public function transaction(Closure $callback) { - return $this->connection->transaction(function () use ($callback) { - return $callback(); - }); + return $this->connection->transaction(fn ...
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Container/ContextualBindingBuilder.php
@@ -91,8 +91,6 @@ public function giveTagged($tag) */ public function giveConfig($key, $default = null) { - $this->give(function ($container) use ($key, $default) { - return $container->get('config')->get($key, $default); - }); + $this->give(fn ($container) => $container-...
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Database/Eloquent/Factories/Factory.php
@@ -296,9 +296,7 @@ public function createQuietly($attributes = [], ?Model $parent = null) */ public function lazy(array $attributes = [], ?Model $parent = null) { - return function () use ($attributes, $parent) { - return $this->create($attributes, $parent); - }; + retur...
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Http/Request.php
@@ -726,8 +726,6 @@ public function __isset($key) */ public function __get($key) { - return Arr::get($this->all(), $key, function () use ($key) { - return $this->route($key); - }); + return Arr::get($this->all(), $key, fn () => $this->route($key)); } }
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Pagination/PaginationState.php
@@ -12,13 +12,9 @@ class PaginationState */ public static function resolveUsing($app) { - Paginator::viewFactoryResolver(function () use ($app) { - return $app['view']; - }); + Paginator::viewFactoryResolver(fn () => $app['view']); - Paginator::currentPathResolve...
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Support/Env.php
@@ -96,8 +96,6 @@ public static function get($key, $default = null) return $value; }) - ->getOrCall(function () use ($default) { - return value($default); - }); + ->getOrCall(fn () => value($default)); } }
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Testing/ParallelRunner.php
@@ -135,9 +135,7 @@ protected function forEachProcess($callback) { collect(range(1, $this->options->processes()))->each(function ($token) use ($callback) { tap($this->createApplication(), function ($app) use ($callback, $token) { - ParallelTesting::resolveTokenUsing(function ()...
true
Other
laravel
framework
b94a68253d77944d68ba22f3391c83df479e1617.json
Use arrow functions (#41963)
src/Illuminate/Validation/Validator.php
@@ -381,9 +381,7 @@ protected function replacePlaceholderInString(string $value) */ public function after($callback) { - $this->after[] = function () use ($callback) { - return $callback($this); - }; + $this->after[] = fn () => $callback($this); return $this; ...
true
Other
laravel
framework
8a10e3f61e05c05829ca80ac23656b6bffe38aba.json
trim zwnbsp (#41949) * trim zwnbsp * fix zwnbsp Co-authored-by: j <j@qq.com>
src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
@@ -53,7 +53,7 @@ protected function transform($key, $value) return $value; } - return is_string($value) ? preg_replace('~^\s+|\s+$~iu', '', $value) : $value; + return is_string($value) ? preg_replace('~^[\s]+|[\s]+$~iu', '', $value) : $value; } /**
true
Other
laravel
framework
8a10e3f61e05c05829ca80ac23656b6bffe38aba.json
trim zwnbsp (#41949) * trim zwnbsp * fix zwnbsp Co-authored-by: j <j@qq.com>
tests/Foundation/Http/Middleware/TrimStringsTest.php
@@ -34,7 +34,9 @@ public function testTrimStringsNBSP() $middleware = new TrimStrings; $symfonyRequest = new SymfonyRequest([ // Here has some NBSP, but it still display to space. + // Please note, do not edit in browser 'abc' => '  123   ', + 'zwnbsp'...
true
Other
laravel
framework
83be3c88bc242b757e957648a1dcb53fd9b3d497.json
Apply fixes from StyleCI
src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
@@ -413,7 +413,6 @@ public function compileGetAllViews() return "select name, type from sys.objects where type = 'V'"; } - /** * Create the column definition for a char type. *
true
Other
laravel
framework
83be3c88bc242b757e957648a1dcb53fd9b3d497.json
Apply fixes from StyleCI
src/Illuminate/Database/Schema/SqlServerBuilder.php
@@ -30,7 +30,7 @@ public function dropDatabaseIfExists($name) ); } - /** + /** * Drop all tables from the database. * * @return void
true
Other
laravel
framework
83be3c88bc242b757e957648a1dcb53fd9b3d497.json
Apply fixes from StyleCI
tests/Integration/Database/SqlServer/DatabaseSqlServerSchemaBuilderTest.php
@@ -63,7 +63,7 @@ public function testGetAllTablesAndColumnListing() public function testGetAllViews() { - DB::connection('sqlsrv')->statement(<<<SQL + DB::connection('sqlsrv')->statement(<<<'SQL' CREATE VIEW users_view AS SELECT name,age from users; @@ -76,7 +76,7 @@ public function testGe...
true
Other
laravel
framework
83be3c88bc242b757e957648a1dcb53fd9b3d497.json
Apply fixes from StyleCI
tests/Integration/Database/Sqlite/DatabaseSqliteSchemaBuilderTest.php
@@ -70,7 +70,7 @@ public function testGetAllTablesAndColumnListing() public function testGetAllViews() { - DB::connection('conn1')->statement(<<<SQL + DB::connection('conn1')->statement(<<<'SQL' CREATE VIEW users_view AS SELECT name,age from users; @@ -83,7 +83,7 @@ public function testGetA...
true
Other
laravel
framework
fab61079afd17483ec91e6a897a912fd3990d97e.json
add test (#41945)
tests/Database/DatabaseEloquentBuilderTest.php
@@ -1106,6 +1106,17 @@ public function testWithCountAndSelect() $this->assertSame('select "id", (select count(*) from "eloquent_builder_test_model_close_related_stubs" where "eloquent_builder_test_model_parent_stubs"."foo_id" = "eloquent_builder_test_model_close_related_stubs"."id") as "foo_count" from "eloque...
false
Other
laravel
framework
5790b491a698237aa76a0e1df6213b4cbcec0424.json
Use arrow functions (#41930)
src/Illuminate/Foundation/Exceptions/Handler.php
@@ -185,9 +185,7 @@ public function renderable(callable $renderUsing) public function map($from, $to = null) { if (is_string($to)) { - $to = function ($exception) use ($to) { - return new $to('', 0, $exception); - }; + $to = fn ($exception) => new $to('...
false
Other
laravel
framework
bd3ac842a4af4d86576234b08371ee54e1920772.json
Fix empty paths for server.php (#41933)
src/Illuminate/Foundation/resources/server.php
@@ -3,7 +3,7 @@ $publicPath = getcwd(); $uri = urldecode( - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '' ); // This file allows us to emulate Apache's "mod_rewrite" functionality from the
false
Other
laravel
framework
75bf702169d0d32ee9b0c4fbf3cbd6d7447829a3.json
Update Handler.php (#41935) fix #41925 review comments
src/Illuminate/Foundation/Exceptions/Handler.php
@@ -68,7 +68,7 @@ class Handler implements ExceptionHandlerContract /** * A map of exceptions with their corresponding custom log levels. * - * @var array<string, string> + * @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*> */ protected $levels = []; @@ -220,7 +220,7 @@ p...
false
Other
laravel
framework
78cb588f9f391016632b3f96755c851a712a442f.json
use arrow function (#41895)
src/Illuminate/Routing/AbstractRouteCollection.php
@@ -79,9 +79,9 @@ protected function matchAgainstRoutes(array $routes, $request, $includingMethod return $route->isFallback; }); - return $routes->merge($fallbacks)->first(function (Route $route) use ($request, $includingMethod) { - return $route->matches($request, $includingMe...
true
Other
laravel
framework
78cb588f9f391016632b3f96755c851a712a442f.json
use arrow function (#41895)
src/Illuminate/Routing/CreatesRegularExpressionRouteConstraints.php
@@ -72,8 +72,7 @@ public function whereIn($parameters, array $values) protected function assignExpressionToParameters($parameters, $expression) { return $this->where(collect(Arr::wrap($parameters)) - ->mapWithKeys(function ($parameter) use ($expression) { - r...
true
Other
laravel
framework
78cb588f9f391016632b3f96755c851a712a442f.json
use arrow function (#41895)
src/Illuminate/Routing/RouteDependencyResolverTrait.php
@@ -92,9 +92,7 @@ protected function transformDependency(ReflectionParameter $parameter, $paramete */ protected function alreadyInParameters($class, array $parameters) { - return ! is_null(Arr::first($parameters, function ($value) use ($class) { - return $value instanceof $class; - ...
true
Other
laravel
framework
78cb588f9f391016632b3f96755c851a712a442f.json
use arrow function (#41895)
src/Illuminate/Routing/Router.php
@@ -695,9 +695,7 @@ protected function findRoute($request) */ protected function runRoute(Request $request, Route $route) { - $request->setRouteResolver(function () use ($route) { - return $route; - }); + $request->setRouteResolver(fn () => $route); $this->even...
true
Other
laravel
framework
644c9d8d6c63d37fcd0c9a917fff821a512e4e1d.json
improve unicode support on Str::squish() (#41877)
src/Illuminate/Support/Str.php
@@ -889,7 +889,7 @@ public static function snake($value, $delimiter = '_') */ public static function squish($value) { - return preg_replace('/\s+/', ' ', trim($value)); + return preg_replace('~\s+~u', ' ', preg_replace('~^\s+|\s+$~u', '', $value)); } /**
true
Other
laravel
framework
644c9d8d6c63d37fcd0c9a917fff821a512e4e1d.json
improve unicode support on Str::squish() (#41877)
tests/Support/SupportStrTest.php
@@ -547,6 +547,12 @@ public function testSquish() php framework ')); + $this->assertSame('laravel php framework', Str::squish('   laravel   php   framework   ')); + $this->assertSame('123', Str::squish('  123   ')); + $this->assertSame('だ', Str::squish('だ')); + ...
true
Other
laravel
framework
644c9d8d6c63d37fcd0c9a917fff821a512e4e1d.json
improve unicode support on Str::squish() (#41877)
tests/Support/SupportStringableTest.php
@@ -620,6 +620,12 @@ public function testSquish() with spaces ')->squish()); + $this->assertSame('laravel php framework', (string) $this->stringable('   laravel   php   framework   ')->squish()); + $this->assertSame('123', (string) $this->stringable('  123   ')->squish...
true
Other
laravel
framework
76a7b3cc7942eda2841518ca7877a5e009570b22.json
Fix seeder property for in-memory tests (#41869)
src/Illuminate/Database/Console/Migrations/MigrateCommand.php
@@ -24,6 +24,7 @@ class MigrateCommand extends BaseCommand {--schema-path= : The path to a schema dump file} {--pretend : Dump the SQL queries that would be run} {--seed : Indicates if the seed task should be re-run} + {--seeder= : The class name of the ...
true
Other
laravel
framework
76a7b3cc7942eda2841518ca7877a5e009570b22.json
Fix seeder property for in-memory tests (#41869)
src/Illuminate/Foundation/Testing/RefreshDatabase.php
@@ -56,6 +56,7 @@ protected function migrateUsing() { return [ '--seed' => $this->shouldSeed(), + '--seeder' => $this->seeder(), ]; }
true
Other
laravel
framework
05dd0e064312bd6e1e193dde7309c363a35ec92d.json
Fix null name (#41870)
src/Illuminate/Mail/Message.php
@@ -220,7 +220,7 @@ protected function addAddresses($address, $name, $type) if (is_array($address)) { $type = lcfirst($type); - $addresses = collect($address)->map(function (string|array $address, $key) { + $addresses = collect($address)->map(function ($address, $key) { ...
false
Other
laravel
framework
2f51de56f1a4d207c3bd82984a96882f9da606fe.json
update doc block
src/Illuminate/Database/Connection.php
@@ -342,7 +342,7 @@ public function selectOne($query, $bindings = [], $useReadPdo = true) * @param bool $useReadPdo * @return mixed * - * @throws MultipleColumnsSelectedException + * @throws \Illuminate\Database\MultipleColumnsSelectedException */ public function scalar($query, $b...
false
Other
laravel
framework
9d3f03b0c53dfe78a30ebde7e022ce4de5a53192.json
Update maintainer action (#41839)
.github/workflows/pull-requests.yml
@@ -13,9 +13,11 @@ permissions: jobs: uneditable: if: github.repository == 'laravel/framework' + runs-on: ubuntu-latest + steps: - - uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d + - uses: actions/github-script@v6 with: script: | const...
false
Other
laravel
framework
2b5d80b51ec020641fdfb3d2be255385a9c337ea.json
Apply fixes from StyleCI
src/Illuminate/Bus/PendingBatch.php
@@ -295,7 +295,7 @@ public function dispatchAfterResponse() /** * Dispatch an existing batch. * - * @param \Illuminate\Bus\Batch $batch + * @param \Illuminate\Bus\Batch $batch * @return void * * @throws \Throwable
false
Other
laravel
framework
71bb3970522c90c66b358ff464d5c3cd3bd5f781.json
Provide pending request to retry callback (#41779)
src/Illuminate/Http/Client/PendingRequest.php
@@ -719,7 +719,7 @@ public function send(string $method, string $url, array $options = []) if (! $response->successful()) { try { - $shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException()) : tr...
true
Other
laravel
framework
71bb3970522c90c66b358ff464d5c3cd3bd5f781.json
Provide pending request to retry callback (#41779)
tests/Http/HttpClientTest.php
@@ -1290,6 +1290,31 @@ public function testRequestExceptionIsNotThrownWithoutRetriesIfRetryNotNecessary $this->factory->assertSentCount(1); } + public function testRequestCanBeModifiedInRetryCallback() + { + $this->factory->fake([ + '*' => $this->factory->sequence() + ...
true
Other
laravel
framework
89c093f86ba0916724713208ee3b21194fba3e78.json
Apply fixes from StyleCI
tests/Integration/Database/DatabaseCustomCastsTest.php
@@ -49,7 +49,7 @@ public function test_custom_casting() $this->assertEquals(['name' => 'Taylor'], $model->array_object->toArray()); $this->assertEquals(['name' => 'Taylor'], $model->array_object_json->toArray()); $this->assertEquals(['name' => 'Taylor'], $model->collection->toArray()); - ...
false
Other
laravel
framework
c4b15293eb57536a8cf26811ba84a148e061181f.json
add test for cache manager (#41781)
tests/Cache/CacheManagerTest.php
@@ -92,6 +92,104 @@ public function testItMakesRepositoryWhenContainerHasNoDispatcher() $this->assertNotNull($repo->getEventDispatcher()); } + public function testItRefreshesDispatcherOnAllStores() + { + $userConfig = [ + 'cache' => [ + 'stores' => [ + ...
false
Other
laravel
framework
d1683918a619c07305319e62f8c863c4ee7818c3.json
Apply fixes from StyleCI
src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php
@@ -481,7 +481,7 @@ public function whereBelongsTo($related, $relationshipName = null, $boolean = 'a } if ($relatedCollection->isEmpty()) { - throw new InvalidArgumentException("Collection given to whereBelongsTo method may not be empty."); + throw new InvalidArgumentException(...
false
Other
laravel
framework
1a81bc74ecac5c1f587b8af85fdd49a135e47a9d.json
Allow int as type for value in pluck (#41751)
src/Illuminate/Collections/Collection.php
@@ -701,7 +701,7 @@ public function last(callable $callback = null, $default = null) /** * Get the values of a given key. * - * @param string|array<array-key, string> $value + * @param string|int|array<array-key, string> $value * @param string|null $key * @return static<int, m...
false
Other
laravel
framework
98aa74abd91eefa7fd14cc5a649a6fa264bbdf97.json
fix nth where step <= offset (#41645) Co-authored-by: Misha van Tol <misha.vantol@synetic.nl>
src/Illuminate/Collections/Collection.php
@@ -806,8 +806,8 @@ public function nth($step, $offset = 0) $position = 0; - foreach ($this->items as $item) { - if ($position % $step === $offset) { + foreach ($this->slice($offset)->items as $item) { + if ($position % $step === 0) { $new[] = $item; ...
true
Other
laravel
framework
98aa74abd91eefa7fd14cc5a649a6fa264bbdf97.json
fix nth where step <= offset (#41645) Co-authored-by: Misha van Tol <misha.vantol@synetic.nl>
src/Illuminate/Collections/LazyCollection.php
@@ -796,8 +796,8 @@ public function nth($step, $offset = 0) return new static(function () use ($step, $offset) { $position = 0; - foreach ($this as $item) { - if ($position % $step === $offset) { + foreach ($this->slice($offset) as $item) { + i...
true
Other
laravel
framework
98aa74abd91eefa7fd14cc5a649a6fa264bbdf97.json
fix nth where step <= offset (#41645) Co-authored-by: Misha van Tol <misha.vantol@synetic.nl>
tests/Support/SupportCollectionTest.php
@@ -2956,6 +2956,8 @@ public function testNth($collection) $this->assertEquals(['b', 'f'], $data->nth(4, 1)->all()); $this->assertEquals(['c'], $data->nth(4, 2)->all()); $this->assertEquals(['d'], $data->nth(4, 3)->all()); + $this->assertEquals(['c', 'e'], $data->nth(2, 2)->all()); + ...
true
Other
laravel
framework
613b0e22c3d6601994d539fb4974b81a464ae54a.json
Add support for multiple new lines (#41638)
src/Illuminate/Support/Stringable.php
@@ -67,11 +67,12 @@ public function append(...$values) /** * Append a new line to the string. * + * @param int $count * @return $this */ - public function newLine() + public function newLine($count = 1) { - return $this->append(PHP_EOL); + return $this->append...
true
Other
laravel
framework
613b0e22c3d6601994d539fb4974b81a464ae54a.json
Add support for multiple new lines (#41638)
tests/Support/SupportStringableTest.php
@@ -422,6 +422,7 @@ public function testAscii() public function testNewLine() { $this->assertSame('Laravel'.PHP_EOL, (string) $this->stringable('Laravel')->newLine()); + $this->assertSame('foo'.PHP_EOL.PHP_EOL.'bar', (string) $this->stringable('foo')->newLine(2)->append('bar')); } ...
true
Other
laravel
framework
fb8d38c41cd68bafc2b34ade348935e7380bf958.json
Apply fixes from StyleCI
src/Illuminate/Collections/Enumerable.php
@@ -461,6 +461,7 @@ public function whereNotInStrict($key, $values); * Filter the items, removing any items that don't match the given type(s). * * @template TWhereInstanceOf + * * @param class-string<TWhereInstanceOf>|array<array-key, class-string<TWhereInstanceOf>> $type * @return ...
true
Other
laravel
framework
fb8d38c41cd68bafc2b34ade348935e7380bf958.json
Apply fixes from StyleCI
src/Illuminate/Collections/Traits/EnumeratesValues.php
@@ -680,6 +680,7 @@ public function whereNotInStrict($key, $values) * Filter the items, removing any items that don't match the given type(s). * * @template TWhereInstanceOf + * * @param class-string<TWhereInstanceOf>|array<array-key, class-string<TWhereInstanceOf>> $type * @return s...
true
Other
laravel
framework
6e14167dd25827128e38429f4fa3c7985c497d89.json
Add withoutMiddleware docbloc (#41655)
src/Illuminate/Support/Facades/Route.php
@@ -30,6 +30,7 @@ * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix) * @method static \Illuminate\Routing\RouteRegistrar scopeBindings() * @method static \Illuminate\Routing\RouteRegistrar where(array $where) + * @method static \Illuminate\Routing\RouteRegistrar withoutMiddleware(array|str...
false
Other
laravel
framework
447f6203a3322d3af624df651627a7480df7f3a7.json
Ensure int type of getSeconds() output (#41623)
src/Illuminate/Cache/Repository.php
@@ -529,7 +529,7 @@ protected function getSeconds($ttl) $duration = Carbon::now()->diffInRealSeconds($duration, false); } - return (int) $duration > 0 ? $duration : 0; + return (int) ($duration > 0 ? $duration : 0); } /**
false
Other
laravel
framework
6094c427834827b9932f848b6a37d788c181e814.json
Use the nullsafe operator in SessionGuard (#41561)
src/Illuminate/Auth/SessionGuard.php
@@ -685,9 +685,7 @@ protected function rehashUserPassword($password, $attribute) */ public function attempting($callback) { - if (isset($this->events)) { - $this->events->listen(Events\Attempting::class, $callback); - } + $this->events?->listen(Events\Attempting::class, $...
false
Other
laravel
framework
91dfbd0c3823069eb8e8d65752a6c85e81e5b4d8.json
use nullsafe operator in Connection (#41544)
src/Illuminate/Database/Connection.php
@@ -852,9 +852,7 @@ public function beforeExecuting(Closure $callback) */ public function listen(Closure $callback) { - if (isset($this->events)) { - $this->events->listen(Events\QueryExecuted::class, $callback); - } + $this->events?->listen(Events\QueryExecuted::class, $...
true
Other
laravel
framework
91dfbd0c3823069eb8e8d65752a6c85e81e5b4d8.json
use nullsafe operator in Connection (#41544)
src/Illuminate/Redis/Connections/Connection.php
@@ -132,9 +132,7 @@ public function command($method, array $parameters = []) */ protected function event($event) { - if (isset($this->events)) { - $this->events->dispatch($event); - } + $this->events?->dispatch($event); } /** @@ -145,9 +143,7 @@ protected func...
true
Other
laravel
framework
4d770fd9a31ad02f724428ec0d15ca38a81cc3d1.json
Bugfix #41302 - Alternative (#41546) * Bugfix #41302 - Alternative This is an alternative option to PR #41502, and adds a match for 'socket' ("socket error when (reading|writing)") to trigger a reconnection. I am not sure if this is valid in other languages, too. My personal preference would be to remove th...
src/Illuminate/Redis/Connections/PhpRedisConnection.php
@@ -531,7 +531,7 @@ public function command($method, array $parameters = []) try { return parent::command($method, $parameters); } catch (RedisException $e) { - if (str_contains($e->getMessage(), 'went away')) { + if (str_contains($e->getMessage(), 'went away') || st...
false