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 | 1c92ee586af684ee82f6560d582475fa6bd430ae.json | Fix the parent permissions | src/Illuminate/Cache/FileStore.php | @@ -137,7 +137,11 @@ protected function ensureCacheDirectoryExists($path)
if (! $this->files->exists($directory)) {
$this->files->makeDirectory($directory, 0777, true, true);
+
+ // We are creating two levels of prefix directories, e.g. 7e/24.
+ // So have to check them both.
$this->ensurePermissionsAreCorrect($directory);
+ $this->ensurePermissionsAreCorrect(dirname($directory));
}
}
| true |
Other | laravel | framework | 1c92ee586af684ee82f6560d582475fa6bd430ae.json | Fix the parent permissions | tests/Cache/CacheFileStoreTest.php | @@ -107,14 +107,17 @@ public function testStoreItemDirectoryProperlySetsPermissions()
$files->shouldIgnoreMissing();
$store = $this->getMockBuilder(FileStore::class)->onlyMethods(['expiration'])->setConstructorArgs([$files, __DIR__, 0606])->getMock();
$hash = sha1('foo');
- $cache_dir = substr($hash, 0, 2).'/'.substr($hash, 2, 2);
+ $cache_parent_dir = substr($hash, 0, 2);
+ $cache_dir = $cache_parent_dir.'/'.substr($hash, 2, 2);
$files->shouldReceive('put')->withArgs([__DIR__.'/'.$cache_dir.'/'.$hash, m::any(), m::any()])->andReturnUsing(function ($name, $value) {
return strlen($value);
});
$files->shouldReceive('exists')->withArgs([__DIR__.'/'.$cache_dir])->andReturn(false)->once();
$files->shouldReceive('makeDirectory')->withArgs([__DIR__.'/'.$cache_dir, 0777, true, true])->once();
+ $files->shouldReceive('chmod')->withArgs([__DIR__.'/'.$cache_parent_dir])->andReturn(['0600'])->once();
+ $files->shouldReceive('chmod')->withArgs([__DIR__.'/'.$cache_parent_dir, 0606])->andReturn([true])->once();
$files->shouldReceive('chmod')->withArgs([__DIR__.'/'.$cache_dir])->andReturn(['0600'])->once();
$files->shouldReceive('chmod')->withArgs([__DIR__.'/'.$cache_dir, 0606])->andReturn([true])->once();
| true |
Other | laravel | framework | 3e09ccca915be11a393d034141a936f478623028.json | Fix typo in Connection property name (#39590)
The uses of this property have been renamed in
https://github.com/laravel/framework/commit/d1a32f9acb225b6b7b360736f3c717461220dac9,
however the property declaration itself has not been adjusted. | src/Illuminate/Database/Connection.php | @@ -54,7 +54,7 @@ class Connection implements ConnectionInterface
*
* @var string|null
*/
- protected $type;
+ protected $readWriteType;
/**
* The table prefix for the connection. | false |
Other | laravel | framework | 5fda5a335bce1527e6796a91bb36ccb48d6807a8.json | fix problem with fallback | src/Illuminate/Routing/RouteRegistrar.php | @@ -242,7 +242,7 @@ public function __call($method, $parameters)
return $this->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters);
}
- return $this->attribute($method, $parameters[0] ?? true);
+ return $this->attribute($method, array_key_exists(0, $parameters) ? $parameters[0] : true);
}
throw new BadMethodCallException(sprintf( | true |
Other | laravel | framework | 5fda5a335bce1527e6796a91bb36ccb48d6807a8.json | fix problem with fallback | src/Illuminate/Routing/Router.php | @@ -1326,6 +1326,6 @@ public function __call($method, $parameters)
return (new RouteRegistrar($this))->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters);
}
- return (new RouteRegistrar($this))->attribute($method, $parameters[0] ?? true);
+ return (new RouteRegistrar($this))->attribute($method, array_key_exists(0, $parameters) ? $parameters[0] : true);
}
} | true |
Other | laravel | framework | 535f1847a3017ff80d75fd26ef4029861ba74abf.json | Remove minimum versions in builds | .github/workflows/tests.yml | @@ -61,14 +61,6 @@ jobs:
command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
if: matrix.php >= 8
- - name: Set Minimum PHP 8.1 Versions
- uses: nick-invision/retry@v1
- with:
- timeout_minutes: 5
- max_attempts: 5
- command: composer require league/commonmark:^2.0.2 phpunit/phpunit:^9.5.8 --no-interaction --no-update
- if: matrix.php >= 8.1
-
- name: Install dependencies
uses: nick-invision/retry@v1
with:
@@ -130,14 +122,6 @@ jobs:
command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
if: matrix.php >= 8
- - name: Set Minimum PHP 8.1 Versions
- uses: nick-invision/retry@v1
- with:
- timeout_minutes: 5
- max_attempts: 5
- command: composer require league/commonmark:^2.0.2 phpunit/phpunit:^9.5.8 --no-interaction --no-update
- if: matrix.php >= 8.1
-
- name: Install dependencies
uses: nick-invision/retry@v1
with: | false |
Other | laravel | framework | 0218f6b829ef31193565c895e9b67dfcad9e765c.json | Apply fixes from StyleCI | tests/Queue/QueueSqsQueueTest.php | @@ -147,10 +147,10 @@ public function testGetQueueProperlyResolvesUrlWithPrefix()
public function testGetQueueProperlyResolvesFifoUrlWithPrefix()
{
$this->queueName = 'emails.fifo';
- $this->queueUrl = $this->prefix . $this->queueName;
+ $this->queueUrl = $this->prefix.$this->queueName;
$queue = new SqsQueue($this->sqs, $this->queueName, $this->prefix);
$this->assertEquals($this->queueUrl, $queue->getQueue(null));
- $queueUrl = $this->baseUrl . '/' . $this->account . '/test.fifo';
+ $queueUrl = $this->baseUrl.'/'.$this->account.'/test.fifo';
$this->assertEquals($queueUrl, $queue->getQueue('test.fifo'));
}
@@ -165,10 +165,10 @@ public function testGetQueueProperlyResolvesUrlWithoutPrefix()
public function testGetQueueProperlyResolvesFifoUrlWithoutPrefix()
{
$this->queueName = 'emails.fifo';
- $this->queueUrl = $this->prefix . $this->queueName;
+ $this->queueUrl = $this->prefix.$this->queueName;
$queue = new SqsQueue($this->sqs, $this->queueUrl);
$this->assertEquals($this->queueUrl, $queue->getQueue(null));
- $fifoQueueUrl = $this->baseUrl . '/' . $this->account . '/test.fifo';
+ $fifoQueueUrl = $this->baseUrl.'/'.$this->account.'/test.fifo';
$this->assertEquals($fifoQueueUrl, $queue->getQueue($fifoQueueUrl));
}
@@ -185,7 +185,7 @@ public function testGetQueueProperlyResolvesFifoUrlWithSuffix()
$this->queueName = 'emails.fifo';
$queue = new SqsQueue($this->sqs, $this->queueName, $this->prefix, $suffix = '-staging');
$this->assertEquals("{$this->prefix}emails-staging.fifo", $queue->getQueue(null));
- $queueUrl = $this->baseUrl . '/' . $this->account . '/test' . $suffix . '.fifo';
+ $queueUrl = $this->baseUrl.'/'.$this->account.'/test'.$suffix.'.fifo';
$this->assertEquals($queueUrl, $queue->getQueue('test.fifo'));
}
@@ -201,7 +201,7 @@ public function testGetFifoQueueEnsuresTheQueueIsOnlySuffixedOnce()
{
$queue = new SqsQueue($this->sqs, "{$this->queueName}-staging.fifo", $this->prefix, $suffix = '-staging');
$this->assertEquals("{$this->prefix}{$this->queueName}{$suffix}.fifo", $queue->getQueue(null));
- $queueUrl = $this->baseUrl . '/' . $this->account . '/test' . $suffix . '.fifo';
+ $queueUrl = $this->baseUrl.'/'.$this->account.'/test'.$suffix.'.fifo';
$this->assertEquals($queueUrl, $queue->getQueue('test-staging.fifo'));
}
} | false |
Other | laravel | framework | 12e47bb3dad10294268fa3167112b198fd0a2036.json | fix bugs and formatting | src/Illuminate/Queue/SqsQueue.php | @@ -193,17 +193,21 @@ public function getQueue($queue)
}
/**
- * Suffixes a queue
+ * Add the given suffix to the given queue name.
*
- * @param string $queue
- * @param string $suffix
+ * @param string $queue
+ * @param string $suffix
* @return string
*/
- private function suffixQueue($queue, $suffix = '')
+ protected function suffixQueue($queue, $suffix = '')
{
- $fifo = Str::endsWith($queue, '.fifo') ? '.fifo' : '';
- $queue = rtrim($queue, '.fifo');
- return rtrim($this->prefix, '/') . '/' . Str::finish($queue, $suffix) . $fifo;
+ if (Str::endsWith($queue, '.fifo')) {
+ $queue = Str::beforeLast($queue, '.fifo');
+
+ return rtrim($this->prefix, '/').'/'.Str::finish($queue, $suffix).'.fifo';
+ }
+
+ return rtrim($this->prefix, '/').'/'.Str::finish($queue, $this->suffix);
}
/** | false |
Other | laravel | framework | 481cd52e06cfa56c941d93ec5401438b6cbf7a23.json | Apply fixes from StyleCI | types/Support/LazyCollection.php | @@ -2,7 +2,6 @@
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\LazyCollection;
-
use function PHPStan\Testing\assertType;
$collection = new LazyCollection([new User]); | false |
Other | laravel | framework | 417d5fc30c2595c227c93e2415674d88143566f2.json | Resolve merge conflicts | composer.json | @@ -139,11 +139,7 @@
"ext-pcntl": "Required to use all features of the queue worker.",
"ext-posix": "Required to use all features of the queue worker.",
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
-<<<<<<< HEAD
- "aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.189.0).",
-=======
- "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).",
->>>>>>> 8.x
+ "aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.198.1).",
"brianium/paratest": "Required to run tests in parallel (^6.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
@@ -156,13 +152,8 @@
"mockery/mockery": "Required to use mocking (^1.4.4).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
-<<<<<<< HEAD
"phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).",
- "predis/predis": "Required to use the predis connector (^1.1.2).",
-=======
- "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).",
"predis/predis": "Required to use the predis connector (^1.1.9).",
->>>>>>> 8.x
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^5.0|^6.0).",
"symfony/amazon-mailer": "Required to enable support for the SES mail transport (^6.0).", | true |
Other | laravel | framework | 417d5fc30c2595c227c93e2415674d88143566f2.json | Resolve merge conflicts | src/Illuminate/Filesystem/FilesystemAdapter.php | @@ -659,20 +659,14 @@ public function allFiles($directory = null)
*/
public function directories($directory = null, $recursive = false)
{
-<<<<<<< HEAD
- return $this->driver->listContents($directory, $recursive)
+ return $this->driver->listContents($directory ?? '', $recursive)
->filter(function (StorageAttributes $attributes) {
return $attributes->isDir();
})
->map(function (StorageAttributes $attributes) {
return $attributes->path();
})
->toArray();
-=======
- $contents = $this->driver->listContents($directory ?? '', $recursive);
-
- return $this->filterContentsByType($contents, 'dir');
->>>>>>> 8.x
}
/** | true |
Other | laravel | framework | b72bfa502b0993dbe2ca74ab656ba75b3406b96a.json | Add final test for fifo | tests/Queue/QueueSqsQueueTest.php | @@ -162,6 +162,16 @@ public function testGetQueueProperlyResolvesUrlWithoutPrefix()
$this->assertEquals($queueUrl, $queue->getQueue($queueUrl));
}
+ public function testGetQueueProperlyResolvesFifoUrlWithoutPrefix()
+ {
+ $this->queueName = 'emails.fifo';
+ $this->queueUrl = $this->prefix . $this->queueName;
+ $queue = new SqsQueue($this->sqs, $this->queueUrl);
+ $this->assertEquals($this->queueUrl, $queue->getQueue(null));
+ $fifoQueueUrl = $this->baseUrl . '/' . $this->account . '/test.fifo';
+ $this->assertEquals($fifoQueueUrl, $queue->getQueue($fifoQueueUrl));
+ }
+
public function testGetQueueProperlyResolvesUrlWithSuffix()
{
$queue = new SqsQueue($this->sqs, $this->queueName, $this->prefix, $suffix = '-staging'); | false |
Other | laravel | framework | f8da97b1ea5c27ad5ed12e5b4c93dfd7329930ac.json | Add some tests for fifo naming conventions | tests/Queue/QueueSqsQueueTest.php | @@ -144,6 +144,16 @@ public function testGetQueueProperlyResolvesUrlWithPrefix()
$this->assertEquals($queueUrl, $queue->getQueue('test'));
}
+ public function testGetQueueProperlyResolvesFifoUrlWithPrefix()
+ {
+ $this->queueName = 'emails.fifo';
+ $this->queueUrl = $this->prefix . $this->queueName;
+ $queue = new SqsQueue($this->sqs, $this->queueName, $this->prefix);
+ $this->assertEquals($this->queueUrl, $queue->getQueue(null));
+ $queueUrl = $this->baseUrl . '/' . $this->account . '/test.fifo';
+ $this->assertEquals($queueUrl, $queue->getQueue('test.fifo'));
+ }
+
public function testGetQueueProperlyResolvesUrlWithoutPrefix()
{
$queue = new SqsQueue($this->sqs, $this->queueUrl);
@@ -160,11 +170,28 @@ public function testGetQueueProperlyResolvesUrlWithSuffix()
$this->assertEquals($queueUrl, $queue->getQueue('test'));
}
+ public function testGetQueueProperlyResolvesFifoUrlWithSuffix()
+ {
+ $this->queueName = 'emails.fifo';
+ $queue = new SqsQueue($this->sqs, $this->queueName, $this->prefix, $suffix = '-staging');
+ $this->assertEquals("{$this->prefix}emails-staging.fifo", $queue->getQueue(null));
+ $queueUrl = $this->baseUrl . '/' . $this->account . '/test' . $suffix . '.fifo';
+ $this->assertEquals($queueUrl, $queue->getQueue('test.fifo'));
+ }
+
public function testGetQueueEnsuresTheQueueIsOnlySuffixedOnce()
{
$queue = new SqsQueue($this->sqs, "{$this->queueName}-staging", $this->prefix, $suffix = '-staging');
$this->assertEquals($this->queueUrl.$suffix, $queue->getQueue(null));
$queueUrl = $this->baseUrl.'/'.$this->account.'/test'.$suffix;
$this->assertEquals($queueUrl, $queue->getQueue('test-staging'));
}
+
+ public function testGetFifoQueueEnsuresTheQueueIsOnlySuffixedOnce()
+ {
+ $queue = new SqsQueue($this->sqs, "{$this->queueName}-staging.fifo", $this->prefix, $suffix = '-staging');
+ $this->assertEquals("{$this->prefix}{$this->queueName}{$suffix}.fifo", $queue->getQueue(null));
+ $queueUrl = $this->baseUrl . '/' . $this->account . '/test' . $suffix . '.fifo';
+ $this->assertEquals($queueUrl, $queue->getQueue('test-staging.fifo'));
+ }
} | false |
Other | laravel | framework | eb41172e22a28fcfa7e3ffbcc71e2d449a84fc6c.json | Fix code style (#39488) | tests/View/Blade/BladeVerbatimTest.php | @@ -58,7 +58,7 @@ public function testMultilineTemplatesWithRawBlocksAreRenderedInTheRightOrder()
@include("users")
@verbatim
{{ $fourth }} @include("test")
-@endverbatim
+@endverbatim
@php echo $fifth; @endphp';
$expected = '<?php echo e($first); ?>
@@ -73,7 +73,7 @@ public function testMultilineTemplatesWithRawBlocksAreRenderedInTheRightOrder()
<?php echo $__env->make("users", \Illuminate\Support\Arr::except(get_defined_vars(), [\'__data\', \'__path\']))->render(); ?>
{{ $fourth }} @include("test")
-
+
<?php echo $fifth; ?>';
$this->assertSame($expected, $this->compiler->compileString($string)); | false |
Other | laravel | framework | bc50a9b10097e66b59f0dfcabc6e100b8fedc760.json | simplify disk change | src/Illuminate/Log/LogManager.php | @@ -69,6 +69,8 @@ public function __construct($app)
*/
public function build(array $config)
{
+ unset($this->channels['ondemand']);
+
return $this->get('ondemand', $config);
}
@@ -127,10 +129,6 @@ public function getChannels()
protected function get($name, ?array $config = null)
{
try {
- if ($name === 'ondemand' && ! empty($config)) {
- unset($this->channels['ondemand']);
- }
-
return $this->channels[$name] ?? with($this->resolve($name, $config), function ($logger) use ($name) {
return $this->channels[$name] = $this->tap($name, new Logger($logger, $this->app['events']));
}); | false |
Other | laravel | framework | d0353b8dd16bd6010e37bd658cc29d469ef4ee8d.json | Add bound check to env resolving (#39434) | src/Illuminate/Foundation/Application.php | @@ -628,7 +628,7 @@ public function runningInConsole()
*/
public function runningUnitTests()
{
- return $this['env'] === 'testing';
+ return $this->bound('env') && $this['env'] === 'testing';
}
/** | false |
Other | laravel | framework | 9bd19df052be07f33e87242d8c110d0ea5027da4.json | Apply fixes from StyleCI | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -265,7 +265,7 @@ protected function addCastAttributesToArray(array $attributes, array $mutatedAtt
}
if ($this->isEnumCastable($key)) {
- $attributes[$key] = isset($attributes[$key] ) ? $attributes[$key]->value : null;
+ $attributes[$key] = isset($attributes[$key]) ? $attributes[$key]->value : null;
}
if ($attributes[$key] instanceof Arrayable) { | false |
Other | laravel | framework | 982c730ec935295712bf22a83eec9b940fbbe649.json | Add check for all exceptions | src/Illuminate/Foundation/Exceptions/Handler.php | @@ -351,7 +351,7 @@ public function render($request, Throwable $e)
return $this->convertValidationExceptionToResponse($e, $request);
}
- return $request->expectsJson()
+ return $this->shouldReturnJson($request, $e)
? $this->prepareJsonResponse($request, $e)
: $this->prepareResponse($request, $e);
}
@@ -414,9 +414,10 @@ protected function unauthenticated($request, AuthenticationException $exception)
* Determine if the response should be json.
*
* @param \Illuminate\Http\Request $request
+ * @param \Throwable $e
* @return bool
*/
- protected function shouldReturnJson($request)
+ protected function shouldReturnJson($request, Throwable $e)
{
return $request->expectsJson();
}
@@ -434,7 +435,7 @@ protected function convertValidationExceptionToResponse(ValidationException $e,
return $e->response;
}
- return $request->expectsJson()
+ return $this->shouldReturnJson($request, $e)
? $this->invalidJson($request, $e)
: $this->invalid($request, $e);
} | false |
Other | laravel | framework | 37217d56ca38c407395bb98ef2532cafd86efa30.json | fix bug with closure formatting | src/Illuminate/Testing/Fluent/Concerns/Matching.php | @@ -122,16 +122,26 @@ public function whereContains(string $key, $expected)
}
return $actual->containsStrict($search);
- })->toArray();
-
- PHPUnit::assertEmpty(
- $missing,
- sprintf(
- 'Property [%s] does not contain [%s].',
- $key,
- implode(', ', array_values($missing))
- )
- );
+ });
+
+ if ($missing->whereInstanceOf('Closure')->isNotEmpty()) {
+ PHPUnit::assertEmpty(
+ $missing->toArray(),
+ sprintf(
+ 'Property [%s] does not contain a value that passes the truth test within the given closure.',
+ $key,
+ )
+ );
+ } else {
+ PHPUnit::assertEmpty(
+ $missing->toArray(),
+ sprintf(
+ 'Property [%s] does not contain [%s].',
+ $key,
+ implode(', ', array_values($missing->toArray()))
+ )
+ );
+ }
return $this;
} | false |
Other | laravel | framework | 99e392b92de4404091dc91c274f2605ed4a047f6.json | add bcmath as an extension suggestion (#39360) | composer.json | @@ -125,6 +125,7 @@
}
},
"suggest": {
+ "ext-bcmath": "Required to use the multiple_of validation rule.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
"ext-memcached": "Required to use the memcache cache driver.", | false |
Other | laravel | framework | 4944427809c2c3437870b4a1cf6b102e94e4433e.json | Add ld-json and fix mime type for json | src/Illuminate/Http/Concerns/InteractsWithContentTypes.php | @@ -23,7 +23,7 @@ public function isJson()
*/
public function expectsJson()
{
- return ($this->ajax() && ! $this->pjax() && $this->acceptsAnyContentType()) || ($this->prefers(['text/html', 'text/json']) === 'text/json');
+ return ($this->ajax() && ! $this->pjax() && $this->acceptsAnyContentType()) || Str::contains($this->prefers(['text/html', 'application/json', 'application/ld+json']) ?? '', 'json'));
}
/** | false |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Broadcasting/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Bus/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Cache/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Collections/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Collections/LazyCollection.php | @@ -1374,9 +1374,9 @@ public function tapEach(callable $callback)
/**
* Return only unique items from the collection array.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): bool)|string|null $key
* @param bool $strict
- * @return static
+ * @return static<TKey, TValue>
*/
public function unique($key = null, $strict = false)
{ | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Conditionable/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Config/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Console/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Container/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Contracts/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Cookie/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Database/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Encryption/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Events/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Filesystem/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Hashing/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Http/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Log/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Macroable/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Mail/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Notifications/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Pagination/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Pipeline/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Queue/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Redis/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Routing/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Session/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Support/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Testing/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Translation/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/Validation/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | f3aedf229f6f40e6063f170ef0b4f3bba2c2abe2.json | Add auto close for PRs to sub splits | src/Illuminate/View/.github/workflows/close-pull-request.yml | @@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on the Illuminate organization which is a read-only sub split of `laravel/framework`. Please submit your PR on the https://github.com/laravel/framework repository.<br><br>Thanks!" | true |
Other | laravel | framework | cf9726d1d8f01884962d5d065d6c3b38cb13b29c.json | Apply fixes from StyleCI | src/Illuminate/Queue/DatabaseQueue.php | @@ -253,7 +253,7 @@ protected function getLockForPopping()
{
$databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
- $databaseVersion = $this->database->getConfig('version') ??
+ $databaseVersion = $this->database->getConfig('version') ??
$this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
if (($databaseEngine === 'mysql' && version_compare($databaseVersion, '8.0.1', '>=')) || | false |
Other | laravel | framework | 4b785c616169f5f621d1f87e9cbe75445ece7523.json | Fix unique bug (#39302)
* fix translation bug and add test
* refactor unique job queueing determination
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | src/Illuminate/Bus/UniqueLock.php | @@ -0,0 +1,48 @@
+<?php
+
+namespace Illuminate\Bus;
+
+use Illuminate\Contracts\Cache\Repository as Cache;
+
+class UniqueLock
+{
+ /**
+ * The cache repository implementation.
+ *
+ * @var \Illuminate\Contracts\Cache\Repository
+ */
+ protected $cache;
+
+ /**
+ * Create a new unique lock manager instance.
+ *
+ * @param \Illuminate\Contracts\Cache\Repository $cache
+ * @return void
+ */
+ public function __construct(Cache $cache)
+ {
+ $this->cache = $cache;
+ }
+
+ /**
+ * Attempt to acquire a lock for the given job.
+ *
+ * @param mixed $job
+ * @return bool
+ */
+ public function acquire($job)
+ {
+ $uniqueId = method_exists($job, 'uniqueId')
+ ? $job->uniqueId()
+ : ($job->uniqueId ?? '');
+
+ $cache = method_exists($job, 'uniqueVia')
+ ? $job->uniqueVia()
+ : $this->cache;
+
+ return (bool) $cache->lock(
+ $key = 'laravel_unique_job:'.get_class($job).$uniqueId,
+ $job->uniqueFor ?? 0
+ )->get();
+ }
+} | true |
Other | laravel | framework | 4b785c616169f5f621d1f87e9cbe75445ece7523.json | Fix unique bug (#39302)
* fix translation bug and add test
* refactor unique job queueing determination
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | src/Illuminate/Console/Scheduling/Schedule.php | @@ -4,10 +4,13 @@
use Closure;
use DateTimeInterface;
+use Illuminate\Bus\UniqueLock;
use Illuminate\Console\Application;
use Illuminate\Container\Container;
use Illuminate\Contracts\Bus\Dispatcher;
+use Illuminate\Contracts\Cache\Repository as Cache;
use Illuminate\Contracts\Container\BindingResolutionException;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\CallQueuedClosure;
use Illuminate\Support\ProcessUtils;
@@ -168,6 +171,35 @@ protected function dispatchToQueue($job, $queue, $connection)
$job = CallQueuedClosure::create($job);
}
+ if ($job instanceof ShouldBeUnique) {
+ return $this->dispatchUniqueJobToQueue($job, $queue, $connection);
+ }
+
+ $this->getDispatcher()->dispatch(
+ $job->onConnection($connection)->onQueue($queue)
+ );
+ }
+
+ /**
+ * Dispatch the given unique job to the queue.
+ *
+ * @param object $job
+ * @param string|null $queue
+ * @param string|null $connection
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
+ protected function dispatchUniqueJobToQueue($job, $queue, $connection)
+ {
+ if (! Container::getInstance()->bound(Cache::class)) {
+ throw new RuntimeException('Cache driver not available. Scheduling unique jobs not supported.');
+ }
+
+ if (! (new UniqueLock(Container::getInstance()->make(Cache::class)))->acquire($job)) {
+ return;
+ }
+
$this->getDispatcher()->dispatch(
$job->onConnection($connection)->onQueue($queue)
); | true |
Other | laravel | framework | 4b785c616169f5f621d1f87e9cbe75445ece7523.json | Fix unique bug (#39302)
* fix translation bug and add test
* refactor unique job queueing determination
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | src/Illuminate/Foundation/Bus/PendingDispatch.php | @@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Bus;
+use Illuminate\Bus\UniqueLock;
use Illuminate\Container\Container;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Contracts\Cache\Repository as Cache;
@@ -159,18 +160,8 @@ protected function shouldDispatch()
return true;
}
- $uniqueId = method_exists($this->job, 'uniqueId')
- ? $this->job->uniqueId()
- : ($this->job->uniqueId ?? '');
-
- $cache = method_exists($this->job, 'uniqueVia')
- ? $this->job->uniqueVia()
- : Container::getInstance()->make(Cache::class);
-
- return (bool) $cache->lock(
- $key = 'laravel_unique_job:'.get_class($this->job).$uniqueId,
- $this->job->uniqueFor ?? 0
- )->get();
+ return (new UniqueLock(Container::getInstance()->make(Cache::class)))
+ ->acquire($this->job);
}
/** | true |
Other | laravel | framework | 4b785c616169f5f621d1f87e9cbe75445ece7523.json | Fix unique bug (#39302)
* fix translation bug and add test
* refactor unique job queueing determination
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | tests/Integration/Console/UniqueJobSchedulingTest.php | @@ -0,0 +1,63 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Console;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Console\Scheduling\Schedule;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Support\Facades\Queue;
+use Orchestra\Testbench\TestCase;
+
+class UniqueJobSchedulingTest extends TestCase
+{
+ public function testJobsPushedToQueue()
+ {
+ Queue::fake();
+ $this->dispatch(
+ TestJob::class,
+ TestJob::class,
+ TestJob::class,
+ TestJob::class
+ );
+
+ Queue::assertPushed(TestJob::class, 4);
+ }
+
+ public function testUniqueJobsPushedToQueue()
+ {
+ Queue::fake();
+ $this->dispatch(
+ UniqueTestJob::class,
+ UniqueTestJob::class,
+ UniqueTestJob::class,
+ UniqueTestJob::class
+ );
+
+ Queue::assertPushed(UniqueTestJob::class, 1);
+ }
+
+ private function dispatch(...$jobs)
+ {
+ /** @var \Illuminate\Console\Scheduling\Schedule $scheduler */
+ $scheduler = $this->app->make(Schedule::class);
+ foreach ($jobs as $job) {
+ $scheduler->job($job)->name('')->everyMinute();
+ }
+ $events = $scheduler->events();
+ foreach ($events as $event) {
+ $event->run($this->app);
+ }
+ }
+}
+
+class TestJob implements ShouldQueue
+{
+ use InteractsWithQueue, Queueable, Dispatchable;
+}
+
+class UniqueTestJob extends TestJob implements ShouldBeUnique
+{
+} | true |
Other | laravel | framework | 024067fd56b227d74ce0b70d6b78ef5ad7095d6d.json | fix translation bug and add test (#39298)
* fix translation bug and add test
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | src/Illuminate/Translation/Translator.php | @@ -6,7 +6,6 @@
use Illuminate\Contracts\Translation\Loader;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use Illuminate\Support\Arr;
-use Illuminate\Support\Collection;
use Illuminate\Support\NamespacedItemResolver;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
@@ -216,30 +215,15 @@ protected function makeReplacements($line, array $replace)
return $line;
}
- $replace = $this->sortReplacements($replace);
+ $shouldReplace = [];
foreach ($replace as $key => $value) {
- $line = str_replace(
- [':'.$key, ':'.Str::upper($key), ':'.Str::ucfirst($key)],
- [$value, Str::upper($value), Str::ucfirst($value)],
- $line
- );
+ $shouldReplace[':'.$key] = $value;
+ $shouldReplace[':'.Str::upper($key)] = Str::upper($value);
+ $shouldReplace[':'.Str::ucfirst($key)] = Str::ucfirst($value);
}
- return $line;
- }
-
- /**
- * Sort the replacements array.
- *
- * @param array $replace
- * @return array
- */
- protected function sortReplacements(array $replace)
- {
- return (new Collection($replace))->sortBy(function ($value, $key) {
- return mb_strlen($key) * -1;
- })->all();
+ return strtr($line, $shouldReplace);
}
/** | true |
Other | laravel | framework | 024067fd56b227d74ce0b70d6b78ef5ad7095d6d.json | fix translation bug and add test (#39298)
* fix translation bug and add test
* Apply fixes from StyleCI
Co-authored-by: Taylor Otwell <taylorotwell@users.noreply.github.com> | tests/Translation/TranslationTranslatorTest.php | @@ -150,6 +150,13 @@ public function testGetJsonReplaces()
$this->assertSame('bar onetwo three', $t->get('foo :i:c :u', ['i' => 'one', 'c' => 'two', 'u' => 'three']));
}
+ public function testGetJsonHasAtomicReplacements()
+ {
+ $t = new Translator($this->getLoader(), 'en');
+ $t->getLoader()->shouldReceive('load')->once()->with('en', '*', '*')->andReturn(['Hello :foo!' => 'Hello :foo!']);
+ $this->assertSame('Hello baz:bar!', $t->get('Hello :foo!', ['foo' => 'baz:bar', 'bar' => 'abcdef']));
+ }
+
public function testGetJsonReplacesForAssociativeInput()
{
$t = new Translator($this->getLoader(), 'en'); | true |
Other | laravel | framework | 790c4d4d2bb4417d35c2ff2323ed2d8305ae4d03.json | Use expectNotToPerformAssertions. (#39240) | tests/Events/EventsSubscriberTest.php | @@ -16,23 +16,25 @@ protected function tearDown(): void
public function testEventSubscribers()
{
+ $this->expectNotToPerformAssertions();
+
$d = new Dispatcher($container = m::mock(Container::class));
$subs = m::mock(ExampleSubscriber::class);
$subs->shouldReceive('subscribe')->once()->with($d);
$container->shouldReceive('make')->once()->with(ExampleSubscriber::class)->andReturn($subs);
$d->subscribe(ExampleSubscriber::class);
- $this->assertTrue(true);
}
public function testEventSubscribeCanAcceptObject()
{
+ $this->expectNotToPerformAssertions();
+
$d = new Dispatcher;
$subs = m::mock(ExampleSubscriber::class);
$subs->shouldReceive('subscribe')->once()->with($d);
$d->subscribe($subs);
- $this->assertTrue(true);
}
public function testEventSubscribeCanReturnMappings() | true |
Other | laravel | framework | 790c4d4d2bb4417d35c2ff2323ed2d8305ae4d03.json | Use expectNotToPerformAssertions. (#39240) | tests/Integration/Database/SchemaBuilderTest.php | @@ -17,6 +17,8 @@ class SchemaBuilderTest extends DatabaseTestCase
{
public function testDropAllTables()
{
+ $this->expectNotToPerformAssertions();
+
Schema::create('table', function (Blueprint $table) {
$table->increments('id');
});
@@ -26,19 +28,17 @@ public function testDropAllTables()
Schema::create('table', function (Blueprint $table) {
$table->increments('id');
});
-
- $this->assertTrue(true);
}
public function testDropAllViews()
{
+ $this->expectNotToPerformAssertions();
+
DB::statement('create view "view"("id") as select 1');
Schema::dropAllViews();
DB::statement('create view "view"("id") as select 1');
-
- $this->assertTrue(true);
}
public function testRegisterCustomDoctrineType() | true |
Other | laravel | framework | 790c4d4d2bb4417d35c2ff2323ed2d8305ae4d03.json | Use expectNotToPerformAssertions. (#39240) | tests/Integration/Log/LoggingIntegrationTest.php | @@ -9,8 +9,8 @@ class LoggingIntegrationTest extends TestCase
{
public function testLoggingCanBeRunWithoutEncounteringExceptions()
{
- Log::info('Hello World');
+ $this->expectNotToPerformAssertions();
- $this->assertTrue(true);
+ Log::info('Hello World');
}
} | true |
Other | laravel | framework | 790c4d4d2bb4417d35c2ff2323ed2d8305ae4d03.json | Use expectNotToPerformAssertions. (#39240) | tests/Routing/ImplicitRouteBindingTest.php | @@ -12,6 +12,8 @@ class ImplicitRouteBindingTest extends TestCase
{
public function test_it_can_resolve_the_implicit_route_bindings_for_the_given_route()
{
+ $this->expectNotToPerformAssertions();
+
$action = ['uses' => function (ImplicitRouteBindingUser $user) {
return $user;
}];
@@ -24,8 +26,6 @@ public function test_it_can_resolve_the_implicit_route_bindings_for_the_given_ro
$container = Container::getInstance();
ImplicitRouteBinding::resolveForRoute($container, $route);
-
- $this->assertTrue(true);
}
}
| true |
Other | laravel | framework | da8aff4338753feda04a9ca794168e0dd7de94e4.json | Add missing tests imports. (#39246) | tests/Bus/BusBatchTest.php | @@ -20,6 +20,7 @@
use Mockery as m;
use PHPUnit\Framework\TestCase;
use RuntimeException;
+use stdClass;
class BusBatchTest extends TestCase
{ | true |
Other | laravel | framework | da8aff4338753feda04a9ca794168e0dd7de94e4.json | Add missing tests imports. (#39246) | tests/Database/DatabaseMigrationMigrateCommandTest.php | @@ -9,6 +9,7 @@
use Illuminate\Foundation\Application;
use Mockery as m;
use PHPUnit\Framework\TestCase;
+use stdClass;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
| true |
Other | laravel | framework | da8aff4338753feda04a9ca794168e0dd7de94e4.json | Add missing tests imports. (#39246) | tests/Integration/Events/ListenerTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Integration\Events;
+use Illuminate\Database\DatabaseTransactionsManager;
use Illuminate\Support\Facades\Event;
use Mockery as m;
use Orchestra\Testbench\TestCase; | true |
Other | laravel | framework | da8aff4338753feda04a9ca794168e0dd7de94e4.json | Add missing tests imports. (#39246) | tests/Integration/Http/ResourceTest.php | @@ -4,6 +4,7 @@
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Http\Exceptions\PostTooLargeException;
+use Illuminate\Http\Request;
use Illuminate\Http\Resources\ConditionallyLoadsAttributes;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\MergeValue; | true |
Other | laravel | framework | da8aff4338753feda04a9ca794168e0dd7de94e4.json | Add missing tests imports. (#39246) | tests/Testing/Concerns/TestDatabasesTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Testing\Concerns;
+use Illuminate\Config\Repository as Config;
use Illuminate\Container\Container;
use Illuminate\Support\Facades\DB;
use Illuminate\Testing\Concerns\TestDatabases; | true |
Other | laravel | framework | 994cf4c422e59a7d2ee188bf7d5537f64f6c9e23.json | Define the expected exception (#39248) | tests/Database/DatabaseConnectionTest.php | @@ -408,6 +408,7 @@ public function testLogQueryFiresEventsIfSet()
public function testBeforeExecutingHooksCanBeRegistered()
{
+ $this->expectException(Exception::class);
$this->expectExceptionMessage('The callback was fired');
$connection = $this->getMockConnection(); | true |
Other | laravel | framework | 994cf4c422e59a7d2ee188bf7d5537f64f6c9e23.json | Define the expected exception (#39248) | tests/Database/DatabaseSchemaBlueprintIntegrationTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Database;
+use BadMethodCallException;
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Schema\Blueprint;
@@ -326,6 +327,7 @@ public function testAddUniqueIndexWithNameWorks()
public function testItEnsuresDroppingMultipleColumnsIsAvailable()
{
+ $this->expectException(BadMethodCallException::class);
$this->expectExceptionMessage("SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.");
$this->db->connection()->getSchemaBuilder()->table('users', function (Blueprint $table) {
@@ -336,6 +338,7 @@ public function testItEnsuresDroppingMultipleColumnsIsAvailable()
public function testItEnsuresRenamingMultipleColumnsIsAvailable()
{
+ $this->expectException(BadMethodCallException::class);
$this->expectExceptionMessage("SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.");
$this->db->connection()->getSchemaBuilder()->table('users', function (Blueprint $table) {
@@ -346,6 +349,7 @@ public function testItEnsuresRenamingMultipleColumnsIsAvailable()
public function testItEnsuresRenamingAndDroppingMultipleColumnsIsAvailable()
{
+ $this->expectException(BadMethodCallException::class);
$this->expectExceptionMessage("SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.");
$this->db->connection()->getSchemaBuilder()->table('users', function (Blueprint $table) {
@@ -356,6 +360,7 @@ public function testItEnsuresRenamingAndDroppingMultipleColumnsIsAvailable()
public function testItEnsuresDroppingForeignKeyIsAvailable()
{
+ $this->expectException(BadMethodCallException::class);
$this->expectExceptionMessage("SQLite doesn't support dropping foreign keys (you would need to re-create the table).");
$this->db->connection()->getSchemaBuilder()->table('users', function (Blueprint $table) { | true |
Other | laravel | framework | 994cf4c422e59a7d2ee188bf7d5537f64f6c9e23.json | Define the expected exception (#39248) | tests/Integration/Queue/JobEncryptionTest.php | @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Integration\Queue;
use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Schema\Blueprint;
@@ -68,6 +69,7 @@ public function testNonEncryptedJobPayloadIsStoredRaw()
{
Bus::dispatch(new JobEncryptionTestNonEncryptedJob);
+ $this->expectException(DecryptException::class);
$this->expectExceptionMessage('The payload is invalid');
$this->assertInstanceOf(JobEncryptionTestNonEncryptedJob::class, | true |
Other | laravel | framework | 994cf4c422e59a7d2ee188bf7d5537f64f6c9e23.json | Define the expected exception (#39248) | tests/View/Blade/BladeEchoHandlerTest.php | @@ -54,6 +54,7 @@ public function testWhitespaceIsPreservedCorrectly()
*/
public function testHandlerLogicWorksCorrectly($blade)
{
+ $this->expectException(Exception::class);
$this->expectExceptionMessage('The fluent object has been successfully handled!');
$this->compiler->stringable(Fluent::class, function ($object) { | true |
Other | laravel | framework | a01e9edfadb140559d1bbf9999dda49148bfa5f7.json | add alias method | src/Illuminate/Collections/Traits/EnumeratesValues.php | @@ -772,6 +772,20 @@ class_basename(static::class), gettype($result)
return $result;
}
+ /**
+ * Reduce the collection to multiple aggregate values.
+ *
+ * @param callable $callback
+ * @param mixed ...$initial
+ * @return array
+ *
+ * @throws \UnexpectedValueException
+ */
+ public function reduceSpread(callable $callback, ...$initial)
+ {
+ return $this->reduceMany($callback, ...$initial);
+ }
+
/**
* Reduce an associative collection to a single value.
* | false |
Other | laravel | framework | c7278f172ecd0447f6f6ce21516bd48273d7c9b7.json | Apply fixes from StyleCI | src/Illuminate/View/Concerns/ManagesLoops.php | @@ -23,7 +23,7 @@ trait ManagesLoops
public function addLoop($data)
{
$length = is_countable($data) && ! $data instanceof LazyCollection
- ? count($data)
+ ? count($data)
: null;
$parent = Arr::last($this->loopsStack); | false |
Other | laravel | framework | e5bfb69708085fef4e48250e3c264df2865198e9.json | Ignore tablespaces in dump (#39126)
Less likely to hit permissions issues in newer versions of MySQL | src/Illuminate/Database/Schema/MySqlSchemaState.php | @@ -85,7 +85,7 @@ public function load($path)
*/
protected function baseDumpCommand()
{
- $command = 'mysqldump '.$this->connectionString().' --skip-add-locks --skip-comments --skip-set-charset --tz-utc';
+ $command = 'mysqldump '.$this->connectionString().' --no-tablespaces --skip-add-locks --skip-comments --skip-set-charset --tz-utc';
if (! $this->connection->isMaria()) {
$command .= ' --column-statistics=0 --set-gtid-purged=OFF'; | false |
Other | laravel | framework | 93b56001c5045a8327a154b6a6534d5faf860bbd.json | Replace \r\n with a proper PHP_EOL | src/Illuminate/Routing/Console/ControllerMakeCommand.php | @@ -223,7 +223,7 @@ protected function buildFormRequestReplacements(array $replace, $modelClass)
$namespacedRequests = $namespace.'\\'.$storeRequestClass.';';
if ($storeRequestClass != $updateRequestClass) {
- $namespacedRequests .= "\r\nuse ".$namespace.'\\'.$updateRequestClass.';';
+ $namespacedRequests .= PHP_EOL."use ".$namespace.'\\'.$updateRequestClass.';';
}
return array_merge($replace, [ | false |
Other | laravel | framework | 51e910670daeeb2f9bbd80f4ccf8e48c3d0abbdb.json | Apply fixes from StyleCI | src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php | @@ -366,12 +366,12 @@ public function whereRelation($relation, $column, $operator = null, $value = nul
return $this->when(
$relations->count() == 1,
- function($query) use ($relations, $column, $operator, $value) {
+ function ($query) use ($relations, $column, $operator, $value) {
$query->whereHas($relations->first(), function ($query) use ($column, $operator, $value) {
$query->where($column, $operator, $value);
});
},
- function($query) use ($relations, $column, $operator, $value) {
+ function ($query) use ($relations, $column, $operator, $value) {
$query->whereHas($relations->first(), function ($query) use ($relations, $column, $operator, $value) {
$relations->shift();
@@ -393,15 +393,15 @@ function($query) use ($relations, $column, $operator, $value) {
public function orWhereRelation($relation, $column, $operator = null, $value = null)
{
$relations = collect(explode('.', $relation));
-
+
return $this->when(
$relations->count() == 1,
- function($query) use ($relations, $column, $operator, $value) {
+ function ($query) use ($relations, $column, $operator, $value) {
$query->orWhereHas($relations->first(), function ($query) use ($column, $operator, $value) {
$query->where($column, $operator, $value);
});
},
- function($query) use ($relations, $column, $operator, $value) {
+ function ($query) use ($relations, $column, $operator, $value) {
$query->orWhereHas($relations->first(), function ($query) use ($relations, $column, $operator, $value) {
$relations->shift();
| false |
Other | laravel | framework | df0ede93019c1193efd8c3e933b856bfea830475.json | Apply fixes from StyleCI | src/Illuminate/Console/OutputStyle.php | @@ -68,7 +68,7 @@ public function isDebug()
{
return $this->output->isDebug();
}
-
+
/**
* Get the underlying Symfony output implementation.
* | false |
Other | laravel | framework | 9b85771608d71988078fb9ce2b5c44c7e1fdfef6.json | Add stringable support for strip_tags() (#39098)
* Update Stringable.php
* Update SupportStringableTest.php
* Update Stringable.php
* Update SupportStringableTest.php
* Update Stringable.php
* Update SupportStringableTest.php
Co-authored-by: Taylor Otwell <taylor@laravel.com> | src/Illuminate/Support/Stringable.php | @@ -565,6 +565,17 @@ public function start($prefix)
return new static(Str::start($this->value, $prefix));
}
+ /**
+ * Strip HTML and PHP tags from the given string.
+ *
+ * @param string $allowedTags
+ * @return static
+ */
+ public function stripTags($allowedTags = null)
+ {
+ return new static(strip_tags($this->value, $allowedTags));
+ }
+
/**
* Convert the given string to upper-case.
* | true |
Other | laravel | framework | 9b85771608d71988078fb9ce2b5c44c7e1fdfef6.json | Add stringable support for strip_tags() (#39098)
* Update Stringable.php
* Update SupportStringableTest.php
* Update Stringable.php
* Update SupportStringableTest.php
* Update Stringable.php
* Update SupportStringableTest.php
Co-authored-by: Taylor Otwell <taylor@laravel.com> | tests/Support/SupportStringableTest.php | @@ -686,4 +686,12 @@ public function testWordCount()
$this->assertEquals(2, $this->stringable('Hello, world!')->wordCount());
$this->assertEquals(10, $this->stringable('Hi, this is my first contribution to the Laravel framework.')->wordCount());
}
+
+ public function testStripTags()
+ {
+ $this->assertSame('beforeafter', (string) $this->stringable('before<br>after')->stripTags());
+ $this->assertSame('before<br>after', (string) $this->stringable('before<br>after')->stripTags('<br>'));
+ $this->assertSame('before<br>after', (string) $this->stringable('<strong>before</strong><br>after')->stripTags('<br>'));
+ $this->assertSame('<strong>before</strong><br>after', (string) $this->stringable('<strong>before</strong><br>after')->stripTags('<br><strong>'));
+ }
} | true |
Other | laravel | framework | 9b0a166660c3b3e3b166d1e4f96115c7f338a4af.json | Add test for withoutContext (#39094) | tests/Log/LogLoggerTest.php | @@ -36,6 +36,17 @@ public function testContextIsAddedToAllSubsequentLogs()
$writer->error('foo');
}
+ public function testContextIsFlushed()
+ {
+ $writer = new Logger($monolog = m::mock(Monolog::class));
+ $writer->withContext(['bar' => 'baz']);
+ $writer->withoutContext();
+
+ $monolog->expects('error')->with('foo', []);
+
+ $writer->error('foo');
+ }
+
public function testLoggerFiresEventsDispatcher()
{
$writer = new Logger($monolog = m::mock(Monolog::class), $events = new Dispatcher); | false |
Other | laravel | framework | d6fd27cdb37b41f58135a8148e37e523f5a7c632.json | Remove password rule (#39030) | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | @@ -1369,19 +1369,6 @@ public function validateNumeric($attribute, $value)
return is_numeric($value);
}
- /**
- * Validate that the password of the currently authenticated user matches the given value.
- *
- * @param string $attribute
- * @param mixed $value
- * @param array $parameters
- * @return bool
- */
- protected function validatePassword($attribute, $value, $parameters)
- {
- return $this->validateCurrentPassword($attribute, $value, $parameters);
- }
-
/**
* Validate that an attribute exists even if not filled.
* | true |
Other | laravel | framework | d6fd27cdb37b41f58135a8148e37e523f5a7c632.json | Remove password rule (#39030) | tests/Validation/ValidationValidatorTest.php | @@ -880,100 +880,6 @@ public function testValidationStopsAtFailedPresenceCheck()
$this->assertEquals(['validation.present'], $v->errors()->get('name'));
}
- public function testValidatePassword()
- {
- // Fails when user is not logged in.
- $auth = m::mock(Guard::class);
- $auth->shouldReceive('guard')->andReturn($auth);
- $auth->shouldReceive('guest')->andReturn(true);
-
- $hasher = m::mock(Hasher::class);
-
- $container = m::mock(Container::class);
- $container->shouldReceive('make')->with('auth')->andReturn($auth);
- $container->shouldReceive('make')->with('hash')->andReturn($hasher);
-
- $trans = $this->getTranslator();
- $trans->shouldReceive('get')->andReturnArg(0);
-
- $v = new Validator($trans, ['password' => 'foo'], ['password' => 'password']);
- $v->setContainer($container);
-
- $this->assertFalse($v->passes());
-
- // Fails when password is incorrect.
- $user = m::mock(Authenticatable::class);
- $user->shouldReceive('getAuthPassword');
-
- $auth = m::mock(Guard::class);
- $auth->shouldReceive('guard')->andReturn($auth);
- $auth->shouldReceive('guest')->andReturn(false);
- $auth->shouldReceive('user')->andReturn($user);
-
- $hasher = m::mock(Hasher::class);
- $hasher->shouldReceive('check')->andReturn(false);
-
- $container = m::mock(Container::class);
- $container->shouldReceive('make')->with('auth')->andReturn($auth);
- $container->shouldReceive('make')->with('hash')->andReturn($hasher);
-
- $trans = $this->getTranslator();
- $trans->shouldReceive('get')->andReturnArg(0);
-
- $v = new Validator($trans, ['password' => 'foo'], ['password' => 'password']);
- $v->setContainer($container);
-
- $this->assertFalse($v->passes());
-
- // Succeeds when password is correct.
- $user = m::mock(Authenticatable::class);
- $user->shouldReceive('getAuthPassword');
-
- $auth = m::mock(Guard::class);
- $auth->shouldReceive('guard')->andReturn($auth);
- $auth->shouldReceive('guest')->andReturn(false);
- $auth->shouldReceive('user')->andReturn($user);
-
- $hasher = m::mock(Hasher::class);
- $hasher->shouldReceive('check')->andReturn(true);
-
- $container = m::mock(Container::class);
- $container->shouldReceive('make')->with('auth')->andReturn($auth);
- $container->shouldReceive('make')->with('hash')->andReturn($hasher);
-
- $trans = $this->getTranslator();
- $trans->shouldReceive('get')->andReturnArg(0);
-
- $v = new Validator($trans, ['password' => 'foo'], ['password' => 'password']);
- $v->setContainer($container);
-
- $this->assertTrue($v->passes());
-
- // We can use a specific guard.
- $user = m::mock(Authenticatable::class);
- $user->shouldReceive('getAuthPassword');
-
- $auth = m::mock(Guard::class);
- $auth->shouldReceive('guard')->with('custom')->andReturn($auth);
- $auth->shouldReceive('guest')->andReturn(false);
- $auth->shouldReceive('user')->andReturn($user);
-
- $hasher = m::mock(Hasher::class);
- $hasher->shouldReceive('check')->andReturn(true);
-
- $container = m::mock(Container::class);
- $container->shouldReceive('make')->with('auth')->andReturn($auth);
- $container->shouldReceive('make')->with('hash')->andReturn($hasher);
-
- $trans = $this->getTranslator();
- $trans->shouldReceive('get')->andReturnArg(0);
-
- $v = new Validator($trans, ['password' => 'foo'], ['password' => 'password:custom']);
- $v->setContainer($container);
-
- $this->assertTrue($v->passes());
- }
-
public function testValidatePresent()
{
$trans = $this->getIlluminateArrayTranslator(); | true |
Other | laravel | framework | 2574aca756138811b331060bb0d572592971d764.json | Fix assertPushedOn docblock (#38987) | src/Illuminate/Support/Facades/Queue.php | @@ -19,7 +19,7 @@
* @method static void assertNotPushed(string|\Closure $job, callable $callback = null)
* @method static void assertNothingPushed()
* @method static void assertPushed(string|\Closure $job, callable|int $callback = null)
- * @method static void assertPushedOn(string $queue, string|\Closure $job, callable|int $callback = null)
+ * @method static void assertPushedOn(string $queue, string|\Closure $job, callable $callback = null)
* @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable $callback = null)
*
* @see \Illuminate\Queue\QueueManager | false |
Other | laravel | framework | 9e0e6df6dbc14290118c23733bbe85a1f0eb8ea3.json | Fix typo in the doc of BelongsToMany.php (#38912)
* Update BelongsToMany.php
* Update BelongsToMany.php
Co-authored-by: Taylor Otwell <taylor@laravel.com> | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -277,7 +277,7 @@ public function match(array $models, Collection $results, $relation)
// Once we have an array dictionary of child objects we can easily match the
// children back to their parent using the dictionary and the keys on the
- // the parent models. Then we will return the hydrated models back out.
+ // parent models. Then we should return these hydrated models back out.
foreach ($models as $model) {
$key = $this->getDictionaryKey($model->{$this->parentKey});
| false |
Other | laravel | framework | 53ac15248368ebda4a809b08ec0f25218ee9e6d5.json | add method to contract | src/Illuminate/Contracts/Encryption/Encrypter.php | @@ -25,4 +25,11 @@ public function encrypt($value, $serialize = true);
* @throws \Illuminate\Contracts\Encryption\DecryptException
*/
public function decrypt($payload, $unserialize = true);
+
+ /**
+ * Get the encryption key that the encrypter is currently using.
+ *
+ * @return string
+ */
+ public function getKey();
} | true |
Other | laravel | framework | 53ac15248368ebda4a809b08ec0f25218ee9e6d5.json | add method to contract | src/Illuminate/Encryption/Encrypter.php | @@ -256,7 +256,7 @@ protected function validMac(array $payload)
}
/**
- * Get the encryption key.
+ * Get the encryption key that the encrypter is currently using.
*
* @return string
*/ | true |
Other | laravel | framework | 195529f6256464ec5df7b87d9a3ecfea5121e984.json | Use correct type hint for redirectTo (#38882) | src/Illuminate/Auth/AuthenticationException.php | @@ -16,7 +16,7 @@ class AuthenticationException extends Exception
/**
* The path the user should be redirected to.
*
- * @var string
+ * @var string|null
*/
protected $redirectTo;
@@ -49,7 +49,7 @@ public function guards()
/**
* Get the path the user should be redirected to.
*
- * @return string
+ * @return string|null
*/
public function redirectTo()
{ | false |
Other | laravel | framework | 544b315513aad36380563c11d041670276dedc7f.json | add missing punctuation (#38863) | src/Illuminate/Foundation/Inspiring.php | @@ -25,7 +25,7 @@ public static function quote()
'Be present above all else. - Naval Ravikant',
'Happiness is not something readymade. It comes from your own actions. - Dalai Lama',
'He who is contented is rich. - Laozi',
- 'I begin to speak only when I am certain what I will say is not better left unsaid - Cato the Younger',
+ 'I begin to speak only when I am certain what I will say is not better left unsaid. - Cato the Younger',
'If you do not have a consistent goal in life, you can not live it in a consistent way. - Marcus Aurelius',
'It is not the man who has too little, but the man who craves more, that is poor. - Seneca',
'It is quality rather than quantity that matters. - Lucius Annaeus Seneca', | false |
Other | laravel | framework | c0c46a4aad10c186419a129283573e86b7c05798.json | add missing method signature in docblock (#38848) | src/Illuminate/Support/Facades/Bus.php | @@ -24,6 +24,7 @@
* @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1)
* @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null)
* @method static void assertBatched(callable $callback)
+ * @method static void assertChained(array $expectedChain)
*
* @see \Illuminate\Contracts\Bus\Dispatcher
*/ | false |
Other | laravel | framework | 913c2a1a6ef70a1574c69c0dbb178f2e0b8c6ea8.json | Add singular syntactic sugar (#38815) | src/Illuminate/Foundation/Testing/Wormhole.php | @@ -24,6 +24,17 @@ public function __construct($value)
$this->value = $value;
}
+ /**
+ * Travel forward the given number of milliseconds.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function millisecond($callback = null)
+ {
+ return $this->milliseconds($callback);
+ }
+
/**
* Travel forward the given number of milliseconds.
*
@@ -37,6 +48,17 @@ public function milliseconds($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of seconds.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function second($callback = null)
+ {
+ return $this->seconds($callback);
+ }
+
/**
* Travel forward the given number of seconds.
*
@@ -63,6 +85,17 @@ public function minutes($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of hours.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function hour($callback = null)
+ {
+ return $this->hours($callback);
+ }
+
/**
* Travel forward the given number of hours.
*
@@ -76,6 +109,17 @@ public function hours($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of days.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function day($callback = null)
+ {
+ return $this->days($callback);
+ }
+
/**
* Travel forward the given number of days.
*
@@ -89,6 +133,17 @@ public function days($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of weeks.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function week($callback = null)
+ {
+ return $this->weeks($callback);
+ }
+
/**
* Travel forward the given number of weeks.
*
@@ -102,6 +157,17 @@ public function weeks($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of months.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function month($callback = null)
+ {
+ return $this->months($callback);
+ }
+
/**
* Travel forward the given number of months.
*
@@ -115,6 +181,17 @@ public function months($callback = null)
return $this->handleCallback($callback);
}
+ /**
+ * Travel forward the given number of years.
+ *
+ * @param callable|null $callback
+ * @return mixed
+ */
+ public function year($callback = null)
+ {
+ return $this->years($callback);
+ }
+
/**
* Travel forward the given number of years.
* | false |
Other | laravel | framework | 089ce46a43219c05f6087e7aed61474693b83be7.json | Fix $expectedListener in docblock (#38813) | src/Illuminate/Support/Facades/Event.php | @@ -17,7 +17,7 @@
* @method static void assertDispatchedTimes(string $event, int $times = 1)
* @method static void assertNotDispatched(string|\Closure $event, callable|int $callback = null)
* @method static void assertNothingDispatched()
- * @method static void assertListening(string $expectedEvent, string expectedListener)
+ * @method static void assertListening(string $expectedEvent, string $expectedListener)
* @method static void flush(string $event)
* @method static void forget(string $event)
* @method static void forgetPushed() | false |
Other | laravel | framework | aeaafd5d172883744b0ebb8571986ada25722d1b.json | fix doc block | src/Illuminate/Database/Eloquent/Relations/Relation.php | @@ -407,7 +407,7 @@ public static function requiresMorphMap()
/**
* Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped.
*
- * @param array|null $map
+ * @param array $map
* @param bool $merge
* @return array
*/ | false |
Other | laravel | framework | 1e956837e1f6c4fded69db19ee9e1484d08591f6.json | Apply fixes from StyleCI | src/Illuminate/Redis/RedisManager.php | @@ -7,8 +7,8 @@
use Illuminate\Redis\Connections\Connection;
use Illuminate\Redis\Connectors\PhpRedisConnector;
use Illuminate\Redis\Connectors\PredisConnector;
-use Illuminate\Support\ConfigurationUrlParser;
use Illuminate\Support\Arr;
+use Illuminate\Support\ConfigurationUrlParser;
use InvalidArgumentException;
/** | true |
Other | laravel | framework | 1e956837e1f6c4fded69db19ee9e1484d08591f6.json | Apply fixes from StyleCI | tests/Redis/RedisConnectorTest.php | @@ -181,7 +181,7 @@ public function testPredisConfigurationWithUsername()
$this->assertEquals($username, $parameters->username);
$this->assertEquals($password, $parameters->password);
}
-
+
public function testPredisConfigurationWithSentinel()
{
$host = env('REDIS_HOST', '127.0.0.1');
@@ -195,8 +195,8 @@ public function testPredisConfigurationWithSentinel()
'parameters' => [
'default' => [
'database' => 5,
- ]
- ]
+ ],
+ ],
],
'default' => [
"tcp://{$host}:{$port}", | true |
Other | laravel | framework | 510651a2f0f552f92a6686b556306187fb44dbe3.json | Use lowercase for hmac hash algorithm (#38787) | src/Illuminate/Foundation/Console/stubs/maintenance-mode.stub | @@ -48,7 +48,7 @@ if (isset($_COOKIE['laravel_maintenance']) && isset($data['secret'])) {
if (is_array($payload) &&
is_numeric($payload['expires_at'] ?? null) &&
isset($payload['mac']) &&
- hash_equals(hash_hmac('SHA256', $payload['expires_at'], $data['secret']), $payload['mac']) &&
+ hash_equals(hash_hmac('sha256', $payload['expires_at'], $data['secret']), $payload['mac']) &&
(int) $payload['expires_at'] >= time()) {
return;
} | true |
Other | laravel | framework | 510651a2f0f552f92a6686b556306187fb44dbe3.json | Use lowercase for hmac hash algorithm (#38787) | src/Illuminate/Foundation/Http/MaintenanceModeBypassCookie.php | @@ -19,7 +19,7 @@ public static function create(string $key)
return new Cookie('laravel_maintenance', base64_encode(json_encode([
'expires_at' => $expiresAt->getTimestamp(),
- 'mac' => hash_hmac('SHA256', $expiresAt->getTimestamp(), $key),
+ 'mac' => hash_hmac('sha256', $expiresAt->getTimestamp(), $key),
])), $expiresAt);
}
@@ -37,7 +37,7 @@ public static function isValid(string $cookie, string $key)
return is_array($payload) &&
is_numeric($payload['expires_at'] ?? null) &&
isset($payload['mac']) &&
- hash_equals(hash_hmac('SHA256', $payload['expires_at'], $key), $payload['mac']) &&
+ hash_equals(hash_hmac('sha256', $payload['expires_at'], $key), $payload['mac']) &&
(int) $payload['expires_at'] >= Carbon::now()->getTimestamp();
}
} | true |
Other | laravel | framework | beda5af8952ecac04aadfe9278d4b79d9135fadd.json | Apply fixes from StyleCI | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -121,7 +121,7 @@ public function match(Request $request)
if ($result = $matcher->matchRequest($trimmedRequest)) {
$route = $this->getByName($result['_route']);
}
- } catch (ResourceNotFoundException | MethodNotAllowedException $e) {
+ } catch (ResourceNotFoundException|MethodNotAllowedException $e) {
try {
return $this->routes->match($request);
} catch (NotFoundHttpException $e) {
@@ -136,7 +136,7 @@ public function match(Request $request)
if (! $dynamicRoute->isFallback) {
$route = $dynamicRoute;
}
- } catch (NotFoundHttpException | MethodNotAllowedHttpException $e) {
+ } catch (NotFoundHttpException|MethodNotAllowedHttpException $e) {
//
}
} | true |
Other | laravel | framework | beda5af8952ecac04aadfe9278d4b79d9135fadd.json | Apply fixes from StyleCI | tests/Integration/Foundation/Fixtures/EventDiscovery/UnionListeners/UnionListener.php | @@ -7,7 +7,7 @@
class UnionListener
{
- public function handle(EventOne | EventTwo $event)
+ public function handle(EventOne|EventTwo $event)
{
//
} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.