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 | 648bdae04bd15f4b32f76c5dfee0294e067e90b1.json | Apply fixes from StyleCI (#24794) | src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php | @@ -82,5 +82,4 @@ protected function inExceptArray($request)
return false;
}
-
} | false |
Other | laravel | framework | 2b3902a77f9f8193ab7ee157530e97d1b96cfa05.json | Allow tuple notation for actions (#24738) | src/Illuminate/Routing/UrlGenerator.php | @@ -392,7 +392,7 @@ protected function toRoute($route, $parameters, $absolute)
/**
* Get the URL to a controller action.
*
- * @param string $action
+ * @param string|array $action
* @param mixed $parameters
* @param bool $absolute
* @return string
@@ -411,11 +411,1... | true |
Other | laravel | framework | 2b3902a77f9f8193ab7ee157530e97d1b96cfa05.json | Allow tuple notation for actions (#24738) | tests/Routing/RoutingUrlGeneratorTest.php | @@ -244,6 +244,7 @@ public function testBasicRouteGeneration()
$this->assertEquals('/foo/bar/taylor/breeze/otwell?fly=wall', $url->route('bar', ['taylor', 'otwell', 'fly' => 'wall'], false));
$this->assertEquals('https://www.foo.com/foo/baz', $url->route('baz'));
$this->assertEquals('http://w... | true |
Other | laravel | framework | e77160aa29370d76bb3b9440d7d141c0f21c226b.json | add missing docblock for RuntimeException (#24732) | src/Illuminate/Hashing/ArgonHasher.php | @@ -47,6 +47,8 @@ public function __construct(array $options = [])
* @param string $value
* @param array $options
* @return string
+ *
+ * @throws \RuntimeException
*/
public function make($value, array $options = [])
{ | false |
Other | laravel | framework | adec8f3b55a7d03305fb8a36b6865206f9a81a8b.json | add docblock for RuntimeException (#24686) | src/Illuminate/Foundation/Console/ViewClearCommand.php | @@ -46,6 +46,8 @@ public function __construct(Filesystem $files)
* Execute the console command.
*
* @return void
+ *
+ * @throws \RuntimeException
*/
public function handle()
{ | false |
Other | laravel | framework | 3414dcfcbe27cf0f4deee0670f022983e8016392.json | add docblock for exception (#24673) | src/Illuminate/Console/Application.php | @@ -166,6 +166,8 @@ public static function forgetBootstrappers()
* @param array $parameters
* @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
* @return int
+ *
+ * @throws \Symfony\Component\Console\Exception\CommandNotFoundException
*/
public functio... | false |
Other | laravel | framework | e227c3762b1b2216e3b98ab507a61d23450e1248.json | Add test for overwriting keys (#24676) | tests/Support/SupportCollectionTest.php | @@ -1586,6 +1586,25 @@ public function testNth()
$this->assertEquals(['d'], $data->nth(4, 3)->all());
}
+ public function testMapWithKeysOverwritingKeys()
+ {
+ $data = new Collection([
+ ['id' => 1, 'name' => 'A'],
+ ['id' => 2, 'name' => 'B'],
+ ['id' => 1... | false |
Other | laravel | framework | 314552e2a0fbdb26dc83077600685a598257839e.json | Apply fixes from StyleCI | src/Illuminate/Redis/Connectors/PhpRedisConnector.php | @@ -92,7 +92,7 @@ protected function createClient(array $config)
*/
protected function establishConnection($client, array $config)
{
- if($config['persistent'] ?? false) {
+ if ($config['persistent'] ?? false) {
$this->establishPersistentConnection($client, $config);
... | true |
Other | laravel | framework | 314552e2a0fbdb26dc83077600685a598257839e.json | Apply fixes from StyleCI | tests/Redis/RedisConnectionTest.php | @@ -615,7 +615,7 @@ public function connections()
'options' => ['prefix' => 'laravel:'],
'timeout' => 0.5,
'persistent' => true,
- 'persistent_id' => 'laravel'
+ 'persistent_id' => 'laravel',
],
... | true |
Other | laravel | framework | 47f55ecc90c02493c50bab1c10985d063cca1267.json | Add a test case for Gate::has() (#24646) | tests/Auth/AuthAccessGateTest.php | @@ -373,6 +373,43 @@ public function test_every_ability_check_fails_if_none_pass()
$this->assertFalse($gate->check(['edit', 'update'], new AccessGateTestDummy));
}
+
+ /**
+ * @dataProvider hasAbilitiesTestDataProvider
+ *
+ * @param array $abilitiesToSet
+ * @param array|string $abil... | false |
Other | laravel | framework | 02591e21d6307d9ff34d406cf1857df13c15586c.json | Apply fixes from StyleCI (#24642) | tests/Database/DatabaseEloquentIntegrationTest.php | @@ -3,7 +3,6 @@
namespace Illuminate\Tests\Database;
use Exception;
-use ReflectionObject;
use Illuminate\Support\Carbon;
use PHPUnit\Framework\TestCase;
use Illuminate\Database\Eloquent\Model; | false |
Other | laravel | framework | fdc1e61d901ec6f660b505630e34f292495497bb.json | Apply fixes from StyleCI (#24641) | src/Illuminate/Database/Eloquent/Relations/Relation.php | @@ -165,7 +165,7 @@ public function touch()
if (! $model::isIgnoringTouch()) {
$this->rawUpdate([
- $model->getUpdatedAtColumn() => $model->freshTimestampString()
+ $model->getUpdatedAtColumn() => $model->freshTimestampString(),
]);
}
} | false |
Other | laravel | framework | 14beafaebbd6fe0f1a48942389c57a67b69f23a2.json | Add missing import (#24614) | src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php | @@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Testing\Concerns;
+use Exception;
use Illuminate\Redis\RedisManager;
trait InteractsWithRedis
@@ -50,7 +51,7 @@ public function setUpRedis()
try {
$this->redis['predis']->connection()->flushdb();
- } catch (\Exception $e) {
+ ... | false |
Other | laravel | framework | 5b5319ff627f0cd830ce52e8da2a70b48029284b.json | Use hSetNx with valid case (#24615) | src/Illuminate/Redis/Connections/PhpRedisConnection.php | @@ -140,7 +140,7 @@ public function hmset($key, ...$dictionary)
*/
public function hsetnx($hash, $key, $value)
{
- return (int) $this->client->hsetnx($hash, $key, $value);
+ return (int) $this->client->hSetNx($hash, $key, $value);
}
/** | false |
Other | laravel | framework | 8b289e9dd00ae34394f76e3615ecd8a30d7be8dd.json | Apply fixes from StyleCI (#24613) | src/Illuminate/Database/Migrations/Migrator.php | @@ -220,7 +220,7 @@ protected function getMigrationsForRollback(array $options)
if (($steps = $options['step'] ?? 0) > 0) {
return $this->repository->getMigrations($steps);
}
-
+
return $this->repository->getLast();
}
| false |
Other | laravel | framework | f05da7293b1921f40238a3e0f54c41656dfd941b.json | Remove unused import (#24587) | src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php | @@ -5,7 +5,6 @@
use Illuminate\Routing\Redirector;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Http\FormRequest;
-use Symfony\Component\HttpFoundation\Request;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;
class FormRequestServiceProvider extends ServiceProvider | false |
Other | laravel | framework | 6197db7f3cfc8086d6beb486800b0d107cb9e2ce.json | check optional status on policies | src/Illuminate/Auth/Access/Gate.php | @@ -363,11 +363,25 @@ protected function allowsGuests($ability, $arguments)
* @return bool
*/
protected function policyAllowsGuests($policy, $ability, $arguments)
+ {
+ return $this->methodAllowsGuests(
+ $policy, $this->formatAbilityToMethod($ability)
+ );
+ }
+
+ /**... | false |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/auth/login.stub | @@ -8,7 +8,7 @@
<div class="card-header">{{ __('Login') }}</div>
<div class="card-body">
- <form method="POST" action="{{ route('login') }}">
+ <form method="POST" action="{{ route('login') }}" aria-label="{{ __('Login') }}">
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/email.stub | @@ -9,12 +9,12 @@
<div class="card-body">
@if (session('status'))
- <div class="alert alert-success">
+ <div class="alert alert-success" role="alert">
{{ session('status') }}
</div... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/reset.stub | @@ -8,7 +8,7 @@
<div class="card-header">{{ __('Reset Password') }}</div>
<div class="card-body">
- <form method="POST" action="{{ route('password.update') }}">
+ <form method="POST" action="{{ route('password.update') }}" aria-label="{{ __('Rese... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/auth/register.stub | @@ -8,7 +8,7 @@
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
- <form method="POST" action="{{ route('register') }}">
+ <form method="POST" action="{{ route('register') }}" aria-label="{{ __('Register') }}">
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/home.stub | @@ -9,7 +9,7 @@
<div class="card-body">
@if (session('status'))
- <div class="alert alert-success">
+ <div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub | @@ -27,7 +27,7 @@
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedConten... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Auth/GuardHelpers.php | @@ -40,6 +40,16 @@ public function authenticate()
throw new AuthenticationException;
}
+ /**
+ * Determine if the guard has a user instance.
+ *
+ * @return bool
+ */
+ public function hasUser()
+ {
+ return ! is_null($this->user);
+ }
+
/**
* Determine if t... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Cache/ArrayStore.php | @@ -23,9 +23,7 @@ class ArrayStore extends TaggableStore implements Store
*/
public function get($key)
{
- if (array_key_exists($key, $this->storage)) {
- return $this->storage[$key];
- }
+ return $this->storage[$key] ?? null;
}
/** | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Console/Scheduling/Event.php | @@ -145,7 +145,7 @@ class Event
/**
* Create a new event instance.
*
- * @param \Illuminate\Console\Scheduling\Mutex $mutex
+ * @param \Illuminate\Console\Scheduling\EventMutex $mutex
* @param string $command
* @return void
*/ | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Console/Migrations/BaseCommand.php | @@ -25,7 +25,7 @@ protected function getMigrationPaths()
}
return array_merge(
- [$this->getMigrationPath()], $this->migrator->paths()
+ $this->migrator->paths(), [$this->getMigrationPath()]
);
}
| true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -535,7 +535,7 @@ protected function isCustomDateTimeCast($cast)
*
* @param string $key
* @param mixed $value
- * @return $this
+ * @return mixed
*/
public function setAttribute($key, $value)
{ | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | @@ -693,7 +693,7 @@ public function relationLoaded($key)
}
/**
- * Set the specific relationship in the model.
+ * Set the given relationship on the model.
*
* @param string $relation
* @param mixed $value
@@ -706,6 +706,19 @@ public function setRelation($relation, $value)
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Eloquent/Relations/Relation.php | @@ -346,9 +346,7 @@ protected static function buildMorphMapFromModels(array $models = null)
*/
public static function getMorphedModel($alias)
{
- return array_key_exists($alias, self::$morphMap)
- ? self::$morphMap[$alias]
- : null;
+ return se... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Grammar.php | @@ -2,10 +2,13 @@
namespace Illuminate\Database;
+use Illuminate\Support\Traits\Macroable;
use Illuminate\Database\Query\Expression;
abstract class Grammar
{
+ use Macroable;
+
/**
* The grammar table prefix.
* | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Query/Builder.php | @@ -1449,7 +1449,7 @@ public function whereJsonContains($column, $value, $boolean = 'and', $not = fals
$this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not');
if (! $value instanceof Expression) {
- $this->addBinding(json_encode($value));
+ $this->addBinding($th... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -523,6 +523,17 @@ protected function compileJsonContains($column, $value)
throw new RuntimeException('This database engine does not support JSON contains operations.');
}
+ /**
+ * Prepare the binding for a "JSON contains" statement.
+ *
+ * @param mixed $binding
+ * @return stri... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -104,6 +104,33 @@ protected function whereDate(Builder $query, $where)
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
}
+ /**
+ * Compile a "JSON contains" statement into SQL.
+ *
+ * @param string $column
+ * @param string $value
+ ... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Filesystem/FilesystemManager.php | @@ -318,11 +318,13 @@ protected function adapt(FilesystemInterface $filesystem)
*
* @param string $name
* @param mixed $disk
- * @return void
+ * @return $this
*/
public function set($name, $disk)
{
$this->disks[$name] = $disk;
+
+ return $this;
}
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -64,6 +64,21 @@ public function assertSuccessful()
return $this;
}
+ /**
+ * Assert that the response has a 200 status code.
+ *
+ * @return $this
+ */
+ public function assertOk()
+ {
+ PHPUnit::assertTrue(
+ $this->isOk(),
+ 'Response status cod... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Foundation/helpers.php | @@ -779,7 +779,7 @@ function resource_path($path = '')
/**
* Return a new response from the application.
*
- * @param string $content
+ * @param string|array $content
* @param int $status
* @param array $headers
* @return \Symfony\Component\HttpFoundation\Response|... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Hashing/AbstractHasher.php | @@ -0,0 +1,34 @@
+<?php
+
+namespace Illuminate\Hashing;
+
+abstract class AbstractHasher
+{
+ /**
+ * Get information about the given hashed value.
+ *
+ * @param string $hashedValue
+ * @return array
+ */
+ public function info($hashedValue)
+ {
+ return password_get_info($hashedV... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Hashing/ArgonHasher.php | @@ -5,7 +5,7 @@
use RuntimeException;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
-class ArgonHasher implements HasherContract
+class ArgonHasher extends AbstractHasher implements HasherContract
{
/**
* The default memory cost factor.
@@ -41,17 +41,6 @@ public function __construct(array $... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Hashing/BcryptHasher.php | @@ -5,7 +5,7 @@
use RuntimeException;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
-class BcryptHasher implements HasherContract
+class BcryptHasher extends AbstractHasher implements HasherContract
{
/**
* The default cost factor.
@@ -25,17 +25,6 @@ public function __construct(array $optio... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Log/LogManager.php | @@ -336,8 +336,10 @@ protected function createMonologDriver(array $config)
);
}
+ $with = array_merge($config['with'] ?? [], $config['handler_with'] ?? []);
+
return new Monolog($this->parseChannel($config), [$this->prepareHandler(
- $this->app->make($config['handler']... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Log/Logger.php | @@ -22,7 +22,7 @@ class Logger implements LoggerInterface
/**
* The event dispatcher instance.
*
- * @var \Illuminate\Contracts\Events\Dispatcher
+ * @var \Illuminate\Contracts\Events\Dispatcher|null
*/
protected $dispatcher;
| true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Routing/RouteAction.php | @@ -29,11 +29,10 @@ public static function parse($uri, $action)
// as the "uses" property, because there is nothing else we need to do when
// it is available. Otherwise we will need to find it in the action list.
if (is_callable($action)) {
- if (is_array($action)) {
- ... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Support/Facades/Auth.php | @@ -18,6 +18,11 @@
* @method static bool onceUsingId(mixed $id)
* @method static bool viaRemember()
* @method static void logout()
+ * @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email',array $extraConditions = [])
+ * @method static null|bool logoutOtherDevices(strin... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Support/Facades/Broadcast.php | @@ -6,6 +6,8 @@
/**
* @method static void connection($name = null);
+ * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(string $channel, callable|string $callback)
+ * @method static mixed auth(\Illuminate\Http\Request $request)
*
* @see \Illuminate\Contracts\Broadcasting\Factory
*/ | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Support/Facades/Lang.php | @@ -7,6 +7,7 @@
* @method static string transChoice(string $key, int | array | \Countable $number, array $replace = [], string $locale = null)
* @method static string getLocale()
* @method static void setLocale(string $locale)
+ * @method static string|array|null get(string $key, array $replace = [], string $loca... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Support/Facades/Log.php | @@ -14,6 +14,8 @@
* @method static void info(string $message, array $context = [])
* @method static void debug(string $message, array $context = [])
* @method static void log($level, string $message, array $context = [])
+ * @method static mixed channel(string $channel = null)
+ * @method static \Psr\Log\LoggerIn... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/Support/Facades/Route.php | @@ -14,6 +14,7 @@
* @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix)
* @method static \Illuminate\Routing\PendingResourceRegistration resource(string $name, string $controller, array $options = [])
* @method static \Illuminate\Routing\PendingResourceRegistration apiResource(string $name, ... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | src/Illuminate/View/Factory.php | @@ -148,7 +148,7 @@ public function make($view, $data = [], $mergeData = [])
*/
public function first(array $views, $data = [], $mergeData = [])
{
- $view = collect($views)->first(function ($view) {
+ $view = Arr::first($views, function ($view) {
return $this->exists($view);
... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Auth/AuthGuardTest.php | @@ -178,6 +178,22 @@ public function testAuthenticateThrowsWhenUserIsNull()
$guard->authenticate();
}
+ public function testHasUserReturnsTrueWhenUserIsNotNull()
+ {
+ $user = m::mock('Illuminate\Contracts\Auth\Authenticatable');
+ $guard = $this->getGuard()->setUser($user);
+
+ ... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabaseEloquentRelationTest.php | @@ -25,6 +25,15 @@ public function testSetRelationFail()
$this->assertArrayNotHasKey('foo', $parent->toArray());
}
+ public function testUnsetExistingRelation()
+ {
+ $parent = new EloquentRelationResetModelStub;
+ $relation = new EloquentRelationResetModelStub;
+ $parent->set... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabaseMySqlSchemaGrammarTest.php | @@ -941,6 +941,18 @@ public function testDropAllTables()
$this->assertEquals('drop table `alpha`,`beta`,`gamma`', $statement);
}
+ public function testGrammarsAreMacroable()
+ {
+ // compileReplace macro.
+ $this->getGrammar()::macro('compileReplace', function () {
+ retur... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabasePostgresSchemaGrammarTest.php | @@ -799,4 +799,16 @@ public function getGrammar()
{
return new \Illuminate\Database\Schema\Grammars\PostgresGrammar;
}
+
+ public function testGrammarsAreMacroable()
+ {
+ // compileReplace macro.
+ $this->getGrammar()::macro('compileReplace', function () {
+ return tru... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabaseQueryBuilderTest.php | @@ -2634,6 +2634,11 @@ public function testWhereRowValuesArityMismatch()
public function testWhereJsonContainsMySql()
{
+ $builder = $this->getMySqlBuilder();
+ $builder->select('*')->from('users')->whereJsonContains('options', ['en']);
+ $this->assertEquals('select * from `users` where... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabaseSQLiteSchemaGrammarTest.php | @@ -759,6 +759,18 @@ public function testAddingMultiPolygon()
$this->assertEquals('alter table "geo" add column "coordinates" multipolygon not null', $statements[0]);
}
+ public function testGrammarsAreMacroable()
+ {
+ // compileReplace macro.
+ $this->getGrammar()::macro('compileRe... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Database/DatabaseSqlServerSchemaGrammarTest.php | @@ -768,6 +768,18 @@ public function testAddingMultiPolygon()
$this->assertEquals('alter table "geo" add "coordinates" geography not null', $statements[0]);
}
+ public function testGrammarsAreMacroable()
+ {
+ // compileReplace macro.
+ $this->getGrammar()::macro('compileReplace', fu... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Hashing/HasherTest.php | @@ -31,7 +31,7 @@ public function testBasicArgonHashing()
}
/**
- * @expectedException \Exception
+ * @expectedException \RuntimeException
*/
public function testBasicBcryptVerification()
{ | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Integration/Auth/AuthenticationTest.php | @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Schema;
use Illuminate\Auth\EloquentUserProvider;
-use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser;
/**
* @group integration
@@ -206,25 +206,3 @@ pu... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Integration/Auth/Fixtures/AuthenticationTestUser.php | @@ -0,0 +1,27 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Auth\Fixtures;
+
+use Illuminate\Foundation\Auth\User as Authenticatable;
+
+class AuthenticationTestUser extends Authenticatable
+{
+ public $table = 'users';
+ public $timestamps = false;
+
+ /**
+ * The attributes that are mass assignable... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Integration/Routing/Fixtures/ApiResourceTaskController.php | @@ -0,0 +1,33 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Routing\Fixtures;
+
+use Illuminate\Routing\Controller;
+
+class ApiResourceTaskController extends Controller
+{
+ public function index()
+ {
+ return 'I`m index tasks';
+ }
+
+ public function store()
+ {
+ return 'I`m stor... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Integration/Routing/Fixtures/ApiResourceTestController.php | @@ -0,0 +1,33 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Routing\Fixtures;
+
+use Illuminate\Routing\Controller;
+
+class ApiResourceTestController extends Controller
+{
+ public function index()
+ {
+ return 'I`m index';
+ }
+
+ public function store()
+ {
+ return 'I`m store';
+ ... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Integration/Routing/RouteApiResourceTest.php | @@ -0,0 +1,115 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Routing;
+
+use Orchestra\Testbench\TestCase;
+use Illuminate\Support\Facades\Route;
+use Illuminate\Tests\Integration\Routing\Fixtures\ApiResourceTaskController;
+use Illuminate\Tests\Integration\Routing\Fixtures\ApiResourceTestController;
+
+/**
+ * @... | true |
Other | laravel | framework | 25974ab05dabae76bd3c326598d9b694a1dc28d8.json | add back checks | tests/Routing/RoutingRouteTest.php | @@ -1326,6 +1326,8 @@ public function testControllerRoutingArrayCallable()
$this->assertEquals(0, $_SERVER['route.test.controller.middleware.parameters.one']);
$this->assertEquals(['foo', 'bar'], $_SERVER['route.test.controller.middleware.parameters.two']);
$this->assertFalse(isset($_SERVER['... | true |
Other | laravel | framework | 8dd376c3ffb1de29c0e421db1bda29a988768b0c.json | Fix JSON queries with table names on SQL Server | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -4,6 +4,7 @@
use RuntimeException;
use Illuminate\Support\Arr;
+use Illuminate\Support\Str;
use Illuminate\Database\Query\Builder;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Database\Grammar as BaseGrammar;
@@ -37,6 +38,58 @@ class Grammar extends BaseGrammar
'lock',
];
+ /**
... | true |
Other | laravel | framework | 8dd376c3ffb1de29c0e421db1bda29a988768b0c.json | Fix JSON queries with table names on SQL Server | src/Illuminate/Database/Query/Grammars/MySqlGrammar.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database\Query\Grammars;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Illuminate\Database\Query\Builder;
use Illuminate\Database\Query\JsonExpression;
@@ -61,7 +60,7 @@ public function compileSelect(Builder $query)
*/
protected function compileJson... | true |
Other | laravel | framework | 8dd376c3ffb1de29c0e421db1bda29a988768b0c.json | Fix JSON queries with table names on SQL Server | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database\Query\Grammars;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Illuminate\Database\Query\Builder;
class PostgresGrammar extends Grammar
@@ -73,7 +72,7 @@ protected function dateBasedWhere($type, Builder $query, $where)
*/
protected function ... | true |
Other | laravel | framework | 8dd376c3ffb1de29c0e421db1bda29a988768b0c.json | Fix JSON queries with table names on SQL Server | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database\Query\Grammars;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Illuminate\Database\Query\Builder;
class SqlServerGrammar extends Grammar
@@ -113,11 +112,13 @@ protected function whereDate(Builder $query, $where)
*/
protected function compile... | true |
Other | laravel | framework | 8dd376c3ffb1de29c0e421db1bda29a988768b0c.json | Fix JSON queries with table names on SQL Server | tests/Database/DatabaseQueryBuilderTest.php | @@ -2024,8 +2024,8 @@ public function testMySqlWrappingJson()
$this->assertEquals('select * from `users` where items->\'$."price"\' = 1', $builder->toSql());
$builder = $this->getMySqlBuilder();
- $builder->select('items->price')->from('users')->where('items->price', '=', 1)->orderBy('items->... | true |
Other | laravel | framework | 4f7b2760aefea06d4860af6ee2b0d52b2e93b78b.json | Apply fixes from StyleCI (#24540) | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -73,7 +73,7 @@ public function assertOk()
{
PHPUnit::assertTrue(
$this->isOk(),
- 'Response status code [' . $this->getStatusCode() . '] does match expected 200 status code.'
+ 'Response status code ['.$this->getStatusCode().'] does match expected 200 status code.'
... | false |
Other | laravel | framework | e2faaccc78b904bb0f0ec3258ee328be87458b28.json | Add missed 'static' in return type list (#24526) | src/Illuminate/Database/Eloquent/Builder.php | @@ -346,7 +346,7 @@ public function findMany($ids, $columns = ['*'])
*
* @param mixed $id
* @param array $columns
- * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
+ * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collectio... | false |
Other | laravel | framework | ffa3ef355ad015ecd87399a21214e1a7efbd9fb0.json | Apply fixes from StyleCI (#24503) | src/Illuminate/Filesystem/FilesystemManager.php | @@ -323,7 +323,7 @@ protected function adapt(FilesystemInterface $filesystem)
public function set($name, $disk)
{
$this->disks[$name] = $disk;
-
+
return $this;
}
| false |
Other | laravel | framework | 7efb6157741da04eedfa077abe283f9f39f89839.json | support other configuration option for consistency | src/Illuminate/Log/LogManager.php | @@ -336,8 +336,10 @@ protected function createMonologDriver(array $config)
);
}
+ $with = array_merge($config['with'] ?? [], $config['handler_with'] ?? []);
+
return new Monolog($this->parseChannel($config), [$this->prepareHandler(
- $this->app->make($config['handler']... | false |
Other | laravel | framework | 4b736f75f533e53f677dff52efd80fa5088a39b6.json | Apply fixes from StyleCI (#24481) | src/Illuminate/Routing/RouteAction.php | @@ -31,7 +31,7 @@ public static function parse($uri, $action)
if (is_callable($action)) {
return ! is_array($action) ? ['uses' => $action] : [
'uses' => $action[0].'@'.$action[1],
- 'controller' => $action[0].'@'.$action[1]
+ 'controller' => $action[0... | false |
Other | laravel | framework | ea3b5e5300be3824cee30dfa9608d27d8432addf.json | Add exit status to WorkStopping event. (#24476) | src/Illuminate/Queue/Events/WorkerStopping.php | @@ -4,5 +4,21 @@
class WorkerStopping
{
- //
+ /**
+ * The exit status.
+ *
+ * @var int
+ */
+ public $status;
+
+ /**
+ * Create a new event instance.
+ *
+ * @param int $status
+ * @return void
+ */
+ public function __construct($status = 0)
+ {
+ $t... | true |
Other | laravel | framework | ea3b5e5300be3824cee30dfa9608d27d8432addf.json | Add exit status to WorkStopping event. (#24476) | src/Illuminate/Queue/Worker.php | @@ -552,7 +552,7 @@ public function memoryExceeded($memoryLimit)
*/
public function stop($status = 0)
{
- $this->events->dispatch(new Events\WorkerStopping);
+ $this->events->dispatch(new Events\WorkerStopping($status));
exit($status);
}
@@ -565,7 +565,7 @@ public function ... | true |
Other | laravel | framework | 8038c3d7eeb8d1cdbec8924bd0b4b41c3234f4d8.json | Add whereJsonContains() to SQL Server | src/Illuminate/Database/Query/Builder.php | @@ -1449,7 +1449,7 @@ public function whereJsonContains($column, $value, $boolean = 'and', $not = fals
$this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not');
if (! $value instanceof Expression) {
- $this->addBinding(json_encode($value));
+ $this->addBinding($th... | true |
Other | laravel | framework | 8038c3d7eeb8d1cdbec8924bd0b4b41c3234f4d8.json | Add whereJsonContains() to SQL Server | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -523,6 +523,17 @@ protected function compileJsonContains($column, $value)
throw new RuntimeException('This database engine does not support JSON contains operations.');
}
+ /**
+ * Prepare the binding for a "JSON contains" statement.
+ *
+ * @param mixed $binding
+ * @return stri... | true |
Other | laravel | framework | 8038c3d7eeb8d1cdbec8924bd0b4b41c3234f4d8.json | Add whereJsonContains() to SQL Server | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -104,6 +104,33 @@ protected function whereDate(Builder $query, $where)
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
}
+ /**
+ * Compile a "JSON contains" statement into SQL.
+ *
+ * @param string $column
+ * @param string $value
+ ... | true |
Other | laravel | framework | 8038c3d7eeb8d1cdbec8924bd0b4b41c3234f4d8.json | Add whereJsonContains() to SQL Server | tests/Database/DatabaseQueryBuilderTest.php | @@ -2634,6 +2634,11 @@ public function testWhereRowValuesArityMismatch()
public function testWhereJsonContainsMySql()
{
+ $builder = $this->getMySqlBuilder();
+ $builder->select('*')->from('users')->whereJsonContains('options', ['en']);
+ $this->assertEquals('select * from `users` where... | true |
Other | laravel | framework | c0afae9c56a0caabb03ac8e6d222c2b32a58a8bf.json | add assertTimesSent method to NotificationFake | src/Illuminate/Support/Testing/Fakes/NotificationFake.php | @@ -95,6 +95,29 @@ public function assertNothingSent()
PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.');
}
+ /**
+ * Assert the total amount of times a notification was sent.
+ *
+ * @param int $expectedCount
+ * @param string $notification
+ *
+... | true |
Other | laravel | framework | c0afae9c56a0caabb03ac8e6d222c2b32a58a8bf.json | add assertTimesSent method to NotificationFake | tests/Support/SupportTestingNotificationFakeTest.php | @@ -66,6 +66,19 @@ public function testResettingNotificationId()
$this->assertNotNull($notification->id);
$this->assertNotSame($id, $notification->id);
}
+
+ public function testAssertTimesSent()
+ {
+ $this->fake->assertTimesSent(0, NotificationStub::class);
+
+ $this->fake->... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Database/DatabaseEloquentHasManyTest.php | @@ -231,10 +231,10 @@ public function testModelsAreProperlyMatchedToParents()
$models = $relation->match([$model1, $model2, $model3], new Collection([$result1, $result2, $result3]), 'foo');
$this->assertEquals(1, $models[0]->foo[0]->foreign_key);
- $this->assertEquals(1, count($models[0]->foo... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Database/DatabaseEloquentIntegrationTest.php | @@ -158,11 +158,11 @@ public function testBasicModelRetrieval()
$collection = EloquentTestUser::find([]);
$this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $collection);
- $this->assertEquals(0, $collection->count());
+ $this->assertCount(0, $collection);
$c... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Database/DatabaseEloquentIntegrationWithTablePrefixTest.php | @@ -87,7 +87,7 @@ public function testBasicModelHydration()
$this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $models);
$this->assertInstanceOf('Illuminate\Tests\Database\EloquentTestUser', $models[0]);
$this->assertEquals('abigailotwell@gmail.com', $models[0]->email);
- ... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Database/DatabaseEloquentPolymorphicRelationsIntegrationTest.php | @@ -81,12 +81,12 @@ public function testCreation()
$post->tags()->attach($tag2->id);
$image->tags()->attach($tag->id);
- $this->assertEquals(2, $post->tags->count());
- $this->assertEquals(1, $image->tags->count());
- $this->assertEquals(1, $tag->posts->count());
- $this-... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Database/DatabaseMySqlSchemaGrammarTest.php | @@ -930,7 +930,7 @@ public function testAddingComment()
$blueprint->string('foo')->comment("Escape ' when using words like it's");
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
- $this->assertEquals(1, count($statements));
+ $this->assertCount(1, $statem... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Integration/Database/EloquentDeleteTest.php | @@ -58,10 +58,10 @@ public function testOnlyDeleteWhatGiven()
}
Post::latest('id')->limit(1)->delete();
- $this->assertEquals(9, Post::all()->count());
+ $this->assertCount(9, Post::all());
Post::join('comments', 'comments.post_id', '=', 'posts.id')->where('posts.id', '>', 1... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Integration/Database/EloquentUpdateTest.php | @@ -53,7 +53,7 @@ public function testBasicUpdate()
TestUpdateModel1::where('title', 'Ms.')->delete();
- $this->assertEquals(0, TestUpdateModel1::all()->count());
+ $this->assertCount(0, TestUpdateModel1::all());
}
public function testUpdateWithLimitsAndOrders()
@@ -105,7 +105,7 @... | true |
Other | laravel | framework | 520fb03d1fe8f019c79a4f49744ae36ab44bed51.json | Use assertCount(). (#24411) | tests/Support/SupportViewErrorBagTest.php | @@ -80,20 +80,20 @@ public function testCount()
{
$viewErrorBag = new ViewErrorBag();
$viewErrorBag->put('default', new MessageBag(['message', 'second']));
- $this->assertEquals(2, $viewErrorBag->count());
+ $this->assertCount(2, $viewErrorBag);
}
public function testCou... | true |
Other | laravel | framework | 10c549f382c123264bfdd2aecd04124f3831aef1.json | fix mock data. | tests/Database/DatabaseSoftDeletingTraitTest.php | @@ -102,4 +102,8 @@ public function getUpdatedAtColumn()
{
return defined('static::UPDATED_AT') ? static::UPDATED_AT : 'updated_at';
}
+
+ public function syncOriginal()
+ {
+ }
} | false |
Other | laravel | framework | d9d3c52d4ff380d901cca0c4d748bfed6e8ae9fe.json | Allow callable array syntax in route definition | src/Illuminate/Routing/RouteAction.php | @@ -29,6 +29,12 @@ public static function parse($uri, $action)
// as the "uses" property, because there is nothing else we need to do when
// it is available. Otherwise we will need to find it in the action list.
if (is_callable($action)) {
+
+ if (\is_array($action)) {
+ ... | true |
Other | laravel | framework | d9d3c52d4ff380d901cca0c4d748bfed6e8ae9fe.json | Allow callable array syntax in route definition | tests/Routing/RoutingRouteTest.php | @@ -1289,6 +1289,26 @@ public function testControllerRouting()
$this->assertFalse(isset($_SERVER['route.test.controller.except.middleware']));
}
+ public function testControllerRoutingArrayCallable()
+ {
+ unset(
+ $_SERVER['route.test.controller.middleware'], $_SERVER['route.tes... | true |
Other | laravel | framework | e2efbcbc609047f7342252fc12dfbaa4682f8b38.json | Prefer stricter negative comparisons with strings | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -396,7 +396,7 @@ protected function transformHeadersToServerVars(array $headers)
*/
protected function formatServerHeaderKey($name)
{
- if (! Str::startsWith($name, 'HTTP_') && $name != 'CONTENT_TYPE' && $name != 'REMOTE_ADDR') {
+ if (! Str::startsWith($name, 'HTTP_') && $name !== 'CON... | true |
Other | laravel | framework | e2efbcbc609047f7342252fc12dfbaa4682f8b38.json | Prefer stricter negative comparisons with strings | src/Illuminate/Mail/Mailable.php | @@ -260,7 +260,7 @@ public function buildViewData()
$data = $this->viewData;
foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
- if ($property->getDeclaringClass()->getName() != self::class) {
+ if ($property->getDeclaringClass(... | true |
Other | laravel | framework | a569df3cd814f891384ce73b3c8186f7b65521a0.json | remove unuse variable. | src/Illuminate/Foundation/Console/ObserverMakeCommand.php | @@ -81,13 +81,11 @@ protected function replaceModel($stub, $model)
$model = class_basename(trim($model, '\\'));
- $dummyModel = $model;
-
- $stub = str_replace('DocDummyModel', Str::snake($dummyModel, ' '), $stub);
+ $stub = str_replace('DocDummyModel', Str::snake($model, ' '), $stub);... | false |
Other | laravel | framework | 255b8fc30036c3fd05544d4d6bf9b57e3fd64592.json | Add model option to command. | src/Illuminate/Foundation/Console/ObserverMakeCommand.php | @@ -3,6 +3,8 @@
namespace Illuminate\Foundation\Console;
use Illuminate\Console\GeneratorCommand;
+use Illuminate\Support\Str;
+use Symfony\Component\Console\Input\InputOption;
class ObserverMakeCommand extends GeneratorCommand
{
@@ -27,14 +29,65 @@ class ObserverMakeCommand extends GeneratorCommand
*/
... | false |
Other | laravel | framework | 30ef278148c447ee6f57e8651a3746ca0e42fd45.json | Create observer.plain stub.
Update observer.stub file; added some functions. | src/Illuminate/Foundation/Console/stubs/observer.plain.stub | @@ -0,0 +1,8 @@
+<?php
+
+namespace DummyNamespace;
+
+class DummyClass
+{
+ //
+} | true |
Other | laravel | framework | 30ef278148c447ee6f57e8651a3746ca0e42fd45.json | Create observer.plain stub.
Update observer.stub file; added some functions. | src/Illuminate/Foundation/Console/stubs/observer.stub | @@ -2,7 +2,40 @@
namespace DummyNamespace;
+use NamespacedDummyModel;
+
class DummyClass
{
- //
+ /**
+ * Listen to the DocDummyModel created event.
+ *
+ * @param \NamespacedDummyModel $dummyModel
+ * @return void
+ */
+ public function created(DummyModel $dummyModel)
+ {
+ ... | true |
Other | laravel | framework | f394191a95e69426e858928de8720fcf169bfc1b.json | Create observer stub | src/Illuminate/Foundation/Console/stubs/observer.stub | @@ -0,0 +1,8 @@
+<?php
+
+namespace DummyNamespace;
+
+class DummyClass
+{
+ //
+} | false |
Other | laravel | framework | 7a78dab48ad00161206d992d6defc43d7159779a.json | Create ObserverMakeCommand file. | src/Illuminate/Foundation/Console/ObserverMakeCommand.php | @@ -0,0 +1,50 @@
+<?php
+
+namespace Illuminate\Foundation\Console;
+
+use Illuminate\Console\GeneratorCommand;
+
+class ObserverMakeCommand extends GeneratorCommand
+{
+ /**
+ * The console command name.
+ *
+ * @var string
+ */
+ protected $name = 'make:observer';
+
+ /**
+ * The console ... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.