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 | 47b934e6b8c8306e4813590b8d390f0ba5e196b9.json | Ensure return null are consistent. (#20884) | src/Illuminate/Auth/Access/Gate.php | @@ -398,7 +398,7 @@ public function getPolicyFor($class)
}
if (! is_string($class)) {
- return null;
+ return;
}
if (isset($this->policies[$class])) { | true |
Other | laravel | framework | 47b934e6b8c8306e4813590b8d390f0ba5e196b9.json | Ensure return null are consistent. (#20884) | tests/Broadcasting/BroadcasterTest.php | @@ -126,6 +126,6 @@ public function where($key, $value)
public function first()
{
- return null;
+ //
}
} | true |
Other | laravel | framework | 47b934e6b8c8306e4813590b8d390f0ba5e196b9.json | Ensure return null are consistent. (#20884) | tests/Queue/QueueSyncQueueTest.php | @@ -59,7 +59,7 @@ public function getQueueableId()
public function getQueueableConnection()
{
- return null;
+ //
}
}
| true |
Other | laravel | framework | 47b934e6b8c8306e4813590b8d390f0ba5e196b9.json | Ensure return null are consistent. (#20884) | tests/Routing/RoutingUrlGeneratorTest.php | @@ -468,7 +468,7 @@ public function getRouteKeyName()
public function resolveRouteBinding($routeKey)
{
- return null;
+ //
}
}
| true |
Other | laravel | framework | 5f40dc6e547043d5fd9b8f7d1baaaeec4d953c53.json | Fix LengthAwarePaginator docblocks (#20899) | src/Illuminate/Pagination/LengthAwarePaginator.php | @@ -71,7 +71,7 @@ protected function setCurrentPage($currentPage, $pageName)
*
* @param string $view
* @param array $data
- * @return string
+ * @return \Illuminate\Support\HtmlString
*/
public function links($view = null, $data = [])
{
@@ -83,7 +83,7 @@ public function lin... | false |
Other | laravel | framework | add68eafe262955a587c181ecfc85598d6467402.json | Fix typos and add missing docblocks | src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php | @@ -47,7 +47,7 @@ class ConcurrencyLimiterBuilder
/**
* Create a new builder instance.
*
- * @param \Illuminate\Redis\Connetions\Connection $connection
+ * @param \Illuminate\Redis\Connections\Connection $connection
* @param string $name
* @return void
*/
@@ -100,8 +100,... | true |
Other | laravel | framework | add68eafe262955a587c181ecfc85598d6467402.json | Fix typos and add missing docblocks | src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php | @@ -47,7 +47,7 @@ class DurationLimiterBuilder
/**
* Create a new builder instance.
*
- * @param \Illuminate\Redis\Connetions\Connection $connection
+ * @param \Illuminate\Redis\Connections\Connection $connection
* @param string $name
* @return void
*/
@@ -100,8 +100,10 ... | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Broadcasting/BroadcastEvent.php | @@ -6,7 +6,6 @@
use ReflectionProperty;
use Illuminate\Support\Arr;
use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\Job;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Broadcasting\Broadcaster; | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php | @@ -5,7 +5,6 @@
use ReflectionFunction;
use Illuminate\Support\Str;
use Illuminate\Container\Container;
-use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Routing\UrlRoutable;
use Illuminate\Contracts\Routing\BindingRegistrar;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Cache/DatabaseStore.php | @@ -4,7 +4,6 @@
use Closure;
use Exception;
-use Illuminate\Support\Carbon;
use Illuminate\Contracts\Cache\Store;
use Illuminate\Support\InteractsWithTime;
use Illuminate\Database\ConnectionInterface; | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Foundation/Console/OptimizeCommand.php | @@ -3,7 +3,6 @@
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
-use Illuminate\Support\Composer;
use Symfony\Component\Console\Input\InputOption;
class OptimizeCommand extends Command | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -8,7 +8,6 @@
use Illuminate\Contracts\View\View;
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\Assert as PHPUnit;
-use Symfony\Component\HttpFoundation\Cookie;
/**
* @mixin \Illuminate\Http\Response | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Http/Resources/CollectsResources.php | @@ -3,7 +3,6 @@
namespace Illuminate\Http\Resources;
use Illuminate\Support\Str;
-use Illuminate\Support\Collection;
use Illuminate\Pagination\AbstractPaginator;
trait CollectsResources | true |
Other | laravel | framework | 53564916cd38cd7b67d4f966b17ba2f96f929eda.json | Remove unused imports | src/Illuminate/Http/Resources/Json/ResourceCollection.php | @@ -3,7 +3,6 @@
namespace Illuminate\Http\Resources\Json;
use IteratorAggregate;
-use Illuminate\Support\Collection;
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Http\Resources\CollectsResources;
| true |
Other | laravel | framework | 740064803568a62ab7c0514d821727947bab7fdd.json | Fix Auth docblocks | src/Illuminate/Auth/SessionGuard.php | @@ -696,7 +696,7 @@ public function setDispatcher(Dispatcher $events)
/**
* Get the session store used by the guard.
*
- * @return \Illuminate\Session\Store
+ * @return \Illuminate\Contracts\Session\Session.
*/
public function getSession()
{ | false |
Other | laravel | framework | 08100578cb467d359f5f0ef8efa7765bdde127f8.json | Ensure Carbon is reset after rate tests. | src/Illuminate/Cache/RateLimiter.php | @@ -40,11 +40,9 @@ public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1)
if ($this->attempts($key) >= $maxAttempts) {
if ($this->cache->has($key.':timer')) {
return true;
- } else {
- $this->resetAttempts($key);
-
- return ... | true |
Other | laravel | framework | 08100578cb467d359f5f0ef8efa7765bdde127f8.json | Ensure Carbon is reset after rate tests. | tests/Integration/Http/ThrottleRequestsTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Integration\Http;
+use Throwable;
use Illuminate\Support\Carbon;
use Orchestra\Testbench\TestCase;
use Illuminate\Support\Facades\Route;
@@ -20,10 +21,15 @@ protected function getEnvironmentSetUp($app)
public function setup()
{
parent::setup();
-
... | true |
Other | laravel | framework | 08100578cb467d359f5f0ef8efa7765bdde127f8.json | Ensure Carbon is reset after rate tests. | tests/Integration/Http/ThrottleRequestsWithRedisTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Integration\Http;
+use Throwable;
use Illuminate\Support\Carbon;
use Orchestra\Testbench\TestCase;
use Illuminate\Support\Facades\Route;
@@ -12,6 +13,12 @@
*/
class ThrottleRequestsWithRedisTest extends TestCase
{
+ public function tearDown()
+ {
+ par... | true |
Other | laravel | framework | 2cc93b3b631cbc3d211a3304a2878388ea2770f0.json | Add Request::validate() method tag (#20866) | src/Illuminate/Http/Request.php | @@ -12,6 +12,9 @@
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
+/**
+ * @method array validate(array $rules, array $messages = [], array $customAttributes = [])
+ */
class Request extends SymfonyRequest implements Arrayable, ArrayAccess
{
... | false |
Other | laravel | framework | 6b7dbc7144b6a1e6d5ff5490e8769b071ea0fb23.json | Remove unnecessary else (#20846) | src/Illuminate/Queue/Console/ListFailedCommand.php | @@ -100,9 +100,9 @@ protected function matchJobName($payload)
if (isset($matches[1])) {
return $matches[1];
- } else {
- return $payload['job'] ?? null;
}
+
+ return $payload['job'] ?? null;
}
/** | false |
Other | laravel | framework | 2f8376e74dd4bb28ce786e1873823eedc6b0c4c5.json | Recommend stable psr http bridge (#20850) | composer.json | @@ -119,7 +119,7 @@
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.3).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.3).... | true |
Other | laravel | framework | 2f8376e74dd4bb28ce786e1873823eedc6b0c4c5.json | Recommend stable psr http bridge (#20850) | src/Illuminate/Routing/composer.json | @@ -38,7 +38,7 @@
},
"suggest": {
"illuminate/console": "Required to use the make commands (5.5.*).",
- "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)."
+ "symfony/psr-http-message-bridge": "Required to psr7 bridging features (~1.0)."
},
"config... | true |
Other | laravel | framework | 7e8a6e5115bd128fa83ffa5a22f6a5dc6da44323.json | remove @author docblocks (#20848)
is this something we're doing now? otherwise I think we should stay consistent and omit them. | src/Illuminate/Support/helpers.php | @@ -335,8 +335,6 @@ function array_wrap($value)
/**
* Determine if the given value is "blank".
*
- * @author Derek MacDonald (https://github.com/derekmd)
- *
* @param mixed $value
* @return bool
*/
@@ -637,8 +635,6 @@ function env($key, $default = null)
/**
* Dete... | false |
Other | laravel | framework | 2af7339b956d22db98ec0b018942fc626bd1c8c1.json | Add 'retrieved' to the list of observable events | src/Illuminate/Database/Eloquent/Concerns/HasEvents.php | @@ -57,7 +57,7 @@ public function getObservableEvents()
[
'creating', 'created', 'updating', 'updated',
'deleting', 'deleted', 'saving', 'saved',
- 'restoring', 'restored',
+ 'restoring', 'restored', 'retrieved',
],
$... | false |
Other | laravel | framework | e00feed421ab788a593e3a19a41fc0b342c03c07.json | Add method to register a 'retrieved' model event | src/Illuminate/Database/Eloquent/Concerns/HasEvents.php | @@ -274,6 +274,17 @@ public static function deleted($callback)
static::registerModelEvent('deleted', $callback);
}
+ /**
+ * Register a retrieved model event with the dispatcher.
+ *
+ * @param \Closure|string $callback
+ * @return void
+ */
+ public static function retrieved... | false |
Other | laravel | framework | 42765659c16f5327c1d5c826b82b71a3c3cef4ee.json | Use end to get last element of array (#20844) | src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php | @@ -404,7 +404,7 @@ public function getForeignKeyName()
{
$segments = explode('.', $this->getQualifiedForeignKeyName());
- return $segments[count($segments) - 1];
+ return end($segments);
}
/** | false |
Other | laravel | framework | c60cf5e029bedf83ee19a2e2a6388c0de374e155.json | Add whereKeyNot to changelog | CHANGELOG-5.5.md | @@ -135,6 +135,7 @@
- ⚠️ Call `setConnection()` in `Model::save()` ([#20466](https://github.com/laravel/framework/pull/20466))
- ⚠️ Touch parent timestamp only if the model is dirty ([#20489](https://github.com/laravel/framework/pull/20489))
- Added `Model::loadMissing()` method ([#20630](https://github.com/laravel/... | false |
Other | laravel | framework | 21f4d19c8413a6688603a73ca341c1de162ec1ee.json | Add whereKeyNot to Eloquent Builder (#20817) | src/Illuminate/Database/Eloquent/Builder.php | @@ -190,6 +190,23 @@ public function whereKey($id)
return $this->where($this->model->getQualifiedKeyName(), '=', $id);
}
+ /**
+ * Add a where clause on the primary key to the query.
+ *
+ * @param mixed $id
+ * @return $this
+ */
+ public function whereKeyNot($id)
+ {
+ ... | true |
Other | laravel | framework | 21f4d19c8413a6688603a73ca341c1de162ec1ee.json | Add whereKeyNot to Eloquent Builder (#20817) | tests/Database/DatabaseEloquentBuilderTest.php | @@ -914,6 +914,45 @@ public function testWhereKeyMethodWithCollection()
$builder->whereKey($collection);
}
+ public function testWhereKeyNotMethodWithInt()
+ {
+ $model = $this->getMockModel();
+ $builder = $this->getBuilder()->setModel($model);
+ $keyName = $model->getQualifi... | true |
Other | laravel | framework | 1e1b4c5b0681141f0219dbf938d117d7239acd88.json | Use getKey (#20811) | src/Illuminate/Database/Eloquent/Model.php | @@ -644,7 +644,7 @@ protected function setKeysForSaveQuery(Builder $query)
protected function getKeyForSaveQuery()
{
return $this->original[$this->getKeyName()]
- ?? $this->getAttribute($this->getKeyName());
+ ?? $this->getKey();
}
/** | false |
Other | laravel | framework | 3d8ae049e84f5ed06107bd0bbf9a68538576f5d2.json | Apply fixes from StyleCI (#20792) | tests/Support/SupportCollectionTest.php | @@ -2140,7 +2140,7 @@ public function testPartition()
public function testPartitionCallbackWithKey()
{
- $collection = new Collection(['zero', 'one','two', 'three']);
+ $collection = new Collection(['zero', 'one', 'two', 'three']);
list($even, $odd) = $collection->partition(function... | false |
Other | laravel | framework | 73de18e32a7d04ed61c1a37b724732a23aad259c.json | allow meta data from response building | src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php | @@ -19,7 +19,8 @@ public function toResponse($request)
$this->resource->resolve($request),
array_merge_recursive(
$this->paginationInformation($request),
- $this->resource->with($request)
+ $this->resource->with($request),
+ ... | true |
Other | laravel | framework | 73de18e32a7d04ed61c1a37b724732a23aad259c.json | allow meta data from response building | src/Illuminate/Http/Resources/Json/Resource.php | @@ -31,6 +31,15 @@ class Resource implements ArrayAccess, JsonSerializable, Responsable, UrlRoutabl
*/
public $with = [];
+ /**
+ * The additional meta data that should be added to the resource response.
+ *
+ * Added during response constuction by the developer.
+ *
+ * @var array
+... | true |
Other | laravel | framework | 73de18e32a7d04ed61c1a37b724732a23aad259c.json | allow meta data from response building | src/Illuminate/Http/Resources/Json/ResourceResponse.php | @@ -37,7 +37,8 @@ public function toResponse($request)
return tap(response()->json(
$this->wrap(
$this->resource->resolve($request),
- $this->resource->with($request)
+ $this->resource->with($request),
+ $this->resource->additional
... | true |
Other | laravel | framework | 73de18e32a7d04ed61c1a37b724732a23aad259c.json | allow meta data from response building | tests/Integration/Http/ResourceTest.php | @@ -214,6 +214,29 @@ public function test_resources_may_customize_extra_data()
]);
}
+ public function test_resources_may_customize_extra_data_when_building_response()
+ {
+ Route::get('/', function () {
+ return (new PostResourceWithExtraData(new Post([
+ 'id' => ... | true |
Other | laravel | framework | 603ed4a73f926e2a94fb39a01ac1d1dbaf5255d1.json | Fix docblock on argument type (#20779) | src/Illuminate/Contracts/Foundation/Application.php | @@ -55,7 +55,7 @@ public function register($provider, $options = [], $force = false);
* Register a deferred provider and service.
*
* @param string $provider
- * @param string $service
+ * @param string|null $service
* @return void
*/
public function registerDeferredProv... | true |
Other | laravel | framework | 603ed4a73f926e2a94fb39a01ac1d1dbaf5255d1.json | Fix docblock on argument type (#20779) | src/Illuminate/Foundation/Application.php | @@ -668,7 +668,7 @@ public function loadDeferredProvider($service)
* Register a deferred provider and service.
*
* @param string $provider
- * @param string $service
+ * @param string|null $service
* @return void
*/
public function registerDeferredProvider($provider, $se... | true |
Other | laravel | framework | 87e71db68fbf0d34fa1b1a729360b90f92806a2a.json | Fix docblock on argument type (#20777) | src/Illuminate/Validation/Concerns/FormatsMessages.php | @@ -68,7 +68,7 @@ protected function getMessage($attribute, $rule)
*
* @param string $attribute
* @param string $lowerRule
- * @param array $source
+ * @param array|null $source
* @return string|null
*/
protected function getFromLocalArray($attribute, $lowerRule, $sou... | false |
Other | laravel | framework | 69e09253ad45eb2b15646d6aaab4c4668bef1c6e.json | relax type hint | src/Illuminate/Http/Resources/Json/Resource.php | @@ -244,11 +244,11 @@ protected function whenLoaded($relationship)
* Execute a callback if the given pivot table has been loaded.
*
* @param string $table
- * @param callable $value
+ * @param mixed $value
* @param mixed $default
* @return \Illuminate\Http\Resources\Missing... | false |
Other | laravel | framework | 27e8438d7a781074a70bda7e4845716063ec56da.json | Apply fixes from StyleCI (#20764) | src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php | @@ -211,6 +211,6 @@ protected function tooManyAttempts($key, $maxAttempts, $decayMinutes)
$this->remaining = $limiter->remaining;
- return !$attempt;
+ return ! $attempt;
}
} | true |
Other | laravel | framework | 27e8438d7a781074a70bda7e4845716063ec56da.json | Apply fixes from StyleCI (#20764) | tests/Integration/Http/ThrottleRequestsTest.php | @@ -27,7 +27,7 @@ public function setup()
public function test_lock_opens_immediately_after_decay()
{
Carbon::setTestNow(null);
-
+
Route::get('/', function () {
return 'yes';
})->middleware(ThrottleRequests::class.':2,1'); | true |
Other | laravel | framework | 92aff02c1f023f333a4ad5e91955e67c8efbe32a.json | Apply fixes from StyleCI (#20763) | src/Illuminate/Http/Resources/MergeValue.php | @@ -23,5 +23,4 @@ public function __construct($data)
{
$this->data = $data instanceof Collection ? $data->all() : $data;
}
-
} | false |
Other | laravel | framework | 8842846e815498f982e83ba44c370143522e0d37.json | Apply fixes from StyleCI (#20758) | tests/Integration/Http/ThrottleRequestsTest.php | @@ -44,9 +44,9 @@ public function test_lock_opens_immediately_after_decay()
Carbon::now()->addSeconds(58)
);
- try{
+ try {
$response = $this->withoutExceptionHandling()->get('/');
- }catch(\Throwable $e){
+ } catch (\Throwable $e) {
$this->a... | false |
Other | laravel | framework | 315baf73daac7fb005d2135f37dc4bbf96e1062c.json | Apply fixes from StyleCI (#20753) | src/Illuminate/View/Factory.php | @@ -153,7 +153,7 @@ public function first(array $views, $data = [], $mergeData = [])
});
if (! $view) {
- throw new InvalidArgumentException("None of the views in the given array exist.");
+ throw new InvalidArgumentException('None of the views in the given array exist.');
... | false |
Other | laravel | framework | 4580cc9580162e9393081ee983cda18880a5e94b.json | add test_resources_may_have_no_wrap test (#20736) | tests/Integration/Http/ResourceTest.php | @@ -38,6 +38,25 @@ public function test_resources_may_be_converted_to_json()
]);
}
+ public function test_resources_may_have_no_wrap()
+ {
+ Route::get('/', function () {
+ return new PostResourceWithoutWrap(new Post([
+ 'id' => 5,
+ 'title' => 'Test... | false |
Other | laravel | framework | 8f209d59cdc7e3991bac712b7fcf36c1f0d63fce.json | Apply fixes from StyleCI (#20733) | src/Illuminate/Http/Resources/Json/Resource.php | @@ -6,8 +6,8 @@
use JsonSerializable;
use Illuminate\Support\Collection;
use Illuminate\Container\Container;
-use Illuminate\Http\Resources\MissingValue;
use Illuminate\Contracts\Support\Arrayable;
+use Illuminate\Http\Resources\MissingValue;
use Illuminate\Contracts\Routing\UrlRoutable;
use Illuminate\Contracts\... | true |
Other | laravel | framework | 8f209d59cdc7e3991bac712b7fcf36c1f0d63fce.json | Apply fixes from StyleCI (#20733) | tests/Integration/Http/ResourceTest.php | @@ -428,7 +428,9 @@ public function toArray($request)
}
}
-class Subscription {}
+class Subscription
+{
+}
class CommentCollection extends ResourceCollection
{ | true |
Other | laravel | framework | 06de9b2beb9e3c13758d93cee86a1657545cb435.json | add various optional helpers | src/Illuminate/Http/Resources/Json/Resource.php | @@ -173,13 +173,13 @@ public function withResponse($request, $response)
* @param mixed $value
* @return \Illuminate\Http\Resources\MissingValue|mixed
*/
- protected function when($condition, $value)
+ protected function when($condition, $value, $default = null)
{
if ($condition) ... | true |
Other | laravel | framework | 06de9b2beb9e3c13758d93cee86a1657545cb435.json | add various optional helpers | src/Illuminate/Support/Optional.php | @@ -0,0 +1,53 @@
+<?php
+
+namespace Illuminate\Support;
+
+class Optional
+{
+ use Traits\Macroable;
+
+ /**
+ * The underlying object.
+ *
+ * @var mixed
+ */
+ protected $value;
+
+ /**
+ * Create a new optional instance.
+ *
+ * @param mixed $value
+ * @return void
+ ... | true |
Other | laravel | framework | 06de9b2beb9e3c13758d93cee86a1657545cb435.json | add various optional helpers | src/Illuminate/Support/helpers.php | @@ -2,6 +2,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
+use Illuminate\Support\Optional;
use Illuminate\Support\Collection;
use Illuminate\Support\Debug\Dumper;
use Illuminate\Contracts\Support\Htmlable;
@@ -330,6 +331,37 @@ function array_wrap($value)
}
}
+if (! function_exists('blank')... | true |
Other | laravel | framework | 06de9b2beb9e3c13758d93cee86a1657545cb435.json | add various optional helpers | tests/Integration/Http/ResourceTest.php | @@ -38,6 +38,29 @@ public function test_resources_may_be_converted_to_json()
]);
}
+ public function test_resources_may_have_optional_values()
+ {
+ Route::get('/', function () {
+ return new PostResourceWithOptionalData(new Post([
+ 'id' => 5,
+ ]));
+ ... | true |
Other | laravel | framework | 06de9b2beb9e3c13758d93cee86a1657545cb435.json | add various optional helpers | tests/Support/SupportHelpersTest.php | @@ -755,6 +755,29 @@ public function testThrowWithString()
{
throw_if(true, RuntimeException::class, 'Test Message');
}
+
+ public function testOptional()
+ {
+ $this->assertNull(optional(null)->something());
+
+ $this->assertEquals(10, optional(new class {
+ public fun... | true |
Other | laravel | framework | a64407c9f37c2a927a39dd8a2cb0ab5a09d5f567.json | Apply fixes from StyleCI (#20730) | src/Illuminate/Http/Resources/Json/Resource.php | @@ -122,7 +122,7 @@ protected function filter($data)
continue;
}
- if ($value instanceof Resource &&
+ if ($value instanceof self &&
$value->resource instanceof MissingResource) {
unset($data[$key]);
}
@@ -177,7 +177,7 ... | false |
Other | laravel | framework | a07d028d732780249539dc6c33396dafc3bfa173.json | remove merge method | src/Illuminate/Http/Resources/Json/Resource.php | @@ -115,19 +115,6 @@ public function toArray($request)
return $this->resource->toArray();
}
- /**
- * Merge additional data into the resource array.
- *
- * @param array $data
- * @return $this
- */
- public function merge(array $data)
- {
- $this->with = $data;
-
-... | true |
Other | laravel | framework | a07d028d732780249539dc6c33396dafc3bfa173.json | remove merge method | tests/Integration/Http/ResourceTest.php | @@ -125,28 +125,6 @@ public function test_resources_may_customize_extra_data()
]);
}
- public function test_resources_may_customize_adhoc_extra_data()
- {
- Route::get('/', function () {
- return PostResource::make(new Post([
- 'id' => 5,
- 'title' =... | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | src/Illuminate/Database/Eloquent/DetectsResource.php | @@ -51,7 +51,7 @@ public function detectResourceName($suffix = '')
}
throw new Exception(
- "Unable to detect the resource for the [".get_class($this)."] model."
+ 'Unable to detect the resource for the ['.get_class($this).'] model.'
);
}
} | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php | @@ -37,9 +37,9 @@
use Illuminate\Foundation\Console\StorageLinkCommand;
use Illuminate\Routing\Console\ControllerMakeCommand;
use Illuminate\Routing\Console\MiddlewareMakeCommand;
-use Illuminate\Foundation\Console\ResourceMakeCommand;
use Illuminate\Foundation\Console\ListenerMakeCommand;
use Illuminate\Foundatio... | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | src/Illuminate/Http/Resources/CollectsResources.php | @@ -4,9 +4,7 @@
use Illuminate\Support\Str;
use Illuminate\Support\Collection;
-use Illuminate\Database\Eloquent\Model;
use Illuminate\Pagination\AbstractPaginator;
-use Illuminate\Database\Eloquent\Collection as EloquentCollection;
trait CollectsResources
{ | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | src/Illuminate/Http/Resources/DelegatesToResource.php | @@ -34,7 +34,7 @@ public function getRouteKeyName()
*/
public function resolveRouteBinding($value)
{
- throw new Exception("Resources may not be implicitly resolved from route bindings.");
+ throw new Exception('Resources may not be implicitly resolved from route bindings.');
}
... | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | src/Illuminate/Http/Resources/Json/ResourceCollection.php | @@ -6,7 +6,6 @@
use Illuminate\Support\Collection;
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Http\Resources\CollectsResources;
-use Illuminate\Database\Eloquent\Collection as EloquentCollection;
class ResourceCollection extends Resource implements IteratorAggregate
{ | true |
Other | laravel | framework | 1e717ace337b4e0257b3ff74b62dc2a6fc45d72a.json | Apply fixes from StyleCI (#20712) | tests/Integration/Http/ResourceTest.php | @@ -7,8 +7,6 @@
use Illuminate\Support\Facades\Route;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Resources\Json\Resource;
-use Illuminate\Database\Eloquent\Collection;
-use Illuminate\Contracts\Support\Responsable;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Http\Resources\Json\... | true |
Other | laravel | framework | 60860f3fdb277154606a1f3584104ed97d24d16a.json | Use Support\Carbon. (#20693) | src/Illuminate/Foundation/helpers.php | @@ -1,6 +1,6 @@
<?php
-use Carbon\Carbon;
+use Illuminate\Support\Carbon;
use Illuminate\Support\HtmlString;
use Illuminate\Container\Container;
use Illuminate\Contracts\Bus\Dispatcher;
@@ -586,7 +586,7 @@ function mix($path, $manifestDirectory = '')
/**
* Create a new Carbon instance for the current t... | false |
Other | laravel | framework | 5dcf584865cceef9f9690673d6a6bd6241e3834a.json | Add View::either method | src/Illuminate/View/Factory.php | @@ -244,6 +244,23 @@ public function exists($view)
return true;
}
+ /**
+ * Get the evaluated view contents for the given view, or for a fallback
+ * view if the given view doesn't exist.
+ *
+ * @param string $view
+ * @param string $fallback
+ * @param array $data
+ ... | true |
Other | laravel | framework | 5dcf584865cceef9f9690673d6a6bd6241e3834a.json | Add View::either method | tests/View/ViewFactoryTest.php | @@ -45,6 +45,28 @@ public function testExistsPassesAndFailsViews()
$this->assertTrue($factory->exists('bar'));
}
+ public function testEitherCreatesNewViewInstanceWithProperPath()
+ {
+ unset($_SERVER['__test.view']);
+
+ $factory = $this->getFactory();
+ $factory->getFinder()... | true |
Other | laravel | framework | ef11aee425a0973b2ccef485eb579802fd7d45f9.json | Add orDoesntHave and orWhereDoesntHave (#20685) | src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php | @@ -107,6 +107,17 @@ public function doesntHave($relation, $boolean = 'and', Closure $callback = null
return $this->has($relation, '<', 1, $boolean, $callback);
}
+ /**
+ * Add a relationship count / exists condition to the query with an "or".
+ *
+ * @param string $relation
+ * @re... | true |
Other | laravel | framework | ef11aee425a0973b2ccef485eb579802fd7d45f9.json | Add orDoesntHave and orWhereDoesntHave (#20685) | tests/Database/DatabaseEloquentBuilderTest.php | @@ -832,6 +832,49 @@ public function testSelfHasNestedUsesAlias()
$this->assertContains('"self_alias_hash"."id" = "self_related_stubs"."parent_id"', $sql);
}
+ public function testDoesntHave()
+ {
+ $model = new EloquentBuilderTestModelParentStub;
+
+ $builder = $model->doesntHave('f... | true |
Other | laravel | framework | f90f5e25b665336fef3a91e219b0ce73c139ab9e.json | Fix whoops version (#20681)
* fix whoops version
* update version | composer.json | @@ -74,7 +74,7 @@
"require-dev": {
"aws/aws-sdk-php": "~3.0",
"doctrine/dbal": "~2.5",
- "filp/whoops": "~2.0",
+ "filp/whoops": "^2.1.4",
"mockery/mockery": "~0.9.4",
"orchestra/testbench-core": "3.5.*",
"pda/pheanstalk": "~3.0", | false |
Other | laravel | framework | 0684c9c7c3f4312e0290c2b179f3a30719e81892.json | update v5.4 changelog | CHANGELOG-5.4.md | @@ -1,5 +1,18 @@
# Release Notes for 5.4.x
+## [Unreleased]
+
+### Added
+- Added `Str::start()` and `str_start()` helper ([#20569](https://github.com/laravel/framework/pull/20569))
+
+### Changed
+- Return the model instance from `Model::refresh()` ([#20657](https://github.com/laravel/framework/pull/20657))
+
+### ... | false |
Other | laravel | framework | 6b692b327d667610ed22265c8de8291551e2d749.json | update v5.5 changelog (fix) | CHANGELOG-5.5.md | @@ -130,7 +130,6 @@
- ⚠️ Call `setConnection()` in `Model::save()` ([#20466](https://github.com/laravel/framework/pull/20466))
- ⚠️ Touch parent timestamp only if the model is dirty ([#20489](https://github.com/laravel/framework/pull/20489))
- Added `Model::loadMissing()` method ([#20630](https://github.com/laravel/... | false |
Other | laravel | framework | 9352d1edc22747417209adb4c314b7ec81120b4c.json | Apply fixes from StyleCI (#20662) | tests/Support/SupportTestingNotificationFakeTest.php | @@ -4,8 +4,8 @@
use PHPUnit\Framework\TestCase;
use Illuminate\Foundation\Auth\User;
-use Illuminate\Support\Testing\Fakes\NotificationFake;
use Illuminate\Notifications\Notification;
+use Illuminate\Support\Testing\Fakes\NotificationFake;
class NotificationFakeTest extends TestCase
{
@@ -54,5 +54,4 @@ public ... | false |
Other | laravel | framework | 331850ecb54c140358cba5f5e9141e830491812c.json | add assertNothingPushed method to QueueFake | src/Illuminate/Support/Testing/Fakes/QueueFake.php | @@ -83,6 +83,16 @@ public function assertNotPushed($job, $callback = null)
);
}
+ /**
+ * Assert that no jobs were pushed.
+ *
+ * @return void
+ */
+ public function assertNothingPushed()
+ {
+ PHPUnit::assertEmpty($this->jobs, 'Jobs were pushed unexpectedly.');
+ }
+... | true |
Other | laravel | framework | 331850ecb54c140358cba5f5e9141e830491812c.json | add assertNothingPushed method to QueueFake | tests/Support/SupportTestingQueueFakeTest.php | @@ -67,6 +67,19 @@ public function testAssertPushedTimes()
$this->fake->assertPushed(JobStub::class, 2);
}
+
+ /**
+ * @expectedException PHPUnit\Framework\ExpectationFailedException
+ * @expectedExceptionMessage Jobs were pushed unexpectedly.
+ */
+ public function testAssertNothingPu... | true |
Other | laravel | framework | f3a556927621bd745a6ca90e3a22063971c3d8c1.json | Apply fixes from StyleCI (#20644) | src/Illuminate/Routing/ImplicitRouteBinding.php | @@ -3,7 +3,6 @@
namespace Illuminate\Routing;
use Illuminate\Support\Str;
-use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Routing\UrlRoutable;
use Illuminate\Database\Eloquent\ModelNotFoundException;
| false |
Other | laravel | framework | 774e5cf990caee75cec678b655d009f811d92ed6.json | Fix exception in tests (#20623) | tests/Database/DatabaseEloquentBuilderTest.php | @@ -475,7 +475,6 @@ public function testGetRelationProperlySetsNestedRelationshipsWithSimilarNames()
/**
* @expectedException \Illuminate\Database\Eloquent\RelationNotFoundException
- * @expectedExceptionMessage Call to undefined relationship [invalid] on model [Mockery_18_Illuminate_Database_Eloquent_... | false |
Other | laravel | framework | 1e2dbe02b40aaf94c2dd776f2530213ab2084ccc.json | Add Request::keys method (#20611) | src/Illuminate/Http/Concerns/InteractsWithInput.php | @@ -165,6 +165,16 @@ public function all($keys = null)
return $results;
}
+ /**
+ * Get the keys for all input and files for the request.
+ *
+ * @return array
+ */
+ public function keys()
+ {
+ return array_merge(array_keys($this->input()), $this->files->keys());
+ }... | true |
Other | laravel | framework | 1e2dbe02b40aaf94c2dd776f2530213ab2084ccc.json | Add Request::keys method (#20611) | tests/Http/HttpRequestTest.php | @@ -308,6 +308,27 @@ public function testAllMethod()
$this->assertEquals(['developer' => ['name' => 'Taylor', 'age' => null]], $request->all());
}
+ public function testKeysMethod()
+ {
+ $request = Request::create('/', 'GET', ['name' => 'Taylor', 'age' => null]);
+ $this->assertEqua... | true |
Other | laravel | framework | 28107d2f40eb5d2baa88af89e065ea211c312f19.json | add withHeader method | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -77,6 +77,20 @@ public function withHeaders(array $headers)
return $this;
}
+ /**
+ * Adds a header to be sent with the requests.
+ *
+ * @param string $name
+ * @param string $value
+ * @return $this
+ */
+ public function withHeader(string $name, string $value)
+ ... | false |
Other | laravel | framework | 76cb5505845665a93816f05df980fc4a6533212c.json | make methods protected (#20582)
+ fix some docblocks | src/Illuminate/Foundation/Console/PresetCommand.php | @@ -55,7 +55,7 @@ protected function none()
}
/**
- * Install the "fresh" preset.
+ * Install the "bootstrap" preset.
*
* @return void
*/
@@ -72,7 +72,7 @@ protected function bootstrap()
*
* @return void
*/
- public function vue()
+ protected function vue()
... | false |
Other | laravel | framework | 9ab8919723f8ec13813278d4d7b77170e3894392.json | Use Support Carbon (#20568) | src/Illuminate/Foundation/Testing/TestCase.php | @@ -3,7 +3,7 @@
namespace Illuminate\Foundation\Testing;
use Mockery;
-use Carbon\Carbon;
+use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Facade;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Console\Application as Artisan; | true |
Other | laravel | framework | 9ab8919723f8ec13813278d4d7b77170e3894392.json | Use Support Carbon (#20568) | tests/Integration/Database/EloquentBelongsToManyTest.php | @@ -2,7 +2,7 @@
namespace Illuminate\Tests\Integration\Database\EloquentBelongsToManyTest;
-use Carbon\Carbon;
+use Illuminate\Support\Carbon;
use Orchestra\Testbench\TestCase;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema; | true |
Other | laravel | framework | 9ab8919723f8ec13813278d4d7b77170e3894392.json | Use Support Carbon (#20568) | tests/Support/SupportArrTest.php | @@ -4,8 +4,8 @@
use stdClass;
use ArrayObject;
-use Carbon\Carbon;
use Illuminate\Support\Arr;
+use Illuminate\Support\Carbon;
use PHPUnit\Framework\TestCase;
use Illuminate\Support\Collection;
| true |
Other | laravel | framework | 87a29a2fa2d7a3df8594d0b45ebe3f6093fb8a09.json | Update Builder.php (#20553) | src/Illuminate/Database/Query/Builder.php | @@ -561,12 +561,12 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
*/
protected function addArrayOfWheres($column, $boolean, $method = 'where')
{
- return $this->whereNested(function ($query) use ($column, $method) {
+ return $this->whereNested(function ... | false |
Other | laravel | framework | e6995b8a07985c4eb116624c13ccb10eb12e3c58.json | accept string (#20529) | src/Illuminate/Routing/PendingResourceRegistration.php | @@ -78,10 +78,10 @@ public function except($methods)
/**
* Set the route names for controller actions.
*
- * @param array $names
+ * @param array|string $names
* @return \Illuminate\Routing\PendingResourceRegistration
*/
- public function names(array $names)
+ public funct... | true |
Other | laravel | framework | e6995b8a07985c4eb116624c13ccb10eb12e3c58.json | accept string (#20529) | tests/Routing/RouteRegistrarTest.php | @@ -223,6 +223,9 @@ public function testUserCanRegisterApiResource()
public function testCanNameRoutesOnRegisteredResource()
{
+ $this->router->resource('comments', 'Illuminate\Tests\Routing\RouteRegistrarControllerStub')
+ ->only('create', 'store')->names('reply');
+
$th... | true |
Other | laravel | framework | e44933af48548502f79d6b8049824205fa229b91.json | allow string for parameters (#20531) | src/Illuminate/Routing/PendingResourceRegistration.php | @@ -105,10 +105,10 @@ public function name($method, $name)
/**
* Override the route parameter names.
*
- * @param array $parameters
+ * @param array|string $parameters
* @return \Illuminate\Routing\PendingResourceRegistration
*/
- public function parameters(array $parameters)... | true |
Other | laravel | framework | e44933af48548502f79d6b8049824205fa229b91.json | allow string for parameters (#20531) | tests/Routing/RoutingRouteTest.php | @@ -1118,7 +1118,7 @@ public function testResourceRoutingParameters()
$router = $this->getRouter();
$router->resource('foos', 'FooController', ['parameters' => 'singular']);
- $router->resource('foos.bars', 'FooController', ['parameters' => 'singular']);
+ $router->resource('foos.bars'... | true |
Other | laravel | framework | 7f887c2fa74ae67887fbc9beb93d5ad0818b2dae.json | Apply fixes from StyleCI (#20533) | tests/Support/SupportTestingMailFakeTest.php | @@ -74,7 +74,6 @@ public function testAssertNothingSent()
}
}
-
class MailableStub extends Mailable
{
public $framework = 'Laravel'; | false |
Other | laravel | framework | 94e8cb36af27c4e85b5e30cd0501b8448ed34909.json | Apply fixes from StyleCI (#20526) | src/Illuminate/Contracts/Queue/Job.php | @@ -99,10 +99,10 @@ public function getConnectionName();
*/
public function getQueue();
- /**
- * Get the raw body string for the job.
- *
- * @return string
- */
- public function getRawBody();
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string... | true |
Other | laravel | framework | 94e8cb36af27c4e85b5e30cd0501b8448ed34909.json | Apply fixes from StyleCI (#20526) | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -679,9 +679,9 @@ protected function asDateTime($value)
return $value;
}
- // If the value is already a DateTime instance, we will just skip the rest of
- // these checks since they will be a waste of time, and hinder performance
- // when checking the field. We will ju... | true |
Other | laravel | framework | 94e8cb36af27c4e85b5e30cd0501b8448ed34909.json | Apply fixes from StyleCI (#20526) | src/Illuminate/Routing/MiddlewareNameResolver.php | @@ -24,15 +24,15 @@ public static function resolve($name, $map, $middlewareGroups)
} elseif (isset($map[$name]) && $map[$name] instanceof Closure) {
return $map[$name];
- // If the middleware is the name of a middleware group, we will return the array
+ // If the middleware is ... | true |
Other | laravel | framework | 94e8cb36af27c4e85b5e30cd0501b8448ed34909.json | Apply fixes from StyleCI (#20526) | src/Illuminate/Routing/SortedMiddleware.php | @@ -55,7 +55,7 @@ protected function sortMiddleware($priorityMap, $middlewares)
)
);
- // This middleware is in the priority map; but, this is the first middleware we have
+ // This middleware is in the priority map; but, this is the firs... | true |
Other | laravel | framework | 15c81645788be437fd7079e50e97e90b7972fd40.json | Apply fixes from StyleCI (#20518) | src/Illuminate/Routing/Route.php | @@ -212,9 +212,9 @@ protected function runController()
*/
public function getController()
{
- if (! $this->controller) {
+ if (! $this->controller) {
$class = $this->parseControllerCallback()[0];
-
+
$this->controller = $this->container->make($... | false |
Other | laravel | framework | 26903b7781664748d3fa8f273d010d9d4ef38953.json | Remove unnecessary parsing (#20517)
* Execute only one time the Controller computing class.
* Remove empty line
* Update Route.php | src/Illuminate/Routing/Route.php | @@ -212,9 +212,9 @@ protected function runController()
*/
public function getController()
{
- $class = $this->parseControllerCallback()[0];
-
- if (! $this->controller) {
+ if (! $this->controller) {
+ $class = $this->parseControllerCallback()[0];
+
... | false |
Other | laravel | framework | be7f51ac647af34d75fb857ee683dc3374292373.json | Apply fixes from StyleCI (#20514) | src/Illuminate/Support/Collection.php | @@ -10,7 +10,6 @@
use CachingIterator;
use JsonSerializable;
use IteratorAggregate;
-use InvalidArgumentException;
use Illuminate\Support\Debug\Dumper;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Support\Jsonable; | false |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | CHANGELOG-5.4.md | @@ -1,5 +1,32 @@
# Release Notes for 5.4.x
+## [Unreleased]
+
+### Changed
+- Moved `tap()` method from `Builder` to `BuildsQueries` ([#20384](https://github.com/laravel/framework/pull/20384))
+- Made Blade `or` operator case-insensitive ([#20425](https://github.com/laravel/framework/pull/20425))
+- Support `$amount... | true |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | src/Illuminate/Database/Concerns/BuildsQueries.php | @@ -96,6 +96,17 @@ public function when($value, $callback, $default = null)
return $this;
}
+ /**
+ * Pass the query to a given callback.
+ *
+ * @param \Closure $callback
+ * @return \Illuminate\Database\Query\Builder
+ */
+ public function tap($callback)
+ {
+ ret... | true |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | src/Illuminate/Database/Eloquent/Builder.php | @@ -217,7 +217,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
/**
* Add an "or where" clause to the query.
*
- * @param \Closure|string $column
+ * @param \Closure|array|string $column
* @param string $operator
* @param mixed $value
... | true |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | src/Illuminate/Database/Migrations/Migrator.php | @@ -245,6 +245,8 @@ protected function rollbackMigrations(array $migrations, $paths, array $options)
$migration = (object) $migration;
if (! $file = Arr::get($files, $migration->migration)) {
+ $this->note("<fg=red>Migration not found:</> {$migration->migration}");
+
... | true |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | src/Illuminate/Database/Query/Builder.php | @@ -459,17 +459,6 @@ public function crossJoin($table, $first = null, $operator = null, $second = nul
return $this;
}
- /**
- * Pass the query to a given callback.
- *
- * @param \Closure $callback
- * @return \Illuminate\Database\Query\Builder
- */
- public function tap($cal... | true |
Other | laravel | framework | a4c781ac40695051b2559d127e3d7595dcc5f904.json | remove stupid test | src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php | @@ -153,7 +153,9 @@ public function compileInsert(Builder $query, array $values)
// grammar insert builder because no special syntax is needed for the single
// row inserts in SQLite. However, if there are multiples, we'll continue.
if (count($values) == 1) {
- return parent::compi... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.