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 | 2e9d90bad11dbaf33e4a7cedcdcbb60419f85a25.json | fix srid mysql schema (#31852) | tests/Database/DatabaseMySqlSchemaGrammarTest.php | @@ -898,6 +898,26 @@ public function testAddingPoint()
$this->assertSame('alter table `geo` add `coordinates` point not null', $statements[0]);
}
+ public function testAddingPointWithSrid()
+ {
+ $blueprint = new Blueprint('geo');
+ $blueprint->point('coordinates', 4326);
+ $s... | true |
Other | laravel | framework | 2ce99051636e8dee09ef405edb90a483f72b7f40.json | Use local variable (#31849) | src/Illuminate/View/Component.php | @@ -61,9 +61,9 @@ public function resolveView()
$factory = Container::getInstance()->make('view');
- return $factory->exists($this->render())
- ? $this->render()
- : $this->createBladeViewFromString($factory, $this->render());
+ return $factory->exists($v... | false |
Other | laravel | framework | 35f81ffd8ae93823a62b5e7b5386704d8b7fc212.json | add another test case | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -5,6 +5,7 @@
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
+use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Exception\MethodNotAllowedEx... | true |
Other | laravel | framework | 35f81ffd8ae93823a62b5e7b5386704d8b7fc212.json | add another test case | tests/Integration/Routing/CompiledRouteCollectionTest.php | @@ -388,6 +388,17 @@ public function testMatchingCachedFallbackTakesPrecedenceOverDynamicFallback()
$this->assertEquals('fallback', $routes->match(Request::create('/baz/1', 'GET'))->getName());
}
+ public function testMatchingCachedFallbackTakesPrecedenceOverDynamicRouteWithWrongMethod()
+ {
+ ... | true |
Other | laravel | framework | 9a805d3dac8208b7450b22717a0bfc6e16e030d0.json | remove redundant condition | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -130,7 +130,7 @@ public function match(Request $request)
try {
$dynamicRoute = $this->routes->match($request);
- if (! $dynamicRoute->isFallback || ! $route->isFallback) {
+ if (! $dynamicRoute->isFallback) {
$route = $dynamicRoute;
... | false |
Other | laravel | framework | 5c8255b2a4b10593fa86013737a55560b96c8341.json | Apply fixes from StyleCI (#31833) | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -2,7 +2,6 @@
namespace Illuminate\Routing;
-use Exception;
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection; | false |
Other | laravel | framework | 83ef6a7eae193ef11e03c400364f2a39fd92acb3.json | Add tests and refactor | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -115,33 +115,22 @@ public function match(Request $request)
$route = null;
- $checkedDynamicRoutes = false;
- $matchedCachedRouteIsFallback = false;
-
try {
if ($result = $matcher->matchRequest($request)) {
$route = $this->getByName($result['_route']);... | true |
Other | laravel | framework | 83ef6a7eae193ef11e03c400364f2a39fd92acb3.json | Add tests and refactor | tests/Integration/Routing/CompiledRouteCollectionTest.php | @@ -295,7 +295,7 @@ public function testMatchingThrowsMethodNotAllowedHttpExceptionWhenMethodIsNotAl
$this->collection()->match(Request::create('/foo', 'POST'));
}
- public function testMatchingThrowsMethodNotAllowedHttpExceptionWhenMethodIsNotAllowedWhileSameRouteIsAddedDynamically()
+ public fun... | true |
Other | laravel | framework | 20f5605b6cf0d0b3e0aee6bebd007ac24a9ae96c.json | Apply fixes from StyleCI (#31832) | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -146,7 +146,6 @@ public function match(Request $request)
}
}
-
return $this->handleMatchedRoute($request, $route);
}
| false |
Other | laravel | framework | 577c88532f1ef11db487b63e589cdd20d58028e9.json | handle fallback priority | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -2,6 +2,7 @@
namespace Illuminate\Routing;
+use Exception;
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
@@ -114,18 +115,38 @@ public function match(Request $request)
$route = null;
+ $checkedDynamicRoutes = false;
+ $matchedCac... | false |
Other | laravel | framework | eca35179ed82a32ba90532ae21a08178581a461b.json | Add tests for new route caching (#31827) | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -185,7 +185,11 @@ public function getByName($name)
public function getByAction($action)
{
$attributes = collect($this->attributes)->first(function (array $attributes) use ($action) {
- return $attributes['action']['controller'] === $action;
+ if (isset($attributes['action']['... | true |
Other | laravel | framework | eca35179ed82a32ba90532ae21a08178581a461b.json | Add tests for new route caching (#31827) | tests/Integration/Routing/CompiledRouteCollectionTest.php | @@ -3,9 +3,13 @@
namespace Illuminate\Tests\Routing;
use ArrayIterator;
+use Illuminate\Http\Request;
use Illuminate\Routing\CompiledRouteCollection;
use Illuminate\Routing\Route;
+use Illuminate\Support\Arr;
use Illuminate\Tests\Integration\IntegrationTest;
+use Symfony\Component\HttpKernel\Exception\MethodNotA... | true |
Other | laravel | framework | eca35179ed82a32ba90532ae21a08178581a461b.json | Add tests for new route caching (#31827) | tests/Routing/RouteCollectionTest.php | @@ -5,6 +5,7 @@
use ArrayIterator;
use Illuminate\Routing\Route;
use Illuminate\Routing\RouteCollection;
+use LogicException;
use PHPUnit\Framework\TestCase;
class RouteCollectionTest extends TestCase
@@ -247,4 +248,18 @@ public function testRouteCollectionCleansUpOverwrittenRoutes()
$this->assertEquals... | true |
Other | laravel | framework | eca35179ed82a32ba90532ae21a08178581a461b.json | Add tests for new route caching (#31827) | tests/Routing/RoutingRouteTest.php | @@ -1144,6 +1144,18 @@ public function testRoutePrefixing()
$routes = $routes->getRoutes();
$routes[0]->prefix('prefix');
$this->assertSame('prefix', $routes[0]->uri());
+
+ /*
+ * Prefix homepage with empty prefix
+ */
+ $router = $this->getRouter();
+ $r... | true |
Other | laravel | framework | d3ba921e5844a31e639f92188900e7b49424ec9e.json | add test for queued listener (#31818) | tests/Events/EventsDispatcherTest.php | @@ -10,6 +10,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Events\CallQueuedListener;
use Illuminate\Events\Dispatcher;
+use Illuminate\Support\Testing\Fakes\QueueFake;
use Mockery as m;
use PHPUnit\Framework\TestCase;
@@ -336,6 +337,22 @@ public function testQueuedEventHandlersAreQueued()
... | false |
Other | laravel | framework | bb60a457f6c3692ea4f14355bddd8ee74cff91d7.json | add missing test cases for arr first (#31820) | tests/Support/SupportArrTest.php | @@ -143,12 +143,37 @@ public function testFirst()
{
$array = [100, 200, 300];
+ //Callback is null and array is empty
+ $this->assertNull(Arr::first([], null));
+ $this->assertSame('foo', Arr::first([], null, 'foo'));
+ $this->assertSame('bar', Arr::first([], null, function (... | false |
Other | laravel | framework | e4f477c42d3e24f6cdf44a45801c0db476ad2b91.json | add missing public methods to interface | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -78,6 +78,30 @@ public function add(Route $route)
return $route;
}
+ /**
+ * Refresh the name look-up table.
+ *
+ * This is done in case any names are fluently defined or if routes are overwritten.
+ *
+ * @return void
+ */
+ public function refreshNameLookups()
+ {
... | true |
Other | laravel | framework | e4f477c42d3e24f6cdf44a45801c0db476ad2b91.json | add missing public methods to interface | src/Illuminate/Routing/RouteCollectionInterface.php | @@ -14,6 +14,24 @@ interface RouteCollectionInterface
*/
public function add(Route $route);
+ /**
+ * Refresh the name look-up table.
+ *
+ * This is done in case any names are fluently defined or if routes are overwritten.
+ *
+ * @return void
+ */
+ public function refreshNa... | true |
Other | laravel | framework | af806851931700e8dd8de0ac0333efd853b19f3d.json | fix model binding when cached | src/Illuminate/Routing/AbstractRouteCollection.php | @@ -146,6 +146,7 @@ public function compile()
'fallback' => $route->isFallback,
'defaults' => $route->defaults,
'wheres' => $route->wheres,
+ 'bindingFields' => $route->bindingFields(),
];
}
| true |
Other | laravel | framework | af806851931700e8dd8de0ac0333efd853b19f3d.json | fix model binding when cached | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -70,6 +70,7 @@ public function add(Route $route)
'fallback' => $route->isFallback,
'defaults' => $route->defaults,
'wheres' => $route->wheres,
+ 'bindingFields' => $route->bindingFields(),
];
$this->compiled = [];
@@ -244,6 +245,7 @@ protected fun... | true |
Other | laravel | framework | af806851931700e8dd8de0ac0333efd853b19f3d.json | fix model binding when cached | src/Illuminate/Routing/Route.php | @@ -488,6 +488,29 @@ public function bindingFieldFor($parameter)
return $this->bindingFields[$parameter] ?? null;
}
+ /**
+ * Get the binding fields for the route.
+ *
+ * @return array
+ */
+ public function bindingFields()
+ {
+ return $this->bindingFields ?? [];
+ }... | true |
Other | laravel | framework | 9c1c8390de66a27de7f41e3c599e5642103b6c73.json | Fix typehints (#31806) | src/Illuminate/Foundation/Application.php | @@ -901,7 +901,7 @@ protected function fireAppCallbacks(array $callbacks)
/**
* {@inheritdoc}
*/
- public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true)
+ public function handle(SymfonyRequest $request, int $type = self::MASTER_REQUEST, bool $catch = true)
... | false |
Other | laravel | framework | 64c9c13734dd9468ee014d01e95fc81ed127182c.json | Remove useless Closure comment (#31783) | src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php | @@ -261,7 +261,7 @@ protected function binder()
* Normalize the given callback into a callable.
*
* @param mixed $callback
- * @return \Closure|callable
+ * @return callable
*/
protected function normalizeChannelHandlerToCallable($callback)
{ | true |
Other | laravel | framework | 64c9c13734dd9468ee014d01e95fc81ed127182c.json | Remove useless Closure comment (#31783) | src/Illuminate/Contracts/Routing/Registrar.php | @@ -8,7 +8,7 @@ interface Registrar
* Register a new GET route with the router.
*
* @param string $uri
- * @param \Closure|array|string|callable $action
+ * @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function get($uri, $action);
@@... | true |
Other | laravel | framework | 64c9c13734dd9468ee014d01e95fc81ed127182c.json | Remove useless Closure comment (#31783) | src/Illuminate/Routing/Router.php | @@ -137,7 +137,7 @@ public function __construct(Dispatcher $events, Container $container = null)
* Register a new GET route with the router.
*
* @param string $uri
- * @param \Closure|array|string|callable|null $action
+ * @param array|string|callable|null $action
* @return \Illumi... | true |
Other | laravel | framework | 64c9c13734dd9468ee014d01e95fc81ed127182c.json | Remove useless Closure comment (#31783) | src/Illuminate/Support/Facades/Route.php | @@ -3,15 +3,15 @@
namespace Illuminate\Support\Facades;
/**
- * @method static \Illuminate\Routing\Route fallback(\Closure|array|string|callable|null $action = null)
- * @method static \Illuminate\Routing\Route get(string $uri, \Closure|array|string|callable|null $action = null)
- * @method static \Illuminate\Routi... | true |
Other | laravel | framework | c087ffe606bfb96f2689a2b9908e5158ff6efb7b.json | Fix a bug with slash prefix | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -229,10 +229,12 @@ protected function newRoute(array $attributes)
if (empty($attributes['action']['prefix'] ?? '')) {
$baseUri = $attributes['uri'];
} else {
+ $prefixParts = trim($attributes['action']['prefix'], '/');
+
$baseUri = trim(implode(
... | false |
Other | laravel | framework | bea4f7629ab7d74d901204e29a5a5ef14fc4b10b.json | add a containter test (#31751) | tests/Container/ContainerTest.php | @@ -198,6 +198,15 @@ public function testBindingAnInstanceReturnsTheInstance()
$this->assertSame($bound, $resolved);
}
+ public function testBindingAnInstanceAsShared()
+ {
+ $container = new Container;
+ $bound = new stdClass;
+ $container->instance('foo', $bound);
+ $... | false |
Other | laravel | framework | 672761ca3828220dee3279a8f630784ae68c9f2d.json | Update doc block (#31741) | src/Illuminate/Support/Facades/Cache.php | @@ -8,8 +8,8 @@
* @method static bool missing(string $key)
* @method static mixed get(string $key, mixed $default = null)
* @method static mixed pull(string $key, mixed $default = null)
- * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl)
- * @method static bool add(string $... | false |
Other | laravel | framework | 7ab5b4bbd5e7a662395f5cec0ece7497cec16806.json | Catch Symfony exception (#31738) | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -5,6 +5,7 @@
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Matcher\CompiledUrlMatcher;
use Symfony\Component\Routing\RequestContext;
@@ -95,8 +96,12 @@ public... | false |
Other | laravel | framework | 5cf7fecc7d656de950ab93d80c3a4a3a4c68fc7d.json | Fix doc @return class (#31737) | src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php | @@ -35,7 +35,7 @@ trait InteractsWithConsole
*
* @param string $command
* @param array $parameters
- * @return \Illuminate\Foundation\Testing\PendingCommand|int
+ * @return \Illuminate\Testing\PendingCommand|int
*/
public function artisan($command, $parameters = [])
{ | false |
Other | laravel | framework | 1f0b7763a4cfce873a52e14fa0405e18c8b344fb.json | Apply fixes from StyleCI (#31735) | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -5,7 +5,6 @@
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
-use Illuminate\Support\Str;
use Symfony\Component\Routing\Matcher\CompiledUrlMatcher;
use Symfony\Component\Routing\RequestContext;
| false |
Other | laravel | framework | 90b0167d97e61eb06fce9cfc58527f4e09cd2a5e.json | fix route caching attempt | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -222,11 +222,15 @@ public function mapAttributesToRoutes()
*/
protected function newRoute(array $attributes)
{
- $baseUri = ltrim(Str::replaceFirst(
- ltrim($attributes['action']['prefix'] ?? '', '/'),
- '',
- $attributes['uri']
- ), '/');
+ if (!... | false |
Other | laravel | framework | ee71973398875afffad81c2c601d6aacf4723cf0.json | add missing docblock | src/Illuminate/Support/Traits/EnumeratesValues.php | @@ -30,6 +30,7 @@
* @property-read HigherOrderCollectionProxy $min
* @property-read HigherOrderCollectionProxy $partition
* @property-read HigherOrderCollectionProxy $reject
+ * @property-read HigherOrderCollectionProxy $some
* @property-read HigherOrderCollectionProxy $sortBy
* @property-read HigherOrderColl... | false |
Other | laravel | framework | ce0355c72bf4defb93ae80c7bf7812bd6532031a.json | trim prefix off | src/Illuminate/Routing/CompiledRouteCollection.php | @@ -5,6 +5,7 @@
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
+use Illuminate\Support\Str;
use Symfony\Component\Routing\Matcher\CompiledUrlMatcher;
use Symfony\Component\Routing\RequestContext;
@@ -221,7 +222,9 @@ public function mapAttributesToRoutes()
... | false |
Other | laravel | framework | 2964d2dfd3cc50f7a709effee0af671c86587915.json | remove comments before compiling components | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -65,7 +65,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
* @var array
*/
protected $compilers = [
- 'Comments',
+ // 'Comments',
'Extensions',
'Statements',
'Echos',
@@ -219,7 +219,7 @@ public function compileString($value)
//... | false |
Other | laravel | framework | 39f1da2756de9e5b6cf6e486d0000cf53ac3357a.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Factory.php | @@ -3,9 +3,11 @@
namespace Illuminate\Http\Client;
use Closure;
+use GuzzleHttp\Psr7\Response as Psr7Response;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\Assert as PHPUnit;
+use function GuzzleHttp\Promise\promise_for;
class Factory
{
@@ -16,7 +18,7 @@ class Fa... | true |
Other | laravel | framework | 39f1da2756de9e5b6cf6e486d0000cf53ac3357a.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Request.php | @@ -36,7 +36,7 @@ public function __construct($request)
/**
* Get the request method.
*
- * @return strign
+ * @return string
*/
public function method()
{
@@ -70,6 +70,7 @@ public function hasHeader($key, $value = null)
/**
* Get the values for the header with the gi... | true |
Other | laravel | framework | 39f1da2756de9e5b6cf6e486d0000cf53ac3357a.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Response.php | @@ -64,6 +64,7 @@ public function json()
/**
* Get a header from the response.
*
+ * @param string $header
* @return string
*/
public function header(string $header)
@@ -134,7 +135,7 @@ public function redirect()
}
/**
- * Detemine if the response indicates a clie... | true |
Other | laravel | framework | 39f1da2756de9e5b6cf6e486d0000cf53ac3357a.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/ResponseSequence.php | @@ -21,7 +21,7 @@ class ResponseSequence
protected $failWhenEmpty = true;
/**
- * The repsonse that should be returned when the sequence is empty.
+ * The response that should be returned when the sequence is empty.
*
* @var \GuzzleHttp\Promise\PromiseInterface
*/
@@ -48,11 +48,7 @... | true |
Other | laravel | framework | 4fe16c2997cfee9b46dea810dc04016c93002625.json | fix typo in docblock (#31699) | src/Illuminate/View/Component.php | @@ -26,7 +26,7 @@ abstract class Component
protected static $methodCache = [];
/**
- * That properties / methods that should not be exposed to the component.
+ * The properties / methods that should not be exposed to the component.
*
* @var array
*/ | false |
Other | laravel | framework | 380d8c692b1448c6b701cc3c94abf98c81715e54.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Factory.php | @@ -3,9 +3,11 @@
namespace Illuminate\Http\Client;
use Closure;
+use GuzzleHttp\Psr7\Response as Psr7Response;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\Assert as PHPUnit;
+use function GuzzleHttp\Promise\promise_for;
class Factory
{
@@ -16,7 +18,7 @@ class Fa... | true |
Other | laravel | framework | 380d8c692b1448c6b701cc3c94abf98c81715e54.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Request.php | @@ -36,7 +36,7 @@ public function __construct($request)
/**
* Get the request method.
*
- * @return strign
+ * @return string
*/
public function method()
{
@@ -70,6 +70,7 @@ public function hasHeader($key, $value = null)
/**
* Get the values for the header with the gi... | true |
Other | laravel | framework | 380d8c692b1448c6b701cc3c94abf98c81715e54.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/Response.php | @@ -64,6 +64,7 @@ public function json()
/**
* Get a header from the response.
*
+ * @param string $header
* @return string
*/
public function header(string $header)
@@ -134,7 +135,7 @@ public function redirect()
}
/**
- * Detemine if the response indicates a clie... | true |
Other | laravel | framework | 380d8c692b1448c6b701cc3c94abf98c81715e54.json | Add minor changes to HTTP client. | src/Illuminate/Http/Client/ResponseSequence.php | @@ -21,7 +21,7 @@ class ResponseSequence
protected $failWhenEmpty = true;
/**
- * The repsonse that should be returned when the sequence is empty.
+ * The response that should be returned when the sequence is empty.
*
* @var \GuzzleHttp\Promise\PromiseInterface
*/
@@ -48,11 +48,7 @... | true |
Other | laravel | framework | fe8c7e17e765c99f35c0c44448258e94409f405f.json | Fix a docblock. (#31689) | src/Illuminate/Support/Stringable.php | @@ -299,7 +299,7 @@ public function match($pattern)
* Get the string matching the given pattern.
*
* @param string $pattern
- * @return static|null
+ * @return \Illuminate\Support\Collection
*/
public function matchAll($pattern)
{ | false |
Other | laravel | framework | 792da8415cdef8eaf41a955248592c2a23f00478.json | Remove unused properties. (#31688) | src/Illuminate/Support/Stringable.php | @@ -27,34 +27,6 @@ public function __construct($value = '')
$this->value = (string) $value;
}
- /**
- * The cache of snake-cased words.
- *
- * @var array
- */
- protected static $snakeCache = [];
-
- /**
- * The cache of camel-cased words.
- *
- * @var array
- *... | false |
Other | laravel | framework | dd878c067ed2ef2ba3adf710e2f4e73effbb256f.json | Add retry to Http facade annotations | src/Illuminate/Support/Facades/Http.php | @@ -13,6 +13,7 @@
* @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType)
* @method static \Illuminate\Http\Client\PendingRequest acceptJson()
* @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType)
+ * @method static \Illuminate\Http\Client\PendingRequ... | false |
Other | laravel | framework | 33461dcbb77702d444ec0e04a55c2e7ff97521b1.json | add test for view component class (#31665) | tests/View/ViewComponentTest.php | @@ -17,6 +17,34 @@ public function testDataExposure()
$this->assertEquals('world', $variables['hello']());
$this->assertEquals('taylor', $variables['hello']('taylor'));
}
+
+ public function testPublicMethodsWithNoArgsAreEagerlyInvokedAndNotCached()
+ {
+ $component = new TestSampleV... | false |
Other | laravel | framework | a1b0a996ab9ab04702a407169c29a34a17173c97.json | add missing return datatype (#31654) | src/Illuminate/Queue/Console/ListFailedCommand.php | @@ -92,7 +92,7 @@ private function extractJobName($payload)
* Match the job name from the payload.
*
* @param array $payload
- * @return string
+ * @return string|null
*/
protected function matchJobName($payload)
{ | true |
Other | laravel | framework | a1b0a996ab9ab04702a407169c29a34a17173c97.json | add missing return datatype (#31654) | src/Illuminate/Queue/Jobs/RedisJob.php | @@ -110,7 +110,7 @@ public function attempts()
/**
* Get the job identifier.
*
- * @return string
+ * @return string|null
*/
public function getJobId()
{ | true |
Other | laravel | framework | a1b0a996ab9ab04702a407169c29a34a17173c97.json | add missing return datatype (#31654) | src/Illuminate/Routing/Route.php | @@ -686,7 +686,7 @@ public function getDomain()
/**
* Get the prefix of the route instance.
*
- * @return string
+ * @return string|null
*/
public function getPrefix()
{
@@ -734,7 +734,7 @@ public function setUri($uri)
/**
* Get the name of the route instance.
*... | true |
Other | laravel | framework | 1a383120a5b39c501cef9cab2a835ea076cc0eb6.json | allow base url | src/Illuminate/Http/Client/PendingRequest.php | @@ -15,6 +15,13 @@ class PendingRequest
*/
protected $factory;
+ /**
+ * The base URL for the request.
+ *
+ * @var string
+ */
+ protected $baseUrl = '';
+
/**
* The request body format.
*
@@ -99,6 +106,19 @@ public function __construct(Factory $factory = null)
... | false |
Other | laravel | framework | ceba11ef3ce9775b04f8169b30c9aab60d0b6810.json | Add withQueryString method to paginator | src/Illuminate/Pagination/AbstractPaginator.php | @@ -3,10 +3,10 @@
namespace Illuminate\Pagination;
use Closure;
-use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
-use Illuminate\Support\Collection;
use Illuminate\Support\Str;
+use Illuminate\Support\Collection;
+use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Traits\For... | true |
Other | laravel | framework | ceba11ef3ce9775b04f8169b30c9aab60d0b6810.json | Add withQueryString method to paginator | src/Illuminate/Pagination/PaginationServiceProvider.php | @@ -46,5 +46,9 @@ public function register()
return 1;
});
+
+ Paginator::withQueryStringResolver(function () {
+ return $this->app['request']->query();
+ });
}
} | true |
Other | laravel | framework | e9f3c95d35c51f486fa4d608be4f6611bd259f72.json | Fix flakey memcached tests (#31646) | tests/Integration/Cache/MemcachedTaggedCacheTest.php | @@ -13,8 +13,8 @@ public function testMemcachedCanStoreAndRetrieveTaggedCacheItems()
{
$store = Cache::store('memcached');
- $store->tags(['people', 'artists'])->put('John', 'foo', 1);
- $store->tags(['people', 'authors'])->put('Anne', 'bar', 1);
+ $store->tags(['people', 'artists']... | false |
Other | laravel | framework | ec30b5ecf94071058ac19e88c93126d7c0275bdf.json | add more tests | tests/Support/SupportStrTest.php | @@ -129,7 +129,15 @@ public function testStrBeforeLast()
public function testStrBetween()
{
+ $this->assertSame('abc', Str::between('abc', '', 'c'));
+ $this->assertSame('abc', Str::between('abc', 'a', ''));
+ $this->assertSame('abc', Str::between('abc', '', ''));
+ $this->assert... | false |
Other | laravel | framework | 2488eba6f85092af7cb4d3b8271d8024d3978379.json | add stringable method | src/Illuminate/Support/Stringable.php | @@ -132,6 +132,18 @@ public function beforeLast($search)
return new static(Str::beforeLast($this->value, $search));
}
+ /**
+ * Get the portion of a string between a given values.
+ *
+ * @param string $before
+ * @param string $after
+ * @return static
+ */
+ public fu... | false |
Other | laravel | framework | 0d16818a7c1114b1d9b12975bcac820a21c35bcc.json | Apply fixes from StyleCI (#31626) | src/Illuminate/Http/Client/ResponseSequence.php | @@ -2,7 +2,6 @@
namespace Illuminate\Http\Client;
-use Closure;
use OutOfBoundsException;
class ResponseSequence | false |
Other | laravel | framework | c354a691669005381c824331f29e184e31f7c583.json | Add Str::between method | src/Illuminate/Support/Str.php | @@ -132,6 +132,25 @@ public static function beforeLast($subject, $search)
return static::substr($subject, 0, $pos);
}
+ /**
+ * Get the portion of a string between a given values.
+ *
+ * @param string $subject
+ * @param string $before
+ * @param string $after
+ * @retu... | true |
Other | laravel | framework | c354a691669005381c824331f29e184e31f7c583.json | Add Str::between method | tests/Support/SupportStrTest.php | @@ -127,6 +127,13 @@ public function testStrBeforeLast()
$this->assertSame('yv2et', Str::beforeLast('yv2et2te', 2));
}
+ public function testStrBetween()
+ {
+ $this->assertSame('nn', Str::between('hannah', 'ha', 'ah'));
+ $this->assertSame('foo', Str::between('foofoobar', 'foo', 'ba... | true |
Other | laravel | framework | 9495b284bb2177f6d84993442bb822ab2bb358de.json | add retry support | src/Illuminate/Http/Client/PendingRequest.php | @@ -50,6 +50,20 @@ class PendingRequest
*/
protected $options = [];
+ /**
+ * The number of times to try the request.
+ *
+ * @var int
+ */
+ protected $tries = 1;
+
+ /**
+ * The number of milliseconds to wait between retries.
+ *
+ * @var int
+ */
+ protected $... | false |
Other | laravel | framework | 61c887fddd6706208be16da5e3e7f3a2ddf95953.json | Clarify invalid connection message (#31584) | src/Illuminate/Database/DatabaseManager.php | @@ -149,7 +149,7 @@ protected function configuration($name)
$connections = $this->app['config']['database.connections'];
if (is_null($config = Arr::get($connections, $name))) {
- throw new InvalidArgumentException("Database [{$name}] not configured.");
+ throw new InvalidArgume... | false |
Other | laravel | framework | 192e6caf53f8d4592c6fd1fbf70d60bed58bf9a8.json | Apply fixes from StyleCI (#31570) | src/Illuminate/Support/Facades/URL.php | @@ -16,7 +16,7 @@
* @method static string temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, array $parameters = [], bool $absolute = true)
* @method static bool hasValidSignature(\Illuminate\Http\Request $request, bool $absolute = true)
* @method static void defaults(array $defa... | false |
Other | laravel | framework | 8934a9189f62907adc9e896c59262a51c06efe1d.json | change doc block | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -39,7 +39,7 @@ trait HasAttributes
protected $changes = [];
/**
- * The attributes that should be cast to native types.
+ * The attributes that should be cast.
*
* @var array
*/ | false |
Other | laravel | framework | 0f693c992d0df1ee34716cdfc4d9c5a5bf9872b9.json | fix bug in isClassCastable | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -1049,7 +1049,7 @@ protected function isJsonCastable($key)
protected function isClassCastable($key)
{
return array_key_exists($key, $this->getCasts()) &&
- class_exists($class = $this->getCasts()[$key]) &&
+ class_exists($class = $this->parseCasterClass($this->getCast... | false |
Other | laravel | framework | fd66e088ec53026667f261e0dae2799bbf37d811.json | improve container tests (#31547) | tests/Container/ContainerTest.php | @@ -68,41 +68,40 @@ public function testBindIfDoesRegisterIfServiceNotRegisteredYet()
public function testSingletonIfDoesntRegisterIfBindingAlreadyRegistered()
{
$container = new Container;
- $class = new stdClass;
- $container->singleton('class', function () use ($class) {
- ... | false |
Other | laravel | framework | 7848377efcc2e09cfab3239c7a93f85beeece11f.json | fix null return | src/Illuminate/Http/Client/PendingRequest.php | @@ -510,7 +510,7 @@ public function buildStubHandler()
->first();
if (is_null($response)) {
- return Factory::response();
+ return $handler($request, $options);
} elseif (is_array($response)) {
return Fa... | false |
Other | laravel | framework | d138e4cc950edc2685750dbfa22b4f01bc6b25e1.json | add replace method | src/Illuminate/Support/Stringable.php | @@ -372,6 +372,18 @@ public function prepend(...$values)
return new static(implode('', $values).$this->value);
}
+ /**
+ * Replace the given value in the given string.
+ *
+ * @param string $search
+ * @param string $replace
+ * @return static
+ */
+ public function rep... | false |
Other | laravel | framework | 14a9515b48b50979ce90994b0f136d1c96e93fb5.json | Use testbench-core 6 | composer.json | @@ -85,7 +85,7 @@
"league/flysystem-cached-adapter": "^1.0",
"mockery/mockery": "^1.3.1",
"moontoast/math": "^1.1",
- "orchestra/testbench-core": "^5.0",
+ "orchestra/testbench-core": "^6.0",
"pda/pheanstalk": "^4.0",
"phpunit/phpunit": "^8.4|^9.0",
"p... | false |
Other | laravel | framework | 37d03d6002c6218e6147c4ee85187673fc7b61f2.json | fail a response sequence when out of responses | src/Illuminate/Http/Client/ResponseSequence.php | @@ -2,6 +2,8 @@
namespace Illuminate\Http\Client;
+use OutOfBoundsException;
+
class ResponseSequence
{
/**
@@ -11,6 +13,13 @@ class ResponseSequence
*/
protected $responses;
+ /**
+ * Indicates that invoking this sequence when it is empty should throw an exception.
+ *
+ * @var ... | true |
Other | laravel | framework | 37d03d6002c6218e6147c4ee85187673fc7b61f2.json | fail a response sequence when out of responses | tests/Http/HttpClientTest.php | @@ -5,6 +5,7 @@
use Illuminate\Http\Client\Factory;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Str;
+use OutOfBoundsException;
use PHPUnit\Framework\TestCase;
class HttpClientTest extends TestCase
@@ -148,5 +149,28 @@ public function testSequenceBuilder()
$response = $factory->get... | true |
Other | laravel | framework | 38f8a4933543ef9390cfd0e0963359a6ad650e9c.json | Use ViewErrorBag instead of MessageBag | src/Illuminate/View/View.php | @@ -13,6 +13,7 @@
use Illuminate\Support\MessageBag;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
+use Illuminate\Support\ViewErrorBag;
use Throwable;
class View implements ArrayAccess, Htmlable, ViewContract
@@ -207,23 +208,30 @@ public function nest($key, $view, array $data = [])
... | true |
Other | laravel | framework | 38f8a4933543ef9390cfd0e0963359a6ad650e9c.json | Use ViewErrorBag instead of MessageBag | tests/View/ViewTest.php | @@ -9,6 +9,7 @@
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Contracts\View\Engine;
use Illuminate\Support\MessageBag;
+use Illuminate\Support\ViewErrorBag;
use Illuminate\View\Factory;
use Illuminate\View\View;
use Mockery as m;
@@ -216,7 +217,7 @@ public function testWithErrors()
$view =... | true |
Other | laravel | framework | 391a1ad63ac4577a5d7730c67ccad3bd9dcf50e0.json | add a sequence builder to the new http client | src/Illuminate/Http/Client/Factory.php | @@ -62,7 +62,7 @@ public static function response($body = null, $status = 200, $headers = [])
* @param array $responses
* @return \Illuminate\Http\Client\ResponseSequence
*/
- public static function sequence(array $responses)
+ public static function sequence(array $responses = [])
{
... | true |
Other | laravel | framework | 391a1ad63ac4577a5d7730c67ccad3bd9dcf50e0.json | add a sequence builder to the new http client | src/Illuminate/Http/Client/ResponseSequence.php | @@ -22,6 +22,80 @@ public function __construct(array $responses)
$this->responses = $responses;
}
+ /**
+ * Push a response to the sequence.
+ *
+ * @param mixed $response
+ * @return $this
+ */
+ public function pushResponse($response)
+ {
+ $this->responses[] = $re... | true |
Other | laravel | framework | 391a1ad63ac4577a5d7730c67ccad3bd9dcf50e0.json | add a sequence builder to the new http client | tests/Http/HttpClientTest.php | @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Http;
use Illuminate\Http\Client\Factory;
+use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Str;
use PHPUnit\Framework\TestCase;
@@ -118,4 +119,34 @@ public function testFilesCanBeAttached()
$request->hasFile('foo', 'data', 'file.tx... | true |
Other | laravel | framework | 8e10370c9c27290d40df12e90cc2f84b6235060b.json | add tests for broadcasted events (#31515) | tests/Events/EventsDispatcherTest.php | @@ -4,6 +4,7 @@
use Exception;
use Illuminate\Container\Container;
+use Illuminate\Contracts\Broadcasting\Factory as BroadcastFactory;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Queue\Queue;
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -404,6 +405,27 @@ public function test... | false |
Other | laravel | framework | 0a670b4db8d4e3c49bcc062833eb21413527d040.json | Add test for event subscribers (#31496) | tests/Events/EventsDispatcherTest.php | @@ -416,6 +416,27 @@ public function testShouldBroadcastFail()
$this->assertFalse($d->shouldBroadcast([$event]));
}
+
+ public function testEventSubscribers()
+ {
+ $d = new Dispatcher($container = m::mock(Container::class));
+ $subs = m::mock(ExampleSubscriber::class);
+ $sub... | false |
Other | laravel | framework | cfd068e09b2983c20b310435d48a1c16b01a238a.json | use camelCase for data | src/Illuminate/View/Compilers/ComponentTagCompiler.php | @@ -155,6 +155,10 @@ protected function componentString(string $component, array $attributes)
[$data, $attributes] = $this->partitionDataAndAttributes($class, $attributes);
+ $data = $data->mapWithKeys(function ($value, $key) {
+ return [Str::camel($key) => $value];
+ });
+
... | true |
Other | laravel | framework | cfd068e09b2983c20b310435d48a1c16b01a238a.json | use camelCase for data | src/Illuminate/View/Compilers/Concerns/CompilesComponents.php | @@ -147,7 +147,7 @@ protected function compileEndComponentFirst()
*/
protected function compileProps($expression)
{
- return "<?php \$attributes = \$attributes->except{$expression}; ?>
+ return "<?php \$attributes = \$attributes->exceptProps{$expression}; ?>
<?php \$__defined_vars = get_d... | true |
Other | laravel | framework | cfd068e09b2983c20b310435d48a1c16b01a238a.json | use camelCase for data | src/Illuminate/View/ComponentAttributeBag.php | @@ -7,6 +7,7 @@
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
use Illuminate\Support\HtmlString;
+use Illuminate\Support\Str;
use IteratorAggregate;
class ComponentAttributeBag implements ArrayAccess, Htmlable, IteratorAggregate
@@ -79,6 +80,24 @@ public function except($keys)
r... | true |
Other | laravel | framework | cfd068e09b2983c20b310435d48a1c16b01a238a.json | use camelCase for data | tests/View/Blade/BladeComponentTagCompilerTest.php | @@ -35,6 +35,14 @@ public function testBasicComponentParsing()
@endcomponentClass</div>", trim($result));
}
+ public function testDataCamelCasing()
+ {
+ $result = (new ComponentTagCompiler(['profile' => TestProfileComponent::class]))->compileTags('<x-profile user-id="1"></x-profile>');
+
+ ... | true |
Other | laravel | framework | 4288dbb7df86f95687d514a4d7b33b93c8200fc8.json | Apply fixes from StyleCI (#31480) | src/Illuminate/Console/Concerns/InteractsWithIO.php | @@ -8,7 +8,6 @@
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Ques... | false |
Other | laravel | framework | 8ec8628dc3cc0fbed0d75dd28f6207d16ef75c2c.json | Apply fixes from StyleCI (#31479) | src/Illuminate/Console/Concerns/InteractsWithIO.php | @@ -8,7 +8,6 @@
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Ques... | false |
Other | laravel | framework | 4be35a5023050c27680336bb256e54a331fefc71.json | add test for event payload of type object (#31477) | tests/Events/EventsDispatcherTest.php | @@ -347,6 +347,18 @@ public function testClassesWork()
$this->assertSame('baz', $_SERVER['__event.test']);
}
+ public function testEventClassesArePayload()
+ {
+ unset($_SERVER['__event.test']);
+ $d = new Dispatcher;
+ $d->listen(ExampleEvent::class, function ($payload) {
+ ... | false |
Other | laravel | framework | ddc6883f4c62821ec48d9670037019175864bf93.json | Apply fixes from StyleCI (#31474) | src/Illuminate/Database/Query/Builder.php | @@ -656,8 +656,8 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
}
// If the column is a Closure instance and there is an operator value, we will
- // assume the developer wants to run a subquery and then compare the result
- // of that subquery wi... | false |
Other | laravel | framework | 4436662a1ee19fc5e9eb76a0651d0de1aedb3ee2.json | fix password check | src/Illuminate/Auth/EloquentUserProvider.php | @@ -107,7 +107,7 @@ public function retrieveByCredentials(array $credentials)
{
if (empty($credentials) ||
(count($credentials) === 1 &&
- array_key_exists('password', $credentials))) {
+ Str::contains($this->firstCredentialKey($credentials), 'password'))) {
... | false |
Other | laravel | framework | 339928401af2b22c4bcec562d4669176b237020f.json | Throw exception on empty collection (#31471) | src/Illuminate/Support/Testing/Fakes/NotificationFake.php | @@ -2,6 +2,7 @@
namespace Illuminate\Support\Testing\Fakes;
+use Exception;
use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher;
use Illuminate\Contracts\Notifications\Factory as NotificationFactory;
use Illuminate\Contracts\Translation\HasLocalePreference;
@@ -35,10 +36,16 @@ class Noti... | true |
Other | laravel | framework | 339928401af2b22c4bcec562d4669176b237020f.json | Throw exception on empty collection (#31471) | tests/Support/SupportTestingNotificationFakeTest.php | @@ -2,9 +2,11 @@
namespace Illuminate\Tests\Support;
+use Exception;
use Illuminate\Contracts\Translation\HasLocalePreference;
use Illuminate\Foundation\Auth\User;
use Illuminate\Notifications\Notification;
+use Illuminate\Support\Collection;
use Illuminate\Support\Testing\Fakes\NotificationFake;
use PHPUnit\... | true |
Other | laravel | framework | a284f906193c22e0e0a5d827da9fc5f8916e081b.json | Remove addHidden method (#31463) | src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php | @@ -41,19 +41,6 @@ public function setHidden(array $hidden)
return $this;
}
- /**
- * Add hidden attributes for the model.
- *
- * @param array|string|null $attributes
- * @return void
- */
- public function addHidden($attributes = null)
- {
- $this->hidden = array_... | false |
Other | laravel | framework | 4123c8d18807a0b31c8d82a446a46b611875ba28.json | allow afterResponse chain | src/Illuminate/Foundation/Bus/PendingDispatch.php | @@ -13,6 +13,13 @@ class PendingDispatch
*/
protected $job;
+ /**
+ * Indicates if the job should be dispatched immediately after sending the response.
+ *
+ * @var bool
+ */
+ protected $afterResponse = false;
+
/**
* Create a new pending job dispatch.
*
@@ -102,13 +... | false |
Other | laravel | framework | 64804d58f7ce957a0236c834ac6d68c2deb7c13e.json | Remove unused use-statement | tests/Integration/Database/QueryBuilderTest.php | @@ -7,7 +7,6 @@
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
-use Illuminate\Tests\Integration\Database\DatabaseTestCase;
/**
* @group integration | false |
Other | laravel | framework | 582c5337b06cd476432e4295356f147174454f13.json | Extract database specific verifier method | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | @@ -671,7 +671,7 @@ public function validateExists($attribute, $value, $parameters)
*/
protected function getExistCount($connection, $table, $column, $value, $parameters)
{
- $verifier = $this->getPresenceVerifierFor($connection);
+ $verifier = $this->getPresenceVerifier($connection);
... | true |
Other | laravel | framework | 582c5337b06cd476432e4295356f147174454f13.json | Extract database specific verifier method | src/Illuminate/Validation/DatabasePresenceVerifier.php | @@ -6,7 +6,7 @@
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Support\Str;
-class DatabasePresenceVerifier implements PresenceVerifierInterface
+class DatabasePresenceVerifier implements DatabasePresenceVerifierInterface
{
/**
* The database connection instance. | true |
Other | laravel | framework | 582c5337b06cd476432e4295356f147174454f13.json | Extract database specific verifier method | src/Illuminate/Validation/DatabasePresenceVerifierInterface.php | @@ -0,0 +1,14 @@
+<?php
+
+namespace Illuminate\Validation;
+
+interface DatabasePresenceVerifierInterface extends PresenceVerifierInterface
+{
+ /**
+ * Set the connection to be used.
+ *
+ * @param string $connection
+ * @return void
+ */
+ public function setConnection($connection);
+} | true |
Other | laravel | framework | 582c5337b06cd476432e4295356f147174454f13.json | Extract database specific verifier method | src/Illuminate/Validation/Validator.php | @@ -1074,34 +1074,24 @@ public function setFallbackMessages(array $messages)
/**
* Get the Presence Verifier implementation.
*
+ * @param string | NULL $connection
* @return \Illuminate\Validation\PresenceVerifierInterface
*
* @throws \RuntimeException
*/
- public functio... | true |
Other | laravel | framework | b4df9393bf0185929aa864529798caae740da99a.json | Fix PresenceVerifier contract | src/Illuminate/Validation/DatabasePresenceVerifier.php | @@ -3,8 +3,8 @@
namespace Illuminate\Validation;
use Closure;
-use Illuminate\Support\Str;
use Illuminate\Database\ConnectionResolverInterface;
+use Illuminate\Support\Str;
class DatabasePresenceVerifier implements PresenceVerifierInterface
{
@@ -120,7 +120,7 @@ protected function addWhere($query, $key, $extra... | true |
Other | laravel | framework | b4df9393bf0185929aa864529798caae740da99a.json | Fix PresenceVerifier contract | src/Illuminate/Validation/PresenceVerifierInterface.php | @@ -27,4 +27,12 @@ public function getCount($collection, $column, $value, $excludeId = null, $idCol
* @return int
*/
public function getMultiCount($collection, $column, array $values, array $extra = []);
+
+ /**
+ * Set the connection to be used.
+ *
+ * @param string $connection
+ ... | true |
Other | laravel | framework | 53f3a817ea90964688948ed144e8bdb686a3662f.json | Fix postgres grammar for nested json arrays. | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -380,6 +380,10 @@ protected function wrapJsonBooleanValue($value)
protected function wrapJsonPathAttributes($path)
{
return array_map(function ($attribute) {
+ if (\strval(\intval($attribute)) === $attribute) {
+ return $attribute;
+ }
+
return "'$... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.