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
8ccc8f4ed5cde0bca666def9acdd8aa31eecdd6e.json
Replace strlen() with is_null()
src/Illuminate/Database/Eloquent/Model.php
@@ -2501,7 +2501,7 @@ public function isDirty($attribute = null) { $dirtyAttributes = $this->getDirty(); - if (strlen($attribute) > 0) return array_key_exists($attribute, $dirtyAttributes); + if ( ! is_null($attribute)) return array_key_exists($attribute, $dirtyAttributes); return count($dirtyAttributes) ...
false
Other
laravel
framework
24ec1591c3cc3f5624071f3989521f45e2a6ee08.json
fix param count for unique and exists
src/Illuminate/Validation/Validator.php
@@ -870,7 +870,7 @@ protected function validateNotIn($attribute, $value, $parameters) */ protected function validateUnique($attribute, $value, $parameters) { - $this->requireParameterCount(2, $parameters, 'unique'); + $this->requireParameterCount(1, $parameters, 'unique'); $table = $parameters[0]; @@ -9...
false
Other
laravel
framework
fd8b6bb6a93772822170c3d86659313f00612106.json
Add check for parameter count
src/Illuminate/Validation/Validator.php
@@ -560,6 +560,8 @@ protected function validateRequiredWithoutAll($attribute, $value, $parameters) */ protected function validateRequiredIf($attribute, $value, $parameters) { + $this->requireParameterCount(2, $parameters, 'required_if'); + if ($parameters[1] == array_get($this->data, $parameters[0])) { ...
false
Other
laravel
framework
5bcdcbaa6fd30cfc3aee851af17954a37453e915.json
Fix code style
src/Illuminate/Support/MessageBag.php
@@ -60,7 +60,8 @@ public function add($key, $message) */ public function merge($messages) { - if ($messages instanceof MessageProviderInterface) { + if ($messages instanceof MessageProviderInterface) + { $messages = $messages->getMessageBag()->getMessages(); }
false
Other
laravel
framework
cb0b6ba6ba26137493fd9c03dfdfecbaeba7ca85.json
fix validator docblocks
src/Illuminate/Validation/Validator.php
@@ -126,6 +126,7 @@ class Validator implements MessageProviderInterface { * @param array $data * @param array $rules * @param array $messages + * @param array $customAttributes * @return void */ public function __construct(TranslatorInterface $translator, $data, $rules, $messages = array(), $cu...
false
Other
laravel
framework
a656d2d8ac3906347ad838b95de5c3d9b2e12066.json
Fix Beanstalkd tests
tests/Queue/QueueBeanstalkdQueueTest.php
@@ -12,7 +12,7 @@ public function tearDown() public function testPushProperlyPushesJobOntoBeanstalkd() { - $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk_Pheanstalk'), 'default'); + $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk_Pheanstalk'), 'default', 60); $pheans...
false
Other
laravel
framework
2038e4e625de390991d2ba5a027d7ca4ed1330b3.json
Add TTR to Beanstalkd...
src/Illuminate/Queue/BeanstalkdQueue.php
@@ -20,17 +20,25 @@ class BeanstalkdQueue extends Queue implements QueueInterface { */ protected $default; + /** + * The timeout for workers + * + * @var int + */ + protected $ttr; + /** * Create a new Beanstalkd queue instance. * * @param Pheanstalk $pheanstalk * @param string...
true
Other
laravel
framework
2038e4e625de390991d2ba5a027d7ca4ed1330b3.json
Add TTR to Beanstalkd...
src/Illuminate/Queue/Connectors/BeanstalkdConnector.php
@@ -15,7 +15,9 @@ public function connect(array $config) { $pheanstalk = new Pheanstalk($config['host']); - return new BeanstalkdQueue($pheanstalk, $config['queue']); + $config['ttr'] = isset($config['ttr']) ? $config['ttr'] : Pheanstalk::DEFAULT_TTR; + + return new BeanstalkdQueue($pheanstalk, $config[...
true
Other
laravel
framework
9bcd9c16aa493bc8825d1ae2885195a063bfa0b1.json
Add blank line at EOF
src/Illuminate/Queue/Console/stubs/failed_jobs.stub
@@ -32,4 +32,4 @@ class CreateFailedJobsTable extends Migration { Schema::drop('failed_jobs'); } -} \ No newline at end of file +}
false
Other
laravel
framework
8b0276809f17d0414f6e3d429cd19c6bfdd617fd.json
Simplify method. Fix bug.
src/Illuminate/Database/Eloquent/Builder.php
@@ -601,8 +601,8 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' } else { - return call_user_func_array( - array($this->query, 'where'), array_slice(func_get_args(), 0, func_num_args()) + call_user_func_array( + array($this->query, 'where'), func_get_args() ); ...
false
Other
laravel
framework
f2d4bef8c0bf301bcad398f1e15ce8d0dfe9e48a.json
Fix variable typo.
src/Illuminate/Database/Eloquent/Model.php
@@ -335,7 +335,7 @@ public static function getGlobalScope($scope) { return array_first(static::$globalScopes[get_called_class()], function($key, $value) use ($scope) { - return $scope instanceof $registered; + return $scope instanceof $value; }); }
false
Other
laravel
framework
c30ae3528e5ea831beff8585bf5e244458fd2755.json
Add missing changes and a test.
src/Illuminate/Pagination/Paginator.php
@@ -93,15 +93,29 @@ class Paginator implements ArrayableInterface, ArrayAccess, Countable, IteratorA * @param \Illuminate\Pagination\Factory $factory * @param array $items * @param int $total - * @param int $perPage + * @param mixed $perPage * @return void */ - public function __construct...
true
Other
laravel
framework
c30ae3528e5ea831beff8585bf5e244458fd2755.json
Add missing changes and a test.
tests/Pagination/PaginationPaginatorTest.php
@@ -22,6 +22,18 @@ public function testPaginationContextIsSetupCorrectly() } + public function testPaginationContextIsSetupCorrectlyInCursorMode() + { + $p = new Paginator($factory = m::mock('Illuminate\Pagination\Factory'), array('foo', 'bar', 'baz'), 2); + $factory->shouldReceive('getCurrentPage')->once()->an...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
src/Illuminate/Database/Eloquent/Builder.php
@@ -269,6 +269,26 @@ protected function ungroupedPaginate($paginator, $perPage, $columns) return $paginator->make($this->get($columns)->all(), $total, $perPage); } + /** + * Get a paginator in cursor mode for the "select" statement. + * + * @param int $perPage + * @param array $columns + * @return \Il...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
src/Illuminate/Database/Query/Builder.php
@@ -1506,6 +1506,26 @@ public function getPaginationCount() return $total; } + /** + * Get a paginator in cursor mode for the "select" statement. + * + * @param int $perPage + * @param array $columns + * @return \Illuminate\Pagination\Paginator + */ + public function cursor($perPage = null, $columns ...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
src/Illuminate/Pagination/Factory.php
@@ -95,10 +95,10 @@ protected function setupPaginationEnvironment() * * @param array $items * @param int $total - * @param int $perPage + * @param mixed $perPage * @return \Illuminate\Pagination\Paginator */ - public function make(array $items, $total, $perPage) + public function make(array...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
src/Illuminate/Pagination/Paginator.php
@@ -31,6 +31,13 @@ class Paginator implements ArrayableInterface, ArrayAccess, Countable, IteratorA */ protected $total; + /** + * Item, array or object indicating if next page is available. + * + * @var mixed + */ + protected $cursor; + /** * The amount of items to show per page. * @@ -118,9 +125,19...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
tests/Database/DatabaseEloquentBuilderTest.php
@@ -220,6 +220,31 @@ public function testPaginateMethodWithGroupedQuery() } + public function testCursorMethod() + { + $query = $this->getMock('Illuminate\Database\Query\Builder', array('from', 'getConnection', 'skip', 'take'), array( + m::mock('Illuminate\Database\ConnectionInterface'), + m::mock('Illuminat...
true
Other
laravel
framework
f358e0dcb4e8ac37bf19f4a707f45413068d7693.json
Add cursor mode to DB and paginator (no conflict).
tests/Database/DatabaseQueryBuilderTest.php
@@ -587,6 +587,24 @@ public function testGetPaginationCountGetsResultCount() } + public function testCursorCorrectlyCreatesPaginatorInstance() + { + $connection = m::mock('Illuminate\Database\ConnectionInterface'); + $grammar = m::mock('Illuminate\Database\Query\Grammars\Grammar'); + $processor = m::mock('Illu...
true
Other
laravel
framework
505957ad634e8d107507755075c8d41805c28098.json
Fix present count.
src/Illuminate/Validation/Validator.php
@@ -581,7 +581,7 @@ protected function getPresentCount($attributes) foreach ($attributes as $key) { - if ( ! is_null(array_get($this->data, $key, null)) || ! is_null(array_get($this->files, $key, null))) + if (array_get($this->data, $key) || array_get($this->files, $key)) { $count++; }
false
Other
laravel
framework
114d33dd940ccea8cbacbc400409a9b9b5bef131.json
Fix multiple methods on routes command.
src/Illuminate/Foundation/Console/RoutesCommand.php
@@ -109,7 +109,7 @@ protected function getRoutes() */ protected function getRouteInformation(Route $route) { - $uri = head($route->methods()).' '.$route->uri(); + $uri = implode('|', $route->methods()).' '.$route->uri(); return $this->filterRoute(array( 'host' => $route->domain(),
false
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/Database/Eloquent/Builder.php
@@ -519,14 +519,12 @@ protected function loadRelation(array $models, $name, Closure $constraints) */ public function getRelation($relation) { - $me = $this; - // We want to run a relationship query without any constrains so that we will // not have to remove these where clauses manually which gets really ...
true
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/Database/Query/Builder.php
@@ -1308,9 +1308,7 @@ public function generateCacheKey() */ protected function getCacheCallback($columns) { - $me = $this; - - return function() use ($me, $columns) { return $me->getFresh($columns); }; + return function() use ($columns) { return $this->getFresh($columns); }; } /**
true
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/Exception/ExceptionServiceProvider.php
@@ -151,16 +151,14 @@ protected function requestWantsJson() */ protected function registerPrettyWhoopsHandler() { - $me = $this; - - $this->app['whoops.handler'] = $this->app->share(function() use ($me) + $this->app['whoops.handler'] = $this->app->share(function() { with($handler = new PrettyPa...
true
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/Queue/QueueServiceProvider.php
@@ -45,16 +45,14 @@ public function register() */ protected function registerManager() { - $me = $this; - - $this->app->bindShared('queue', function($app) use ($me) + $this->app->bindShared('queue', function($app) { // Once we have an instance of the queue manager, we will register the various ...
true
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/Routing/Router.php
@@ -911,18 +911,16 @@ protected function getControllerAction($action) */ protected function getClassClosure($controller) { - $me = $this; - // Here we'll get an instance of this controller dispatcher and hand it off to // the Closure so it will be used to resolve the class instances out of our // IoC c...
true
Other
laravel
framework
5c6c2bb3de560d6ff119b9107a2036416372891a.json
use php 5.4 closures see #3687
src/Illuminate/View/ViewServiceProvider.php
@@ -35,9 +35,7 @@ public function register() */ public function registerEngineResolver() { - $me = $this; - - $this->app->bindShared('view.engine.resolver', function($app) use ($me) + $this->app->bindShared('view.engine.resolver', function($app) { $resolver = new EngineResolver; @@ -46,7 +4...
true
Other
laravel
framework
17bfed2d234f19ddfa183ef93039c225873c5e53.json
Fix bug in view extending.
src/Illuminate/View/Environment.php
@@ -673,7 +673,7 @@ public function addExtension($extension, $engine, $resolver = null) $this->engines->register($engine, $resolver); } - unset($this->extensions[$engine]); + unset($this->extensions[$extension]); $this->extensions = array_merge(array($extension => $engine), $this->extensions); }
false
Other
laravel
framework
a83a19ddeb4bcd52f5ebcd4a08e951826428a272.json
Change import order.
src/Illuminate/Support/Facades/Response.php
@@ -1,8 +1,8 @@ <?php namespace Illuminate\Support\Facades; use Illuminate\Http\JsonResponse; -use Illuminate\Http\Response as IlluminateResponse; use Illuminate\Support\Traits\MacroableTrait; +use Illuminate\Http\Response as IlluminateResponse; use Illuminate\Support\Contracts\ArrayableInterface; use Symfony\Co...
false
Other
laravel
framework
9a4ae9e13f126aedb4e22d9d3e2a7fdb52d6e14a.json
Allow pgsql enum fields /w reserved words as names An enum with a name like `unique` would cause an SQL syntax error, so just wrapped that sucker up in double-quotes to make it work.
src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
@@ -393,7 +393,7 @@ protected function typeEnum(Fluent $column) { $allowed = array_map(function($a) { return "'".$a."'"; }, $column->allowed); - return "varchar(255) check ({$column->name} in (".implode(', ', $allowed)."))"; + return "varchar(255) check (\"{$column->name}\" in (".implode(', ', $allowed)."))"; ...
true
Other
laravel
framework
9a4ae9e13f126aedb4e22d9d3e2a7fdb52d6e14a.json
Allow pgsql enum fields /w reserved words as names An enum with a name like `unique` would cause an SQL syntax error, so just wrapped that sucker up in double-quotes to make it work.
tests/Database/DatabasePostgresSchemaGrammarTest.php
@@ -355,7 +355,7 @@ public function testAddingEnum() $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); - $this->assertEquals('alter table "users" add column "foo" varchar(255) check (foo in (\'bar\', \'baz\')) not null', $statements[0]); +...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/Database/Query/Grammars/Grammar.php
@@ -458,13 +458,11 @@ protected function compileBasicHaving($having) */ protected function compileOrders(Builder $query, $orders) { - $me = $this; - - return 'order by '.implode(', ', array_map(function($order) use ($me) + return 'order by '.implode(', ', array_map(function($order) { if (isset($order['...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/Events/Dispatcher.php
@@ -105,11 +105,9 @@ public function hasListeners($eventName) */ public function queue($event, $payload = array()) { - $me = $this; - - $this->listen($event.'_queue', function() use ($me, $event, $payload) + $this->listen($event.'_queue', function() use ($event, $payload) { - $me->fire($event, $payload);...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/Foundation/MigrationPublisher.php
@@ -61,11 +61,9 @@ public function publish($source, $destination) */ protected function getFreshMigrations($source, $destination) { - $me = $this; - - return array_filter($this->getPackageMigrations($source), function($file) use ($me, $destination) + return array_filter($this->getPackageMigrations($source), f...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/Remote/Connection.php
@@ -213,9 +213,7 @@ protected function getCallback($callback) { if ( ! is_null($callback)) return $callback; - $me = $this; - - return function($line) use ($me) { $me->display($line); }; + return function($line) { $this->display($line); }; } /** @@ -269,4 +267,4 @@ public function setOutput(OutputInterf...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/Routing/Router.php
@@ -440,14 +440,12 @@ public function getResourceUri($resource) */ protected function getNestedResourceUri(array $segments) { - $me = $this; - // We will spin through the segments and create a place-holder for each of the // resource segments, as well as the resource itself. Then we should get an // en...
true
Other
laravel
framework
a1c5dd80aa6a13e0f8cf1f0e0e1700ff65c11f2c.json
Use php 5.4 closures $this where safe to
src/Illuminate/View/Compilers/BladeCompiler.php
@@ -190,13 +190,11 @@ protected function compileEchos($value) */ protected function compileRegularEchos($value) { - $me = $this; - $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s/s', $this->contentTags[0], $this->contentTags[1]); - $callback = function($matches) use ($me) + $callback = function($matches) { -...
true
Other
laravel
framework
0cd120a75090480af98b32e3b7f3adc24890c842.json
Convert spaces to tabs
src/Illuminate/Routing/Router.php
@@ -988,7 +988,7 @@ public function dispatchToRoute(Request $request) { $route = $this->findRoute($request); - $this->events->fire('router.matched', array($route, $request)); + $this->events->fire('router.matched', array($route, $request)); // Once we have successfully matched the incoming request t...
false
Other
laravel
framework
f42cc7fa47cdbb5a9f7e43a41c51cbd82786b367.json
Handle __call on Queue capsule
src/Illuminate/Queue/Capsule/Manager.php
@@ -204,6 +204,18 @@ public function setContainer(Container $container) $this->container = $container; } + /** + * Pass dynamic instance methods to the manager. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($m...
false
Other
laravel
framework
01d5a77488e54bf425cfc6407b0c474d0d4190fc.json
Add tests for Eloquent Builder Tested methods : pluck, chunk and lists
tests/Database/DatabaseEloquentBuilderTest.php
@@ -95,6 +95,69 @@ public function testGetMethodDoesntHydrateEagerRelationsWhenNoResultsAreReturned } + public function testPluckMethodWithModelFound() + { + $builder = m::mock('Illuminate\Database\Eloquent\Builder[first]', array($this->getMockQueryBuilder())); + $mockModel = new StdClass; + $mockModel->name =...
false
Other
laravel
framework
9902e7d5960c6f3a2ad9a187c142ab6dbb384ed1.json
fix filtering of parameters.
src/Illuminate/Routing/Router.php
@@ -1396,7 +1396,21 @@ public function callRouteFilter($filter, $parameters, $route, $request, $respons $data = array_merge(array($route, $request, $response), $parameters); - return $this->events->until('router.filter: '.$filter, array_filter($data)); + return $this->events->until('router.filter: '.$filter, $...
true
Other
laravel
framework
9902e7d5960c6f3a2ad9a187c142ab6dbb384ed1.json
fix filtering of parameters.
tests/Routing/RoutingRouteTest.php
@@ -187,6 +187,11 @@ public function testBasicBeforeFilters() $router->filter('foo', function($route, $request, $age) { return $age; }); $this->assertEquals('25', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent()); + $router = $this->getRouter(); + $router->get('foo/bar', array('before' =...
true
Other
laravel
framework
26e8fadf89a14f28ee8b613f423c87eaaba701b5.json
Add getter for loggingQueries
src/Illuminate/Database/Connection.php
@@ -918,6 +918,16 @@ public function disableQueryLog() $this->loggingQueries = false; } + /** + * Determine whether we're logging queries. + * + * @return bool + */ + public function getQueryLogState() + { + return $this->loggingQueries; + } + /** * Get the name of the connected database. *
false
Other
laravel
framework
18e6a1dfb3f14e9f7a42912fbab871acd5d6c947.json
Return ID from Redis queue push.
src/Illuminate/Queue/RedisQueue.php
@@ -64,7 +64,9 @@ public function push($job, $data = '', $queue = null) */ public function pushRaw($payload, $queue = null, array $options = array()) { - return $this->redis->rpush($this->getQueue($queue), $payload); + $this->redis->rpush($this->getQueue($queue), $payload); + + return array_get(json_decode($p...
true
Other
laravel
framework
18e6a1dfb3f14e9f7a42912fbab871acd5d6c947.json
Return ID from Redis queue push.
tests/Queue/QueueRedisQueueTest.php
@@ -16,7 +16,8 @@ public function testPushProperlyPushesJobOntoRedis() $queue->expects($this->once())->method('getRandomId')->will($this->returnValue('foo')); $redis->shouldReceive('rpush')->once()->with('queues:default', json_encode(array('job' => 'foo', 'data' => array('data'), 'id' => 'foo', 'attempts' => 1)))...
true
Other
laravel
framework
f1e656ba13802af0309bbded9231d9b8484721a0.json
Use rawurldecode in Route::parameters.
src/Illuminate/Foundation/changes.json
@@ -4,7 +4,8 @@ {"message": "Configurable encryption for Iron.io queue messages.", "backport": null}, {"message": "Make FrameGuard middleware opt-in.", "backport": null}, {"message": "Convert View '$errors' shared variable into ViewErrorBag. Allows multiple bags per view. Should be backwards compatible.", "bac...
true
Other
laravel
framework
f1e656ba13802af0309bbded9231d9b8484721a0.json
Use rawurldecode in Route::parameters.
src/Illuminate/Routing/Route.php
@@ -319,7 +319,7 @@ public function parameters() { return array_map(function($value) { - return is_string($value) ? urldecode($value) : $value; + return is_string($value) ? rawurldecode($value) : $value; }, $this->parameters); }
true
Other
laravel
framework
cbe8c41080e605622b68ec9ed6908e46e48a9171.json
Modify tests to also test the new behaviour
tests/Database/DatabaseEloquentBelongsToManyTest.php
@@ -235,7 +235,7 @@ public function testSyncMethodSyncsIntermediateTableWithGivenArray($list) $relation->getRelated()->shouldReceive('touches')->andReturn(false); $relation->getParent()->shouldReceive('touches')->andReturn(false); - $relation->sync($list); + $this->assertEquals(array('attached' => array(4), '...
false
Other
laravel
framework
909ddcb8dd5a412b6f71ab45b8e784ee41188cb0.json
Fix boot on unserialize
src/Illuminate/Database/Eloquent/Model.php
@@ -239,6 +239,20 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa * @return void */ public function __construct(array $attributes = array()) + { + $this->bootIfNotBooted(); + + $this->syncOriginal(); + + $this->fill($attributes); + } + + /** + * Check if the model needs t...
true
Other
laravel
framework
909ddcb8dd5a412b6f71ab45b8e784ee41188cb0.json
Fix boot on unserialize
tests/Database/DatabaseEloquentModelTest.php
@@ -750,6 +750,20 @@ public function testGetModelAttributeMethodThrowsExceptionIfNotRelation() } + public function testModelIsBootedOnUnserialize() + { + $model = new EloquentModelBootingTestStub; + $this->assertTrue(EloquentModelBootingTestStub::isBooted()); + $model->foo = 'bar'; + $string = serialize($mode...
true
Other
laravel
framework
8654da2892cf4fbd629d99bbf410925d07379cd9.json
Use array_values to rekey filtered array If the path had an empty segment, for instancem 'foo//bar', requesting segment 2 would return the default value instead of 'bar'
src/Illuminate/Http/Request.php
@@ -94,7 +94,7 @@ public function segment($index, $default = null) { $segments = explode('/', trim($this->getPathInfo(), '/')); - $segments = array_filter($segments, function($v) { return $v != ''; }); + $segments = array_values(array_filter($segments)); return array_get($segments, $index - 1, $default); ...
true
Other
laravel
framework
8654da2892cf4fbd629d99bbf410925d07379cd9.json
Use array_values to rekey filtered array If the path had an empty segment, for instancem 'foo//bar', requesting segment 2 would return the default value instead of 'bar'
tests/Http/HttpRequestTest.php
@@ -42,16 +42,24 @@ public function testDecodedPathMethod() } - public function testSegmentMethod() + /** + * @dataProvider segmentProvider + */ + public function testSegmentMethod($path, $segment, $expected) { - $request = Request::create('', 'GET'); - $this->assertEquals('default', $request->segment(1, 'd...
true
Other
laravel
framework
83943331dba1a7acc4cf8388ba43578c8fa674ed.json
Add comment for clarification.
src/Illuminate/View/Engines/EngineResolver.php
@@ -21,6 +21,8 @@ class EngineResolver { /** * Register a new engine resolver. * + * The engine string typically corresponds to a file extension. + * * @param string $engine * @param Closure $resolver * @return void
false
Other
laravel
framework
e24c6e67af844a6ac8b5436dbd96d343446684c4.json
Fix caller bug.
src/Illuminate/Database/Eloquent/Model.php
@@ -848,12 +848,14 @@ protected function getBelongsToManyCaller() { $self = __FUNCTION__; - return array_first(debug_backtrace(false), function($trace) use ($self) + $caller = array_first(debug_backtrace(false), function($key, $trace) use ($self) { $caller = $trace['function']; return ( ! in_array...
false
Other
laravel
framework
c3fc09e4e56b700e390827153acf9d13d51596b9.json
Update MySqlConnector.php to support Sphinx Sphinx is one of the 4 main search engines PHP has documented and provides classes for. http://www.php.net/manual/en/refs.search.php Sphinx uses the mysql protocol as an interface. The problem is when passing collate the connection to sphinx fails. The patch will not...
src/Illuminate/Database/Connectors/MySqlConnector.php
@@ -26,7 +26,7 @@ public function connect(array $config) // is set on the server but needs to be set here on this client objects. $charset = $config['charset']; - $names = "set names '$charset' collate '$collation'"; + $names = "set names '$charset'".($collation!==null ? " collate '$collation'" : null); ...
false
Other
laravel
framework
e747c4a1098d5c33073588ce91d4025f8e9d629e.json
Make getDictionary public
src/Illuminate/Database/Eloquent/Collection.php
@@ -200,7 +200,7 @@ public function unique() * @param \Illuminate\Support\Collection $collection * @return array */ - protected function getDictionary($collection) + public function getDictionary($collection) { $dictionary = array();
false
Other
laravel
framework
8c45fba521d318a22387404442e3daa1b2e3e426.json
Add $path param for docblock
src/Illuminate/Support/helpers.php
@@ -484,6 +484,7 @@ function asset($path, $secure = null) /** * Get the path to the base of the install. * + * @param string $path * @return string */ function base_path($path = '') @@ -738,6 +739,7 @@ function preg_replace_sub($pattern, &$replacements, $subject) /** * Get the path to the public ...
false
Other
laravel
framework
9d14fbb21290b0948a46b449e7aa92361eb1df2c.json
fix code and test
src/Illuminate/Database/Eloquent/Builder.php
@@ -593,7 +593,9 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' { if ($column instanceof Closure) { - $query = $this->model->newQuery(); + // Get a new query builder instance but avoid including any soft + // delete constraints that could mess up the nested query. + ...
true
Other
laravel
framework
9d14fbb21290b0948a46b449e7aa92361eb1df2c.json
fix code and test
tests/Database/DatabaseEloquentBuilderTest.php
@@ -339,7 +339,7 @@ public function testNestedWhere() $nestedRawQuery = $this->getMockQueryBuilder(); $nestedQuery->shouldReceive('getQuery')->once()->andReturn($nestedRawQuery); $model = $this->getMockModel()->makePartial(); - $model->shouldReceive('newQuery')->once()->andReturn($nestedQuery); + $model->sho...
true
Other
laravel
framework
da39766b20b915a6b554cbf6392f6a9c9c8f1a90.json
Remove previous URL stuff from session. Bad idea.
src/Illuminate/Routing/Redirector.php
@@ -50,14 +50,7 @@ public function home($status = 302) */ public function back($status = 302, $headers = array()) { - if ($this->generator->getRequest()->headers->has('referer')) - { - $back = $this->generator->getRequest()->headers->get('referer'); - } - elseif ($this->session->hasPreviousUrl()) - { - ...
true
Other
laravel
framework
da39766b20b915a6b554cbf6392f6a9c9c8f1a90.json
Remove previous URL stuff from session. Bad idea.
src/Illuminate/Session/Middleware.php
@@ -76,7 +76,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ // add the session identifier cookie to the application response headers now. if ($this->sessionConfigured()) { - $this->closeSession($session, $request); + $this->closeSession($session); $this->addCook...
true
Other
laravel
framework
da39766b20b915a6b554cbf6392f6a9c9c8f1a90.json
Remove previous URL stuff from session. Bad idea.
src/Illuminate/Session/Store.php
@@ -472,37 +472,6 @@ public function flush() $this->clear(); } - /** - * Determine if the session contains the previous URL. - * - * @return bool - */ - public function hasPreviousUrl() - { - return $this->has('_previous_url'); - } - - /** - * Get the previous URL from the session. - * - * @return string...
true
Other
laravel
framework
da39766b20b915a6b554cbf6392f6a9c9c8f1a90.json
Remove previous URL stuff from session. Bad idea.
tests/Routing/RoutingRedirectorTest.php
@@ -105,25 +105,13 @@ public function testRefreshRedirectToCurrentUrl() public function testBackRedirectToHttpReferer() { - $this->session->shouldReceive('hasPreviousUrl')->never(); $this->headers->shouldReceive('has')->with('referer')->andReturn(true); $this->headers->shouldReceive('get')->with('referer')...
true
Other
laravel
framework
b8778d24106ac6fc71d32284424ac0e5c2cb5bd3.json
Use referer header if it exists.
src/Illuminate/Routing/Redirector.php
@@ -50,13 +50,13 @@ public function home($status = 302) */ public function back($status = 302, $headers = array()) { - if ($this->session->hasPreviousUrl()) + if ($this->generator->getRequest()->headers->has('referer')) { - $back = $this->session->getPreviousUrl(); + $back = $this->generator->getRequest...
false
Other
laravel
framework
080a07c3ae6401f911c679732bc7532c8ac9f9b2.json
Add flush test for Http\Request
tests/Http/HttpRequestTest.php
@@ -312,6 +312,16 @@ public function testOldMethodCallsSession() } + public function testFlushMethodCallsSession() + { + $request = Request::create('/', 'GET'); + $session = m::mock('Illuminate\Session\Store'); + $session->shouldReceive('flashInput')->once(); + $request->setSession($session); + $request->flu...
false
Other
laravel
framework
663a586c79048051dcd394ceda9965dce60d3d99.json
Improve HTTP\RedirectResponse test coverage
tests/Http/HttpResponseTest.php
@@ -67,6 +67,41 @@ public function testGetOriginalContent() $response->setContent($arr); $this->assertTrue($arr === $response->getOriginalContent()); } + + + public function testHeaderOnRedirect() + { + $response = new RedirectResponse('foo.bar'); + $this->assertNull($response->headers->get('foo')); + $res...
false
Other
laravel
framework
4dfd0b7a3a82d21abd7d2cd1d7a2eb7ec2ac6d65.json
Improve HTTP\Request test coverage
tests/Http/HttpRequestTest.php
@@ -9,6 +9,20 @@ public function tearDown() { m::close(); } + + + public function testInstanceMethod() + { + $request = Request::create('', 'GET'); + $this->assertTrue($request === $request->instance()); + } + + + public function testRootMethod() + { + $request = Request::create('http://example.com/foo/ba...
false
Other
laravel
framework
ab24f99c5e843cf7ce24c9ff0b12d1b7bbc96ca2.json
Improve HTTP\Response test coverage
tests/Http/HttpResponseTest.php
@@ -18,6 +18,11 @@ public function testJsonResponsesAreConvertedAndHeadersAreSet() $response = new Illuminate\Http\Response(new JsonableStub); $this->assertEquals('foo', $response->getContent()); $this->assertEquals('application/json', $response->headers->get('Content-Type')); + + $response = new Illuminate...
false
Other
laravel
framework
9f654456b101e1d57be8e4f307cff1f96d12a2c4.json
Improve Illuminate\View\View test coverage
tests/View/ViewTest.php
@@ -75,6 +75,7 @@ public function testSectionsAreNotFlushedWhenNotDoneRendering() $view->getEnvironment()->shouldReceive('flushSectionsIfDoneRendering')->once(); $this->assertEquals('contents', $view->render()); + $this->assertEquals('contents', (string)$view); } @@ -104,6 +105,97 @@ public function test...
false
Other
laravel
framework
545cd1b06c65ce1a11ebe17088ace02d9261d731.json
Reverse if statement conditions.
src/Illuminate/Database/Eloquent/Builder.php
@@ -427,7 +427,7 @@ public function onlyTrashed() */ protected function isSoftDeleteConstraint(array $where, $column) { - return $where['column'] == $column && $where['type'] == 'Null'; + return $where['type'] == 'Null' && $where['column'] == $column; } /**
false
Other
laravel
framework
c0c2415bd109721de4fb9d7328f3f264241a1bd5.json
Remove expectedExceptionMessage comment.
tests/Database/DatabaseEloquentModelTest.php
@@ -69,7 +69,6 @@ public function testFindMethodCallsQueryBuilderCorrectly() /** * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - * @expectedExceptionMessage EloquentModelFindNotFoundStub model not found */ public function testFindOrFailMethodThrowsModelNotFoundException() {
false
Other
laravel
framework
ef2220995f73155fd5ebedd754c89656bcb49c25.json
Use JSON_PRETTY_PRINT available in php 5.4.
src/Illuminate/Foundation/ProviderRepository.php
@@ -200,7 +200,7 @@ public function writeManifest($manifest) { $path = $this->manifestPath.'/services.json'; - $this->files->put($path, json_encode($manifest)); + $this->files->put($path, json_encode($manifest, JSON_PRETTY_PRINT)); return $manifest; }
false
Other
laravel
framework
5eb304614019530d360421ba7ec930fac7aa65b1.json
Move getDirty out of timestamp check.
src/Illuminate/Database/Eloquent/Model.php
@@ -1334,13 +1334,13 @@ protected function performUpdate(Builder $query) if ($this->timestamps) { $this->updateTimestamps(); - - $dirty = $this->getDirty(); } // Once we have run the update operation, we will fire the "updated" event for // this model instance. This will allow developers t...
false
Other
laravel
framework
8a9b8c6b864cc7e72200e89fab367796c72e4269.json
Improve Illuminate\Cookie\CookieJar test coverage
tests/Cookie/CookieTest.php
@@ -29,6 +29,10 @@ public function testCookiesAreCreatedWithProperOptions() $this->assertTrue($c2->isSecure()); $this->assertEquals('/domain', $c2->getDomain()); $this->assertEquals('/path', $c2->getPath()); + + $c3 = $cookie->forget('color'); + $this->assertTrue($c3->getValue() === null); + $this->assert...
false
Other
laravel
framework
ac9aa8d06c4d81fa746b6e114c2146a7a468a7db.json
Improve Illuminate\Session\Store test coverage
tests/Session/SessionStoreTest.php
@@ -30,6 +30,14 @@ public function testSessionIsLoadedFromHandler() } + public function testSessionGetBagException() + { + $this->setExpectedException('InvalidArgumentException'); + $session = $this->getSession(); + $session->getBag('doesNotExist'); + } + + public function testSessionMigration() { $sess...
false
Other
laravel
framework
e1e764ee8800203720ff6a5c6601cc821e3073a8.json
Update doc block.
src/Illuminate/Http/RedirectResponse.php
@@ -112,6 +112,7 @@ public function exceptInput() * Flash a container of errors to the session. * * @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider + * @param string $key * @return \Illuminate\Http\RedirectResponse */ public function withErrors($provider, $key = 'defa...
false
Other
laravel
framework
bf062fee1e0b67b2d646f37a7ef734ea5391c34c.json
Allow fallback_locale in translator.
src/Illuminate/Translation/TranslationServiceProvider.php
@@ -31,6 +31,8 @@ public function register() $trans = new Translator($loader, $locale); + $trans->setFallback($app['config']['app.fallback_locale']); + return $trans; }); }
true
Other
laravel
framework
bf062fee1e0b67b2d646f37a7ef734ea5391c34c.json
Allow fallback_locale in translator.
src/Illuminate/Translation/Translator.php
@@ -21,6 +21,13 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface { */ protected $locale; + /** + * The fallback locale used by the translator. + * + * @var string + */ + protected $fallback; + /** * The array of loaded translation groups. * @@ -68,13 +75,16 @@ public ...
true
Other
laravel
framework
1a9006b868b3dc7cbfa33d4c63239e76d5e4bc1e.json
Return empty collection if array is empty.
src/Illuminate/Database/Eloquent/Model.php
@@ -502,6 +502,8 @@ public static function all($columns = array('*')) */ public static function find($id, $columns = array('*')) { + if (is_array($id) && empty($id)) return new Collection; + $instance = new static; return $instance->newQuery()->find($id, $columns);
true
Other
laravel
framework
1a9006b868b3dc7cbfa33d4c63239e76d5e4bc1e.json
Return empty collection if array is empty.
src/Illuminate/Foundation/changes.json
@@ -85,7 +85,8 @@ {"message": "Added 'append_config' helper to assign high keys to configuration items.", "backport": null}, {"message": "Nested where queries using Closures with Eloquent will now use Eloquent query builder.", "backport": null}, {"message": "Allow passing a string into the 'sortBy' and 'sortBy...
true
Other
laravel
framework
222e5c62c7a013bd4cb0c749bfea69f0988943bd.json
Move Config::append to helper instead.
src/Illuminate/Support/Facades/Config.php
@@ -5,29 +5,6 @@ */ class Config extends Facade { - /** - * Assign high numeric IDs to a config item to force appending. - * - * @param array $array - * @return array - */ - public static function append(array $array) - { - $start = 9999; - - foreach ($array as $key => $value) - { - if (...
true
Other
laravel
framework
222e5c62c7a013bd4cb0c749bfea69f0988943bd.json
Move Config::append to helper instead.
src/Illuminate/Support/helpers.php
@@ -48,6 +48,32 @@ function app_path($path = '') } } +if ( ! function_exists('append_config')) +{ + /** + * Assign high numeric IDs to a config item to force appending. + * + * @param array $array + * @return array + */ + function append_config(array $array) + { + $start = 9999; + + foreach ($array as $ke...
true
Other
laravel
framework
cbec444542fa9da5fec1a39bd8b602d16016eccd.json
Fix unit tests
tests/Cache/CacheFileStoreTest.php
@@ -74,18 +74,28 @@ public function testForeversAreStoredWithHighTimestamp() $store->forever('foo', 'Hello World', 10); } + public function testRemoveDeletesFileDoesntExist() + { + $files = $this->mockFilesystem(); + $md5 = md5('foobull'); + $cache_dir = substr($md5, 0, 2).'/'.substr($md5, 2, 2); + $files->e...
false
Other
laravel
framework
6c2a68891a7069b9e6ffa9c23d0f125720b6307a.json
Fix boolean operators.
src/Illuminate/Foundation/Console/TinkerCommand.php
@@ -118,7 +118,7 @@ protected function prompt() */ protected function supportsBoris() { - return (extension_loaded('readline') and extension_loaded('posix') and extension_loaded('pcntl')); + return extension_loaded('readline') && extension_loaded('posix') && extension_loaded('pcntl'); } }
false
Other
laravel
framework
da9970de40d99e58843b27e9f01f56bfcf1789ff.json
Remove some unused variables in functions.
src/Illuminate/Foundation/ViewPublisher.php
@@ -63,9 +63,7 @@ public function publish($package, $source) */ public function publishPackage($package, $packagePath = null) { - list($vendor, $name) = explode('/', $package); - - $source = $this->getSource($package, $name, $packagePath ?: $this->packagePath); + $source = $this->getSource($package, $packageP...
false
Other
laravel
framework
0555702816ad551e3a5a98ec9e322e323f06bb8a.json
Return results from function.
src/Illuminate/Remote/Connection.php
@@ -150,7 +150,7 @@ public function get($remote, $local) */ public function getString($remote) { - $this->getGateway()->getString($remote); + return $this->getGateway()->getString($remote); } /**
true
Other
laravel
framework
0555702816ad551e3a5a98ec9e322e323f06bb8a.json
Return results from function.
src/Illuminate/Remote/SecLibGateway.php
@@ -126,7 +126,7 @@ public function get($remote, $local) */ public function getString($remote) { - $this->getConnection()->get($remote); + return $this->getConnection()->get($remote); } /**
true
Other
laravel
framework
726ac155f7e27814058607a2c357fe9e71555b13.json
Make encryption optional on Iron.io.
src/Illuminate/Queue/Connectors/IronConnector.php
@@ -46,7 +46,7 @@ public function connect(array $config) if (isset($config['host'])) $ironConfig['host'] = $config['host']; - return new IronQueue(new IronMQ($ironConfig), $this->crypt, $this->request, $config['queue']); + return new IronQueue(new IronMQ($ironConfig), $this->crypt, $this->request, $config['que...
true
Other
laravel
framework
726ac155f7e27814058607a2c357fe9e71555b13.json
Make encryption optional on Iron.io.
src/Illuminate/Queue/IronQueue.php
@@ -36,21 +36,30 @@ class IronQueue extends Queue implements QueueInterface { */ protected $default; + /** + * Indicates if the messages should be encrypted. + * + * @var bool + */ + protected $shouldEncrypt; + /** * Create a new IronMQ queue instance. * * @param \IronMQ $iron * @param \Illu...
true
Other
laravel
framework
726ac155f7e27814058607a2c357fe9e71555b13.json
Make encryption optional on Iron.io.
tests/Queue/QueueIronQueueTest.php
@@ -12,16 +12,25 @@ public function tearDown() public function testPushProperlyPushesJobOntoIron() { - $queue = new Illuminate\Queue\IronQueue($iron = m::mock('IronMQ'), $crypt = m::mock('Illuminate\Encryption\Encrypter'), m::mock('Illuminate\Http\Request'), 'default'); + $queue = new Illuminate\Queue\IronQueue...
true
Other
laravel
framework
13f00c8e26a792da3817f47c07e1e5f48cd84b0f.json
Fix incorrect comment
src/Illuminate/Http/FrameGuard.php
@@ -13,7 +13,7 @@ class FrameGuard implements HttpKernelInterface { protected $app; /** - * Create a new CookieQueue instance. + * Create a new FrameGuard instance. * * @param \Symfony\Component\HttpKernel\HttpKernelInterface $app * @return void
false
Other
laravel
framework
7b1b90e5ee8420758c5c880d5d6ec92092315b13.json
Implement array sessions on certain callbacks.
src/Illuminate/Foundation/Application.php
@@ -514,6 +514,20 @@ public function shutdown($callback = null) } } + /** + * Register a function for determining when to use array sessions. + * + * @param \Closure $callback + * @return void + */ + public function useArraySessions(Closure $callback) + { + $this->bind('session.reject', function() use ($...
true
Other
laravel
framework
7b1b90e5ee8420758c5c880d5d6ec92092315b13.json
Implement array sessions on certain callbacks.
src/Illuminate/Session/Middleware.php
@@ -1,5 +1,6 @@ <?php namespace Illuminate\Session; +use Closure; use Carbon\Carbon; use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Request; @@ -22,16 +23,25 @@ class Middleware implements HttpKernelInterface { */ protected $manager; + /** + * The callback to determine t...
true
Other
laravel
framework
7b1b90e5ee8420758c5c880d5d6ec92092315b13.json
Implement array sessions on certain callbacks.
tests/Session/SessionMiddlewareTest.php
@@ -63,4 +63,18 @@ public function testSessionIsNotUsedWhenNoDriver() $this->assertTrue($response === $middleResponse); } + + public function testCheckingForRequestUsingArraySessions() + { + $middleware = new Illuminate\Session\Middleware( + m::mock('Symfony\Component\HttpKernel\HttpKernelInterface'), + $ma...
true
Other
laravel
framework
13063142ac0539362d07f4aca83084b43cbf77b1.json
Move locale method.
src/Illuminate/Foundation/Application.php
@@ -937,31 +937,6 @@ public function getProviderRepository() return new ProviderRepository(new Filesystem, $manifest); } - /** - * Get the current application locale. - * - * @return string - */ - public function getLocale() - { - return $this['config']->get('app.locale'); - } - - /** - * Set the current a...
false
Other
laravel
framework
5e125b1290749373358ff8c1efe260f88b2e0a59.json
Resolve customer connectors out of the container.
tests/Database/DatabaseConnectionFactoryTest.php
@@ -103,7 +103,18 @@ public function testIfDriverIsntSetExceptionIsThrown() public function testExceptionIsThrownOnUnsupportedDriver() { $factory = new Illuminate\Database\Connectors\ConnectionFactory($container = m::mock('Illuminate\Container\Container')); + $container->shouldReceive('bound')->once()->andRetur...
false
Other
laravel
framework
d78fb051caa5c3c8cf8b59ef82d8562bd3de1e92.json
Pass container instance to resolving callbacks.
src/Illuminate/Container/Container.php
@@ -639,7 +639,7 @@ protected function fireCallbackArray($object, array $callbacks) { foreach ($callbacks as $callback) { - call_user_func($callback, $object); + call_user_func($callback, $object, $this); } }
false
Other
laravel
framework
a4124979faa0e57bda92f0e3f8f8214fe545a2ba.json
str_limit helper added
src/Illuminate/Support/helpers.php
@@ -932,6 +932,22 @@ function studly_case($value) } } +if ( ! function_exists('str_limit')) +{ + /** + * Limit the number of characters in a string. + * + * @param string $value + * @param int $limit + * @param string $end + * @return string + ...
false
Other
laravel
framework
f0efda482ebf0d76bc3478257655a2e079c11cd7.json
Pass getBindings through to querybuilder
src/Illuminate/Database/Eloquent/Builder.php
@@ -34,8 +34,8 @@ class Builder { * @var array */ protected $passthru = array( - 'toSql', 'lists', 'insert', 'insertGetId', 'pluck', - 'count', 'min', 'max', 'avg', 'sum', 'exists', + 'toSql', 'lists', 'insert', 'insertGetId', 'pluck', 'count', + 'min', 'max', 'avg', 'sum', 'exists', 'getBindings', ); ...
false
Other
laravel
framework
93baad51c57176d8363b3720b57415c3c4a669fe.json
Fix cache minutes.
src/Illuminate/Cache/Repository.php
@@ -233,15 +233,12 @@ protected function getMinutes($duration) if ($duration instanceof DateTime) { $duration = Carbon::instance($duration); - } - if ($duration instanceof Carbon) - { return max(0, Carbon::now()->diffInMinutes($duration, false)); } else { - return intval($duration); + re...
false