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
bc656ad451d99a83432d02b165beb70da51e68c5.json
Add logo support to notification email. Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
src/Illuminate/Notifications/Transports/Notification.php
@@ -30,6 +30,13 @@ class Notification implements Arrayable */ public $application; + /** + * The URL to the application's logo. + * + * @var string + */ + public $logoUrl; + /** * The "level" of the notification (info, success, error). * @@ -87,11 +94,13 @@ public fun...
true
Other
laravel
framework
bc656ad451d99a83432d02b165beb70da51e68c5.json
Add logo support to notification email. Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
src/Illuminate/Notifications/resources/views/email.blade.php
@@ -218,8 +218,11 @@ <tr> <td class="email-masthead"> <a class="email-masthead_name" href="{{ url('/') }}" target="_blank"> - <!-- <img src="logo" class="email-logo" /> --> - {{ $appl...
true
Other
laravel
framework
76350b6666b31716e240b08b8cb5fb0158f32d65.json
remove parsedown import
src/Illuminate/Notifications/DatabaseNotification.php
@@ -2,7 +2,6 @@ namespace Illuminate\Notifications; -use Parsedown; use Illuminate\Database\Eloquent\Model; class DatabaseNotification extends Model
false
Other
laravel
framework
8dfae2aab8d0371ecfd6ea239e19ce784528e25f.json
remove int check
src/Illuminate/Cache/Repository.php
@@ -196,7 +196,7 @@ public function pull($key, $default = null) */ public function put($key, $value, $minutes = null) { - if (is_array($key) && filter_var($value, FILTER_VALIDATE_FLOAT) !== false) { + if (is_array($key)) { return $this->putMany($key, $value); }
false
Other
laravel
framework
35ab21af36861b27bd3621bccef4e15696aa2e73.json
Remove useless mock
tests/Auth/AuthEloquentUserProviderTest.php
@@ -49,7 +49,6 @@ public function testCredentialValidation() public function testModelsCanBeCreated() { - $conn = m::mock('Illuminate\Database\Connection'); $hasher = m::mock('Illuminate\Contracts\Hashing\Hasher'); $provider = new Illuminate\Auth\EloquentUserProvider($hasher, 'Eloqu...
false
Other
laravel
framework
061e0ffec3f48e920b609c56ce0c99f1c79dd73e.json
Remove extraneous whitespace in docblock
src/Illuminate/Session/SessionInterface.php
@@ -33,7 +33,6 @@ public function setRequestOnHandler(Request $request); * Checks if an attribute exists. * * @param string|array $key - * * @return bool */ public function exists($key);
false
Other
laravel
framework
b3606975fb65f6a65a592dd160f010017b6627dc.json
Add exists method to Session Store Currently, there is no way to test if a session variable exists and its value is null, as the has method will return false for any null value. This PR introduces the exists method into SessionStore, as well as SessionInterface and relevant tests to account for this functionality, wh...
src/Illuminate/Session/SessionInterface.php
@@ -28,4 +28,13 @@ public function handlerNeedsRequest(); * @return void */ public function setRequestOnHandler(Request $request); + + /** + * Checks if an attribute exists. + * + * @param string|array $key + * + * @return bool + */ + public function exists($key); }
true
Other
laravel
framework
b3606975fb65f6a65a592dd160f010017b6627dc.json
Add exists method to Session Store Currently, there is no way to test if a session variable exists and its value is null, as the has method will return false for any null value. This PR introduces the exists method into SessionStore, as well as SessionInterface and relevant tests to account for this functionality, wh...
src/Illuminate/Session/Store.php
@@ -321,6 +321,22 @@ public function has($name) return true; } + /** + * {@inheritdoc} + */ + public function exists($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if (! Arr::exists($this->attributes, $value)) { + ...
true
Other
laravel
framework
b3606975fb65f6a65a592dd160f010017b6627dc.json
Add exists method to Session Store Currently, there is no way to test if a session variable exists and its value is null, as the has method will return false for any null value. This PR introduces the exists method into SessionStore, as well as SessionInterface and relevant tests to account for this functionality, wh...
tests/Session/SessionStoreTest.php
@@ -296,6 +296,19 @@ public function testName() $this->assertEquals($session->getName(), 'foo'); } + public function testKeyExists() + { + $session = $this->getSession(); + $session->set('foo', 'bar'); + $this->assertTrue($session->exists('foo')); + $session->set('baz',...
true
Other
laravel
framework
e54e797432a60f165bea2b8c84c62a65fd7f2ca3.json
add tap helper and test
src/Illuminate/Support/helpers.php
@@ -801,6 +801,21 @@ function studly_case($value) } } +if (! function_exists('tap')) { + /** + * Call the given Closure with a given value then return the value. + * + * @param mixed $value + * @return mixed + */ + function tap($value, $callback) + { + $callback($value); + ...
true
Other
laravel
framework
e54e797432a60f165bea2b8c84c62a65fd7f2ca3.json
add tap helper and test
tests/Support/SupportHelpersTest.php
@@ -673,6 +673,12 @@ public function testArrayPull() $this->assertEquals('Mövsümov', array_pull($developer, 'surname')); $this->assertEquals(['firstname' => 'Ferid'], $developer); } + + public function testTap() + { + $object = (object) ['id' => 1]; + $this->assertEquals(2, ta...
true
Other
laravel
framework
af0080918dd53471916c38a87fcac0568a8deef2.json
remove requirement to have register method.
src/Illuminate/Foundation/Application.php
@@ -551,7 +551,9 @@ public function register($provider, $options = [], $force = false) $provider = $this->resolveProviderClass($provider); } - $this->registerProvider($provider); + if (method_exists($provider, 'register')) { + $provider->register(); + } ...
true
Other
laravel
framework
af0080918dd53471916c38a87fcac0568a8deef2.json
remove requirement to have register method.
tests/Foundation/FoundationApplicationTest.php
@@ -25,7 +25,7 @@ public function testSetLocaleSetsLocaleAndFiresLocaleChangedEvent() public function testServiceProvidersAreCorrectlyRegistered() { - $provider = m::mock('Illuminate\Support\ServiceProvider'); + $provider = m::mock('ApplicationBasicServiceProviderStub'); $class = get_...
true
Other
laravel
framework
4811209231b3e20886ddaeafcea78c659be5b4af.json
Fix morphTo macro calls (#13828)
src/Illuminate/Database/Eloquent/Relations/MorphTo.php
@@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations; +use BadMethodCallException; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; @@ -29,6 +30,13 @@ class MorphTo extends BelongsTo */ protected $dictionary = [...
true
Other
laravel
framework
4811209231b3e20886ddaeafcea78c659be5b4af.json
Fix morphTo macro calls (#13828)
tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php
@@ -536,6 +536,12 @@ public function testMorphToWithTrashed() }])->first(); $this->assertEquals($abigail->email, $comment->owner->email); + + $comment = TestCommentWithoutSoftDelete::with(['owner' => function ($q) { + $q->withTrashed(); + }])->first(); + + $this->asse...
true
Other
laravel
framework
9fa19379ff8c201a9c0d1ad55167337d0c94e3e8.json
allow customization of default views
src/Illuminate/Pagination/AbstractPaginator.php
@@ -80,6 +80,20 @@ abstract class AbstractPaginator implements Htmlable */ protected static $viewFactoryResolver; + /** + * The default pagination view. + * + * @var string + */ + public static $defaultView = 'pagination::bootstrap-3'; + + /** + * The default "simple" paginatio...
true
Other
laravel
framework
9fa19379ff8c201a9c0d1ad55167337d0c94e3e8.json
allow customization of default views
src/Illuminate/Pagination/LengthAwarePaginator.php
@@ -127,7 +127,7 @@ public function links($view = null) */ public function render($view = null) { - $view = $view ?: 'pagination::bootstrap-3'; + $view = $view ?: static::$defaultView; $window = UrlWindow::make($this);
true
Other
laravel
framework
9fa19379ff8c201a9c0d1ad55167337d0c94e3e8.json
allow customization of default views
src/Illuminate/Pagination/Paginator.php
@@ -110,9 +110,11 @@ public function links($view = null) */ public function render($view = null) { - return new HtmlString(static::viewFactory()->make($view ?: 'pagination::simple-bootstrap-3', [ - 'paginator' => $this, - ])->render()); + return new HtmlString( + ...
true
Other
laravel
framework
883b6db9d3d2b553637b08adefc97f6b22d188f1.json
allow publishing of pagination views
src/Illuminate/Pagination/PaginationServiceProvider.php
@@ -14,6 +14,12 @@ class PaginationServiceProvider extends ServiceProvider public function boot() { $this->loadViewsFrom(__DIR__.'/resources/views', 'pagination'); + + if ($this->app->runningInConsole()) { + $this->publishes([ + __DIR__.'/resources/views' => resource_...
false
Other
laravel
framework
34b2ed68e2dfe038050d74a28947e1180bb8cb2b.json
add method to commandName
src/Illuminate/Queue/Queue.php
@@ -76,7 +76,10 @@ protected function createPayload($job, $data = '', $queue = null) } elseif (is_object($job)) { return json_encode([ 'job' => 'Illuminate\Queue\CallQueuedHandler@call', - 'data' => ['commandName' => get_class($job), 'command' => serialize(clone $jo...
false
Other
laravel
framework
5cfe7313ccb65485dc5cf2eb6f3bf0512aebf5e1.json
improve some comments
src/Illuminate/Queue/Worker.php
@@ -182,9 +182,9 @@ public function runNextJob($connectionName, $queue = null, $delay = 0, $sleep = $job = $this->getNextJob($connection, $queue); - // If we're able to pull a job off of the stack, we will process it and - // then immediately return back out. If there is no job on...
false
Other
laravel
framework
550fe258561e6ef700b5237c1bd1974624542db7.json
Add a point on suggest (#13808)
src/Illuminate/Auth/composer.json
@@ -33,7 +33,7 @@ "suggest": { "illuminate/console": "Required to use the auth:clear-resets command (5.2.*).", "illuminate/queue": "Required to fire login / logout events (5.2.*).", - "illuminate/session": "Required to use the session based guard (5.2.*)" + "illuminate/session": "Re...
false
Other
laravel
framework
6c22d54f89d1021306b6dfab1604a06d4c9cc53e.json
remove queue responses. no longer needed
src/Illuminate/Queue/Worker.php
@@ -197,8 +197,6 @@ public function runNextJob($connectionName, $queue = null, $delay = 0, $sleep = } $this->sleep($sleep); - - return ['job' => null, 'failed' => false]; } /** @@ -247,8 +245,6 @@ public function process($connection, Job $job, $maxTries = 0, $delay = 0) ...
false
Other
laravel
framework
ace7f04ae579146ca3adf1c5992256c50ddc05a8.json
Use events, duh.
src/Illuminate/Queue/Console/WorkCommand.php
@@ -6,6 +6,8 @@ use Illuminate\Queue\Worker; use Illuminate\Console\Command; use Illuminate\Contracts\Queue\Job; +use Illuminate\Queue\Events\JobFailed; +use Illuminate\Queue\Events\JobProcessed; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; @@ -56,6 +58,11 @...
false
Other
laravel
framework
baf62ee5a1b55b62e642c40cee08030faebe1781.json
add collection serialization
src/Illuminate/Queue/SerializesModels.php
@@ -53,6 +53,10 @@ public function __wakeup() */ protected function getSerializedPropertyValue($value) { + if ($value instanceof QueueableCollection) { + return new ModelIdentifier($value->getQueueableClass(), $value->getQueueableIds()); + } + if ($value instanceof Queu...
false
Other
laravel
framework
d5bbda95a6435fa8cb38b8b640440b38de6b7f83.json
set exception handler even on non daemon
src/Illuminate/Queue/Console/WorkCommand.php
@@ -91,13 +91,13 @@ public function fire() */ protected function runWorker($connection, $queue, $delay, $memory, $daemon = false) { + $this->worker->setDaemonExceptionHandler( + $this->laravel['Illuminate\Contracts\Debug\ExceptionHandler'] + ); + if ($daemon) { ...
false
Other
laravel
framework
0f66352eb394e5f7ca10cd937bddef2898c49170.json
Use keyBy instead of flatMap (#13777)
src/Illuminate/Database/Eloquent/Relations/MorphTo.php
@@ -194,12 +194,12 @@ protected function getResultsByType($type) */ protected function getEagerLoadsForInstance(Model $instance) { - $eagers = BaseCollection::make($this->query->getEagerLoads()); + $relations = BaseCollection::make($this->query->getEagerLoads()); - return $eagers-...
false
Other
laravel
framework
bccaf7c179237ca558be5df2d7e8e44ef52136cc.json
Pass the key to the keyBy callback (#13766)
src/Illuminate/Support/Collection.php
@@ -374,8 +374,8 @@ public function keyBy($keyBy) $results = []; - foreach ($this->items as $item) { - $results[$keyBy($item)] = $item; + foreach ($this->items as $key => $item) { + $results[$keyBy($item, $key)] = $item; } return new static($results);
true
Other
laravel
framework
bccaf7c179237ca558be5df2d7e8e44ef52136cc.json
Pass the key to the keyBy callback (#13766)
tests/Support/SupportCollectionTest.php
@@ -961,12 +961,12 @@ public function testKeyByClosure() ['firstname' => 'Taylor', 'lastname' => 'Otwell', 'locale' => 'US'], ['firstname' => 'Lucas', 'lastname' => 'Michot', 'locale' => 'FR'], ]); - $result = $data->keyBy(function ($item) { - return strtolower($item...
true
Other
laravel
framework
a2c879a8e89fc2f0de989dfd5d0dac32b3a3db38.json
Move the Authorize middleware into Auth (#13767)
src/Illuminate/Auth/Middleware/Authorize.php
@@ -1,10 +1,10 @@ <?php -namespace Illuminate\Foundation\Http\Middleware; +namespace Illuminate\Auth\Middleware; use Closure; use Illuminate\Contracts\Auth\Access\Gate; -use Illuminate\Contracts\Auth\Factory as AuthFactory; +use Illuminate\Contracts\Auth\Factory as Auth; class Authorize { @@ -29,7 +29,7 @@ c...
true
Other
laravel
framework
a2c879a8e89fc2f0de989dfd5d0dac32b3a3db38.json
Move the Authorize middleware into Auth (#13767)
tests/Auth/AuthorizeMiddlewareTest.php
@@ -6,14 +6,14 @@ use Illuminate\Auth\Access\Gate; use Illuminate\Events\Dispatcher; use Illuminate\Container\Container; +use Illuminate\Auth\Middleware\Authorize; use Illuminate\Contracts\Routing\Registrar; use Illuminate\Contracts\Auth\Factory as Auth; use Illuminate\Auth\Access\AuthorizationException; -use Ill...
true
Other
laravel
framework
38acdd807faec4b85fd47051341ccaf666499551.json
fix boolean binding for json updates
src/Illuminate/Database/Query/Builder.php
@@ -2067,6 +2067,8 @@ public function update(array $values) $sql = $this->grammar->compileUpdate($this, $values); + $bindings = $this->grammar->prepareBindingsForUpdate($bindings, $values); + return $this->connection->update($sql, $this->cleanBindings($bindings)); }
true
Other
laravel
framework
38acdd807faec4b85fd47051341ccaf666499551.json
fix boolean binding for json updates
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -776,6 +776,18 @@ public function compileUpdate(Builder $query, $values) return trim("update {$table}{$joins} set $columns $where"); } + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values + * @return array + */ ...
true
Other
laravel
framework
38acdd807faec4b85fd47051341ccaf666499551.json
fix boolean binding for json updates
src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
@@ -157,6 +157,28 @@ protected function compileJsonUpdateColumn($key, JsonExpression $value) return "{$field} = json_set({$field}, {$accessor}, {$value->getValue()})"; } + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values...
true
Other
laravel
framework
73695d9766ff341906664c0f101e85189915a516.json
Remove unnecessary code (#13732)
tests/Database/DatabaseEloquentMorphToTest.php
@@ -83,17 +83,6 @@ protected function getRelationAssociate($parent) public function getRelation($parent = null, $builder = null) { $builder = $builder ?: m::mock('Illuminate\Database\Eloquent\Builder'); - $builder->shouldReceive('toBase')->andReturn($builder); - $builder->shouldReceive(...
true
Other
laravel
framework
73695d9766ff341906664c0f101e85189915a516.json
Remove unnecessary code (#13732)
tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php
@@ -2,11 +2,11 @@ use Carbon\Carbon; use Illuminate\Database\Connection; -use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Pagination\Paginator; use Illuminate\Database\Query\Builder; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Capsule\Manager as DB; +use Illuminate\D...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
CHANGELOG.md
@@ -3,7 +3,7 @@ ## v5.2.33 (2016-05-25) ### Added -- Allow query results to be traverse their via cursor ([#13030](https://github.com/laravel/framework/pull/13030)) +- Allow query results to be traversed using a cursor ([#13030](https://github.com/laravel/framework/pull/13030)) - Added support for log levels ([#13...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Cache/RedisTaggedCache.php
@@ -9,13 +9,13 @@ class RedisTaggedCache extends TaggedCache * * @var string */ - const REFERENCE_KEY_FOREVER = 'forever'; + const REFERENCE_KEY_FOREVER = 'forever_ref'; /** * Standard reference key. * * @var string */ - const REFERENCE_KEY_STANDARD = 'standard'; ...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Database/Eloquent/Builder.php
@@ -731,6 +731,24 @@ protected function isNested($name, $relation) return $dots && Str::startsWith($name, $relation.'.'); } + /** + * Apply the callback's query changes if the given "value" is true. + * + * @param bool $value + * @param \Closure $callback + * @return $this + ...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Database/Eloquent/Relations/MorphTo.php
@@ -29,13 +29,6 @@ class MorphTo extends BelongsTo */ protected $dictionary = []; - /* - * Indicates if soft-deleted model instances should be fetched. - * - * @var bool - */ - protected $withTrashed = false; - /** * Create a new morph to relationship instance. * @@ -...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Database/Query/Builder.php
@@ -535,6 +535,10 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' // will be bound to each SQL statements when it is finally executed. $type = 'Basic'; + if (Str::contains($column, '->') && is_bool($value)) { + $value = new Expression($value ? 't...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
@@ -4,6 +4,7 @@ use Illuminate\Support\Str; use Illuminate\Database\Query\Builder; +use Illuminate\Database\Query\JsonExpression; class MySqlGrammar extends Grammar { @@ -92,7 +93,40 @@ protected function compileLock(Builder $query, $value) */ public function compileUpdate(Builder $query, $values) ...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
src/Illuminate/Database/Query/JsonExpression.php
@@ -0,0 +1,70 @@ +<?php + +namespace Illuminate\Database\Query; + +use InvalidArgumentException; + +class JsonExpression extends Expression +{ + /** + * The value of the expression. + * + * @var mixed + */ + protected $value; + + /** + * Create a new raw query expression. + * + * @p...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
tests/Cache/CacheTaggedCacheTest.php
@@ -64,8 +64,9 @@ public function testRedisCacheTagsPushForeverKeysCorrectly() $redis = new Illuminate\Cache\RedisTaggedCache($store, $tagSet); $store->shouldReceive('getPrefix')->andReturn('prefix:'); $store->shouldReceive('connection')->andReturn($conn = m::mock('StdClass')); - $conn...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
tests/Database/DatabaseEloquentBuilderTest.php
@@ -493,9 +493,9 @@ public function testWithCountAndContraintsAndHaving() $builder = $model->where('bar', 'baz'); $builder->withCount(['foo' => function ($q) { $q->where('bam', '>', 'qux'); - }])->having('fooCount', '>=', 1); + }])->having('foo_count', '>=', 1); - $...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
tests/Database/DatabaseEloquentMorphToTest.php
@@ -1,7 +1,6 @@ <?php use Mockery as m; -use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\MorphTo; class DatabaseEloquentMorphToTest extends PHPUnit_Framework_TestCase @@ -37,61 +36,6 @@ public function testLookupDictionaryIsProperlyConstructed() ], $dictionary); ...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php
@@ -2,6 +2,7 @@ use Carbon\Carbon; use Illuminate\Database\Connection; +use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Pagination\Paginator; use Illuminate\Database\Query\Builder; use Illuminate\Database\Eloquent\SoftDeletes; @@ -50,6 +51,8 @@ public function createSchema() $this->...
true
Other
laravel
framework
fb546f8d67a610381ba5ccea6bf873d75d363805.json
Fix tests and cons
tests/Database/DatabaseQueryBuilderTest.php
@@ -1256,6 +1256,62 @@ public function testMySqlWrapping() $this->assertEquals('select * from `users`', $builder->toSql()); } + public function testMySqlUpdateWrappingJson() + { + $grammar = new Illuminate\Database\Query\Grammars\MySqlGrammar; + $processor = m::mock('Illuminate\Datab...
true
Other
laravel
framework
6ed8b3a3e9a454a0959ea8ecd70a166cc3dbf357.json
Remove the "unauthenticated" method (#13709)
src/Illuminate/Foundation/Exceptions/Handler.php
@@ -181,22 +181,6 @@ protected function convertValidationExceptionToResponse(ValidationException $e, return redirect()->back()->withInput($request->input())->withErrors($errors); } - /** - * Convert an authentication exception into an unauthenticated response. - * - * @param \Illuminate\...
false
Other
laravel
framework
c1820b2039f4bb44322c704f9c208fb10341cd38.json
fix style issue
src/Illuminate/Auth/Events/Logout.php
@@ -7,7 +7,6 @@ class Logout { use SerializesModels; - /** * The authenticated user. *
false
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
src/Illuminate/Database/Console/Migrations/MigrateCommand.php
@@ -68,9 +68,9 @@ public function fire() if (! is_null($path = $this->input->getOption('path'))) { $paths[] = $this->laravel->basePath().'/'.$path; } else { - $paths[] = $this->getMigrationPath(); - - $paths = array_merge($paths, $this->migrator->paths()); + ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
src/Illuminate/Database/Console/Migrations/ResetCommand.php
@@ -66,9 +66,9 @@ public function fire() $pretend = $this->input->getOption('pretend'); - $paths[] = $this->getMigrationPath(); - - $paths = array_merge($paths, $this->migrator->paths()); + $paths = array_merge( + [$this->getMigrationPath()], $this->migrator->paths() + ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
src/Illuminate/Database/Console/Migrations/RollbackCommand.php
@@ -60,9 +60,9 @@ public function fire() $pretend = $this->input->getOption('pretend'); - $paths[] = $this->getMigrationPath(); - - $paths = array_merge($paths, $this->migrator->paths()); + $paths = array_merge( + [$this->getMigrationPath()], $this->migrator->paths() + ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
src/Illuminate/Database/Console/Migrations/StatusCommand.php
@@ -57,9 +57,9 @@ public function fire() if (! is_null($path = $this->input->getOption('path'))) { $paths[] = $this->laravel->basePath().'/'.$path; } else { - $paths[] = $this->getMigrationPath(); - - $paths = array_merge($paths, $this->migrator->paths()); + ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
src/Illuminate/Database/Migrations/Migrator.php
@@ -4,6 +4,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; +use Illuminate\Support\Collection; use Illuminate\Filesystem\Filesystem; use Illuminate\Database\ConnectionResolverInterface as Resolver; @@ -45,7 +46,7 @@ class Migrator protected $notes = []; /** - * The paths for all mig...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
tests/Database/DatabaseMigratorIntegrationTest.php
@@ -0,0 +1,126 @@ +<?php + +use Illuminate\Filesystem\Filesystem; +use Illuminate\Database\Migrations\Migrator; +use Illuminate\Database\Capsule\Manager as DB; +use Illuminate\Database\Migrations\DatabaseMigrationRepository; + +class DatabaseMigratorIntegrationTest extends PHPUnit_Framework_TestCase +{ + protected $...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
tests/Database/DatabaseMigratorTest.php
@@ -1,302 +0,0 @@ -<?php - -use Mockery as m; - -class DatabaseMigratorTest extends PHPUnit_Framework_TestCase -{ - public function tearDown() - { - m::close(); - } - - public function testMigrationAreRunUpWhenOutstandingMigrationsExist() - { - $migrator = $this->getMockBuilder('Illuminate\...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
tests/Database/migrations/one/2016_01_01_000000_create_users_table.php
@@ -0,0 +1,35 @@ +<?php + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateUsersTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
tests/Database/migrations/one/2016_01_01_100000_create_password_resets_table.php
@@ -0,0 +1,32 @@ +<?php + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreatePasswordResetsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { ...
true
Other
laravel
framework
540b1ae0a17ffc5720b678f33795422e8a152ab8.json
write integration tests for migrator
tests/Database/migrations/two/2016_01_01_200000_create_flights_table.php
@@ -0,0 +1,31 @@ +<?php + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateFlightsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + ...
true
Other
laravel
framework
1c1f2f2d87876be86fc1ce98efa0f2bc1a3670f6.json
Fix postgres Schema::hastable (#13008)
src/Illuminate/Database/PostgresConnection.php
@@ -2,13 +2,28 @@ namespace Illuminate\Database; +use Illuminate\Database\Schema\PostgresBuilder; use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineDriver; use Illuminate\Database\Query\Processors\PostgresProcessor; use Illuminate\Database\Query\Grammars\PostgresGrammar as QueryGrammar; use Illuminate\Databa...
true
Other
laravel
framework
1c1f2f2d87876be86fc1ce98efa0f2bc1a3670f6.json
Fix postgres Schema::hastable (#13008)
src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
@@ -28,7 +28,7 @@ class PostgresGrammar extends Grammar */ public function compileTableExists() { - return 'select * from information_schema.tables where table_name = ?'; + return 'select * from information_schema.tables where table_schema = ? and table_name = ?'; } /**
true
Other
laravel
framework
1c1f2f2d87876be86fc1ce98efa0f2bc1a3670f6.json
Fix postgres Schema::hastable (#13008)
src/Illuminate/Database/Schema/PostgresBuilder.php
@@ -0,0 +1,23 @@ +<?php + +namespace Illuminate\Database\Schema; + +class PostgresBuilder extends Builder +{ + /** + * Determine if the given table exists. + * + * @param string $table + * @return bool + */ + public function hasTable($table) + { + $sql = $this->grammar->compileTabl...
true
Other
laravel
framework
e53d363ea783e7307d9e068cd003078a03021b16.json
Add catch exception when connect and get job
src/Illuminate/Queue/Worker.php
@@ -143,17 +143,24 @@ protected function daemonShouldRun() */ public function pop($connectionName, $queue = null, $delay = 0, $sleep = 3, $maxTries = 0) { - $connection = $this->manager->connection($connectionName); + try { + $connection = $this->manager->connection($connectionN...
false
Other
laravel
framework
d48e5312550e7df050f63c5040c3043cde96f369.json
fix bugs. add tests
src/Illuminate/Database/Connection.php
@@ -343,12 +343,12 @@ public function select($query, $bindings = [], $useReadPdo = true) } /** - * Run a select statement against the database and returns a cursor. + * Run a select statement against the database and returns a generator. * * @param string $query * @param array ...
true
Other
laravel
framework
d48e5312550e7df050f63c5040c3043cde96f369.json
fix bugs. add tests
src/Illuminate/Database/Eloquent/Builder.php
@@ -304,29 +304,16 @@ public function firstOrFail($columns = ['*']) } /** - * Traverses through a result set using a cursor. + * Get a generator for the given query. * - * @return void + * @return \Generator */ public function cursor() { $builder = $this->apply...
true
Other
laravel
framework
d48e5312550e7df050f63c5040c3043cde96f369.json
fix bugs. add tests
src/Illuminate/Database/Query/Builder.php
@@ -1693,15 +1693,19 @@ protected function restoreFieldsForCount() } /** - * Execute the query as a "select" statement. + * Get a generator for the given query. * - * @return mixed + * @return \Generator */ public function cursor() { - $results = $this->connectio...
true
Other
laravel
framework
d48e5312550e7df050f63c5040c3043cde96f369.json
fix bugs. add tests
tests/Database/DatabaseEloquentIntegrationTest.php
@@ -112,6 +112,21 @@ public function testBasicModelRetrieval() $collection = EloquentTestUser::find([1, 2, 3]); $this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $collection); $this->assertEquals(2, $collection->count()); + + $models = EloquentTestUser::where('id', 1)-...
true
Other
laravel
framework
473910ce1932173a5ed700b9b50dd9f0a6696e0f.json
use injectoin for consistency
src/Illuminate/Foundation/Http/Middleware/Authorize.php
@@ -4,9 +4,17 @@ use Closure; use Illuminate\Contracts\Auth\Access\Gate; +use Illuminate\Contracts\Auth\Factory as AuthFactory; class Authorize { + /** + * The authentication factory instance. + * + * @var \Illuminate\Contracts\Auth\Factory + */ + protected $auth; + /** * The ga...
true
Other
laravel
framework
473910ce1932173a5ed700b9b50dd9f0a6696e0f.json
use injectoin for consistency
tests/Foundation/FoundationAuthorizeMiddlewareTest.php
@@ -32,7 +32,6 @@ public function setUp() $this->container->singleton(Auth::class, function () { $auth = m::mock(Auth::class); $auth->shouldReceive('authenticate')->once()->andReturn(null); - return $auth; });
true
Other
laravel
framework
33d15865502031195013ee8636731585149dd717.json
fix code style
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -842,7 +842,7 @@ public function compileSavepointRollBack($name) */ public function compileRandom() { - return "RANDOM()"; + return 'RANDOM()'; } /**
true
Other
laravel
framework
33d15865502031195013ee8636731585149dd717.json
fix code style
src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
@@ -166,6 +166,6 @@ protected function wrapJsonSelector($value) */ public function compileRandom() { - return "RAND()"; + return 'RAND()'; } }
true
Other
laravel
framework
33d15865502031195013ee8636731585149dd717.json
fix code style
src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php
@@ -355,6 +355,6 @@ protected function wrapTableValuedFunction($table) */ public function compileRandom() { - return "NEWID()"; + return 'NEWID()'; } }
true
Other
laravel
framework
354a94ee6a379a4a4fa4fad0b090aea05d795fcb.json
fix code style
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -840,7 +840,8 @@ public function compileSavepointRollBack($name) * * @return string */ - public function compileRandom(){ + public function compileRandom() + { return "RANDOM()"; }
true
Other
laravel
framework
354a94ee6a379a4a4fa4fad0b090aea05d795fcb.json
fix code style
src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
@@ -164,7 +164,8 @@ protected function wrapJsonSelector($value) * * @return string */ - public function compileRandom(){ + public function compileRandom() + { return "RAND()"; } }
true
Other
laravel
framework
354a94ee6a379a4a4fa4fad0b090aea05d795fcb.json
fix code style
src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php
@@ -353,7 +353,8 @@ protected function wrapTableValuedFunction($table) * * @return string */ - public function compileRandom(){ + public function compileRandom() + { return "NEWID()"; } }
true
Other
laravel
framework
9197863f0a6304afca17f0d88071bee471cbe949.json
add random() function to query builder This function adds sql statements to query to get a number of random records.
src/Illuminate/Database/Query/Builder.php
@@ -1389,6 +1389,17 @@ public function take($value) return $this->limit($value); } + /** + * Add statements to query to get one or many random records. + * + * @param int $value + * @return $this + */ + public function random($value = 1) + { + return $this->orderByR...
false
Other
laravel
framework
9fcceb8e3febc26441be50f62910abe7a03c86bd.json
add connect_timeout:60 to MailgunTransport
src/Illuminate/Mail/Transport/MailgunTransport.php
@@ -75,6 +75,7 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null) 'message' => new PostFile('message', $message->toString()), ]; } + $options['connect_timeout'] = 60; return $this->client->post($this->url, $options); }
false
Other
laravel
framework
4abb185e5a60148676df2333fe36ed9c31f8f480.json
Add softDeletesIntegration test for withCount
tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php
@@ -461,6 +461,43 @@ public function testWhereHasWithNestedDeletedRelationshipAndWithTrashedCondition $this->assertEquals(1, count($users)); } + /** + * @group test + */ + public function testWithCountWithNestedDeletedRelationshipAndOnlyTrashedCondition() + { + $this->createUsers...
false
Other
laravel
framework
03300b0632d1839b12139022bd0a3aa6055f6ddb.json
Add test for merged wheres in withCount
tests/Database/DatabaseEloquentBuilderTest.php
@@ -477,7 +477,7 @@ public function testWithCountAndMergedWheres() { $model = new EloquentBuilderTestModelParentStub; - $builder = $model->select('id')->withCount(['activeFoo' => function($q){ + $builder = $model->select('id')->withCount(['activeFoo' => function ($q) { $q->whe...
false
Other
laravel
framework
356e19914614896e0f7ec940468e24848135d552.json
Add test for merged wheres in withCount
tests/Database/DatabaseEloquentBuilderTest.php
@@ -473,6 +473,18 @@ public function testWithCountAndSelect() $this->assertEquals('select "id", (select count(*) from "eloquent_builder_test_model_close_related_stubs" where "eloquent_builder_test_model_parent_stubs"."foo_id" = "eloquent_builder_test_model_close_related_stubs"."id") as "foo_count" from "eloque...
false
Other
laravel
framework
86d46309b0499cbc1b1ab8692a08c627d2e50940.json
Compare user instances in Auth tests (#13588)
tests/Auth/AuthGuardTest.php
@@ -141,7 +141,7 @@ public function testUserMethodReturnsCachedUser() $user = m::mock('Illuminate\Contracts\Auth\Authenticatable'); $mock = $this->getGuard(); $mock->setUser($user); - $this->assertEquals($user, $mock->user()); + $this->assertSame($user, $mock->user()); } ...
false
Other
laravel
framework
001cffc9b32c764971d825ef6f9c42476d468ef3.json
Correct blank line with no tabs
src/Illuminate/Database/Query/Builder.php
@@ -1418,7 +1418,7 @@ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') } } } - + return $this->where($column, '>', $lastId) ->orderBy($column, 'asc') ->take($perPage);
false
Other
laravel
framework
e4eb25e527fa6696dd599f0a0cb07d07ba29b971.json
Remove blank line
src/Illuminate/Database/Query/Builder.php
@@ -1418,6 +1418,7 @@ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') } } } + return $this->where($column, '>', $lastId) ->orderBy($column, 'asc') ->take($perPage);
false
Other
laravel
framework
18cbc9d197dbc27ee1e502b93dcf03cf02e347fa.json
Remove blank line
src/Illuminate/Database/Query/Builder.php
@@ -1418,7 +1418,6 @@ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') } } } - return $this->where($column, '>', $lastId) ->orderBy($column, 'asc') ->take($perPage);
false
Other
laravel
framework
fcc9a1c231510c3e20d5a406b46211917dd53fa7.json
Remove blank line
src/Illuminate/Database/Query/Builder.php
@@ -1410,7 +1410,6 @@ public function forPage($page, $perPage = 15) */ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') { - // avoid duplicate orders if ($this->orders !== null) { foreach ($this->orders as $key => $order) {
false
Other
laravel
framework
a06e156348dfd932a36758ca1df5062aa4c953d5.json
Simplify join clause
src/Illuminate/Database/Query/Builder.php
@@ -335,30 +335,30 @@ public function from($table) */ public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false) { + $join = new JoinClause($type, $table, $this); + // If the first "column" of the join is really a Closure instance the developer ...
true
Other
laravel
framework
a06e156348dfd932a36758ca1df5062aa4c953d5.json
Simplify join clause
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -3,6 +3,7 @@ namespace Illuminate\Database\Query\Grammars; use Illuminate\Database\Query\Builder; +use Illuminate\Database\Query\JoinClause; use Illuminate\Database\Grammar as BaseGrammar; class Grammar extends BaseGrammar @@ -145,92 +146,16 @@ protected function compileJoins(Builder $query, $joins) ...
true
Other
laravel
framework
a06e156348dfd932a36758ca1df5062aa4c953d5.json
Simplify join clause
src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
@@ -209,8 +209,10 @@ protected function compileUpdateJoinWheres(Builder $query) // all out then implode them. This should give us "where" like syntax after // everything has been built and then we will join it to the real wheres. foreach ($query->joins as $join) { - foreach ($join-...
true
Other
laravel
framework
a06e156348dfd932a36758ca1df5062aa4c953d5.json
Simplify join clause
src/Illuminate/Database/Query/JoinClause.php
@@ -5,7 +5,7 @@ use Closure; use InvalidArgumentException; -class JoinClause +class JoinClause extends Builder { /** * The type of join being performed. @@ -22,30 +22,29 @@ class JoinClause public $table; /** - * The "on" clauses for the join. + * The parent query builder instance. ...
true
Other
laravel
framework
a06e156348dfd932a36758ca1df5062aa4c953d5.json
Simplify join clause
tests/Database/DatabaseEloquentBuilderTest.php
@@ -506,7 +506,7 @@ public function testHasWithContraintsAndJoinAndHavingInSubquery() $builder = $model->where('bar', 'baz'); $builder->whereHas('foo', function ($q) { $q->join('quuuux', function ($j) { - $j->on('quuuuux', '=', 'quuuuuux', 'and', true); + $j->w...
true
Other
laravel
framework
0fecd603347b74c954d74d8b7c38658a2c344aa7.json
Fix PHPDoc collection union() return type
src/Illuminate/Support/Collection.php
@@ -557,7 +557,7 @@ public function combine($values) * Union the collection with the given items. * * @param mixed $items - * @return void + * @return static */ public function union($items) {
false
Other
laravel
framework
853300b13201f98b8149acb3992554af25e2232c.json
Add whereColumn clause
src/Illuminate/Database/Query/Builder.php
@@ -550,16 +550,17 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' * * @param array $column * @param string $boolean + * @param string $method * @return $this */ - protected function addArrayOfWheres($column, $boolean) + protected functio...
true
Other
laravel
framework
853300b13201f98b8149acb3992554af25e2232c.json
Add whereColumn clause
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -308,6 +308,20 @@ protected function whereBasic(Builder $query, $where) return $this->wrap($where['column']).' '.$where['operator'].' '.$value; } + /** + * Compile a where clause comparing two columns.. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $...
true
Other
laravel
framework
853300b13201f98b8149acb3992554af25e2232c.json
Add whereColumn clause
tests/Database/DatabaseQueryBuilderTest.php
@@ -341,6 +341,32 @@ public function testEmptyWhereNotIns() $this->assertEquals([0 => 1], $builder->getBindings()); } + public function testBasicWhereColumn() + { + $builder = $this->getBuilder(); + $builder->select('*')->from('users')->whereColumn('first_name', 'last_name')->orWhere...
true
Other
laravel
framework
07177e94983f20d478026dc93278c05f6f18c0dd.json
fix #13527 (#13537)
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -189,7 +189,7 @@ public function firstOrFail($columns = ['*']) return $model; } - throw new ModelNotFoundException; + throw (new ModelNotFoundException)->setModel(get_class($this->parent)); } /**
true
Other
laravel
framework
07177e94983f20d478026dc93278c05f6f18c0dd.json
fix #13527 (#13537)
src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php
@@ -244,7 +244,7 @@ public function firstOrFail($columns = ['*']) return $model; } - throw new ModelNotFoundException; + throw (new ModelNotFoundException)->setModel(get_class($this->parent)); } /**
true
Other
laravel
framework
07177e94983f20d478026dc93278c05f6f18c0dd.json
fix #13527 (#13537)
tests/Database/DatabaseEloquentBelongsToManyTest.php
@@ -335,6 +335,38 @@ public function testCreateMethodCreatesNewModelAndInsertsAttachmentRecord() $this->assertEquals($model, $relation->create(['attributes'], ['joining'])); } + public function testFindOrFailThrowsException() + { + $relation = $this->getMock('Illuminate\Database\Eloquent\Re...
true
Other
laravel
framework
07177e94983f20d478026dc93278c05f6f18c0dd.json
fix #13527 (#13537)
tests/Database/DatabaseEloquentHasManyThroughTest.php
@@ -138,6 +138,38 @@ public function testFirstMethod() $this->assertEquals('first', $relation->first()); } + public function testFindOrFailThrowsException() + { + $relation = $this->getMock('Illuminate\Database\Eloquent\Relations\HasManyThrough', ['find'], $this->getRelationArguments()); + ...
true
Other
laravel
framework
615ba9a6ead3608ef2cf6956c85a6fc71ac37e57.json
Allow multiple folders for migrations
src/Illuminate/Database/Console/Migrations/MigrateCommand.php
@@ -66,12 +66,14 @@ public function fire() // we will use the path relative to the root of this installation folder // so that migrations may be run for any path within the applications. if (! is_null($path = $this->input->getOption('path'))) { - $path = $this->laravel->basePath()....
true