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 | df87ba5aad0629c47b4a22845081bdf9bfa55d54.json | Remove .php_cs (#20001) | .gitattributes | @@ -5,7 +5,6 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
-.php_cs export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
CHANGELOG-* export-ignore | true |
Other | laravel | framework | df87ba5aad0629c47b4a22845081bdf9bfa55d54.json | Remove .php_cs (#20001) | .gitignore | @@ -1,7 +1,6 @@
/vendor
composer.phar
composer.lock
-.php_cs.cache
.DS_Store
Thumbs.db
/phpunit.xml | true |
Other | laravel | framework | df87ba5aad0629c47b4a22845081bdf9bfa55d54.json | Remove .php_cs (#20001) | .php_cs | @@ -1,77 +0,0 @@
-<?php
-
-use Symfony\CS\Finder;
-use Symfony\CS\Config\Config;
-use Symfony\CS\FixerInterface;
-
-$fixers = [
- 'blankline_after_open_tag',
- 'braces',
- 'concat_without_spaces',
- 'double_arrow_multiline_whitespaces',
- 'duplicate_semicolon',
- 'elseif',
- 'empty_return',
- 'e... | true |
Other | laravel | framework | 247e96b7adb8fb92f32a5420dcf0fbb33e6a2475.json | Apply fixes from StyleCI (#19996) | src/Illuminate/Support/Str.php | @@ -38,7 +38,7 @@ class Str
*/
public static function after($subject, $search)
{
- return $search == "" ? $subject : array_reverse(explode($search, $subject, 2))[0];
+ return $search == '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
}
/**
@@ -72,7 +72,7 @@ pub... | false |
Other | laravel | framework | 4087ab34e16eb4ba35512b9d2d68ad184b2a0fc5.json | Apply StyleCI fixes | src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php | @@ -76,9 +76,7 @@ protected function getArguments()
{
return [
parent::getArguments()[0],
- ['model', InputArgument::OPTIONAL, 'The name of the model to create']
+ ['model', InputArgument::OPTIONAL, 'The name of the model to create'],
];
}
-
-
} | true |
Other | laravel | framework | 4087ab34e16eb4ba35512b9d2d68ad184b2a0fc5.json | Apply StyleCI fixes | src/Illuminate/Foundation/Console/ModelMakeCommand.php | @@ -69,7 +69,7 @@ protected function createFactory()
{
$this->call('make:factory', [
'name' => $this->argument('name').'Factory',
- 'model' => $this->argument('name')
+ 'model' => $this->argument('name'),
]);
}
| true |
Other | laravel | framework | c21c87defcf412c48c8b0cfe3eb8af89c8132ad5.json | Use single quotes | src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php | @@ -49,7 +49,7 @@ protected function buildClass($name)
$model = $this->qualifyClass($this->argument('name'));
if ($this->argument('model')) {
- $model = $this->qualifyClass($this->argument("model"));
+ $model = $this->qualifyClass($this->argument('model'));
}
... | false |
Other | laravel | framework | 948666108a51a906ad6787897e8f957ffbc5f833.json | Fix cache in mix method. (#19968) | src/Illuminate/Foundation/helpers.php | @@ -537,32 +537,30 @@ function mix($path, $manifestDirectory = '')
$manifestDirectory = "/{$manifestDirectory}";
}
- $manifestKey = $manifestDirectory ? $manifestDirectory : '/';
-
if (file_exists(public_path($manifestDirectory.'/hot'))) {
return new HtmlString("//lo... | false |
Other | laravel | framework | 37d429d485b3dc36536e08e0b8b01d7941f73248.json | Add comprovation before replacing the namespace | src/Illuminate/Foundation/Console/PolicyMakeCommand.php | @@ -38,7 +38,7 @@ class PolicyMakeCommand extends GeneratorCommand
protected function buildClass($name)
{
$stub = parent::buildClass($name);
-
+
$stub = $this->replaceUserModelNamespace($stub);
$model = $this->option('model');
@@ -47,14 +47,38 @@ protected function buildCl... | false |
Other | laravel | framework | 50a0be8ad3de589bc7be08eae71d31945dacda0f.json | Fix return comment | src/Illuminate/Foundation/Console/PolicyMakeCommand.php | @@ -50,7 +50,7 @@ protected function buildClass($name)
* Replace the user model for the given stub.
*
* @param string $stub
- * @return string mixed
+ * @return string
*/
protected function replaceUserModelNamespace($stub)
{ | false |
Other | laravel | framework | 361992f1578bc1db37936845cdedf58af1047bf9.json | remove temporary variable (#19935)
* remove temporary variable
remove the temporary `$aliases` variable and refactor the array into the `foreach` loop.
is this crazy? unecessary?
I think technically it should be **less memory usage** (much much less), but it's still something
and I don't think we lose read... | src/Illuminate/Foundation/Application.php | @@ -1091,7 +1091,7 @@ public function isLocale($locale)
*/
public function registerCoreContainerAliases()
{
- $aliases = [
+ foreach ([
'app' => [\Illuminate\Foundation\Application::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts... | false |
Other | laravel | framework | 897e48d14860db18c9285187ca6c29e150b9ff30.json | add `force` option to some generators
this will allow the user to continue execution of the command even if the class already exists. | src/Illuminate/Foundation/Console/MailMakeCommand.php | @@ -35,7 +35,7 @@ class MailMakeCommand extends GeneratorCommand
*/
public function fire()
{
- if (parent::fire() === false) {
+ if (parent::fire() === false && !$this->option('force')) {
return;
}
@@ -109,6 +109,8 @@ protected function getOptions()
{
... | true |
Other | laravel | framework | 897e48d14860db18c9285187ca6c29e150b9ff30.json | add `force` option to some generators
this will allow the user to continue execution of the command even if the class already exists. | src/Illuminate/Foundation/Console/ModelMakeCommand.php | @@ -36,7 +36,7 @@ class ModelMakeCommand extends GeneratorCommand
*/
public function fire()
{
- if (parent::fire() === false) {
+ if (parent::fire() === false && !$this->option('force')) {
return;
}
@@ -114,7 +114,9 @@ protected function getOptions()
... | true |
Other | laravel | framework | 897e48d14860db18c9285187ca6c29e150b9ff30.json | add `force` option to some generators
this will allow the user to continue execution of the command even if the class already exists. | src/Illuminate/Foundation/Console/NotificationMakeCommand.php | @@ -35,7 +35,7 @@ class NotificationMakeCommand extends GeneratorCommand
*/
public function fire()
{
- if (parent::fire() === false) {
+ if (parent::fire() === false && !$this->option('force')) {
return;
}
@@ -109,6 +109,8 @@ protected function getOptions()
{
... | true |
Other | laravel | framework | ec88362ee06ad418db93eb0e19f6d285eed7e701.json | fix status code | src/Illuminate/Foundation/Exceptions/Handler.php | @@ -214,7 +214,7 @@ protected function convertValidationExceptionToResponse(ValidationException $e,
if ($request->expectsJson()) {
return response()->json(
- $this->formatValidationResponse($e)
+ $this->formatValidationResponse($e), 422
);
}
| false |
Other | laravel | framework | 1692b839089a0e5ae65815dd59c82cee9afca9df.json | Add new methods to mailer contract (#19928) | src/Illuminate/Contracts/Mail/Mailer.php | @@ -4,15 +4,77 @@
interface Mailer
{
+ /**
+ * Set the global from address and name.
+ *
+ * @param string $address
+ * @param string|null $name
+ * @return void
+ */
+ public function alwaysFrom($address, $name = null);
+
+ /**
+ * Set the global reply-to address and name.
... | false |
Other | laravel | framework | 231119b846aa975988d39707b5d404d36be710f2.json | Apply fixes from StyleCI (#19925) | src/Illuminate/Support/Facades/Storage.php | @@ -34,7 +34,7 @@ public static function fake($disk)
public static function persistentFake($disk)
{
static::set($disk, self::createLocalDriver([
- 'root' => storage_path('framework/testing/disks/' . $disk)
+ 'root' => storage_path('framework/testing/disks/'.$disk),
]));... | false |
Other | laravel | framework | e64f5b195626f8e88f2afbd201cc48060ca9cd45.json | Add test for getRoutesByName() (#19913) | tests/Routing/RouteCollectionTest.php | @@ -166,6 +166,30 @@ public function testRouteCollectionCanGetAllRoutes()
$this->assertEquals($allRoutes, $this->routeCollection->getRoutes());
}
+ public function testRouteCollectionCanGetRoutesByName()
+ {
+ $routesByName = [
+ 'foo_index' => new Route('GET', 'foo/index', [
+ ... | false |
Other | laravel | framework | 01e398030bd894fb5c8996a6a9dd3d60794d1a74.json | Fix minore typo | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -176,7 +176,7 @@ protected function addCastAttributesToArray(array $attributes, array $mutatedAtt
);
// If the attribute cast was a date or a datetime, we will serialize the date as
- // a string. This allows the developers to customize hwo dates are serialized
+ // ... | false |
Other | laravel | framework | 45bfce0955372a5c613f305178465937628a1332.json | Return exception instead. | src/Illuminate/Routing/Middleware/ThrottleRequests.php | @@ -38,6 +38,7 @@ public function __construct(RateLimiter $limiter)
* @param int|string $maxAttempts
* @param float|int $decayMinutes
* @return mixed
+ * @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function handle($request, Closure $next, $maxAttempts = 6... | false |
Other | laravel | framework | 990326c988f3b9a844cd6cf47d067bc1dad2173f.json | Throw a 429 HTTP exception. | src/Illuminate/Routing/Middleware/ThrottleRequests.php | @@ -8,6 +8,7 @@
use Illuminate\Support\Carbon;
use Illuminate\Cache\RateLimiter;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Exception\HttpException;
class ThrottleRequests
{
@@ -45,7 +46,7 @@ public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes
... | false |
Other | laravel | framework | 6623996212b3d59aa31a374b70311f03fd158075.json | extract key generation | src/Illuminate/Encryption/Encrypter.php | @@ -59,6 +59,17 @@ public static function supported($key, $cipher)
($cipher === 'AES-256-CBC' && $length === 32);
}
+ /**
+ * Create a new encryption key for the given cipher.
+ *
+ * @param string $cipher
+ * @return string
+ */
+ public static function generateKey($c... | true |
Other | laravel | framework | 6623996212b3d59aa31a374b70311f03fd158075.json | extract key generation | src/Illuminate/Foundation/Console/KeyGenerateCommand.php | @@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
+use Illuminate\Encryption\Encrypter;
use Illuminate\Console\ConfirmableTrait;
class KeyGenerateCommand extends Command
@@ -57,9 +58,9 @@ public function handle()
*/
protected function generateRandomKey()
{
... | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Auth/AuthAccessGateTest.php | @@ -3,7 +3,6 @@
namespace Illuminate\Tests\Auth;
use stdClass;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Illuminate\Auth\Access\Gate;
use Illuminate\Container\Container; | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Container/ContainerTest.php | @@ -3,7 +3,6 @@
namespace Illuminate\Tests\Container;
use stdClass;
-use ReflectionException;
use PHPUnit\Framework\TestCase;
use Illuminate\Container\Container;
| true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Database/DatabaseConnectionFactoryTest.php | @@ -4,7 +4,6 @@
use Mockery as m;
use ReflectionProperty;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Connectors\ConnectionFactory; | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Database/DatabaseEloquentModelTest.php | @@ -6,7 +6,6 @@
use stdClass;
use Exception;
use Mockery as m;
-use LogicException;
use ReflectionClass;
use DateTimeImmutable;
use DateTimeInterface; | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Http/HttpRedirectResponseTest.php | @@ -3,7 +3,6 @@
namespace Illuminate\Tests\Http;
use Mockery as m;
-use BadMethodCallException;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Illuminate\Http\RedirectResponse; | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/Routing/RoutingRouteTest.php | @@ -7,7 +7,6 @@
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
-use UnexpectedValueException;
use Illuminate\Routing\Router;
use PHPUnit\Framework\TestCase;
use Illuminate\Events\Dispatcher; | true |
Other | laravel | framework | 72c92621d946ef01e1b4258f0f4b4769f4d58ddd.json | Apply fixes from StyleCI (#19876) | tests/View/ViewEngineResolverTest.php | @@ -3,7 +3,6 @@
namespace Illuminate\Tests\View;
use stdClass;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
class ViewEngineResolverTest extends TestCase | true |
Other | laravel | framework | d29f5eb315b330b0e0be3591f032acf016797b5a.json | Add Macroable trait to Blueprint class (#19862)
* Add Macroable trait to Blueprint class
See https://github.com/laravel/internals/issues/662
* cs
* Update Blueprint.php | src/Illuminate/Database/Schema/Blueprint.php | @@ -5,10 +5,13 @@
use Closure;
use Illuminate\Support\Fluent;
use Illuminate\Database\Connection;
+use Illuminate\Support\Traits\Macroable;
use Illuminate\Database\Schema\Grammars\Grammar;
class Blueprint
{
+ use Macroable;
+
/**
* The table the blueprint describes.
* | false |
Other | laravel | framework | c3c789b35fb0c3673a48dc400dd5cc4688776cb4.json | Allow passing of data to the view | src/Illuminate/Routing/Router.php | @@ -234,12 +234,14 @@ public function redirect($uri, $destination, $status = 301)
*
* @param string $uri
* @param string $view
+ * @param array $data
* @return \Illuminate\Routing\Route
*/
- public function view($uri, $view)
+ public function view($uri, $view, $data = [])
{
... | true |
Other | laravel | framework | c3c789b35fb0c3673a48dc400dd5cc4688776cb4.json | Allow passing of data to the view | src/Illuminate/Routing/ViewController.php | @@ -27,10 +27,11 @@ public function __construct(ViewFactory $view)
* Invoke the controller method.
*
* @param string $view
+ * @param array $data
* @return \Illuminate\Contracts\View\View
*/
- public function __invoke($view)
+ public function __invoke($view, $data)
{
- ... | true |
Other | laravel | framework | c3c789b35fb0c3673a48dc400dd5cc4688776cb4.json | Allow passing of data to the view | tests/Routing/RoutingRouteTest.php | @@ -1384,7 +1384,7 @@ public function testRouteView()
{
$container = new Container;
$factory = m::mock('Illuminate\View\Factory');
- $factory->shouldReceive('make')->once()->with('pages.contact')->andReturn('Contact us');
+ $factory->shouldReceive('make')->once()->with('pages.contac... | true |
Other | laravel | framework | 57faddf069d2a47f5774ae107c457388db1fd17f.json | Apply fixes from StyleCI (#19852) | tests/Support/SupportCollectionTest.php | @@ -313,17 +313,19 @@ public function testHigherOrderFilter()
new class {
public $name = 'Alex';
- public function active() {
+ public function active()
+ {
return true;
}
},
new ... | false |
Other | laravel | framework | 5b65863336fe08e3bbdf5a00336530d9d6304094.json | Call parent::handle command (#19839) | src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php | @@ -57,7 +57,7 @@ public function __construct(Filesystem $files, Composer $composer)
*/
public function handle()
{
- parent::fire();
+ parent::handle();
$this->composer->dumpAutoloads();
} | true |
Other | laravel | framework | 5b65863336fe08e3bbdf5a00336530d9d6304094.json | Call parent::handle command (#19839) | src/Illuminate/Foundation/Console/ListenerMakeCommand.php | @@ -40,7 +40,7 @@ public function handle()
return $this->error('Missing required option: --event');
}
- parent::fire();
+ parent::handle();
}
/** | true |
Other | laravel | framework | 5b65863336fe08e3bbdf5a00336530d9d6304094.json | Call parent::handle command (#19839) | src/Illuminate/Foundation/Console/MailMakeCommand.php | @@ -35,7 +35,7 @@ class MailMakeCommand extends GeneratorCommand
*/
public function handle()
{
- if (parent::fire() === false) {
+ if (parent::handle() === false) {
return;
}
| true |
Other | laravel | framework | 5b65863336fe08e3bbdf5a00336530d9d6304094.json | Call parent::handle command (#19839) | src/Illuminate/Foundation/Console/ModelMakeCommand.php | @@ -36,7 +36,7 @@ class ModelMakeCommand extends GeneratorCommand
*/
public function handle()
{
- if (parent::fire() === false) {
+ if (parent::handle() === false) {
return;
}
| true |
Other | laravel | framework | 5b65863336fe08e3bbdf5a00336530d9d6304094.json | Call parent::handle command (#19839) | src/Illuminate/Foundation/Console/NotificationMakeCommand.php | @@ -35,7 +35,7 @@ class NotificationMakeCommand extends GeneratorCommand
*/
public function handle()
{
- if (parent::fire() === false) {
+ if (parent::handle() === false) {
return;
}
| true |
Other | laravel | framework | 8af5a280bc9dc0450adde93a6399c006b8fa5386.json | Apply fixes from StyleCI (#19836) | src/Illuminate/Console/Scheduling/CallbackEvent.php | @@ -101,7 +101,7 @@ public function withoutOverlapping()
"A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'."
);
}
-
+
$this->withoutOverlapping = true;
return $this->skip(function () { | false |
Other | laravel | framework | 1d6ad39f84b5fa677b049e68b86ddbd12cf674eb.json | Add Route::view() helper | src/Illuminate/Routing/Router.php | @@ -229,6 +229,19 @@ public function redirect($uri, $destination, $status = 301)
->defaults('status', $status);
}
+ /**
+ * Register a new route that returns a view.
+ *
+ * @param string $uri
+ * @param string $view
+ * @return \Illuminate\Routing\Route
+ */
+ publ... | true |
Other | laravel | framework | 1d6ad39f84b5fa677b049e68b86ddbd12cf674eb.json | Add Route::view() helper | src/Illuminate/Routing/ViewController.php | @@ -0,0 +1,36 @@
+<?php
+
+namespace Illuminate\Routing;
+
+use Illuminate\Contracts\View\Factory as ViewFactory;
+
+class ViewController extends Controller
+{
+ /**
+ * The view factory instance.
+ *
+ * @var \Illuminate\Contracts\View\Factory
+ */
+ protected $view;
+
+ /**
+ * Create a n... | true |
Other | laravel | framework | 1d6ad39f84b5fa677b049e68b86ddbd12cf674eb.json | Add Route::view() helper | tests/Routing/RoutingRouteTest.php | @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Routing;
use stdClass;
+use Mockery as m;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
@@ -19,6 +20,7 @@
use Illuminate\Contracts\Routing\Registrar;
use Illuminate\Auth\Middleware\Authenticate;
use Symfony\Component\HttpFound... | true |
Other | laravel | framework | 21cc812403d343f46dc6ebe34b12a98fa99a7246.json | Use proper assertions. (#19831) | tests/Container/ContainerTest.php | @@ -974,7 +974,7 @@ public function testContainerKnowsEntry()
{
$container = new Container;
$container->bind('Illuminate\Tests\Container\IContainerContractStub', 'Illuminate\Tests\Container\ContainerImplementationStub');
- $this->assertEquals(true, $container->has('Illuminate\Tests\Contain... | false |
Other | laravel | framework | 67dca8689cf5cfc85e0a2a95432f2249c9ef96d4.json | Reuse Arr::random() in Collection::random() | src/Illuminate/Support/Collection.php | @@ -1083,15 +1083,11 @@ public function random($amount = 1)
throw new InvalidArgumentException("You requested {$amount} items, but there are only {$count} items in the collection.");
}
- $keys = array_rand($this->items, $amount);
-
if (count(func_get_args()) == 0) {
- ... | false |
Other | laravel | framework | 66325c2c5768a5b10376e1838288c5212e3c9c40.json | add container alias | src/Illuminate/Foundation/Application.php | @@ -1095,7 +1095,7 @@ public function isLocale($locale)
public function registerCoreContainerAliases()
{
$aliases = [
- 'app' => [\Illuminate\Foundation\Application::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::clas... | false |
Other | laravel | framework | 294eac84b5d268fd39004a46037c0a2d2623ba97.json | Apply fixes from StyleCI (#19809) | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -66,7 +66,7 @@ protected function compileLock(Builder $query, $value)
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function compileInsert(Builder $query, array $values)
{ | false |
Other | laravel | framework | 4cfbd5716115ec2e6497302badb34f581f8dc4d7.json | Apply fixes from StyleCI (#19808) | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -66,7 +66,7 @@ protected function compileLock(Builder $query, $value)
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function compileInsert(Builder $query, array $values)
{ | false |
Other | laravel | framework | 55bee118c323c7b1deec8da081eafd2e649cbd41.json | Add Route::redirect() helper method | src/Illuminate/Routing/RedirectController.php | @@ -0,0 +1,13 @@
+<?php
+
+namespace Illuminate\Routing;
+
+use Illuminate\Http\RedirectResponse;
+
+class RedirectController extends Controller
+{
+ public function __invoke($destination, $status = 301)
+ {
+ return new RedirectResponse($destination, $status);
+ }
+} | true |
Other | laravel | framework | 55bee118c323c7b1deec8da081eafd2e649cbd41.json | Add Route::redirect() helper method | src/Illuminate/Routing/Router.php | @@ -295,6 +295,21 @@ public function group(array $attributes, $routes)
array_pop($this->groupStack);
}
+ /**
+ * Create a redirect from one route to another.
+ *
+ * @param string $url
+ * @param string $destination
+ * @param int $status
+ * @return Route
+ */
+ public... | true |
Other | laravel | framework | 55bee118c323c7b1deec8da081eafd2e649cbd41.json | Add Route::redirect() helper method | tests/Routing/RoutingRouteTest.php | @@ -1365,6 +1365,19 @@ public function testJsonResponseIsReturned()
$this->assertInstanceOf(\Illuminate\Http\JsonResponse::class, $response);
}
+ public function testRouteRedirect()
+ {
+ $router = $this->getRouter();
+ $router->get('contact_us', function () {
+ throw new ... | true |
Other | laravel | framework | bceded6fef79760b9907dbe105829f7d2d62f899.json | allow silent deletion on failed model retrieval | src/Illuminate/Queue/CallQueuedHandler.php | @@ -2,6 +2,8 @@
namespace Illuminate\Queue;
+use Exception;
+use ReflectionClass;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Database\Eloquent\ModelNotFoundException;
@@ -40,9 +42,7 @@ public function call(Job $job, array $data)
$job, unserialize... | true |
Other | laravel | framework | bceded6fef79760b9907dbe105829f7d2d62f899.json | allow silent deletion on failed model retrieval | tests/Integration/Queue/CallQueuedHandlerTest.php | @@ -37,6 +37,7 @@ public function test_job_is_marked_as_failed_if_model_not_found_exception_is_thr
$job = Mockery::mock('Illuminate\Contracts\Queue\Job');
$job->shouldReceive('getConnectionName')->andReturn('connection');
+ $job->shouldReceive('resolveName')->andReturn(__CLASS__);
$j... | true |
Other | laravel | framework | 5b4b02e9d9494b91fece6b6cc29bb50edca5ee2a.json | Apply fixes from StyleCI (#19789) | src/Illuminate/Foundation/Auth/ThrottlesLogins.php | @@ -109,7 +109,7 @@ protected function limiter()
*/
public function maxAttempts()
{
- return property_exists($this,'maxAttempts') ? $this->maxAttempts : 5;
+ return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;
}
/**
@@ -119,6 +119,6 @@ public function maxAtte... | false |
Other | laravel | framework | ff00aa9e02634b94ec2b6572a3dcdb90d4349071.json | Add withDefault to MorphOne relations. | src/Illuminate/Database/Eloquent/Relations/BelongsTo.php | @@ -5,17 +5,11 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Relations\Concerns\HasDefault;
class BelongsTo extends Relation
{
- /**
- * Indicates if a default model instance should be use... | true |
Other | laravel | framework | ff00aa9e02634b94ec2b6572a3dcdb90d4349071.json | Add withDefault to MorphOne relations. | src/Illuminate/Database/Eloquent/Relations/Concerns/HasDefault.php | @@ -0,0 +1,63 @@
+<?php
+
+namespace Illuminate\Database\Eloquent\Relations\Concerns;
+
+use Illuminate\Database\Eloquent\Model;
+
+trait HasDefault
+{
+ /**
+ * Indicates if a default model instance should be used.
+ *
+ * Alternatively, may be a Closure or array.
+ *
+ * @var \Closure|array|boo... | true |
Other | laravel | framework | ff00aa9e02634b94ec2b6572a3dcdb90d4349071.json | Add withDefault to MorphOne relations. | src/Illuminate/Database/Eloquent/Relations/HasOne.php | @@ -4,17 +4,11 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Relations\Concerns\HasDefault;
class HasOne extends HasOneOrMany
{
- /**
- * Indicates if a default model instance should be used.
- *
- * Alternatively, may be... | true |
Other | laravel | framework | ff00aa9e02634b94ec2b6572a3dcdb90d4349071.json | Add withDefault to MorphOne relations. | src/Illuminate/Database/Eloquent/Relations/MorphOne.php | @@ -2,18 +2,22 @@
namespace Illuminate\Database\Eloquent\Relations;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Relations\Concerns\HasDefault;
class MorphOne extends MorphOneOrMany
{
+ use HasDefault;
+
/**
* Get the res... | true |
Other | laravel | framework | bb5a955c2e146d8cf198ae5ac4c50bb28a194f58.json | Add dump method to Collection class (#19755)
* Add dump method
* cs fix
* add support for labels | src/Illuminate/Support/Collection.php | @@ -11,6 +11,7 @@
use JsonSerializable;
use IteratorAggregate;
use InvalidArgumentException;
+use Illuminate\Support\Debug\Dumper;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
@@ -253,6 +254,22 @@ public function dd()
dd($... | false |
Other | laravel | framework | f5fafad80dbb08353824483f5b849031693cc477.json | Add dd() to collection. | src/Illuminate/Support/Collection.php | @@ -243,6 +243,16 @@ public function crossJoin(...$lists)
));
}
+ /**
+ * Dump the collection and end the script.
+ *
+ * @return void
+ */
+ public function dd()
+ {
+ dd($this->all());
+ }
+
/**
* Get the items in the collection that are not present in the... | false |
Other | laravel | framework | 91543c185366dbef4749aa3552e186ce9190c78c.json | Apply fixes from StyleCI (#19753) | src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php | @@ -14,10 +14,10 @@
use Illuminate\Queue\Console\FailedTableCommand;
use Illuminate\Foundation\Console\AppNameCommand;
use Illuminate\Foundation\Console\JobMakeCommand;
-use Illuminate\Foundation\Console\RuleMakeCommand;
use Illuminate\Database\Console\Seeds\SeedCommand;
use Illuminate\Foundation\Console\MailMakeC... | false |
Other | laravel | framework | bc0f60b00b8c2c2fba2cc2c48b8a83a0d18f9c0d.json | detect lock wait timeout as deadlock (#19749) | src/Illuminate/Database/DetectsDeadlocks.php | @@ -25,6 +25,7 @@ protected function causedByDeadlock(Exception $e)
'database table is locked',
'A table in the database is locked',
'has been chosen as the deadlock victim',
+ 'Lock wait timeout exceeded; try restarting transaction',
]);
}
} | false |
Other | laravel | framework | ed1ede2a14e0db78d8172a596ac0acab38de03a1.json | initialize conditions property and fix docblock | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -37,6 +37,14 @@ class BladeCompiler extends Compiler implements CompilerInterface
*/
protected $customDirectives = [];
+ /**
+ * All custom directives conditions, used
+ * by the "if" and "check" methods
+ *
+ * @var array
+ */
+ protected $conditions = [];
+
/**
* ... | false |
Other | laravel | framework | 1f1540ab92effba1025b2e74b358c3e75ecf2ac6.json | Apply fixes from StyleCI (#19742) | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -364,7 +364,7 @@ public function if($name, Closure $callback)
});
$this->directive('end'.$name, function () {
- return "<?php endif; ?>";
+ return '<?php endif; ?>';
});
}
| false |
Other | laravel | framework | 71dfe0f0824412f106b80df8dedd7708e66dfb00.json | add if method | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -2,6 +2,7 @@
namespace Illuminate\View\Compilers;
+use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
@@ -345,6 +346,40 @@ public function getExtensions()
return $this->extensions;
}
+ /**
+ * Register an "if" statement directive.
+ *
+ * @param string $nam... | true |
Other | laravel | framework | 71dfe0f0824412f106b80df8dedd7708e66dfb00.json | add if method | tests/View/Blade/BladeCustomTest.php | @@ -60,4 +60,17 @@ public function testCustomExtensionOverwritesCore()
$expected = '<?php custom(); ?>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
+
+ public function testCustomConditions()
+ {
+ $this->compiler->if('custom', function ($user) {
+ ... | true |
Other | laravel | framework | 346d352d15802b4fdbd692595235e23e2e12ba6c.json | Update ListenerMakeCommand.php (#19660)
* Update ListenerMakeCommand.php
Allow to make listeners for the events outside of App or Illuminate namespaces
* Update ListenerMakeCommand.php
Pass all prefixes to `Str::startWith()` in anonymous array. instead of calling it 3 times (even more useful if more prefixes ... | src/Illuminate/Foundation/Console/ListenerMakeCommand.php | @@ -53,8 +53,11 @@ protected function buildClass($name)
{
$event = $this->option('event');
- if (! Str::startsWith($event, $this->laravel->getNamespace()) &&
- ! Str::startsWith($event, 'Illuminate')) {
+ if (! Str::startsWith($event, [
+ $this->laravel->getNamespace(... | false |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | src/Illuminate/Foundation/Application.php | @@ -520,7 +520,7 @@ public function detectEnvironment(Closure $callback)
{
$args = isset($_SERVER['argv']) ? $_SERVER['argv'] : null;
- return $this['env'] = (new EnvironmentDetector())->detect($callback, $args);
+ return $this['env'] = (new EnvironmentDetector)->detect($callback, $args);
... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | src/Illuminate/Mail/TransportManager.php | @@ -104,7 +104,7 @@ protected function addSesCredentials(array $config)
*/
protected function createMailDriver()
{
- return new MailTransport();
+ return new MailTransport;
}
/** | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | src/Illuminate/Routing/RoutingServiceProvider.php | @@ -133,7 +133,7 @@ protected function registerPsrRequest()
protected function registerPsrResponse()
{
$this->app->bind(ResponseInterface::class, function ($app) {
- return new PsrResponse();
+ return new PsrResponse;
});
}
| true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Auth/AuthorizesResourcesTest.php | @@ -13,42 +13,42 @@ class AuthorizesResourcesTest extends TestCase
{
public function testCreateMethod()
{
- $controller = new AuthorizesResourcesController();
+ $controller = new AuthorizesResourcesController;
$this->assertHasMiddleware($controller, 'create', 'can:create,App\User');
... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Broadcasting/BroadcasterTest.php | @@ -18,7 +18,7 @@ public function tearDown()
public function testExtractingParametersWhileCheckingForUserAccess()
{
- $broadcaster = new FakeBroadcaster();
+ $broadcaster = new FakeBroadcaster;
$callback = function ($user, BroadcasterTestEloquentModelStub $model, $nonModel) {
... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/CacheEventsTest.php | @@ -182,7 +182,7 @@ protected function getDispatcher()
protected function getRepository($dispatcher)
{
- $repository = new \Illuminate\Cache\Repository(new \Illuminate\Cache\ArrayStore());
+ $repository = new \Illuminate\Cache\Repository(new \Illuminate\Cache\ArrayStore);
$repository-... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/CacheFileStoreTest.php | @@ -26,7 +26,7 @@ public function tearDown()
public function testNullIsReturnedIfFileDoesntExist()
{
$files = $this->mockFilesystem();
- $files->expects($this->once())->method('get')->will($this->throwException(new FileNotFoundException()));
+ $files->expects($this->once())->method('get... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/CacheMemcachedStoreTest.php | @@ -138,7 +138,7 @@ public function testGetAndSetPrefix()
$this->markTestSkipped('Memcached module not installed');
}
- $store = new MemcachedStore(new Memcached(), 'bar');
+ $store = new MemcachedStore(new Memcached, 'bar');
$this->assertEquals('bar:', $store->getPrefix()... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/CacheTableCommandTest.php | @@ -22,7 +22,7 @@ public function testCreateMakesMigration()
);
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator')->shouldIgnoreMissing();
- $app = new Application();
+ $app = new Application;
$app->useDatabasePath(__DIR__);
$app['migration.creator'... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/CacheTaggedCacheTest.php | @@ -27,7 +27,7 @@ public function testCacheCanBeSetWithDatetimeArgument()
{
$store = new ArrayStore;
$tags = ['bop', 'zap'];
- $duration = new DateTime();
+ $duration = new DateTime;
$duration->add(new DateInterval('PT10M'));
$store->tags($tags)->put('foo', 'bar', ... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cache/ClearCommandTest.php | @@ -22,7 +22,7 @@ public function testClearWithNoStoreArgument()
$cacheRepository = m::mock('Illuminate\Contracts\Cache\Repository');
- $app = new Application();
+ $app = new Application;
$command->setLaravel($app);
$cacheManager->shouldReceive('store')->once()->with(null)... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Container/ContainerTest.php | @@ -525,7 +525,7 @@ public function testCallWithAtSignBasedClassReferences()
public function testCallWithCallableArray()
{
$container = new Container;
- $stub = new ContainerTestCallStub();
+ $stub = new ContainerTestCallStub;
$result = $container->call([$stub, 'work'], ['foo',... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Cookie/Middleware/EncryptCookiesTest.php | @@ -77,7 +77,7 @@ class EncryptCookiesTestController extends Controller
{
public function setCookies()
{
- $response = new Response();
+ $response = new Response;
$response->headers->setCookie(new Cookie('encrypted_cookie', 'value'));
$response->headers->setCookie(new Cookie('... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Database/DatabaseEloquentGlobalScopesTest.php | @@ -14,39 +14,39 @@ public function tearDown()
public function testGlobalScopeIsApplied()
{
- $model = new EloquentGlobalScopesTestModel();
+ $model = new EloquentGlobalScopesTestModel;
$query = $model->newQuery();
$this->assertEquals('select * from "table" where "active" = ?... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Database/DatabaseEloquentHasOneTest.php | @@ -26,7 +26,7 @@ public function testHasOneWithDefault()
$this->builder->shouldReceive('first')->once()->andReturnNull();
- $newModel = new EloquentHasOneModelStub();
+ $newModel = new EloquentHasOneModelStub;
$this->related->shouldReceive('newInstance')->once()->andReturn($newMod... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Database/DatabaseEloquentModelTest.php | @@ -423,7 +423,7 @@ public function testTimestampsAreCreatedFromStringsAndIntegers()
public function testFromDateTime()
{
- $model = new EloquentModelStub();
+ $model = new EloquentModelStub;
$value = \Carbon\Carbon::parse('2015-04-17 22:59:01');
$this->assertEquals('2015-0... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Database/DatabaseEloquentRelationTest.php | @@ -71,7 +71,7 @@ public function testMacroable()
return 'foo';
});
- $model = new EloquentRelationResetModelStub();
+ $model = new EloquentRelationResetModelStub;
$relation = new EloquentRelationStub($model->newQuery(), $model);
$result = $relation->foo(); | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Database/DatabaseSchemaBlueprintIntegrationTest.php | @@ -47,7 +47,7 @@ public function testRenamingAndChangingColumnsWork()
$table->integer('age')->change();
});
- $queries = $blueprint->toSql($this->db->connection(), new \Illuminate\Database\Schema\Grammars\SQLiteGrammar());
+ $queries = $blueprint->toSql($this->db->connection(), ne... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Events/EventsDispatcherTest.php | @@ -230,7 +230,7 @@ public function testShouldBroadcastSuccess()
$d->makePartial()->shouldAllowMockingProtectedMethods();
- $event = new BroadcastEvent();
+ $event = new BroadcastEvent;
$this->assertTrue($d->shouldBroadcast([$event]));
}
@@ -241,7 +241,7 @@ public function tes... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Filesystem/FilesystemTest.php | @@ -17,28 +17,28 @@ public function setUp()
public function tearDown()
{
- $files = new Filesystem();
+ $files = new Filesystem;
$files->deleteDirectory($this->tempDir);
}
public function testGetRetrievesFiles()
{
file_put_contents($this->tempDir.'/file.txt',... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Foundation/FoundationTestResponseTest.php | @@ -147,7 +147,7 @@ public function testMacroable()
public function testCanBeCreatedFromBinaryFileResponses()
{
- $files = new Filesystem();
+ $files = new Filesystem;
$tempDir = __DIR__.'/tmp';
$files->makeDirectory($tempDir, 0755, false, true);
$files->put($tempDir... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Foundation/Http/Middleware/TransformsRequestTest.php | @@ -10,7 +10,7 @@ class TransformsRequestTest extends TestCase
{
public function testLowerAgeAndAddBeer()
{
- $middleware = new ManipulateInput();
+ $middleware = new ManipulateInput;
$request = new Request(
[
'name' => 'Damian',
@@ -28,7 +28,7 @@ public f... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Http/HttpResponseTest.php | @@ -31,7 +31,7 @@ public function testJsonResponsesAreConvertedAndHeadersAreSet()
$this->assertEquals('{"foo":"bar"}', $response->getContent());
$this->assertEquals('application/json', $response->headers->get('Content-Type'));
- $response = new \Illuminate\Http\Response();
+ $response ... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Integration/Notifications/SendingMailNotificationsTest.php | @@ -54,7 +54,7 @@ public function setUp()
public function test_mail_is_sent()
{
- $notification = new TestMailNotification();
+ $notification = new TestMailNotification;
$user = NotifiableUser::forceCreate([
'email' => 'taylor@laravel.com',
@@ -90,7 +90,7 @@ public func... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Mail/MailMailerTest.php | @@ -201,6 +201,6 @@ public function getTransport()
public function createMessage()
{
- return new \Swift_Message();
+ return new \Swift_Message;
}
} | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Queue/QueueDatabaseQueueUnitTest.php | @@ -54,7 +54,7 @@ public function testFailureToCreatePayloadFromObject()
{
$this->expectException('InvalidArgumentException');
- $job = new stdClass();
+ $job = new stdClass;
$job->invalid = "\xc3\x28";
$queue = $this->getMockForAbstractClass('Illuminate\Queue\Queue'); | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Queue/QueueListenerTest.php | @@ -36,7 +36,7 @@ public function testListenerStopsWhenMemoryIsExceeded()
public function testMakeProcessCorrectlyFormatsCommandLine()
{
$listener = new \Illuminate\Queue\Listener(__DIR__);
- $options = new \Illuminate\Queue\ListenerOptions();
+ $options = new \Illuminate\Queue\Listener... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Queue/QueueSyncQueueTest.php | @@ -75,7 +75,7 @@ class FailingSyncQueueTestHandler
{
public function fire($job, $data)
{
- throw new Exception();
+ throw new Exception;
}
public function failed() | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Routing/RouteCollectionTest.php | @@ -18,7 +18,7 @@ public function setUp()
{
parent::setUp();
- $this->routeCollection = new RouteCollection();
+ $this->routeCollection = new RouteCollection;
}
public function testRouteCollectionCanBeConstructed() | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Routing/RoutingRouteTest.php | @@ -761,7 +761,7 @@ public function testModelBindingWithBindingClosure()
return $name;
}]);
$router->model('bar', 'Illuminate\Tests\Routing\RouteModelBindingNullStub', function ($value) {
- return (new RouteModelBindingClosureStub())->findAlternate($value);
+ return ... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Session/SessionStoreTest.php | @@ -289,10 +289,10 @@ public function testHandlerNeedsRequest()
$this->assertFalse($session->handlerNeedsRequest());
$session->getHandler()->shouldReceive('setRequest')->never();
- $session = new \Illuminate\Session\Store('test', m::mock(new \Illuminate\Session\CookieSessionHandler(new \Illum... | true |
Other | laravel | framework | cfc5264204b83309226412e6104313ad6e6f1023.json | Remove useless braces in constructors. (#19663) | tests/Session/SessionTableCommandTest.php | @@ -22,7 +22,7 @@ public function testCreateMakesMigration()
);
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator')->shouldIgnoreMissing();
- $app = new Application();
+ $app = new Application;
$app->useDatabasePath(__DIR__);
$app['migration.creator'... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.