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 | bd7956649a55d727ae7cdab83c76fb3bc2a3f1ad.json | Use session->get default | src/Illuminate/Auth/Guard.php | @@ -166,7 +166,7 @@ public function id()
{
if ($this->loggedOut) return;
- return $this->session->get($this->getName()) ?: $this->getRecallerId();
+ return $this->session->get($this->getName(), $this->getRecallerId());
}
/** | false |
Other | laravel | framework | e2c21cc29375a5f29fe84e4f45f986549351c8d4.json | Enable fast finish for hhvm | .travis.yml | @@ -15,3 +15,4 @@ script: vendor/bin/phpunit --verbose
matrix:
allow_failures:
- php: hhvm
+ fast_finish: true | false |
Other | laravel | framework | 463802fe7d4e8fa0cf98ad50a9f4ab0ee2794e43.json | Use interface methods instead of stubbing them out | tests/Routing/RoutingUrlGeneratorTest.php | @@ -109,6 +109,7 @@ public function testRouteableInterfaceRouting()
$routes->add($route);
$model = new RouteableInterfaceStub;
+ $model->key = 'routeable';
$this->assertEquals('/foo/routeable', $url->route('routeable', array($model), false));
}
@@ -254,6 +255,6 @@ public function testForceRootUrl()
}
class RouteableInterfaceStub implements RouteableInterface {
- public function getRouteKey() { return 'routeable'; }
- public function getRouteKeyName() {}
+ public function getRouteKey() { return $this->{$this->getRouteKeyName()}; }
+ public function getRouteKeyName() { return 'key'; }
}
\ No newline at end of file | false |
Other | laravel | framework | 5cd82c114dce511db580e2b2b827b75eedda80d8.json | Add tests which cover additional functionality | tests/Database/DatabaseEloquentModelTest.php | @@ -744,14 +744,21 @@ public function testTheMutatorCacheIsPopulated()
}
+ public function testRouteKeyIsPrimaryKey()
+ {
+ $model = new EloquentModelStub;
+ $model->id = 'foo';
+ $this->assertEquals('foo', $model->getRouteKey());
+ }
+
+
public function testRouteNameIsPrimaryKeyName()
{
$model = new EloquentModelStub;
$this->assertEquals('id', $model->getRouteKeyName());
}
-
public function testCloneModelMakesAFreshCopyOfTheModel()
{
$class = new EloquentModelStub; | true |
Other | laravel | framework | 5cd82c114dce511db580e2b2b827b75eedda80d8.json | Add tests which cover additional functionality | tests/Routing/RoutingUrlGeneratorTest.php | @@ -1,6 +1,7 @@
<?php
use Illuminate\Routing\UrlGenerator;
+use Illuminate\Support\Contracts\RouteableInterface;
class RoutingUrlGeneratorTest extends PHPUnit_Framework_TestCase {
@@ -97,6 +98,21 @@ public function testBasicRouteGeneration()
}
+ public function testRouteableInterfaceRouting()
+ {
+ $url = new UrlGenerator(
+ $routes = new Illuminate\Routing\RouteCollection,
+ $request = Illuminate\Http\Request::create('http://www.foo.com/')
+ );
+
+ $route = new Illuminate\Routing\Route(array('GET'), 'foo/{bar}', array('as' => 'routeable'));
+ $routes->add($route);
+
+ $model = new RouteableInterfaceStub;
+
+ $this->assertEquals('/foo/routeable', $url->route('routeable', array($model), false));
+ }
+
public function testRoutesMaintainRequestScheme()
{
@@ -236,3 +252,8 @@ public function testForceRootUrl()
}
}
+
+class RouteableInterfaceStub implements RouteableInterface {
+ public function getRouteKey() { return 'routeable'; }
+ public function getRouteKeyName() {}
+}
\ No newline at end of file | true |
Other | laravel | framework | 2399dabe64136ccb851a4e0f1370c32fda0100d2.json | Reference the correct interface method | src/Illuminate/Routing/UrlGenerator.php | @@ -322,7 +322,7 @@ protected function replaceRouteableParameters($parameters = array())
{
if ($parameter instanceof RouteableInterface)
{
- $parameter = $parameter->getRouteParameter();
+ $parameter = $parameter->getRouteKey();
}
}
| false |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/ApcStore.php | @@ -51,7 +51,7 @@ public function get($key)
* @param string $key
* @param mixed $value
* @param int $minutes
- * @return array|bool
+ * @return void
*/
public function put($key, $value, $minutes)
{
@@ -63,7 +63,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return array|bool
+ * @return int|bool
*/
public function increment($key, $value = 1)
{
@@ -75,7 +75,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return array|bool
+ * @return int|bool
*/
public function decrement($key, $value = 1)
{
@@ -98,7 +98,7 @@ public function forever($key, $value)
* Remove an item from the cache.
*
* @param string $key
- * @return array|bool
+ * @return void
*/
public function forget($key)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/ApcWrapper.php | @@ -48,7 +48,7 @@ public function put($key, $value, $seconds)
*
* @param string $key
* @param mixed $value
- * @return array|bool
+ * @return int|bool
*/
public function increment($key, $value)
{
@@ -60,7 +60,7 @@ public function increment($key, $value)
*
* @param string $key
* @param mixed $value
- * @return array|bool
+ * @return int|bool
*/
public function decrement($key, $value)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/ArrayStore.php | @@ -41,7 +41,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function increment($key, $value = 1)
{
@@ -55,7 +55,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function decrement($key, $value = 1)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/MemcachedStore.php | @@ -65,7 +65,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int|bool
*/
public function increment($key, $value = 1)
{
@@ -77,7 +77,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int|bool
*/
public function decrement($key, $value = 1)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/RedisStore.php | @@ -74,7 +74,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function increment($key, $value = 1)
{
@@ -86,7 +86,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function decrement($key, $value = 1)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/WinCacheStore.php | @@ -54,7 +54,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int|bool
*/
public function increment($key, $value = 1)
{
@@ -66,7 +66,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int|bool
*/
public function decrement($key, $value = 1)
{ | true |
Other | laravel | framework | 15f414604c8992c5c8eddfd5d4a2115bd37f3ec9.json | Update return values | src/Illuminate/Cache/XCacheStore.php | @@ -54,7 +54,7 @@ public function put($key, $value, $minutes)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function increment($key, $value = 1)
{
@@ -66,7 +66,7 @@ public function increment($key, $value = 1)
*
* @param string $key
* @param mixed $value
- * @return void
+ * @return int
*/
public function decrement($key, $value = 1)
{ | true |
Other | laravel | framework | a9444e1ddb2cbc95008fee7174c3fef683889155.json | Move segments processing | src/Illuminate/Support/NamespacedItemResolver.php | @@ -25,13 +25,13 @@ public function parseKey($key)
return $this->parsed[$key];
}
- $segments = explode('.', $key);
-
// If the key does not contain a double colon, it means the key is not in a
// namespace, and is just a regular configuration item. Namespaces are a
// tool for organizing configuration items for things such as modules.
if (strpos($key, '::') === false)
{
+ $segments = explode('.', $key);
+
$parsed = $this->parseBasicSegments($segments);
}
else | false |
Other | laravel | framework | 2101129d386268813b2ab70abb045a5f5551879f.json | Make note if route cache file exists. | src/Illuminate/Foundation/Console/RouteCacheCommand.php | @@ -71,6 +71,11 @@ public function fire()
return $this->error("Your application doesn't have any routes.");
}
+ if ($this->laravel->routesAreCached())
+ {
+ return $this->error("Route cache file already exists!");
+ }
+
foreach ($this->routes as $route)
{
$route->prepareForSerialization(); | false |
Other | laravel | framework | 54f198fd9d54ad492eb22a9add5ca15c24208002.json | Write route:clear command. | src/Illuminate/Foundation/Console/RouteCacheCommand.php | @@ -5,7 +5,6 @@
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
-use Illuminate\Routing\Generators\ControllerGenerator;
class RouteCacheCommand extends Command {
@@ -48,6 +47,7 @@ class RouteCacheCommand extends Command {
* Create a new route command instance.
*
* @param \Illuminate\Routing\Router $router
+ * @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Router $router, Filesystem $files) | true |
Other | laravel | framework | 54f198fd9d54ad492eb22a9add5ca15c24208002.json | Write route:clear command. | src/Illuminate/Foundation/Console/RouteClearCommand.php | @@ -0,0 +1,57 @@
+<?php namespace Illuminate\Foundation\Console;
+
+use Illuminate\Routing\Router;
+use Illuminate\Console\Command;
+use Illuminate\Filesystem\Filesystem;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputArgument;
+
+class RouteClearCommand extends Command {
+
+ /**
+ * The console command name.
+ *
+ * @var string
+ */
+ protected $name = 'route:clear';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Remove the route cache file.';
+
+ /**
+ * The filesystem instance.
+ *
+ * @var \Illuminate\Filesystem\Filesystem
+ */
+ protected $files;
+
+ /**
+ * Create a new route command instance.
+ *
+ * @param \Illuminate\Filesystem\Filesystem $files
+ * @return void
+ */
+ public function __construct(Filesystem $files)
+ {
+ parent::__construct();
+
+ $this->files = $files;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->files->delete($this->laravel['path'].'/routing/cache.php');
+
+ $this->info('Route cache cleared!');
+ }
+
+}
\ No newline at end of file | true |
Other | laravel | framework | 54f198fd9d54ad492eb22a9add5ca15c24208002.json | Write route:clear command. | src/Illuminate/Foundation/Providers/RouteCacheServiceProvider.php | @@ -2,6 +2,7 @@
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Console\RouteCacheCommand;
+use Illuminate\Foundation\Console\RouteClearCommand;
class RouteCacheServiceProvider extends ServiceProvider {
@@ -24,7 +25,12 @@ public function register()
return new RouteCacheCommand($app['router'], $app['files']);
});
- $this->commands('command.route.cache');
+ $this->app->bindShared('command.route.clear', function($app)
+ {
+ return new RouteClearCommand($app['files']);
+ });
+
+ $this->commands('command.route.cache', 'command.route.clear');
}
/**
@@ -34,7 +40,7 @@ public function register()
*/
public function provides()
{
- return array('command.route.cache');
+ return array('command.route.cache', 'command.route.clear');
}
} | true |
Other | laravel | framework | e3a8001a13fb3ff0edd4a1c851d30e4fc9f654f3.json | Simplify code per JosephSilber's suggestion. | src/Illuminate/Database/Eloquent/Model.php | @@ -2682,32 +2682,23 @@ public function syncOriginalAttribute($attribute)
/**
* Determine if the model or given attribute(s) have been modified.
*
- * @param string|array|null $attribute
+ * @param string|array|null $attributes
* @return bool
*/
- public function isDirty($attribute = null)
+ public function isDirty($attributes = null)
{
$dirty = $this->getDirty();
- if (func_num_args() > 1) $attribute = func_get_args();
+ if (is_null($attributes)) return count($dirty) > 0;
- if (is_null($attribute))
+ if ( ! is_array($attributes)) $attributes = func_get_args();
+
+ foreach ($attributes as $attr)
{
- return count($dirty) > 0;
+ if (array_key_exists($attr, $dirty)) return true;
}
- elseif (is_array($attribute))
- {
- foreach ($attribute as $attr)
- {
- if (array_key_exists($attr, $dirty)) return true;
- }
- return false;
- }
- else
- {
- return array_key_exists($attribute, $dirty);
- }
+ return false;
}
/** | false |
Other | laravel | framework | cff5fb356458f8ef9fefb1734358cc1c1026acb7.json | Add path option to RemindersControllerCommand | src/Illuminate/Auth/Console/RemindersControllerCommand.php | @@ -2,6 +2,7 @@
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
+use Symfony\Component\Console\Input\InputOption;
class RemindersControllerCommand extends Command {
@@ -29,8 +30,8 @@ class RemindersControllerCommand extends Command {
/**
* Create a new reminder table command instance.
*
- * @param \Illuminate\Filesystem\Filesystem $files
- * @return void
+ * @param \Illuminate\Filesystem\Filesystem $files
+ * @return \Illuminate\Auth\Console\RemindersControllerCommand
*/
public function __construct(Filesystem $files)
{
@@ -46,7 +47,7 @@ public function __construct(Filesystem $files)
*/
public function fire()
{
- $destination = $this->laravel['path'].'/controllers/RemindersController.php';
+ $destination = $this->getPath() . '/RemindersController.php';
if ( ! $this->files->exists($destination))
{
@@ -62,4 +63,31 @@ public function fire()
}
}
+ /**
+ * Get the path to the migration directory.
+ *
+ * @return string
+ */
+ private function getPath()
+ {
+ if ( ! $path = $this->input->getOption('path'))
+ {
+ $path = $this->laravel['path'].'/controllers';
+ }
+
+ return $path;
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return array(
+ array('path', null, InputOption::VALUE_OPTIONAL, 'The path to controllers.', null),
+ );
+ }
+
} | false |
Other | laravel | framework | 45dc7bd26cf388e203b88d07f15093289b6188e1.json | Replace more static return types | src/Illuminate/Database/Eloquent/Collection.php | @@ -73,7 +73,7 @@ public function contains($key)
* Fetch a nested element of the collection.
*
* @param string $key
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function fetch($key)
{
@@ -122,7 +122,7 @@ public function modelKeys()
* Merge the collection with the given items.
*
* @param \ArrayAccess|array $items
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function merge($items)
{
@@ -140,7 +140,7 @@ public function merge($items)
* Diff the collection with the given items.
*
* @param \ArrayAccess|array $items
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function diff($items)
{
@@ -163,7 +163,7 @@ public function diff($items)
* Intersect the collection with the given items.
*
* @param \ArrayAccess|array $items
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function intersect($items)
{
@@ -185,7 +185,7 @@ public function intersect($items)
/**
* Return only unique items from the collection.
*
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function unique()
{
@@ -198,7 +198,7 @@ public function unique()
* Returns only the models from the collection with the specified keys.
*
* @param mixed $keys
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function only($keys)
{
@@ -211,7 +211,7 @@ public function only($keys)
* Returns all models in the collection except the models with specified keys.
*
* @param mixed $keys
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return static
*/
public function except($keys)
{ | true |
Other | laravel | framework | 45dc7bd26cf388e203b88d07f15093289b6188e1.json | Replace more static return types | src/Illuminate/Database/Eloquent/Model.php | @@ -436,7 +436,7 @@ protected function fillableFromArray(array $attributes)
*
* @param array $attributes
* @param bool $exists
- * @return \Illuminate\Database\Eloquent\Model|static
+ * @return static
*/
public function newInstance($attributes = array(), $exists = false)
{
@@ -454,7 +454,7 @@ public function newInstance($attributes = array(), $exists = false)
* Create a new model instance that is existing.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|static
+ * @return static
*/
public function newFromBuilder($attributes = array())
{
@@ -517,7 +517,7 @@ public static function hydrateRaw($query, $bindings = array(), $connection = nul
* Save a new model and return the instance.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|static
+ * @return static
*/
public static function create(array $attributes)
{
@@ -532,7 +532,7 @@ public static function create(array $attributes)
* Get the first record matching the attributes or create it.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model
+ * @return static
*/
public static function firstOrCreate(array $attributes)
{
@@ -548,7 +548,7 @@ public static function firstOrCreate(array $attributes)
* Get the first record matching the attributes or instantiate it.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model
+ * @return static
*/
public static function firstOrNew(array $attributes)
{
@@ -565,7 +565,7 @@ public static function firstOrNew(array $attributes)
*
* @param array $attributes
* @param array $values
- * @return \Illuminate\Database\Eloquent\Model
+ * @return static
*/
public static function updateOrCreate(array $attributes, array $values = array())
{
@@ -580,7 +580,7 @@ public static function updateOrCreate(array $attributes, array $values = array()
* Get the first model for the given attributes.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|null
+ * @return static|null
*/
protected static function firstByAttributes($attributes)
{
@@ -633,7 +633,7 @@ public static function all($columns = array('*'))
*
* @param mixed $id
* @param array $columns
- * @return \Illuminate\Database\Eloquent\Model|Collection|static
+ * @return \Illuminate\Support\Collection|static
*/
public static function find($id, $columns = array('*'))
{
@@ -649,7 +649,7 @@ public static function find($id, $columns = array('*'))
*
* @param mixed $id
* @param array $columns
- * @return \Illuminate\Database\Eloquent\Model|Collection|static
+ * @return \Illuminate\Support\Collection|static
*/
public static function findOrNew($id, $columns = array('*'))
{
@@ -663,7 +663,7 @@ public static function findOrNew($id, $columns = array('*'))
*
* @param mixed $id
* @param array $columns
- * @return \Illuminate\Database\Eloquent\Model|Collection|static
+ * @return \Illuminate\Support\Collection|static
*
* @throws ModelNotFoundException
*/ | true |
Other | laravel | framework | 45dc7bd26cf388e203b88d07f15093289b6188e1.json | Replace more static return types | src/Illuminate/Support/Collection.php | @@ -34,7 +34,7 @@ public function __construct(array $items = array())
* Create a new collection instance if the value isn't one already.
*
* @param mixed $items
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public static function make($items)
{
@@ -58,7 +58,7 @@ public function all()
/**
* Collapse the collection items into a single array.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function collapse()
{
@@ -92,7 +92,7 @@ public function contains($value)
* Diff the collection with the given items.
*
* @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function diff($items)
{
@@ -426,7 +426,7 @@ public function reduce(callable $callback, $initial = null)
* Create a colleciton of all elements that do not pass a given truth test.
*
* @param \Closure|mixed $callback
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function reject($callback)
{
| true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Auth/Guard.php | @@ -690,7 +690,7 @@ public function getRequest()
* Set the current request instance.
*
* @param \Symfony\Component\HttpFoundation\Request
- * @return \Illuminate\Auth\Guard
+ * @return $this
*/
public function setRequest(Request $request)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Console/Application.php | @@ -56,7 +56,7 @@ public static function make($app)
/**
* Boot the Console application.
*
- * @return \Illuminate\Console\Application
+ * @return $this
*/
public function boot()
{
@@ -200,7 +200,7 @@ public function renderException($e, $output)
* Set the exception handler instance.
*
* @param \Illuminate\Exception\Handler $handler
- * @return \Illuminate\Console\Application
+ * @return $this
*/
public function setExceptionHandler($handler)
{
@@ -213,7 +213,7 @@ public function setExceptionHandler($handler)
* Set the Laravel application instance.
*
* @param \Illuminate\Foundation\Application $laravel
- * @return \Illuminate\Console\Application
+ * @return $this
*/
public function setLaravel($laravel)
{
@@ -226,7 +226,7 @@ public function setLaravel($laravel)
* Set whether the Console app should auto-exit when done.
*
* @param bool $boolean
- * @return \Illuminate\Console\Application
+ * @return $this
*/
public function setAutoExit($boolean)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Cookie/CookieJar.php | @@ -145,7 +145,7 @@ protected function getPathAndDomain($path, $domain)
*
* @param string $path
* @param string $domain
- * @return self
+ * @return $this
*/
public function setDefaultPathAndDomain($path, $domain)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Capsule/Manager.php | @@ -173,7 +173,7 @@ public function bootEloquent()
* Set the fetch mode for the database connections.
*
* @param int $fetchMode
- * @return \Illuminate\Database\Capsule\Manager
+ * @return $this
*/
public function setFetchMode($fetchMode)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Connection.php | @@ -688,7 +688,7 @@ public function getReadPdo()
* Set the PDO connection.
*
* @param \PDO $pdo
- * @return \Illuminate\Database\Connection
+ * @return $this
*/
public function setPdo(PDO $pdo)
{
@@ -701,7 +701,7 @@ public function setPdo(PDO $pdo)
* Set the PDO connection used for reading.
*
* @param \PDO $pdo
- * @return \Illuminate\Database\Connection
+ * @return $this
*/
public function setReadPdo(PDO $pdo)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Builder.php | @@ -556,7 +556,7 @@ protected function isNested($name, $relation)
* @param string $operator
* @param mixed $value
* @param string $boolean
- * @return \Illuminate\Database\Eloquent\Builder|static
+ * @return $this
*/
public function where($column, $operator = null, $value = null, $boolean = 'and')
{
@@ -712,7 +712,7 @@ protected function getHasRelationQuery($relation)
* Set the relationships that should be eager loaded.
*
* @param dynamic $relations
- * @return \Illuminate\Database\Eloquent\Builder|static
+ * @return $this
*/
public function with($relations)
{
@@ -855,7 +855,7 @@ public function getModel()
* Set a model instance for the model being queried.
*
* @param \Illuminate\Database\Eloquent\Model $model
- * @return \Illuminate\Database\Eloquent\Builder
+ * @return $this
*/
public function setModel(Model $model)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Collection.php | @@ -28,8 +28,8 @@ public function find($key, $default = null)
/**
* Load a set of relationships onto the collection.
*
- * @param dynamic $relations
- * @return \Illuminate\Database\Eloquent\Collection
+ * @param mixed $relations
+ * @return $this
*/
public function load($relations)
{
@@ -49,7 +49,7 @@ public function load($relations)
* Add an item to the collection.
*
* @param mixed $item
- * @return \Illuminate\Database\Eloquent\Collection
+ * @return $this
*/
public function add($item)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Model.php | @@ -387,7 +387,7 @@ public static function observe($class)
* Fill the model with an array of attributes.
*
* @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|static
+ * @return $this
*
* @throws MassAssignmentException
*/
@@ -678,7 +678,7 @@ public static function findOrFail($id, $columns = array('*'))
* Eager load relations on the model.
*
* @param array|string $relations
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function load($relations)
{
@@ -1990,7 +1990,7 @@ public function getFillable()
* Set the fillable attributes for the model.
*
* @param array $fillable
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function fillable(array $fillable)
{
@@ -2003,7 +2003,7 @@ public function fillable(array $fillable)
* Set the guarded attributes for the model.
*
* @param array $guarded
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function guard(array $guarded)
{
@@ -2657,7 +2657,7 @@ public function getOriginal($key = null, $default = null)
/**
* Sync the original attributes with the current.
*
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function syncOriginal()
{
@@ -2670,7 +2670,7 @@ public function syncOriginal()
* Sync a single original attribute with its current value.
*
* @param string $attribute
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function syncOriginalAttribute($attribute)
{
@@ -2765,7 +2765,7 @@ public function getRelation($relation)
*
* @param string $relation
* @param mixed $value
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function setRelation($relation, $value)
{
@@ -2778,7 +2778,7 @@ public function setRelation($relation, $value)
* Set the entire relations array on the model.
*
* @param array $relations
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function setRelations(array $relations)
{
@@ -2811,7 +2811,7 @@ public function getConnectionName()
* Set the connection associated with the model.
*
* @param string $name
- * @return \Illuminate\Database\Eloquent\Model
+ * @return $this
*/
public function setConnection($name)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/ModelNotFoundException.php | @@ -13,7 +13,7 @@ class ModelNotFoundException extends \RuntimeException {
* Set the affected Eloquent model.
*
* @param string $model
- * @return ModelNotFoundException
+ * @return $this
*/
public function setModel($model)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -327,7 +327,7 @@ protected function getAliasedPivotColumns()
* Set the join clause for the relation query.
*
* @param \Illuminate\Database\Eloquent\Builder|null
- * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return $this
*/
protected function setJoin($query = null)
{
@@ -348,7 +348,7 @@ protected function setJoin($query = null)
/**
* Set the where clause for the relation query.
*
- * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return $this
*/
protected function setWhere()
{
@@ -942,7 +942,7 @@ public function newExistingPivot(array $attributes = array())
* Set the columns on the pivot table to retrieve.
*
* @param array $columns
- * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return $this
*/
public function withPivot($columns)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Relations/MorphPivot.php | @@ -44,7 +44,7 @@ public function delete()
* Set the morph type for the pivot.
*
* @param string $morphType
- * @return \Illuminate\Database\Eloquent\Relations\MorphPivot
+ * @return $this
*/
public function setMorphType($morphType)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Relations/MorphTo.php | @@ -207,7 +207,7 @@ public function getDictionary()
/**
* Fetch soft-deleted model instances with query
*
- * @return MorphTo
+ * @return $this
*/
public function withTrashed()
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -53,7 +53,7 @@ public function __construct(Builder $query, Model $parent, $name, $table, $forei
/**
* Set the where clause for the relation query.
*
- * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return $this
*/
protected function setWhere()
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Eloquent/Relations/Pivot.php | @@ -127,7 +127,7 @@ public function getOtherKey()
*
* @param string $foreignKey
* @param string $otherKey
- * @return \Illuminate\Database\Eloquent\Relations\Pivot
+ * @return $this
*/
public function setPivotKeys($foreignKey, $otherKey)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Grammar.php | @@ -167,7 +167,7 @@ public function getTablePrefix()
* Set the grammar's table prefix.
*
* @param string $prefix
- * @return \Illuminate\Database\Grammar
+ * @return $this
*/
public function setTablePrefix($prefix)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Query/Builder.php | @@ -201,7 +201,7 @@ public function __construct(ConnectionInterface $connection,
* Set the columns to be selected.
*
* @param array $columns
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function select($columns = array('*'))
{
@@ -225,7 +225,7 @@ public function selectRaw($expression)
* Add a new select column to the query.
*
* @param mixed $column
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function addSelect($column)
{
@@ -239,7 +239,7 @@ public function addSelect($column)
/**
* Force the query to only return distinct results.
*
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function distinct()
{
@@ -252,7 +252,7 @@ public function distinct()
* Set the table which the query is targeting.
*
* @param string $table
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function from($table)
{
@@ -270,7 +270,7 @@ public function from($table)
* @param string $two
* @param string $type
* @param bool $where
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)
{
@@ -377,7 +377,7 @@ public function rightJoinWhere($table, $one, $operator, $two)
* @param string $operator
* @param mixed $value
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*
* @throws \InvalidArgumentException
*/
@@ -489,7 +489,7 @@ protected function invalidOperatorAndValue($operator, $value)
* @param string $sql
* @param array $bindings
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function whereRaw($sql, array $bindings = array(), $boolean = 'and')
{
@@ -521,7 +521,7 @@ public function orWhereRaw($sql, array $bindings = array())
* @param array $values
* @param string $boolean
* @param bool $not
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function whereBetween($column, array $values, $boolean = 'and', $not = false)
{
@@ -597,7 +597,7 @@ public function whereNested(Closure $callback, $boolean = 'and')
*
* @param \Illuminate\Database\Query\Builder|static $query
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function addNestedWhereQuery($query, $boolean = 'and')
{
@@ -620,7 +620,7 @@ public function addNestedWhereQuery($query, $boolean = 'and')
* @param string $operator
* @param \Closure $callback
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
protected function whereSub($column, $operator, Closure $callback, $boolean)
{
@@ -646,7 +646,7 @@ protected function whereSub($column, $operator, Closure $callback, $boolean)
* @param \Closure $callback
* @param string $boolean
* @param bool $not
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function whereExists(Closure $callback, $boolean = 'and', $not = false)
{
@@ -708,7 +708,7 @@ public function orWhereNotExists(Closure $callback)
* @param mixed $values
* @param string $boolean
* @param bool $not
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function whereIn($column, $values, $boolean = 'and', $not = false)
{
@@ -773,7 +773,7 @@ public function orWhereNotIn($column, $values)
* @param \Closure $callback
* @param string $boolean
* @param bool $not
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
protected function whereInSub($column, Closure $callback, $boolean, $not)
{
@@ -797,7 +797,7 @@ protected function whereInSub($column, Closure $callback, $boolean, $not)
* @param string $column
* @param string $boolean
* @param bool $not
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function whereNull($column, $boolean = 'and', $not = false)
{
@@ -892,7 +892,7 @@ public function whereYear($column, $operator, $value, $boolean = 'and')
* @param string $operator
* @param int $value
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and')
{
@@ -908,7 +908,7 @@ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean
*
* @param string $method
* @param string $parameters
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function dynamicWhere($method, $parameters)
{
@@ -969,8 +969,7 @@ protected function addDynamic($segment, $connector, $parameters, $index)
/**
* Add a "group by" clause to the query.
*
- * @param dynamic $columns
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function groupBy()
{
@@ -989,7 +988,7 @@ public function groupBy()
* @param string $operator
* @param string $value
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function having($column, $operator = null, $value = null, $boolean = 'and')
{
@@ -1021,7 +1020,7 @@ public function orHaving($column, $operator = null, $value = null)
* @param string $sql
* @param array $bindings
* @param string $boolean
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function havingRaw($sql, array $bindings = array(), $boolean = 'and')
{
@@ -1051,7 +1050,7 @@ public function orHavingRaw($sql, array $bindings = array())
*
* @param string $column
* @param string $direction
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function orderBy($column, $direction = 'asc')
{
@@ -1089,7 +1088,7 @@ public function oldest($column = 'created_at')
*
* @param string $sql
* @param array $bindings
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function orderByRaw($sql, $bindings = array())
{
@@ -1106,7 +1105,7 @@ public function orderByRaw($sql, $bindings = array())
* Set the "offset" value of the query.
*
* @param int $value
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function offset($value)
{
@@ -1130,7 +1129,7 @@ public function skip($value)
* Set the "limit" value of the query.
*
* @param int $value
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function limit($value)
{
@@ -1195,8 +1194,8 @@ public function unionAll($query)
/**
* Lock the selected rows in the table.
*
- * @param bool $update
- * @return \Illuminate\Database\Query\Builder
+ * @param bool $value
+ * @return $this
*/
public function lock($value = true)
{
@@ -1240,7 +1239,7 @@ public function toSql()
*
* @param \DateTime|int $minutes
* @param string $key
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function remember($minutes, $key = null)
{
@@ -1264,7 +1263,7 @@ public function rememberForever($key = null)
* Indicate that the results, if cached, should use the given cache tags.
*
* @param array|dynamic $cacheTags
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function cacheTags($cacheTags)
{
@@ -1277,7 +1276,7 @@ public function cacheTags($cacheTags)
* Indicate that the results, if cached, should use the given cache driver.
*
* @param string $cacheDriver
- * @return \Illuminate\Database\Query\Builder|static
+ * @return $this
*/
public function cacheDriver($cacheDriver)
{
@@ -2010,7 +2009,7 @@ public function getRawBindings()
*
* @param array $bindings
* @param string $type
- * @return \Illuminate\Database\Query\Builder
+ * @return $this
*
* @throws \InvalidArgumentException
*/
@@ -2031,7 +2030,7 @@ public function setBindings(array $bindings, $type = 'where')
*
* @param mixed $value
* @param string $type
- * @return \Illuminate\Database\Query\Builder
+ * @return $this
*
* @throws \InvalidArgumentException
*/
@@ -2058,7 +2057,7 @@ public function addBinding($value, $type = 'where')
* Merge an array of bindings into our bindings.
*
* @param \Illuminate\Database\Query\Builder $query
- * @return \Illuminate\Database\Query\Builder
+ * @return $this
*/
public function mergeBindings(Builder $query)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Query/JoinClause.php | @@ -53,7 +53,7 @@ public function __construct(Builder $query, $type, $table)
* @param string $second
* @param string $boolean
* @param bool $where
- * @return \Illuminate\Database\Query\JoinClause
+ * @return $this
*/
public function on($first, $operator, $second, $boolean = 'and', $where = false)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Schema/Blueprint.php | @@ -765,7 +765,7 @@ protected function addColumn($type, $name, array $parameters = array())
* Remove a column from the schema blueprint.
*
* @param string $name
- * @return \Illuminate\Database\Schema\Blueprint
+ * @return $this
*/
public function removeColumn($name)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Schema/Builder.php | @@ -202,7 +202,7 @@ public function getConnection()
* Set the database connection instance.
*
* @param \Illuminate\Database\Connection
- * @return \Illuminate\Database\Schema\Builder
+ * @return $this
*/
public function setConnection(Connection $connection)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Database/Seeder.php | @@ -73,7 +73,7 @@ protected function resolve($class)
* Set the IoC container instance.
*
* @param \Illuminate\Container\Container $container
- * @return \Illuminate\Database\Seeder
+ * @return $this
*/
public function setContainer(Container $container)
{
@@ -86,7 +86,7 @@ public function setContainer(Container $container)
* Set the console command instance.
*
* @param \Illuminate\Console\Command $command
- * @return \Illuminate\Database\Seeder
+ * @return $this
*/
public function setCommand(Command $command)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Foundation/Application.php | @@ -698,7 +698,7 @@ protected function registerBaseMiddlewares()
*
* @param string $class
* @param array $parameters
- * @return \Illuminate\Foundation\Application
+ * @return $this
*/
public function middleware($class, array $parameters = array())
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Foundation/Composer.php | @@ -86,7 +86,7 @@ protected function getProcess()
* Set the working path used by the class.
*
* @param string $path
- * @return \Illuminate\Foundation\Composer
+ * @return $this
*/
public function setWorkingPath($path)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Html/FormBuilder.php | @@ -960,7 +960,7 @@ public function getSessionStore()
* Set the session store implementation.
*
* @param \Illuminate\Session\Store $session
- * @return \Illuminate\Html\FormBuilder
+ * @return $this
*/
public function setSessionStore(Session $session)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Http/RedirectResponse.php | @@ -28,7 +28,7 @@ class RedirectResponse extends \Symfony\Component\HttpFoundation\RedirectRespons
* @param string $key
* @param string $value
* @param bool $replace
- * @return \Illuminate\Http\RedirectResponse
+ * @return $this
*/
public function header($key, $value, $replace = true)
{
@@ -62,7 +62,7 @@ public function with($key, $value = null)
* Add a cookie to the response.
*
* @param \Symfony\Component\HttpFoundation\Cookie $cookie
- * @return \Illuminate\Http\RedirectResponse
+ * @return $this
*/
public function withCookie(Cookie $cookie)
{
@@ -75,7 +75,7 @@ public function withCookie(Cookie $cookie)
* Flash an array of input to the session.
*
* @param array $input
- * @return \Illuminate\Http\RedirectResponse
+ * @return $this
*/
public function withInput(array $input = null)
{
@@ -89,8 +89,8 @@ public function withInput(array $input = null)
/**
* Flash an array of input to the session.
*
- * @param dynamic string
- * @return \Illuminate\Http\RedirectResponse
+ * @param mixed string
+ * @return $this
*/
public function onlyInput()
{
@@ -113,7 +113,7 @@ public function exceptInput()
*
* @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider
* @param string $key
- * @return \Illuminate\Http\RedirectResponse
+ * @return $this
*/
public function withErrors($provider, $key = 'default')
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Http/Request.php | @@ -22,7 +22,7 @@ class Request extends SymfonyRequest {
/**
* Return the Request instance.
*
- * @return \Illuminate\Http\Request
+ * @return $this
*/
public function instance()
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Http/ResponseTrait.php | @@ -10,7 +10,7 @@ trait ResponseTrait {
* @param string $key
* @param string $value
* @param bool $replace
- * @return \Illuminate\Http\Response
+ * @return $this
*/
public function header($key, $value, $replace = true)
{
@@ -23,7 +23,7 @@ public function header($key, $value, $replace = true)
* Add a cookie to the response.
*
* @param \Symfony\Component\HttpFoundation\Cookie $cookie
- * @return \Illuminate\Http\Response
+ * @return $this
*/
public function withCookie(Cookie $cookie)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Mail/Mailer.php | @@ -468,7 +468,7 @@ public function setSwiftMailer($swift)
* Set the log writer instance.
*
* @param \Illuminate\Log\Writer $logger
- * @return \Illuminate\Mail\Mailer
+ * @return $this
*/
public function setLogger(Writer $logger)
{
@@ -481,7 +481,7 @@ public function setLogger(Writer $logger)
* Set the queue manager instance.
*
* @param \Illuminate\Queue\QueueManager $queue
- * @return \Illuminate\Mail\Mailer
+ * @return $this
*/
public function setQueue(QueueManager $queue)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Mail/Message.php | @@ -28,7 +28,7 @@ public function __construct($swift)
*
* @param string $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function from($address, $name = null)
{
@@ -42,7 +42,7 @@ public function from($address, $name = null)
*
* @param string $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function sender($address, $name = null)
{
@@ -55,7 +55,7 @@ public function sender($address, $name = null)
* Set the "return path" of the message.
*
* @param string $address
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function returnPath($address)
{
@@ -69,7 +69,7 @@ public function returnPath($address)
*
* @param string|array $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function to($address, $name = null)
{
@@ -81,7 +81,7 @@ public function to($address, $name = null)
*
* @param string $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function cc($address, $name = null)
{
@@ -93,7 +93,7 @@ public function cc($address, $name = null)
*
* @param string $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function bcc($address, $name = null)
{
@@ -105,7 +105,7 @@ public function bcc($address, $name = null)
*
* @param string $address
* @param string $name
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function replyTo($address, $name = null)
{
@@ -118,7 +118,7 @@ public function replyTo($address, $name = null)
* @param string|array $address
* @param string $name
* @param string $type
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
protected function addAddresses($address, $name, $type)
{
@@ -138,7 +138,7 @@ protected function addAddresses($address, $name, $type)
* Set the subject of the message.
*
* @param string $subject
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function subject($subject)
{
@@ -151,7 +151,7 @@ public function subject($subject)
* Set the message priority level.
*
* @param int $level
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function priority($level)
{
@@ -165,7 +165,7 @@ public function priority($level)
*
* @param string $file
* @param array $options
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function attach($file, array $options = array())
{
@@ -191,7 +191,7 @@ protected function createAttachmentFromPath($file)
* @param string $data
* @param string $name
* @param array $options
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
public function attachData($data, $name, array $options = array())
{
@@ -243,7 +243,7 @@ public function embedData($data, $name, $contentType = null)
*
* @param \Swift_Attachment $attachment
* @param array $options
- * @return \Illuminate\Mail\Message
+ * @return $this
*/
protected function prepAttachment($attachment, $options = array())
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Pagination/Paginator.php | @@ -117,7 +117,7 @@ public function __construct(Factory $factory, array $items, $total, $perPage = n
/**
* Setup the pagination context (current and last page).
*
- * @return \Illuminate\Pagination\Paginator
+ * @return $this
*/
public function setupPaginationContext()
{
@@ -233,7 +233,7 @@ public function getUrl($page)
* Get / set the URL fragment to be appended to URLs.
*
* @param string|null $fragment
- * @return \Illuminate\Pagination\Paginator|string
+ * @return $this|string
*/
public function fragment($fragment = null)
{
@@ -257,7 +257,7 @@ protected function buildFragment()
*
* @param string $key
* @param string $value
- * @return \Illuminate\Pagination\Paginator
+ * @return $this
*/
public function appends($key, $value = null)
{
@@ -270,7 +270,7 @@ public function appends($key, $value = null)
* Add an array of query string values.
*
* @param array $keys
- * @return \Illuminate\Pagination\Paginator
+ * @return $this
*/
protected function appendArray(array $keys)
{
@@ -287,7 +287,7 @@ protected function appendArray(array $keys)
*
* @param string $key
* @param string $value
- * @return \Illuminate\Pagination\Paginator
+ * @return $this
*/
public function addQuery($key, $value)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Routing/Route.php | @@ -372,7 +372,7 @@ protected function compileParameterNames()
* Bind the route to a given request for execution.
*
* @param \Illuminate\Http\Request $request
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function bind(Request $request)
{
@@ -537,7 +537,7 @@ public static function getValidators()
* Add before filters to the route.
*
* @param string $filters
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function before($filters)
{
@@ -548,7 +548,7 @@ public function before($filters)
* Add after filters to the route.
*
* @param string $filters
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function after($filters)
{
@@ -560,7 +560,7 @@ public function after($filters)
*
* @param string $type
* @param string $filters
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
protected function addFilters($type, $filters)
{
@@ -581,7 +581,7 @@ protected function addFilters($type, $filters)
*
* @param string $key
* @param mixed $value
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function defaults($key, $value)
{
@@ -595,7 +595,7 @@ public function defaults($key, $value)
*
* @param array|string $name
* @param string $expression
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function where($name, $expression = null)
{
@@ -612,7 +612,7 @@ public function where($name, $expression = null)
*
* @param array|string $name
* @param string $expression
- * @return \Illuminate\Routing\Route
+ * @return array
*/
protected function parseWhere($name, $expression)
{
@@ -623,7 +623,7 @@ protected function parseWhere($name, $expression)
* Set a list of regular expression requirements on the route.
*
* @param array $wheres
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
protected function whereArray(array $wheres)
{
@@ -639,7 +639,7 @@ protected function whereArray(array $wheres)
* Add a prefix to the route URI.
*
* @param string $prefix
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function prefix($prefix)
{
@@ -795,7 +795,7 @@ public function getAction()
* Set the action array for the route.
*
* @param array $action
- * @return \Illuminate\Routing\Route
+ * @return $this
*/
public function setAction(array $action)
{
| true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Session/DatabaseSessionHandler.php | @@ -118,7 +118,7 @@ protected function getQuery()
* Set the existence state for the session.
*
* @param bool $value
- * @return \SessionHandlerInterface
+ * @return $this
*/
public function setExists($value)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Support/Collection.php | @@ -103,7 +103,7 @@ public function diff($items)
* Execute a callback over each item.
*
* @param \Closure $callback
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function each(Closure $callback)
{
@@ -116,7 +116,7 @@ public function each(Closure $callback)
* Fetch a nested element of the collection.
*
* @param string $key
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function fetch($key)
{
@@ -127,7 +127,7 @@ public function fetch($key)
* Run a filter over each of the items.
*
* @param \Closure $callback
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function filter(Closure $callback)
{
@@ -156,7 +156,7 @@ public function first(Closure $callback = null, $default = null)
/**
* Get a flattened array of the items in the collection.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function flatten()
{
@@ -166,7 +166,7 @@ public function flatten()
/**
* Flip the items in the collection.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function flip()
{
@@ -205,7 +205,7 @@ public function get($key, $default = null)
* Group an associative array by a field or Closure value.
*
* @param callable|string $groupBy
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function groupBy($groupBy)
{
@@ -225,7 +225,7 @@ public function groupBy($groupBy)
* Key an associative array by a field.
*
* @param string $keyBy
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function keyBy($keyBy)
{
@@ -270,7 +270,7 @@ public function implode($value, $glue = null)
* Intersect the collection with the given items.
*
* @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function intersect($items)
{
@@ -323,7 +323,7 @@ public function lists($value, $key = null)
* Run a map over each of the items.
*
* @param \Closure $callback
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function map(Closure $callback)
{
@@ -334,7 +334,7 @@ public function map(Closure $callback)
* Merge the collection with the given items.
*
* @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function merge($items)
{
@@ -453,7 +453,7 @@ public function reject($callback)
/**
* Reverse items order.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function reverse()
{
@@ -485,7 +485,7 @@ public function shift()
/**
* Shuffle the items in the collection.
*
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function shuffle()
{
@@ -500,7 +500,7 @@ public function shuffle()
* @param int $offset
* @param int $length
* @param bool $preserveKeys
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function slice($offset, $length = null, $preserveKeys = false)
{
@@ -512,7 +512,7 @@ public function slice($offset, $length = null, $preserveKeys = false)
*
* @param int $size
* @param bool $preserveKeys
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function chunk($size, $preserveKeys = false)
{
@@ -530,7 +530,7 @@ public function chunk($size, $preserveKeys = false)
* Sort through each item with a callback.
*
* @param \Closure $callback
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function sort(Closure $callback)
{
@@ -545,7 +545,7 @@ public function sort(Closure $callback)
* @param \Closure|string $callback
* @param int $options
* @param bool $descending
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
{
@@ -583,7 +583,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
*
* @param \Closure|string $callback
* @param int $options
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function sortByDesc($callback, $options = SORT_REGULAR)
{
@@ -596,7 +596,7 @@ public function sortByDesc($callback, $options = SORT_REGULAR)
* @param int $offset
* @param int $length
* @param mixed $replacement
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function splice($offset, $length = 0, $replacement = array())
{
@@ -627,7 +627,7 @@ public function sum($callback)
* Take the first or last {$limit} items.
*
* @param int $limit
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function take($limit = null)
{
@@ -640,7 +640,7 @@ public function take($limit = null)
* Transform each item in the collection using a callback.
*
* @param \Closure $callback
- * @return \Illuminate\Support\Collection
+ * @return $this
*/
public function transform(Closure $callback)
{
@@ -652,7 +652,7 @@ public function transform(Closure $callback)
/**
* Return only unique items from the collection array.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function unique()
{
@@ -662,7 +662,7 @@ public function unique()
/**
* Reset the keys on the underlying array.
*
- * @return \Illuminate\Support\Collection
+ * @return static
*/
public function values()
{
| true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Support/Fluent.php | @@ -136,7 +136,7 @@ public function offsetUnset($offset)
*
* @param string $method
* @param array $parameters
- * @return \Illuminate\Support\Fluent
+ * @return $this
*/
public function __call($method, $parameters)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Support/Manager.php | @@ -107,7 +107,7 @@ protected function callCustomCreator($driver)
*
* @param string $driver
* @param \Closure $callback
- * @return \Illuminate\Support\Manager|static
+ * @return $this
*/
public function extend($driver, Closure $callback)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Support/MessageBag.php | @@ -41,7 +41,7 @@ public function __construct(array $messages = array())
*
* @param string $key
* @param string $message
- * @return \Illuminate\Support\MessageBag
+ * @return $this
*/
public function add($key, $message)
{
@@ -57,7 +57,7 @@ public function add($key, $message)
* Merge a new array of messages into the bag.
*
* @param \Illuminate\Support\Contracts\MessageProviderInterface|array $messages
- * @return \Illuminate\Support\MessageBag
+ * @return $this
*/
public function merge($messages)
{
| true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Support/ViewErrorBag.php | @@ -27,7 +27,7 @@ public function getBag($key)
*
* @param string $key
* @param \Illuminate\Support\MessageBag $bag
- * @return \Illuminate\Support\ViewErrorBag
+ * @return $this
*/
public function put($key, MessageBag $bag)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/Validation/Validator.php | @@ -2130,7 +2130,7 @@ public function getRules()
* Set the validation rules.
*
* @param array $rules
- * @return \Illuminate\Validation\Validator
+ * @return $this
*/
public function setRules(array $rules)
{
@@ -2143,7 +2143,7 @@ public function setRules(array $rules)
* Set the custom attributes on the validator.
*
* @param array $attributes
- * @return \Illuminate\Validation\Validator
+ * @return $this
*/
public function setAttributeNames(array $attributes)
{
@@ -2166,7 +2166,7 @@ public function getFiles()
* Set the files under validation.
*
* @param array $files
- * @return \Illuminate\Validation\Validator
+ * @return $this
*/
public function setFiles(array $files)
{ | true |
Other | laravel | framework | b073237d341549ada2f13e8e5b1d6d98f93428ec.json | Update phpdocs for better chaining
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class. | src/Illuminate/View/View.php | @@ -159,7 +159,7 @@ protected function gatherData()
*
* @param string|array $key
* @param mixed $value
- * @return \Illuminate\View\View
+ * @return $this
*/
public function with($key, $value = null)
{
@@ -181,7 +181,7 @@ public function with($key, $value = null)
* @param string $key
* @param string $view
* @param array $data
- * @return \Illuminate\View\View
+ * @return $this
*/
public function nest($key, $view, array $data = array())
{
@@ -192,7 +192,7 @@ public function nest($key, $view, array $data = array())
* Add validation errors to the view.
*
* @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider
- * @return \Illuminate\View\View
+ * @return $this
*/
public function withErrors($provider)
{ | true |
Other | laravel | framework | 38cbdb207bd3b64628b2cf881dbd5ceff0fb2625.json | Add comment on Artisan class. | src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php | @@ -22,6 +22,9 @@ class ArtisanServiceProvider extends ServiceProvider {
*/
public function register()
{
+ // This Artisan class is a lightweight wrapper for calling into the Artisan
+ // command line. If a call to this class is executed we will boot up the
+ // entire Artisan command line then pass the method into the main app.
$this->app->bindShared('artisan', function($app)
{
return new Artisan($app); | false |
Other | laravel | framework | 21fddea479015b863f319274ad4187900b64d282.json | Remove class loader from optimize file. | src/Illuminate/Foundation/Console/Optimize/config.php | @@ -3,7 +3,6 @@
$basePath = $app['path.base'];
return array_map('realpath', array(
- $basePath.'/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Container/Container.php',
$basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php',
$basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php', | false |
Other | laravel | framework | b98c24f69de3831ab2d42de69fdc14242c6c78a6.json | Allow HHVM failures. | .travis.yml | @@ -11,3 +11,7 @@ before_script:
- travis_retry composer install --prefer-source --no-interaction --dev
script: vendor/bin/phpunit --verbose
+
+matrix:
+ allow_failures:
+ - php: hhvm | false |
Other | laravel | framework | 0434715dd49fc46940efa35790c5ddd9506dca65.json | Change Artisan requirement. | src/Illuminate/Console/Application.php | @@ -60,8 +60,6 @@ public static function make($app)
*/
public function boot()
{
- require $this->laravel['path'].'/start/artisan.php';
-
// If the event dispatcher is set on the application, we will fire an event
// with the Artisan instance to provide each listener the opportunity to
// register their commands on this application before it gets started. | false |
Other | laravel | framework | cc45646a55310ffd3929f5f4b7e0766d3c0c37ad.json | Change console directory back to commands. | src/Illuminate/Foundation/Console/CommandMakeCommand.php | @@ -121,7 +121,7 @@ protected function getPath()
if (is_null($path))
{
- return $this->laravel['path'].'/console';
+ return $this->laravel['path'].'/commands';
}
else
{ | false |
Other | laravel | framework | b929969bac9354f5a77116bea518da9ea99c2a4f.json | Add failing test for date_format and before/after | tests/Validation/ValidationValidatorTest.php | @@ -1119,6 +1119,9 @@ public function testBeforeAndAfterWithFormat()
$v = new Validator($trans, array('start' => '31/12/2012', 'ends' => '31/12/2000'), array('start' => 'date_format:d/m/Y|before:ends', 'ends' => 'date_format:d/m/Y|after:start'));
$this->assertTrue($v->fails());
+ $v = new Validator($trans, array('start' => 'invalid', 'ends' => 'invalid'), array('start' => 'date_format:d/m/Y|before:ends', 'ends' => 'date_format:d/m/Y|after:start'));
+ $this->assertTrue($v->fails());
+
$v = new Validator($trans, array('x' => date('d/m/Y')), array('x' => 'date_format:d/m/Y|after:yesterday|before:tomorrow'));
$this->assertTrue($v->passes());
| false |
Other | laravel | framework | a22d0bcdfa4e7fdce53b1b77198413f5db5953cf.json | Add "call" method to container. | src/Illuminate/Container/Container.php | @@ -3,6 +3,8 @@
use Closure;
use ArrayAccess;
use ReflectionClass;
+use ReflectionMethod;
+use ReflectionFunction;
use ReflectionParameter;
class BindingResolutionException extends \Exception {}
@@ -403,6 +405,81 @@ protected function getReboundCallbacks($abstract)
}
}
+ /**
+ * Wrap the given closure such that its dependencies will be injected when executed.
+ *
+ * @param \Closure $callback
+ * @param array $parameters
+ * @return \Closure
+ */
+ public function wrap(Closure $callback, array $parameters = array())
+ {
+ return function() use ($callback, $parameters)
+ {
+ return $this->call($callback, $parameters);
+ };
+ }
+
+ /**
+ * Call the given Closure and inject its dependencies.
+ *
+ * @param callable $callback
+ * @param array $parameters
+ * @return mixed
+ */
+ public function call($callback, array $parameters = array())
+ {
+ $dependencies = [];
+
+ foreach ($this->getCallReflector($callback)->getParameters() as $key => $parameter)
+ {
+ $dependencies[] = $this->getDependencyForCallParameter($parameter, $parameters);
+ }
+
+ return call_user_func_array($callback, $dependencies);
+ }
+
+ /**
+ * Get the proper reflection instance for the given callback.
+ *
+ * @param \Closure|array $callback
+ * @return \ReflectionFunctionAbstract
+ */
+ protected function getCallReflector($callback)
+ {
+ if (is_array($callback))
+ {
+ return new ReflectionMethod($callback[0], $callback[1]);
+ }
+ else
+ {
+ return new ReflectionFunction($callback);
+ }
+ }
+
+ /**
+ * Get the dependency for the given call parameter.
+ *
+ * @param \ReflectionParameter $parameter
+ * @param array $parameters
+ * @return mixed
+ */
+ protected function getDependencyForCallParameter(ReflectionParameter $parameter, array $parameters)
+ {
+ if (array_key_exists($parameter->name, $parameters))
+ {
+ return $parameters[$parameter->name];
+ }
+ elseif ($parameter->getClass())
+ {
+ return $this->make($parameter->getClass()->name);
+ }
+ elseif ($parameter->isDefaultValueAvailable())
+ {
+ return $parameter->getDefaultValue();
+ }
+ }
+
/**
* Resolve the given type from the container.
* | true |
Other | laravel | framework | a22d0bcdfa4e7fdce53b1b77198413f5db5953cf.json | Add "call" method to container. | src/Illuminate/Foundation/changes.json | @@ -2,7 +2,8 @@
"4.3.*": [
{"message": "Allow passing a priority to Eloquent event listeners.", "backport": null},
{"message": "Tweak 'compile' configuration file for 'files' and 'providers' support.", "backport": null},
- {"message": "Allow method injection via IoC to any controller or route method.", "backport": null}
+ {"message": "Allow method injection via IoC to any controller or route method.", "backport": null},
+ {"message": "Added the 'call' method to the Container to execute a callback with its dependencies.", "backport": null}
],
"4.2.*": [
{"message": "View and Pagination 'Environment' classes renamed to 'Factory'.", "backport": null}, | true |
Other | laravel | framework | a22d0bcdfa4e7fdce53b1b77198413f5db5953cf.json | Add "call" method to container. | tests/Container/ContainerTest.php | @@ -329,6 +329,38 @@ public function testInternalClassWithDefaultParameters()
$container->make('ContainerMixedPrimitiveStub', $parameters);
}
+
+ public function testCallWithDependencies()
+ {
+ $container = new Container;
+ $result = $container->call(function(StdClass $foo, $bar = array()) {
+ return func_get_args();
+ });
+
+ $this->assertInstanceOf('stdClass', $result[0]);
+ $this->assertEquals([], $result[1]);
+
+ $result = $container->call(function(StdClass $foo, $bar = array()) {
+ return func_get_args();
+ }, ['bar' => 'taylor']);
+
+ $this->assertInstanceOf('stdClass', $result[0]);
+ $this->assertEquals('taylor', $result[1]);
+
+ /**
+ * Wrap a function...
+ */
+ $result = $container->wrap(function(StdClass $foo, $bar = array()) {
+ return func_get_args();
+ }, ['bar' => 'taylor']);
+
+ $this->assertInstanceOf('Closure', $result);
+ $result = $result();
+
+ $this->assertInstanceOf('stdClass', $result[0]);
+ $this->assertEquals('taylor', $result[1]);
+ }
+
}
class ContainerConcreteStub {} | true |
Other | laravel | framework | 10a0c61cc47bfa97f8b440b6266b8a47d51239b1.json | move domain() and getUri() out of foreach loop | src/Illuminate/Routing/RouteCollection.php | @@ -61,9 +61,10 @@ public function add(Route $route)
*/
protected function addToCollections($route)
{
+ $domainAndUri = $route->domain().$route->getUri();
+
foreach ($route->methods() as $method)
{
- $domainAndUri = $route->domain().$route->getUri();
$this->routes[$method][$domainAndUri] = $route;
}
| false |
Other | laravel | framework | aa1eada9c212ef879c03e9f71c93ad2b14c55614.json | Add Illuminate\Support\Arr to compiled class.
Signed-off-by: crynobone <crynobone@gmail.com> | src/Illuminate/Foundation/Console/Optimize/config.php | @@ -31,6 +31,7 @@
$basePath.'/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Support/Traits/MacroableTrait.php',
+ $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Arr.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Support/Str.php',
$basePath.'/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php',
$basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php', | false |
Other | laravel | framework | 0932f900853f454b1042a3e862eaab73afb3cfa7.json | Add excluded paths. | .scrutinizer.yml | @@ -1,3 +1,6 @@
+filter:
+ excluded_paths: [tests/*]
+
checks:
php:
code_rating: true | false |
Other | laravel | framework | 29bb5c44d19038c80f90cd573fc519277767e344.json | Move abstract method to top. | src/Illuminate/Foundation/Publishing/Publisher.php | @@ -38,6 +38,17 @@ public function __construct(Filesystem $files, $publishPath)
$this->publishPath = $publishPath;
}
+ /**
+ * Get the source directory to publish.
+ *
+ * @param string $package
+ * @param string $packagePath
+ * @return string
+ *
+ * @throws \InvalidArgumentException
+ */
+ abstract protected function getSource($package, $packagePath);
+
/**
* Publish files from a given path.
*
@@ -115,15 +126,4 @@ public function setPackagePath($packagePath)
$this->packagePath = $packagePath;
}
- /**
- * Get the source directory to publish.
- *
- * @param string $package
- * @param string $packagePath
- * @return string
- *
- * @throws \InvalidArgumentException
- */
- abstract protected function getSource($package, $packagePath);
-
} | false |
Other | laravel | framework | 9b7eea0fa73c0bc359bec0132ccb8afec66084a0.json | add test for #5a6c10d | tests/Validation/ValidationValidatorTest.php | @@ -116,6 +116,17 @@ public function testAttributeNamesAreReplaced()
$this->assertFalse($v->passes());
$v->messages()->setFormat(':message');
$this->assertEquals('Name is required!', $v->messages()->first('name'));
+
+ //set customAttributes by setter
+ $trans = $this->getRealTranslator();
+ $trans->addResource('array', array('validation.required' => ':attribute is required!'), 'en', 'messages');
+ $customAttributes = array('name' => 'Name');
+ $v = new Validator($trans, array('name' => ''), array('name' => 'Required'));
+ $v->setCustomAttributes($customAttributes);
+ $this->assertFalse($v->passes());
+ $v->messages()->setFormat(':message');
+ $this->assertEquals('Name is required!', $v->messages()->first('name'));
+
$trans = $this->getRealTranslator();
$trans->addResource('array', array('validation.required' => ':attribute is required!'), 'en', 'messages');
@@ -147,7 +158,22 @@ public function testDisplayableValuesAreReplaced()
$this->assertFalse($v->passes());
$v->messages()->setFormat(':message');
$this->assertEquals('type must be included in Short, Long.', $v->messages()->first('type'));
-
+
+ // set custom values by setter
+ $trans = $this->getRealTranslator();
+ $trans->addResource('array', array('validation.in' => ':attribute must be included in :values.'), 'en', 'messages');
+ $customValues = array(
+ 'type' =>
+ array(
+ '5' => 'Short',
+ '300' => 'Long',
+ )
+ );
+ $v = new Validator($trans, array('type' => '4'), array('type' => 'in:5,300'));
+ $v->setCustomValues($customValues);
+ $this->assertFalse($v->passes());
+ $v->messages()->setFormat(':message');
+ $this->assertEquals('type must be included in Short, Long.', $v->messages()->first('type'));
}
| false |
Other | laravel | framework | 5a6c10d5fafaf5a19e085b6b1b16d9aff9714d80.json | add getter and setter | src/Illuminate/Validation/Validator.php | @@ -2212,6 +2212,48 @@ public function setCustomMessages(array $messages)
{
$this->customMessages = array_merge($this->customMessages, $messages);
}
+
+ /**
+ * Get the custom attributes for the validator
+ *
+ * @return array
+ */
+ public function getCustomAttributes()
+ {
+ return $this->customAttributes;
+ }
+
+ /**
+ * Set the custom attributes for the validator
+ *
+ * @param array $customAttributes
+ * @return void
+ */
+ public function setCustomAttributes(array $customAttributes)
+ {
+ $this->customAttributes = array_merge($this->customAttributes, $customAttributes);
+ }
+
+ /**
+ * Get the custom values for the validator
+ *
+ * @return array
+ */
+ public function getCustomValues()
+ {
+ return $this->customValues;
+ }
+
+ /**
+ * Set the custom values for the validator
+ *
+ * @param array $customValues
+ * @return void
+ */
+ public function setCustomValues(array $customValues)
+ {
+ $this->customValues = array_merge($this->customValues, $customValues);
+ }
/**
* Get the fallback messages for the validator. | false |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Console/AssetPublishCommand.php | @@ -2,9 +2,9 @@
use Illuminate\Console\Command;
use Symfony\Component\Finder\Finder;
-use Illuminate\Foundation\AssetPublisher;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
+use Illuminate\Foundation\Publishing\AssetPublisher;
class AssetPublishCommand extends Command {
@@ -25,14 +25,14 @@ class AssetPublishCommand extends Command {
/**
* The asset publisher instance.
*
- * @var \Illuminate\Foundation\AssetPublisher
+ * @var \Illuminate\Foundation\Publishing\AssetPublisher
*/
protected $assets;
/**
* Create a new asset publish command instance.
*
- * @param \Illuminate\Foundation\AssetPublisher $assets
+ * @param \Illuminate\Foundation\Publishing\AssetPublisher $assets
* @return void
*/
public function __construct(AssetPublisher $assets) | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Console/ConfigPublishCommand.php | @@ -2,9 +2,9 @@
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
-use Illuminate\Foundation\ConfigPublisher;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
+use Illuminate\Foundation\Publishing\ConfigPublisher;
class ConfigPublishCommand extends Command {
@@ -27,14 +27,14 @@ class ConfigPublishCommand extends Command {
/**
* The config publisher instance.
*
- * @var \Illuminate\Foundation\ConfigPublisher
+ * @var \Illuminate\Foundation\Publishing\ConfigPublisher
*/
protected $config;
/**
* Create a new configuration publish command instance.
*
- * @param \Illuminate\Foundation\ConfigPublisher $config
+ * @param \Illuminate\Foundation\Publishing\ConfigPublisher $config
* @return void
*/
public function __construct(ConfigPublisher $config) | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Console/ViewPublishCommand.php | @@ -1,9 +1,9 @@
<?php namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
-use Illuminate\Foundation\ViewPublisher;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
+use Illuminate\Foundation\Publishing\ViewPublisher;
class ViewPublishCommand extends Command {
@@ -24,14 +24,14 @@ class ViewPublishCommand extends Command {
/**
* The view publisher instance.
*
- * @var \Illuminate\Foundation\ViewPublisher
+ * @var \Illuminate\Foundation\Publishing\ViewPublisher
*/
protected $view;
/**
* Create a new view publish command instance.
*
- * @param \Illuminate\Foundation\ViewPublisher $view
+ * @param \Illuminate\Foundation\Publishing\ViewPublisher $view
* @return void
*/
public function __construct(ViewPublisher $view) | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Providers/PublisherServiceProvider.php | @@ -1,13 +1,13 @@
<?php namespace Illuminate\Foundation\Providers;
use Illuminate\Support\ServiceProvider;
-use Illuminate\Foundation\ViewPublisher;
-use Illuminate\Foundation\AssetPublisher;
-use Illuminate\Foundation\ConfigPublisher;
-use Illuminate\Foundation\MigrationPublisher;
+use Illuminate\Foundation\Publishing\ViewPublisher;
+use Illuminate\Foundation\Publishing\AssetPublisher;
+use Illuminate\Foundation\Publishing\ConfigPublisher;
use Illuminate\Foundation\Console\ViewPublishCommand;
use Illuminate\Foundation\Console\AssetPublishCommand;
use Illuminate\Foundation\Console\ConfigPublishCommand;
+use Illuminate\Foundation\Publishing\MigrationPublisher;
use Illuminate\Foundation\Console\MigratePublishCommand;
class PublisherServiceProvider extends ServiceProvider { | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Publishing/AssetPublisher.php | @@ -1,4 +1,4 @@
-<?php namespace Illuminate\Foundation;
+<?php namespace Illuminate\Foundation\Publishing;
use Illuminate\Filesystem\Filesystem;
| true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Publishing/ConfigPublisher.php | @@ -1,4 +1,4 @@
-<?php namespace Illuminate\Foundation;
+<?php namespace Illuminate\Foundation\Publishing;
use Illuminate\Filesystem\Filesystem;
| true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Publishing/MigrationPublisher.php | @@ -1,4 +1,4 @@
-<?php namespace Illuminate\Foundation;
+<?php namespace Illuminate\Foundation\Publishing;
use Carbon\Carbon;
use Illuminate\Filesystem\Filesystem; | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Foundation/Publishing/ViewPublisher.php | @@ -1,4 +1,4 @@
-<?php namespace Illuminate\Foundation;
+<?php namespace Illuminate\Foundation\Publishing;
use Illuminate\Filesystem\Filesystem;
| true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Http/Exception/HttpResponseException.php | @@ -1,4 +1,4 @@
-<?php namespace Illuminate\Routing\Exception;
+<?php namespace Illuminate\Http\Exception;
use RuntimeException;
use Symfony\Component\HttpFoundation\Response; | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | src/Illuminate/Routing/Route.php | @@ -8,7 +8,7 @@
use Illuminate\Routing\Matching\MethodValidator;
use Illuminate\Routing\Matching\SchemeValidator;
use Symfony\Component\Routing\Route as SymfonyRoute;
-use Illuminate\Routing\Exception\HttpResponseException;
+use Illuminate\Http\Exception\HttpResponseException;
class Route {
| true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationAssetPublishCommandTest.php | @@ -12,7 +12,7 @@ public function tearDown()
public function testCommandCallsPublisherWithProperPackageName()
{
- $command = new Illuminate\Foundation\Console\AssetPublishCommand($pub = m::mock('Illuminate\Foundation\AssetPublisher'));
+ $command = new Illuminate\Foundation\Console\AssetPublishCommand($pub = m::mock('Illuminate\Foundation\Publishing\AssetPublisher'));
$pub->shouldReceive('publishPackage')->once()->with('foo');
$command->run(new Symfony\Component\Console\Input\ArrayInput(array('package' => 'foo')), new Symfony\Component\Console\Output\NullOutput);
} | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationAssetPublisherTest.php | @@ -12,7 +12,7 @@ public function tearDown()
public function testBasicPathPublishing()
{
- $pub = new Illuminate\Foundation\AssetPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\AssetPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$files->shouldReceive('copyDirectory')->once()->with('foo', __DIR__.'/packages/bar')->andReturn(true);
$this->assertTrue($pub->publish('bar', 'foo'));
@@ -21,13 +21,13 @@ public function testBasicPathPublishing()
public function testPackageAssetPublishing()
{
- $pub = new Illuminate\Foundation\AssetPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\AssetPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$pub->setPackagePath(__DIR__.'/vendor');
$files->shouldReceive('copyDirectory')->once()->with(__DIR__.'/vendor/foo/public', __DIR__.'/packages/foo')->andReturn(true);
$this->assertTrue($pub->publishPackage('foo'));
- $pub = new Illuminate\Foundation\AssetPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\AssetPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$files2->shouldReceive('copyDirectory')->once()->with(__DIR__.'/custom-packages/foo/public', __DIR__.'/packages/foo')->andReturn(true);
$this->assertTrue($pub->publishPackage('foo', __DIR__.'/custom-packages')); | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationConfigPublishCommandTest.php | @@ -12,7 +12,7 @@ public function tearDown()
public function testCommandCallsPublisherWithProperPackageName()
{
- $command = new Illuminate\Foundation\Console\ConfigPublishCommand($pub = m::mock('Illuminate\Foundation\ConfigPublisher'));
+ $command = new Illuminate\Foundation\Console\ConfigPublishCommand($pub = m::mock('Illuminate\Foundation\Publishing\ConfigPublisher'));
$pub->shouldReceive('alreadyPublished')->andReturn(false);
$pub->shouldReceive('publishPackage')->once()->with('foo');
$command->run(new Symfony\Component\Console\Input\ArrayInput(array('package' => 'foo')), new Symfony\Component\Console\Output\NullOutput); | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationConfigPublisherTest.php | @@ -12,15 +12,15 @@ public function tearDown()
public function testPackageConfigPublishing()
{
- $pub = new Illuminate\Foundation\ConfigPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\ConfigPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$pub->setPackagePath(__DIR__.'/vendor');
$files->shouldReceive('isDirectory')->once()->with(__DIR__.'/vendor/foo/bar/src/config')->andReturn(true);
$files->shouldReceive('isDirectory')->once()->with(__DIR__.'/packages/foo/bar')->andReturn(true);
$files->shouldReceive('copyDirectory')->once()->with(__DIR__.'/vendor/foo/bar/src/config', __DIR__.'/packages/foo/bar')->andReturn(true);
$this->assertTrue($pub->publishPackage('foo/bar'));
- $pub = new Illuminate\Foundation\ConfigPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\ConfigPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$files2->shouldReceive('isDirectory')->once()->with(__DIR__.'/custom-packages/foo/bar/src/config')->andReturn(true);
$files2->shouldReceive('isDirectory')->once()->with(__DIR__.'/packages/foo/bar')->andReturn(true);
$files2->shouldReceive('copyDirectory')->once()->with(__DIR__.'/custom-packages/foo/bar/src/config', __DIR__.'/packages/foo/bar')->andReturn(true); | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationViewPublishCommandTest.php | @@ -12,7 +12,7 @@ public function tearDown()
public function testCommandCallsPublisherWithProperPackageName()
{
- $command = new Illuminate\Foundation\Console\ViewPublishCommand($pub = m::mock('Illuminate\Foundation\ViewPublisher'));
+ $command = new Illuminate\Foundation\Console\ViewPublishCommand($pub = m::mock('Illuminate\Foundation\Publishing\ViewPublisher'));
$pub->shouldReceive('publishPackage')->once()->with('foo');
$command->run(new Symfony\Component\Console\Input\ArrayInput(array('package' => 'foo')), new Symfony\Component\Console\Output\NullOutput);
} | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Foundation/FoundationViewPublisherTest.php | @@ -12,15 +12,15 @@ public function tearDown()
public function testPackageViewPublishing()
{
- $pub = new Illuminate\Foundation\ViewPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\ViewPublisher($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$pub->setPackagePath(__DIR__.'/vendor');
$files->shouldReceive('isDirectory')->once()->with(__DIR__.'/vendor/foo/bar/src/views')->andReturn(true);
$files->shouldReceive('isDirectory')->once()->with(__DIR__.'/packages/foo/bar')->andReturn(true);
$files->shouldReceive('copyDirectory')->once()->with(__DIR__.'/vendor/foo/bar/src/views', __DIR__.'/packages/foo/bar')->andReturn(true);
$this->assertTrue($pub->publishPackage('foo/bar'));
- $pub = new Illuminate\Foundation\ViewPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
+ $pub = new Illuminate\Foundation\Publishing\ViewPublisher($files2 = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$files2->shouldReceive('isDirectory')->once()->with(__DIR__.'/custom-packages/foo/bar/src/views')->andReturn(true);
$files2->shouldReceive('isDirectory')->once()->with(__DIR__.'/packages/foo/bar')->andReturn(true);
$files2->shouldReceive('copyDirectory')->once()->with(__DIR__.'/custom-packages/foo/bar/src/views', __DIR__.'/packages/foo/bar')->andReturn(true); | true |
Other | laravel | framework | e8df05c6472c85824e27ea9d56959778ab85f07c.json | Move publishing classes. | tests/Routing/RoutingRouteTest.php | @@ -14,7 +14,7 @@ public function testBasicDispatchingOfRoutes()
$this->assertEquals('hello', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent());
$router = $this->getRouter();
- $router->get('foo/bar', function() { throw new Illuminate\Routing\Exception\HttpResponseException(new Response('hello')); });
+ $router->get('foo/bar', function() { throw new Illuminate\Http\Exception\HttpResponseException(new Response('hello')); });
$this->assertEquals('hello', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent());
$router = $this->getRouter();
| true |
Other | laravel | framework | 0d4b6eecc83ea43c48a3dad18be594167de4d2bc.json | Add test for CapsuleManagerTrait and fixes a typo.
Signed-off-by: crynobone <crynobone@gmail.com> | tests/Support/SupportCapsuleManagerTraitTest.php | @@ -0,0 +1,37 @@
+<?php
+
+use Mockery as m;
+use Illuminate\Container\Container;
+use Illuminate\Support\Traits\CapsuleManagerTrait;
+
+class SupportCapsuleManagerTraitTest extends \PHPUnit_Framework_TestCase {
+
+ use CapsuleManagerTrait;
+
+ public function tearDown()
+ {
+ m::close();
+ }
+
+ public function testSetupContainerForCapsule()
+ {
+ $this->container = null;
+ $app = new Container;
+
+ $this->assertNull($this->setupContainer($app));
+ $this->assertEquals($app, $this->getContainer());
+ $this->assertInstanceOf('\Illuminate\Support\Fluent', $app['config']);
+ }
+
+
+ public function testSetupContainerForCapsuleWhenConfigIsBound()
+ {
+ $this->container = null;
+ $app = new Container;
+ $app['config'] = m::mock('\Illuminate\Config\Repository');
+
+ $this->assertNull($this->setupContainer($app));
+ $this->assertEquals($app, $this->getContainer());
+ $this->assertInstanceOf('\Illuminate\Config\Repository', $app['config']);
+ }
+} | true |
Other | laravel | framework | 0d4b6eecc83ea43c48a3dad18be594167de4d2bc.json | Add test for CapsuleManagerTrait and fixes a typo.
Signed-off-by: crynobone <crynobone@gmail.com> | tests/Support/SupportMacroTraitTest.php | @@ -28,7 +28,7 @@ public function testRegisterMacro()
}
- public function testResgisterMacroAndCallWithoutStatic()
+ public function testRegisterMacroAndCallWithoutStatic()
{
$macroTrait = $this->macroTrait;
$macroTrait::macro(__CLASS__, function() { return 'Taylor'; }); | true |
Other | laravel | framework | 936c734964afc1f2503dec8c7cf32eb360ff4898.json | Update the change log. | src/Illuminate/Foundation/changes.json | @@ -1,7 +1,8 @@
{
"4.3.*": [
{"message": "Allow passing a priority to Eloquent event listeners.", "backport": null},
- {"message": "Tweak 'compile' configuration file for 'files' and 'providers' support.", "backport": null}
+ {"message": "Tweak 'compile' configuration file for 'files' and 'providers' support.", "backport": null},
+ {"message": "Allow method injection via IoC to any controller method.", "backport": null}
],
"4.2.*": [
{"message": "View and Pagination 'Environment' classes renamed to 'Factory'.", "backport": null}, | false |
Other | laravel | framework | 7931724ee9518b82ffd2f7476a4b2af335ae32cc.json | Fix doc block. | src/Illuminate/Foundation/AliasLoader.php | @@ -24,7 +24,9 @@ class AliasLoader {
protected static $instance;
/**
- * Singleton shouln't allow instantiation
+ * Create a new AliasLoader instance.
+ *
+ * @param array $aliases
*/
private function __construct($aliases)
{ | false |
Other | laravel | framework | 5691f12b63f3cbe41d950a26cc0f64d8ce4a7cd3.json | Add default function. | src/Illuminate/Support/ServiceProvider.php | @@ -189,4 +189,14 @@ public function isDeferred()
return $this->defer;
}
+ /**
+ * Get a list of files that should be compiled for the package.
+ *
+ * @return array
+ */
+ public static function compiles()
+ {
+ return [];
+ }
+
} | false |
Other | laravel | framework | 1fa90966dd7867da71d03115d5bb6cdb071f8864.json | Handle new compile config. | src/Illuminate/Foundation/Console/OptimizeCommand.php | @@ -101,11 +101,16 @@ protected function compileClasses()
*/
protected function getClassFiles()
{
- $app = $this->laravel;
-
$core = require __DIR__.'/Optimize/config.php';
- return array_merge($core, $this->laravel['config']['compile']);
+ $files = array_merge($core, $this->laravel['config']['compile.files']);
+
+ foreach ($this->laravel['config']['compile.providers'] as $provider)
+ {
+ $files = array_merge($files, forward_static_call([$provider, 'compiles']));
+ }
+
+ return $files;
}
/** | false |
Other | laravel | framework | b18c7258f7ae8ba3a01a41c272cbf2f7e0b75005.json | Set incremented value on model. | src/Illuminate/Database/Eloquent/Model.php | @@ -1302,9 +1302,26 @@ protected function incrementOrDecrement($column, $amount, $method)
return $query->{$method}($column, $amount);
}
+ $this->incrementOrDecrementAttributeValue($column, $amount, $method);
+
return $query->where($this->getKeyName(), $this->getKey())->{$method}($column, $amount);
}
+ /**
+ * Increment the underlying attribute value and sync with original.
+ *
+ * @param string $column
+ * @param int $amount
+ * @param string $method
+ * @return void
+ */
+ protected function incrementOrDecrementAttributeValue($column, $amount, $method)
+ {
+ $this->{$column} = $this->{$column} + ($method == 'increment' ? $amount : $amount * -1);
+
+ $this->syncOriginalAttribute($column);
+ }
+
/**
* Update the model in the database.
*
@@ -2652,6 +2669,19 @@ public function syncOriginal()
return $this;
}
+ /**
+ * Sync a single original attribute with its current value.
+ *
+ * @param string $attribute
+ * @return \Illuminate\Database\Eloquent\Model
+ */
+ public function syncOriginalAttribute($attribute)
+ {
+ $this->original[$attribute] = $this->attributes[$attribute];
+
+ return $this;
+ }
+
/**
* Determine if the model or a given attribute has been modified.
* | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.