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 | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
| true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use Illuminate\Contracts\Console\Kernel;
| true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
trait InteractsWithContainer
{ | true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
trait InteractsWithDatabase
{ | true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php | @@ -1,12 +1,13 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use Exception;
use Illuminate\Support\Str;
use InvalidArgumentException;
use Symfony\Component\DomCrawler\Form;
use Symfony\Component\DomCrawler\Crawler;
+use Illuminate\Foundation\Testing\Http... | true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use PHPUnit_Framework_Assert as PHPUnit;
| true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use Illuminate\Support\Str;
use Illuminate\Http\Request; | true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php | @@ -1,6 +1,6 @@
<?php
-namespace Illuminate\Foundation\Testing;
+namespace Illuminate\Foundation\Testing\Concerns;
use Mockery;
use Exception; | true |
Other | laravel | framework | 613f17fb6f1c76105111169deacac8fe8605d303.json | Move some classes. | src/Illuminate/Foundation/Testing/TestCase.php | @@ -7,13 +7,13 @@
abstract class TestCase extends PHPUnit_Framework_TestCase
{
- use InteractsWithContainer,
- MakesHttpRequests,
- ImpersonatesUsers,
- InteractsWithConsole,
- InteractsWithDatabase,
- InteractsWithSession,
- MocksApplicationServices;
+ use Concerns\I... | true |
Other | laravel | framework | 934bb07cdafe0b086740bdb163691f0d7cc9364b.json | Skip non-arrays when collapsing | src/Illuminate/Support/Arr.php | @@ -60,6 +60,10 @@ public static function collapse($array)
$values = $values->all();
}
+ if (! is_array($values)) {
+ continue;
+ }
+
$results = array_merge($results, $values);
}
| false |
Other | laravel | framework | c7da89d4d45e69c5302551854962a65948e38401.json | Remove comments (missing commit)
laravel/framework#10704 | src/Illuminate/Database/Connection.php | @@ -352,7 +352,7 @@ public function insert($query, $bindings = [])
*
* @param string $query
* @param array $bindings
- * @return int Number of rows affected by the query
+ * @return int
*/
public function update($query, $bindings = [])
{
@@ -364,7 +364,7 @@ public function... | true |
Other | laravel | framework | c7da89d4d45e69c5302551854962a65948e38401.json | Remove comments (missing commit)
laravel/framework#10704 | src/Illuminate/Database/Query/Builder.php | @@ -1789,7 +1789,7 @@ public function insertGetId(array $values, $sequence = null)
* Update a record in the database.
*
* @param array $values
- * @return int Number of rows affected by the query
+ * @return int
*/
public function update(array $values)
{ | true |
Other | laravel | framework | 79f64b8929cf2d3d71eefddc6e284a1aea1d772f.json | Fix Collection JSON serializing logic | src/Illuminate/Support/Collection.php | @@ -922,7 +922,15 @@ public function toArray()
*/
public function jsonSerialize()
{
- return $this->toArray();
+ return array_map(function ($value) {
+ if ($value instanceof JsonSerializable) {
+ return $value->jsonSerialize();
+ } elseif ($value instan... | true |
Other | laravel | framework | 79f64b8929cf2d3d71eefddc6e284a1aea1d772f.json | Fix Collection JSON serializing logic | tests/Support/SupportCollectionTest.php | @@ -112,19 +112,31 @@ public function testToArrayCallsToArrayOnEachItemInCollection()
$this->assertEquals(['foo.array', 'bar.array'], $results);
}
- public function testToJsonEncodesTheToArrayResult()
+ public function testJsonSerializeCallsToArrayOrJsonSerializeOnEachItemInCollection()
{
- ... | true |
Other | laravel | framework | fb644538937e91b922135161355d7466600f7a03.json | Move session assertions. | src/Illuminate/Foundation/Testing/InteractsWithSession.php | @@ -55,4 +55,89 @@ public function flushSession()
$this->app['session']->flush();
}
+
+ /**
+ * Assert that the session has a given list of values.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return void
+ */
+ public function seeInSession($key, $value... | true |
Other | laravel | framework | fb644538937e91b922135161355d7466600f7a03.json | Move session assertions. | src/Illuminate/Foundation/Testing/MakesHttpRequests.php | @@ -635,91 +635,6 @@ public function assertRedirectedToAction($name, $parameters = [], $with = [])
$this->assertRedirectedTo($this->app['url']->action($name, $parameters), $with);
}
- /**
- * Assert that the session has a given list of values.
- *
- * @param string|array $key
- * @p... | true |
Other | laravel | framework | 7d89a3ea6c74bfeb1f82e7cf47aedc4aff2c8d6d.json | Fix Eloquent Collection tests | tests/Database/DatabaseEloquentCollectionTest.php | @@ -235,12 +235,12 @@ public function testNonModelRelatedMethods()
{
$a = new Collection([['foo' => 'bar'], ['foo' => 'baz']]);
$b = new Collection(['a', 'b', 'c']);
- $this->assertInstanceOf(BaseCollection::class, $a->pluck('foo'));
- $this->assertInstanceOf(BaseCollection::class, ... | false |
Other | laravel | framework | e0c7d76bbbc829c4069bf142fe5d56545252b99e.json | Allow negative condition in presence verifier | src/Illuminate/Validation/DatabasePresenceVerifier.php | @@ -2,6 +2,7 @@
namespace Illuminate\Validation;
+use Illuminate\Support\Str;
use Illuminate\Database\ConnectionResolverInterface;
class DatabasePresenceVerifier implements PresenceVerifierInterface
@@ -91,6 +92,8 @@ protected function addWhere($query, $key, $extraValue)
$query->whereNull($key);
... | true |
Other | laravel | framework | e0c7d76bbbc829c4069bf142fe5d56545252b99e.json | Allow negative condition in presence verifier | tests/Validation/ValidationDatabasePresenceVerifierTest.php | @@ -16,11 +16,12 @@ public function testBasicCount()
$db->shouldReceive('connection')->once()->with('connection')->andReturn($conn = m::mock('StdClass'));
$conn->shouldReceive('table')->once()->with('table')->andReturn($builder = m::mock('StdClass'));
$builder->shouldReceive('where')->with('c... | true |
Other | laravel | framework | 0ad5b36932a87bd76736d763aef858d60d9f4fa7.json | Make queued jobs the default. | src/Illuminate/Foundation/Console/JobMakeCommand.php | @@ -35,10 +35,10 @@ class JobMakeCommand extends GeneratorCommand
*/
protected function getStub()
{
- if ($this->option('queued')) {
- return __DIR__.'/stubs/job-queued.stub';
- } else {
+ if ($this->option('sync')) {
return __DIR__.'/stubs/job.stub';
+ ... | false |
Other | laravel | framework | 00e2c2b503e603ca78035abbce9dfe05c2a2965b.json | Remove unused imports | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -2,7 +2,6 @@
namespace Illuminate\Foundation\Testing;
-use Exception;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
| true |
Other | laravel | framework | 00e2c2b503e603ca78035abbce9dfe05c2a2965b.json | Remove unused imports | src/Illuminate/Foundation/Testing/InteractsWithPages.php | @@ -4,7 +4,6 @@
use Exception;
use Illuminate\Support\Str;
-use Illuminate\Http\Request;
use InvalidArgumentException;
use Symfony\Component\DomCrawler\Form;
use Symfony\Component\DomCrawler\Crawler; | true |
Other | laravel | framework | 5311a22735cad8ae34e42e8b4e76b03d5e928399.json | Prevent $config conflicts within config files | src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php | @@ -50,10 +50,10 @@ public function bootstrap(Application $app)
* @param \Illuminate\Contracts\Config\Repository $config
* @return void
*/
- protected function loadConfigurationFiles(Application $app, RepositoryContract $config)
+ protected function loadConfigurationFiles(Application $app, Rep... | false |
Other | laravel | framework | 2f5a4ccf7834c82c465767fc6fcbf8e7b8278b61.json | Add other test | tests/Database/DatabaseEloquentBuilderTest.php | @@ -433,6 +433,21 @@ public function testHasWithContraintsAndHavingInSubquery()
$this->assertEquals(['baz', 'qux', 'quuux'], $builder->getBindings());
}
+ public function testHasWithContraintsAndJoinAndHavingInSubquery()
+ {
+ $model = new EloquentBuilderTestModelParentStub;
+ $build... | false |
Other | laravel | framework | acfdc3e5b90a43eeede56f496356009fa87bdee8.json | Apply StyleCI fixes | src/Illuminate/Foundation/Validation/ValidationException.php | @@ -6,32 +6,32 @@
class ValidationException extends Exception
{
- /**
- * The validator instance.
- *
- * @var \Illuminate\Validation\Validator
- */
- public $validator;
+ /**
+ * The validator instance.
+ *
+ * @var \Illuminate\Validation\Validator
+ */
+ public $validator;
- /**
- * T... | false |
Other | laravel | framework | 65f69f0ebf1622ae5e0ffb23d8e1ac1e178b03fa.json | Make Seeder and its run() method abstract | src/Illuminate/Database/Seeder.php | @@ -5,7 +5,7 @@
use Illuminate\Console\Command;
use Illuminate\Container\Container;
-class Seeder
+abstract class Seeder
{
/**
* The container instance.
@@ -26,10 +26,7 @@ class Seeder
*
* @return void
*/
- public function run()
- {
- //
- }
+ abstract public functio... | true |
Other | laravel | framework | 65f69f0ebf1622ae5e0ffb23d8e1ac1e178b03fa.json | Make Seeder and its run() method abstract | tests/Database/DatabaseSeederTest.php | @@ -3,6 +3,14 @@
use Mockery as m;
use Illuminate\Database\Seeder;
+class TestSeeder extends Seeder
+{
+ public function run()
+ {
+ //
+ }
+}
+
class DatabaseSeederTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
@@ -12,7 +20,7 @@ public function tearDown()
public ... | true |
Other | laravel | framework | bc38e1494b1130415456de9702a93db071c248fe.json | Fix performance on getSize method
Not is more faster only return $value for numeric types
There is some special reason search again the value
Arr::get($this->data, $attribute) | src/Illuminate/Validation/Validator.php | @@ -960,7 +960,7 @@ protected function getSize($attribute, $value)
// is the size. If it is a file, we take kilobytes, and for a string the
// entire length of the string will be considered the attribute size.
if (is_numeric($value) && $hasNumeric) {
- return Arr::get($this->data, ... | false |
Other | laravel | framework | 489a06810e8027a46c869827f94f114ff24a5286.json | Add a failing test for resource "update" route | tests/Routing/RoutingRouteTest.php | @@ -573,6 +573,12 @@ public function testResourceRouting()
$routes = $router->getRoutes();
$this->assertCount(8, $routes);
+ $router = $this->getRouter();
+ $router->resource('foo', 'FooController', ['only' => ['update']]);
+ $routes = $router->getRoutes();
+
+ $this->ass... | false |
Other | laravel | framework | 377596b316319569ab62cdb8d31408a16d5b08cf.json | Add AuthorizesRequests returns responses test | tests/Foundation/FoundationAuthorizesRequestsTraitTest.php | @@ -1,6 +1,7 @@
<?php
use Illuminate\Container\Container;
+use Illuminate\Auth\Access\Response;
use Illuminate\Contracts\Auth\Access\Gate;
class FoundationAuthorizesRequestsTraitTest extends PHPUnit_Framework_TestCase
@@ -17,8 +18,9 @@ public function test_basic_gate_check()
return true;
}... | false |
Other | laravel | framework | 29e07131b79b63098b6db9b77df3c0f7d7e4e19a.json | Return access response from AuthorizesRequests | src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php | @@ -13,15 +13,15 @@ trait AuthorizesRequests
*
* @param mixed $ability
* @param mixed|array $arguments
- * @return void
+ * @return \Illuminate\Auth\Access\Response
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function authorize($abilit... | false |
Other | laravel | framework | 367e456bcbf73b16f60fababd366a21db802b14d.json | Add gate authorize tests | tests/Auth/AuthAccessGateTest.php | @@ -2,6 +2,8 @@
use Illuminate\Auth\Access\Gate;
use Illuminate\Container\Container;
+use Illuminate\Auth\Access\Response;
+use Illuminate\Auth\Access\HandlesAuthorization;
class GateTest extends PHPUnit_Framework_TestCase
{
@@ -122,7 +124,7 @@ public function test_policy_default_to_false_if_method_does_not_exi... | false |
Other | laravel | framework | 150cbf7d7d8f4b1ea6160799c73f862606636564.json | Add HandlesAuthorization to policy stub | src/Illuminate/Foundation/Console/stubs/policy.stub | @@ -2,8 +2,12 @@
namespace DummyNamespace;
+use Illuminate\Auth\Access\HandlesAuthorization;
+
class DummyClass
{
+ use HandlesAuthorization;
+
/**
* Create a new policy instance.
* | false |
Other | laravel | framework | cf3440799657486757a2e39b077a051cddd7756c.json | Allow passing of permissions on local file driver. | src/Illuminate/Filesystem/FilesystemManager.php | @@ -125,7 +125,11 @@ protected function callCustomCreator(array $config)
*/
public function createLocalDriver(array $config)
{
- return $this->adapt(new Flysystem(new LocalAdapter($config['root'])));
+ $permissions = isset($config['permissions']) ? $config['permissions'] : [];
+
+ r... | false |
Other | laravel | framework | b6113ebc5a23905474548a9d0eea448da2c178e3.json | remove container check | src/Illuminate/Routing/Router.php | @@ -741,7 +741,7 @@ protected function substituteImplicitBindings($route)
foreach ($route->callableParameters(Model::class) as $parameter) {
$class = $parameter->getClass();
- if (array_key_exists($parameter->name, $parameters) && ! $this->container->bound($class->name)) {
+ ... | false |
Other | laravel | framework | 0c34df04ff0eb63f4377c8bc0807411e08b517e9.json | Have the $commands property initialized by default
With this change, the developers can bind "Illuminate\Foundation\Console\Kernel" to "Illuminate\Contracts\Console\Kernel". | src/Illuminate/Foundation/Console/Kernel.php | @@ -49,6 +49,14 @@ class Kernel implements KernelContract
'Illuminate\Foundation\Bootstrap\RegisterProviders',
'Illuminate\Foundation\Bootstrap\BootProviders',
];
+
+ /**
+ * The Artisan commands provided by the application.
+ * Initialized as empty here, in case there is no need o... | false |
Other | laravel | framework | afe7528cc296b0ea873a1f608a819df70e0a6496.json | Use $this in closure
Supported since PHP 5.4 | tests/Mail/MailMailerTest.php | @@ -173,9 +173,8 @@ public function testGlobalFromIsRespectedOnAllMessages()
$view->shouldReceive('render')->once()->andReturn('rendered.view');
$this->setSwiftMailer($mailer);
$mailer->alwaysFrom('taylorotwell@gmail.com', 'Taylor Otwell');
- $me = $this;
- $mailer->getSwiftMail... | false |
Other | laravel | framework | 2d4dd33f87a604716beb4e03e9526c1a9d4e5a54.json | Add note to remember method's purpose. | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -145,6 +145,8 @@ public function delete($uri, array $data = [], array $headers = [])
/**
* Send the given request through the application.
*
+ * This method allows you to fully customize the entire Request object.
+ *
* @param \Illuminate\Http\Request $request
* @return $this
... | false |
Other | laravel | framework | 052ebceb4a26b47d294600976d8756f77245eee2.json | Get exception property only if it exists | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -289,7 +289,7 @@ protected function assertPageLoaded($uri, $message = null)
} catch (PHPUnitException $e) {
$message = $message ?: "A request to [{$uri}] failed. Received status code [{$status}].";
- throw new HttpException($message, null, $this->response->exception);
+ ... | false |
Other | laravel | framework | 87f0fab78b63d17def5f79cd28220119b5995709.json | Remove unused imports | src/Illuminate/Routing/RoutingServiceProvider.php | @@ -4,8 +4,6 @@
use Illuminate\Support\ServiceProvider;
use Zend\Diactoros\Response as PsrResponse;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Response;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
class RoutingServiceProvider extends ServiceProvider | false |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Database/DatabaseEloquentModelTest.php | @@ -571,7 +571,7 @@ public function testToArray()
$model->setRelation('multi', new Illuminate\Database\Eloquent\Collection);
$array = $model->toArray();
- $this->assertTrue(is_array($array));
+ $this->assertInternalType('array', $array);
$this->assertEquals('foo', $array['name... | true |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Filesystem/FilesystemTest.php | @@ -16,7 +16,7 @@ public function testPutStoresFiles()
{
$files = new Filesystem;
$files->put(__DIR__.'/file.txt', 'Hello World');
- $this->assertEquals('Hello World', file_get_contents(__DIR__.'/file.txt'));
+ $this->assertStringEqualsFile(__DIR__.'/file.txt', 'Hello World');
... | true |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Queue/QueueDatabaseQueueTest.php | @@ -20,7 +20,7 @@ public function testPushProperlyPushesJobOntoDatabase()
$this->assertEquals(0, $array['attempts']);
$this->assertEquals(0, $array['reserved']);
$this->assertNull($array['reserved_at']);
- $this->assertTrue(is_int($array['available_at']));
+ ... | true |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Support/SupportCollectionTest.php | @@ -118,15 +118,15 @@ public function testToJsonEncodesTheToArrayResult()
$c->expects($this->once())->method('toArray')->will($this->returnValue('foo'));
$results = $c->toJson();
- $this->assertEquals(json_encode('foo'), $results);
+ $this->assertJsonStringEqualsJsonString(json_encode(... | true |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Support/SupportFluentTest.php | @@ -93,7 +93,7 @@ public function testToJsonEncodesTheToArrayResult()
$fluent->expects($this->once())->method('toArray')->will($this->returnValue('foo'));
$results = $fluent->toJson();
- $this->assertEquals(json_encode('foo'), $results);
+ $this->assertJsonStringEqualsJsonString(json_e... | true |
Other | laravel | framework | 7b1a0732e8e3b70c811f31ce1ed85166e7a0b772.json | Use proper assertions | tests/Support/SupportHelpersTest.php | @@ -187,7 +187,7 @@ public function testStrIs()
public function testStrRandom()
{
$result = Str::random(20);
- $this->assertTrue(is_string($result));
+ $this->assertInternalType('string', $result);
$this->assertEquals(20, strlen($result));
}
| true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Console/composer.json | @@ -17,7 +17,7 @@
"php": ">=5.5.9",
"illuminate/contracts": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/console": "3.0.*",
+ "symfony/console": "2.8.*|3.0.*",
"nesbot/carbon": "~1.20"
},
"autoload": { | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Cookie/composer.json | @@ -17,8 +17,8 @@
"php": ">=5.5.9",
"illuminate/contracts": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/http-kernel": "3.0.*",
- "symfony/http-foundation": "3.0.*"
+ "symfony/http-kernel": "2.8.*|3.0.*",
+ "symfony/http-foundation": "2.8.*|3.0.*"
},
... | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Filesystem/composer.json | @@ -17,7 +17,7 @@
"php": ">=5.5.9",
"illuminate/contracts": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/finder": "3.0.*"
+ "symfony/finder": "2.8.*|3.0.*"
},
"autoload": {
"psr-4": { | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Http/composer.json | @@ -17,8 +17,8 @@
"php": ">=5.5.9",
"illuminate/session": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/http-foundation": "3.0.*",
- "symfony/http-kernel": "3.0.*"
+ "symfony/http-foundation": "2.8.*|3.0.*",
+ "symfony/http-kernel": "2.8.*|3.0.*"
},
... | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Queue/composer.json | @@ -20,7 +20,7 @@
"illuminate/container": "5.2.*",
"illuminate/http": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/process": "3.0.*",
+ "symfony/process": "2.8.*|3.0.*",
"nesbot/carbon": "~1.20"
},
"autoload": { | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Routing/composer.json | @@ -21,9 +21,9 @@
"illuminate/pipeline": "5.2.*",
"illuminate/session": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/http-foundation": "3.0.*",
- "symfony/http-kernel": "3.0.*",
- "symfony/routing": "3.0.*"
+ "symfony/http-foundation": "2.8.*|3.0.*",
+ ... | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Session/composer.json | @@ -18,8 +18,8 @@
"illuminate/contracts": "5.2.*",
"illuminate/support": "5.2.*",
"nesbot/carbon": "~1.20",
- "symfony/finder": "3.0.*",
- "symfony/http-foundation": "3.0.*"
+ "symfony/finder": "2.8.*|3.0.*",
+ "symfony/http-foundation": "2.8.*|3.0.*"
},
... | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Translation/composer.json | @@ -17,7 +17,7 @@
"php": ">=5.5.9",
"illuminate/filesystem": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/translation": "3.0.*"
+ "symfony/translation": "2.8.*|3.0.*"
},
"autoload": {
"psr-4": { | true |
Other | laravel | framework | 2a896c5e23e44b657dab27f87561fd05f5859bf0.json | Update components for 2.8|3.0 | src/Illuminate/Validation/composer.json | @@ -18,8 +18,8 @@
"illuminate/container": "5.2.*",
"illuminate/contracts": "5.2.*",
"illuminate/support": "5.2.*",
- "symfony/http-foundation": "3.0.*",
- "symfony/translation": "3.0.*"
+ "symfony/http-foundation": "2.8.*|3.0.*",
+ "symfony/translation": "2.8.*|3.0... | true |
Other | laravel | framework | 47e2f092d052303b47caa08c6ab5e7d481c103e9.json | Allow both Symfony 2.8 and 3.0 | composer.json | @@ -29,17 +29,17 @@
"paragonie/random_compat": "^1.0.4",
"psy/psysh": "~0.5.1",
"swiftmailer/swiftmailer": "~5.1",
- "symfony/console": "3.0.*",
- "symfony/css-selector": "3.0.*",
- "symfony/debug": "3.0.*",
- "symfony/dom-crawler": "3.0.*",
- "symfony/finde... | false |
Other | laravel | framework | c34ad52bdeea9163b8283e4793c2cb9a951469bf.json | Fix union with join issue | src/Illuminate/Database/Query/Builder.php | @@ -337,9 +337,13 @@ public function join($table, $one, $operator = null, $two = null, $type = 'inner
// is trying to build a join with a complex "on" clause containing more than
// one condition, so we'll add the join and call a Closure with the query.
if ($one instanceof Closure) {
- ... | true |
Other | laravel | framework | c34ad52bdeea9163b8283e4793c2cb9a951469bf.json | Fix union with join issue | tests/Database/DatabaseQueryBuilderTest.php | @@ -371,7 +371,7 @@ public function testUnionWithJoin()
{
$builder = $this->getBuilder();
$builder->select('*')->from('users');
- $builder->union($this->getBuilder()->select('*')->from('dogs')->join('breeds', function($join) {
+ $builder->union($this->getBuilder()->select('*')->from... | true |
Other | laravel | framework | e7f4c52114a51604e0fb3b00fb794ae821b1a62c.json | use file object instead of file_exists | src/Illuminate/Cache/FileStore.php | @@ -110,12 +110,8 @@ public function put($key, $value, $minutes)
*/
protected function createCacheDirectory($path)
{
- try {
- if (! file_exists(dirname($path))) {
- $this->files->makeDirectory(dirname($path), 0777, true, true);
- }
- } catch (Exception... | false |
Other | laravel | framework | ba3bcebbe32f87a54da37ef99581c164fe22ef2c.json | change code style to match with style ci | src/Illuminate/Cache/FileStore.php | @@ -111,7 +111,7 @@ public function put($key, $value, $minutes)
protected function createCacheDirectory($path)
{
try {
- if (!file_exists(dirname($path))) {
+ if (! file_exists(dirname($path))) {
$this->files->makeDirectory(dirname($path), 0777, true, true);
... | false |
Other | laravel | framework | fc38e00289d848163c4da024877f31951c55b353.json | fix missing round bracket | src/Illuminate/Cache/FileStore.php | @@ -111,7 +111,7 @@ public function put($key, $value, $minutes)
protected function createCacheDirectory($path)
{
try {
- if (!file_exists(dirname($path)) {
+ if (!file_exists(dirname($path))) {
$this->files->makeDirectory(dirname($path), 0777, true, true);
... | false |
Other | laravel | framework | ab902adb2e9b28012f9c4f1a95005891f8bc040b.json | Resolve validation factory contract in FormRequest
Replaces resolution of the concrete implementation of the validation factory with
resolution of the contract. | src/Illuminate/Foundation/Http/FormRequest.php | @@ -11,6 +11,7 @@
use Illuminate\Http\Exception\HttpResponseException;
use Illuminate\Validation\ValidatesWhenResolvedTrait;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;
+use Illuminate\Contracts\Validation\Factory as ValidationFactory;
class FormRequest extends Request implements ValidatesWhenResol... | false |
Other | laravel | framework | 55f415bcff70c991a6accee9a17deee46a9e29c1.json | fix undefined variable | src/Illuminate/Database/Query/Builder.php | @@ -1668,7 +1668,7 @@ public function avg($column)
*/
public function average($column)
{
- return $this->avg($key);
+ return $this->avg($column);
}
/** | false |
Other | laravel | framework | 6f7a98ea4a62fae6eace3c410d189fa5fd8c4ace.json | Remove the array_fetch helper | src/Illuminate/Support/helpers.php | @@ -112,22 +112,6 @@ function array_except($array, $keys)
}
}
-if (! function_exists('array_fetch')) {
- /**
- * Fetch a flattened array of a nested array element.
- *
- * @param array $array
- * @param string $key
- * @return array
- *
- * @deprecated since version 5.1. Use ... | false |
Other | laravel | framework | 0fb1a0ec95e7ac1784dcb5ad49503ec758006f93.json | fix code style | src/Illuminate/Database/Capsule/Manager.php | @@ -6,9 +6,9 @@
use Illuminate\Container\Container;
use Illuminate\Database\DatabaseManager;
use Illuminate\Contracts\Events\Dispatcher;
+use Illuminate\Support\Traits\CapsuleManagerTrait;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Connectors\ConnectionFactory;
-use Illuminate\Supp... | false |
Other | laravel | framework | 306d04cc04fa00d57cddac810b0f329af101d598.json | Fix CS and add Int as a numericRule | src/Illuminate/Validation/Validator.php | @@ -139,7 +139,7 @@ class Validator implements ValidatorContract
*
* @var array
*/
- protected $numericRules = ['Numeric', 'Integer'];
+ protected $numericRules = ['Numeric', 'Integer', 'Int'];
/**
* The validation rules that imply the field is required.
@@ -2600,8 +2600,7 @@ protec... | false |
Other | laravel | framework | e4c9bdb8e3761584c0899661a7667784831467f9.json | Fix small typo in comments | src/Illuminate/Routing/UrlGenerator.php | @@ -138,7 +138,7 @@ public function previous()
}
/**
- * Generate a absolute URL to the given path.
+ * Generate an absolute URL to the given path.
*
* @param string $path
* @param mixed $extra | false |
Other | laravel | framework | 7873cdb3c266721204b6ac593e440c1e064d4d7a.json | Remove unnecessary brackets | src/Illuminate/Encryption/Encrypter.php | @@ -47,7 +47,7 @@ public static function supported($key, $cipher)
{
$length = mb_strlen($key, '8bit');
- return ($cipher === 'AES-128-CBC' && ($length === 16)) || ($cipher === 'AES-256-CBC' && $length === 32);
+ return ($cipher === 'AES-128-CBC' && $length === 16) || ($cipher === 'AES-256-... | false |
Other | laravel | framework | 23d409b450ae7cc0b236a396003ac7ea15b7538a.json | simplify request isset | src/Illuminate/Http/Request.php | @@ -881,42 +881,30 @@ public function offsetUnset($offset)
}
/**
- * Get an input element from the request.
+ * Check if an input element is set on the request.
*
* @param string $key
- * @return mixed
+ * @return bool
*/
- public function __get($key)
+ public funct... | false |
Other | laravel | framework | d410a6bf3f279b5e766d6d7c2a7bb49fb93c88d9.json | Fix code style; | tests/Http/HttpRequestTest.php | @@ -565,7 +565,7 @@ public function testMagicMethods()
$this->assertEquals(empty($request->undefined), true);
// Simulates Route parameters.
- $request = Request::create('/example/bar', 'GET', [ 'xyz' => 'overwrited' ]);
+ $request = Request::create('/example/bar', 'GET', ['xyz' => 'ov... | false |
Other | laravel | framework | 4824f4b2fd402b597dfa9e93d27075497e411afd.json | Turn tests inline to make more clear; | tests/Http/HttpRequestTest.php | @@ -543,43 +543,74 @@ public function testCreateFromBase()
* Tests for Http\Request magic methods `__get()` and `__isset()`.
*
* @link https://github.com/laravel/framework/issues/10403 Form request object attribute returns empty when have some string.
- * @dataProvider magicMethodsProvider
*... | false |
Other | laravel | framework | 01e42d1a6cd15acf4989390721eb663b57a8407c.json | Fix code style; | tests/Http/HttpRequestTest.php | @@ -540,15 +540,15 @@ public function testCreateFromBase()
}
/**
- * Tests to issue https://github.com/laravel/framework/issues/10403
+ * Tests to https://github.com/laravel/framework/issues/10403 issue.
* @dataProvider magicMethodsProvider
*/
public function testMagicMethods($uri, ... | false |
Other | laravel | framework | e064596297bd045650e8981c4114a94ceacafe97.json | code formatting issues | src/Illuminate/Cache/RateLimiter.php | @@ -34,13 +34,9 @@ public function __construct(Cache $cache)
*/
public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1)
{
- $attempts = $this->cache->get(
- $key, 0
- );
-
$lockedOut = $this->cache->has($key.':lockout');
- if ($attempts > $maxAtt... | true |
Other | laravel | framework | e064596297bd045650e8981c4114a94ceacafe97.json | code formatting issues | src/Illuminate/Foundation/Auth/ThrottlesLogins.php | @@ -23,31 +23,31 @@ protected function hasTooManyLoginAttempts(Request $request)
}
/**
- * Determine how many retries left.
+ * Increment the login attempts for the user.
*
- * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Http\Request $request
* @return int
... | true |
Other | laravel | framework | 7bebac8dd5282918f16a3b553dbd6f4e1089a8b9.json | Simplify code of View::renderSections() | src/Illuminate/View/View.php | @@ -121,10 +121,8 @@ protected function renderContents()
*/
public function renderSections()
{
- $env = $this->factory;
-
- return $this->render(function ($view) use ($env) {
- return $env->getSections();
+ return $this->render(function () {
+ return $this->fac... | false |
Other | laravel | framework | b877dadfe9d892244a7418f4ea446e1dd4dbc8c0.json | Fix incorrect @return value in docblock
On the `createMany()` method of the `BelongsToMany` relation, the `$instances` variable being returned is an array and not an `\Illuminate\Database\Eloquent\Model` instance as the @return tag in the docblock states. | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -731,7 +731,7 @@ public function create(array $attributes, array $joining = [], $touch = true)
*
* @param array $records
* @param array $joinings
- * @return \Illuminate\Database\Eloquent\Model
+ * @return array
*/
public function createMany(array $records, array $joinings = ... | false |
Other | laravel | framework | b9a51803b7fd191e9665db1fd9f9686db6755ad4.json | remove unused method. | src/Illuminate/Database/Eloquent/Model.php | @@ -684,20 +684,6 @@ public static function findOrNew($id, $columns = ['*'])
return new static;
}
- /**
- * Refresh the current model with the current attributes from the database.
- *
- * @return void
- */
- protected function refresh()
- {
- $fresh = $this->fresh();
-
-... | false |
Other | laravel | framework | d9dd691526dcf17eb87390b2dbcf3574388d53ac.json | change method order. | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -199,6 +199,20 @@ public function compileTruncate(Builder $query)
return ['truncate table '.$this->wrapTable($query->from) => []];
}
+ /**
+ * Compile a "where date" clause.
+ *
+ * @param \Illuminate\Database\Query\Builder $query
+ * @param array $where
+ * @return string
... | false |
Other | laravel | framework | 99ba29aeeb210f33e24c7dbeedda6cce9ec916dd.json | Return instance from more eloquent methods | src/Illuminate/Database/Eloquent/Model.php | @@ -1344,11 +1344,13 @@ public function getObservableEvents()
* Set the observable event names.
*
* @param array $observables
- * @return void
+ * @return $this
*/
public function setObservableEvents(array $observables)
{
$this->observables = $observables;
+
+ ... | false |
Other | laravel | framework | f59d8a8ca4a2ddc08415634f473d604ec7b4ffdd.json | Return instance from eloquent setters | src/Illuminate/Database/Eloquent/Model.php | @@ -2172,11 +2172,13 @@ public function getVisible()
* Set the visible attributes for the model.
*
* @param array $visible
- * @return void
+ * @return $this
*/
public function setVisible(array $visible)
{
$this->visible = $visible;
+
+ return $this;
}
... | false |
Other | laravel | framework | f19151762b38e7386a5d85d4bbc948de6d123cd8.json | Return instance from setHidden | src/Illuminate/Database/Eloquent/Model.php | @@ -2123,11 +2123,13 @@ public function getHidden()
* Set the hidden attributes for the model.
*
* @param array $hidden
- * @return void
+ * @return $this
*/
public function setHidden(array $hidden)
{
$this->hidden = $hidden;
+
+ return $this;
}
/*... | false |
Other | laravel | framework | 3f695312a174f5b5c39171ec740d136442a9d186.json | Replace double quotes with single quotes | tests/Database/DatabaseEloquentIntegrationTest.php | @@ -61,9 +61,9 @@ public function setUp()
$this->schema()->create('photos', function ($table) {
$table->increments('id');
- $table->unsignedInteger("imageable_id")->nullable();
- $table->string("imageable_type")->nullable();
- $table->index(["imageable_id", "imag... | false |
Other | laravel | framework | 8c36b31e36f9073edaa1672e892d81e819528fd1.json | Add docblock and comment | src/Illuminate/Database/Eloquent/Model.php | @@ -1621,13 +1621,20 @@ protected function performInsert(Builder $query, array $options = [])
$this->wasRecentlyCreated = true;
+ // When inserting newly created models, they might have default values for some
+ // attributes. So it's important that we refresh the model after it has been
+ ... | false |
Other | laravel | framework | 067c6276826799f8223b8c58db4443d1fb0d9677.json | Fix fluent route name in groups. | src/Illuminate/Routing/Route.php | @@ -927,7 +927,7 @@ public function getName()
*/
public function name($name)
{
- $this->action['as'] = $name;
+ $this->action['as'] = isset($this->action['as']) ? $this->action['as'].$name : $name;
return $this;
} | true |
Other | laravel | framework | 067c6276826799f8223b8c58db4443d1fb0d9677.json | Fix fluent route name in groups. | tests/Routing/RoutingRouteTest.php | @@ -92,6 +92,16 @@ public function testBasicDispatchingOfRoutes()
$this->assertEquals('closure', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent());
}
+ public function testFluentRouteNamingWithinAGroup()
+ {
+ $router = $this->getRouter();
+ $router->group(['as' => ... | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Cache/CacheArrayStoreTest.php | @@ -55,6 +55,6 @@ public function testItemsCanBeFlushed()
public function testCacheKey()
{
$store = new ArrayStore;
- $this->assertEquals('', $store->getPrefix());
+ $this->assertEmpty($store->getPrefix());
}
} | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Cache/CacheMemcachedStoreTest.php | @@ -67,6 +67,6 @@ public function testGetAndSetPrefix()
$store->setPrefix('foo');
$this->assertEquals('foo:', $store->getPrefix());
$store->setPrefix(null);
- $this->assertSame('', $store->getPrefix());
+ $this->assertEmpty($store->getPrefix());
}
} | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Cache/CacheRedisStoreTest.php | @@ -88,7 +88,7 @@ public function testGetAndSetPrefix()
$redis->setPrefix('foo');
$this->assertEquals('foo:', $redis->getPrefix());
$redis->setPrefix(null);
- $this->assertSame('', $redis->getPrefix());
+ $this->assertEmpty($redis->getPrefix());
}
protected function ... | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Cache/CacheRepositoryTest.php | @@ -85,9 +85,9 @@ public function testAddWithDatetimeInPastOrZeroMinutesReturnsImmediately()
$repo = $this->getRepository();
$repo->getStore()->shouldReceive('add', 'get', 'put')->never();
$result = $repo->add('foo', 'bar', Carbon::now()->subMinutes(10));
- $this->assertSame(false, $re... | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Routing/RoutingRouteTest.php | @@ -72,11 +72,11 @@ public function testBasicDispatchingOfRoutes()
$router = $this->getRouter();
$router->get('foo/bar', function () { return 'hello'; });
- $this->assertEquals('', $router->dispatch(Request::create('foo/bar', 'HEAD'))->getContent());
+ $this->assertEmpty($router->dispa... | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/Support/SupportStrTest.php | @@ -164,13 +164,13 @@ public function testSubstr()
$this->assertEquals('ЛЁ', Str::substr('БГДЖИЛЁ', -2));
$this->assertEquals('И', Str::substr('БГДЖИЛЁ', -3, 1));
$this->assertEquals('ДЖИЛ', Str::substr('БГДЖИЛЁ', 2, -1));
- $this->assertEquals(false, Str::substr('БГДЖИЛЁ', 4, -4));
+ ... | true |
Other | laravel | framework | ebbae988f5697b0a456f27c0c865515b4c0ab51a.json | Use proper assertion | tests/View/ViewFactoryTest.php | @@ -312,7 +312,7 @@ public function testInjectStartsSectionWithContent()
public function testEmptyStringIsReturnedForNonSections()
{
$factory = $this->getFactory();
- $this->assertEquals('', $factory->yieldContent('foo'));
+ $this->assertEmpty($factory->yieldContent('foo'));
}
... | true |
Other | laravel | framework | 7fe79c5f43820ed64d1bed86ed6d709c7bf51e73.json | Use static instead of self | src/Illuminate/Support/Arr.php | @@ -424,11 +424,11 @@ public static function sortRecursive($array)
{
foreach ($array as &$value) {
if (is_array($value)) {
- $value = self::sortRecursive($value);
+ $value = static::sortRecursive($value);
}
}
- if (self::isAssoc($ar... | false |
Other | laravel | framework | 94d3c6e2ca575b5babd1bbe410ea44602c459123.json | Add avg() method to Collection | src/Illuminate/Support/Collection.php | @@ -53,6 +53,19 @@ public function all()
return $this->items;
}
+ /**
+ * Get the average value of a given key.
+ *
+ * @param string|null $key
+ * @return mixed
+ */
+ public function avg($key = null)
+ {
+ if ($count = $this->count()) {
+ return $this->... | true |
Other | laravel | framework | 94d3c6e2ca575b5babd1bbe410ea44602c459123.json | Add avg() method to Collection | tests/Support/SupportCollectionTest.php | @@ -798,6 +798,21 @@ public function testGettingMinItemsFromCollection()
$c = new Collection();
$this->assertNull($c->min());
}
+
+ public function testGettingAvgItemsFromCollection()
+ {
+ $c = new Collection([(object) ['foo' => 10], (object) ['foo' => 20]]);
+ $this->assertE... | true |
Other | laravel | framework | 13cf97954b639572d167393e4531910aa0bf5c97.json | Improve query builder implode method
Removed a redundant `is_null()` check. Also, the docs recommend against using implode in this way. | src/Illuminate/Database/Query/Builder.php | @@ -1576,12 +1576,8 @@ protected function getListSelect($column, $key)
* @param string $glue
* @return string
*/
- public function implode($column, $glue = null)
+ public function implode($column, $glue = '')
{
- if (is_null($glue)) {
- return implode($this->lists($colum... | false |
Other | laravel | framework | 854e6b231484715df2eb325ebf7ebd1b11cd8adf.json | Create access admission and unauthorized exception | src/Illuminate/Auth/Access/Admission.php | @@ -0,0 +1,33 @@
+<?php
+
+namespace Illuminate\Auth\Access;
+
+class Admission
+{
+ /**
+ * The reason admission was granted.
+ *
+ * @var string|null
+ */
+ protected $reason;
+
+ /**
+ * Create an admission instance.
+ *
+ * @param string|null $reason
+ */
+ public functi... | true |
Other | laravel | framework | 854e6b231484715df2eb325ebf7ebd1b11cd8adf.json | Create access admission and unauthorized exception | src/Illuminate/Auth/Access/Gate.php | @@ -8,6 +8,8 @@
class Gate implements GateContract
{
+ use HandlesAuthorization;
+
/**
* The container instance.
*
@@ -162,13 +164,13 @@ public function denies($ability, $arguments = [])
}
/**
- * Determine if the given ability should be granted for the current user.
+ * Get ... | true |
Other | laravel | framework | 854e6b231484715df2eb325ebf7ebd1b11cd8adf.json | Create access admission and unauthorized exception | src/Illuminate/Auth/Access/HandlesAuthorization.php | @@ -0,0 +1,29 @@
+<?php
+
+namespace Illuminate\Auth\Access;
+
+trait HandlesAuthorization
+{
+ /**
+ * Create a new admission instance.
+ *
+ * @return \Illuminate\Auth\Access\Admission
+ */
+ protected function allow($reason = null)
+ {
+ return new Admission($reason);
+ }
+
+ /*... | true |
Other | laravel | framework | 854e6b231484715df2eb325ebf7ebd1b11cd8adf.json | Create access admission and unauthorized exception | src/Illuminate/Auth/Access/UnauthorizedException.php | @@ -0,0 +1,10 @@
+<?php
+
+namespace Illuminate\Auth\Access;
+
+use Exception;
+
+class UnauthorizedException extends Exception
+{
+ //
+} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.