diff --git a/src/Illuminate/Bus/Dispatcher.php b/src/Illuminate/Bus/Dispatcher.php index 268206471598..c8b424f08d3d 100644 --- a/src/Illuminate/Bus/Dispatcher.php +++ b/src/Illuminate/Bus/Dispatcher.php @@ -129,7 +129,7 @@ protected function marshal($command, ArrayAccess $source, array $extras = []) * @return mixed */ protected function getParameterValueForCommand($command, ArrayAccess $source, - ReflectionParameter $parameter, array $extras = array()) + ReflectionParameter $parameter, array $extras = []) { $value = $this->extractValueFromExtras($parameter, $extras) ?: $this->extractValueFromSource($source, $parameter); diff --git a/src/Illuminate/Cache/ArrayStore.php b/src/Illuminate/Cache/ArrayStore.php index 04fee3e69809..c2987aef8915 100755 --- a/src/Illuminate/Cache/ArrayStore.php +++ b/src/Illuminate/Cache/ArrayStore.php @@ -7,7 +7,7 @@ class ArrayStore extends TaggableStore implements StoreInterface { * * @var array */ - protected $storage = array(); + protected $storage = []; /** * Retrieve an item from the cache by key. @@ -94,7 +94,7 @@ public function forget($key) */ public function flush() { - $this->storage = array(); + $this->storage = []; } /** diff --git a/src/Illuminate/Cache/NullStore.php b/src/Illuminate/Cache/NullStore.php index 51d7f5026e09..8045ba673b12 100755 --- a/src/Illuminate/Cache/NullStore.php +++ b/src/Illuminate/Cache/NullStore.php @@ -7,7 +7,7 @@ class NullStore extends TaggableStore implements StoreInterface { * * @var array */ - protected $storage = array(); + protected $storage = []; /** * Retrieve an item from the cache by key. diff --git a/src/Illuminate/Cache/TagSet.php b/src/Illuminate/Cache/TagSet.php index 36df05de3f09..c6e30e024e9e 100644 --- a/src/Illuminate/Cache/TagSet.php +++ b/src/Illuminate/Cache/TagSet.php @@ -14,7 +14,7 @@ class TagSet { * * @var array */ - protected $names = array(); + protected $names = []; /** * Create a new TagSet instance. @@ -23,7 +23,7 @@ class TagSet { * @param array $names * @return void */ - public function __construct(StoreInterface $store, array $names = array()) + public function __construct(StoreInterface $store, array $names = []) { $this->store = $store; $this->names = $names; diff --git a/src/Illuminate/Config/Repository.php b/src/Illuminate/Config/Repository.php index 391d385d357a..b262534ead1d 100644 --- a/src/Illuminate/Config/Repository.php +++ b/src/Illuminate/Config/Repository.php @@ -25,7 +25,7 @@ class Repository implements ArrayAccess, ConfigContract { * @param array $items * @return void */ - public function __construct(array $items = array()) + public function __construct(array $items = []) { $this->items = $items; } diff --git a/src/Illuminate/Console/Application.php b/src/Illuminate/Console/Application.php index 850878f9d1e3..70c7a91914d3 100755 --- a/src/Illuminate/Console/Application.php +++ b/src/Illuminate/Console/Application.php @@ -58,7 +58,7 @@ public function __construct(LaravelApplication $laravel, Dispatcher $events) * @param array $parameters * @return int */ - public function call($command, array $parameters = array()) + public function call($command, array $parameters = []) { $parameters['command'] = $command; diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index 85c774b89fee..b6d7654e4431 100755 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output) * @param array $arguments * @return integer */ - public function call($command, array $arguments = array()) + public function call($command, array $arguments = []) { $instance = $this->getApplication()->find($command); @@ -138,7 +138,7 @@ public function call($command, array $arguments = array()) * @param array $arguments * @return integer */ - public function callSilent($command, array $arguments = array()) + public function callSilent($command, array $arguments = []) { $instance = $this->getApplication()->find($command); diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index 61380ba790f2..fdf0cea2164c 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -26,7 +26,7 @@ class CallbackEvent extends Event { * @param array $parameters * @return void */ - public function __construct($callback, array $parameters = array()) + public function __construct($callback, array $parameters = []) { $this->callback = $callback; $this->parameters = $parameters; diff --git a/src/Illuminate/Console/Scheduling/Schedule.php b/src/Illuminate/Console/Scheduling/Schedule.php index 5e0a850a8363..514aebb3d4d4 100644 --- a/src/Illuminate/Console/Scheduling/Schedule.php +++ b/src/Illuminate/Console/Scheduling/Schedule.php @@ -18,7 +18,7 @@ class Schedule { * @param array $parameters * @return \Illuminate\Console\Scheduling\Event */ - public function call($callback, array $parameters = array()) + public function call($callback, array $parameters = []) { $this->events[] = $event = new CallbackEvent($callback, $parameters); diff --git a/src/Illuminate/Contracts/Auth/Guard.php b/src/Illuminate/Contracts/Auth/Guard.php index 7a02c38d9d3c..9f19f1778cab 100644 --- a/src/Illuminate/Contracts/Auth/Guard.php +++ b/src/Illuminate/Contracts/Auth/Guard.php @@ -29,7 +29,7 @@ public function user(); * @param array $credentials * @return bool */ - public function once(array $credentials = array()); + public function once(array $credentials = []); /** * Attempt to authenticate a user using the given credentials. @@ -39,7 +39,7 @@ public function once(array $credentials = array()); * @param bool $login * @return bool */ - public function attempt(array $credentials = array(), $remember = false, $login = true); + public function attempt(array $credentials = [], $remember = false, $login = true); /** * Attempt to authenticate using HTTP Basic Auth. @@ -63,7 +63,7 @@ public function onceBasic($field = 'email'); * @param array $credentials * @return bool */ - public function validate(array $credentials = array()); + public function validate(array $credentials = []); /** * Log a user into the application. diff --git a/src/Illuminate/Contracts/Console/Application.php b/src/Illuminate/Contracts/Console/Application.php index 0a6586ca5899..417ab351cab2 100644 --- a/src/Illuminate/Contracts/Console/Application.php +++ b/src/Illuminate/Contracts/Console/Application.php @@ -9,7 +9,7 @@ interface Application { * @param array $parameters * @return int */ - public function call($command, array $parameters = array()); + public function call($command, array $parameters = []); /** * Get the output from the last command. diff --git a/src/Illuminate/Contracts/Console/Kernel.php b/src/Illuminate/Contracts/Console/Kernel.php index bce6f1aa8b85..930253904635 100644 --- a/src/Illuminate/Contracts/Console/Kernel.php +++ b/src/Illuminate/Contracts/Console/Kernel.php @@ -18,7 +18,7 @@ public function handle($input, $output = null); * @param array $parameters * @return int */ - public function call($command, array $parameters = array()); + public function call($command, array $parameters = []); /** * Queue an Artisan console command by name. @@ -27,7 +27,7 @@ public function call($command, array $parameters = array()); * @param array $parameters * @return int */ - public function queue($command, array $parameters = array()); + public function queue($command, array $parameters = []); /** * Get all of the commands registered with the console. diff --git a/src/Illuminate/Contracts/Container/Container.php b/src/Illuminate/Contracts/Container/Container.php index 09dc3ff3c48c..fd18a710f301 100644 --- a/src/Illuminate/Contracts/Container/Container.php +++ b/src/Illuminate/Contracts/Container/Container.php @@ -102,7 +102,7 @@ public function when($concrete); * @param array $parameters * @return mixed */ - public function make($abstract, $parameters = array()); + public function make($abstract, $parameters = []); /** * Call the given Closure / class@method and inject its dependencies. @@ -112,7 +112,7 @@ public function make($abstract, $parameters = array()); * @param string|null $defaultMethod * @return mixed */ - public function call($callback, array $parameters = array(), $defaultMethod = null); + public function call($callback, array $parameters = [], $defaultMethod = null); /** * Determine if the given abstract type has been resolved. diff --git a/src/Illuminate/Contracts/Events/Dispatcher.php b/src/Illuminate/Contracts/Events/Dispatcher.php index 01df3e8bbb3d..d911ab7ed793 100644 --- a/src/Illuminate/Contracts/Events/Dispatcher.php +++ b/src/Illuminate/Contracts/Events/Dispatcher.php @@ -27,7 +27,7 @@ public function hasListeners($eventName); * @param array $payload * @return mixed */ - public function until($event, $payload = array()); + public function until($event, $payload = []); /** * Fire an event and call the listeners. @@ -37,7 +37,7 @@ public function until($event, $payload = array()); * @param bool $halt * @return array|null */ - public function fire($event, $payload = array(), $halt = false); + public function fire($event, $payload = [], $halt = false); /** * Get the event that is currently firing. diff --git a/src/Illuminate/Contracts/Foundation/Application.php b/src/Illuminate/Contracts/Foundation/Application.php index 8f21c1c0e7e5..86f062d40b9f 100644 --- a/src/Illuminate/Contracts/Foundation/Application.php +++ b/src/Illuminate/Contracts/Foundation/Application.php @@ -41,7 +41,7 @@ public function registerConfiguredProviders(); * @param bool $force * @return \Illuminate\Support\ServiceProvider */ - public function register($provider, $options = array(), $force = false); + public function register($provider, $options = [], $force = false); /** * Register a deferred provider and service. diff --git a/src/Illuminate/Contracts/Hashing/Hasher.php b/src/Illuminate/Contracts/Hashing/Hasher.php index 0d0e246b8b5d..47ea7d169029 100644 --- a/src/Illuminate/Contracts/Hashing/Hasher.php +++ b/src/Illuminate/Contracts/Hashing/Hasher.php @@ -9,7 +9,7 @@ interface Hasher { * @param array $options * @return string */ - public function make($value, array $options = array()); + public function make($value, array $options = []); /** * Check the given plain value against a hash. @@ -19,7 +19,7 @@ public function make($value, array $options = array()); * @param array $options * @return bool */ - public function check($value, $hashedValue, array $options = array()); + public function check($value, $hashedValue, array $options = []); /** * Check if the given hash has been hashed using the given options. @@ -28,6 +28,6 @@ public function check($value, $hashedValue, array $options = array()); * @param array $options * @return bool */ - public function needsRehash($hashedValue, array $options = array()); + public function needsRehash($hashedValue, array $options = []); } diff --git a/src/Illuminate/Contracts/Logging/Log.php b/src/Illuminate/Contracts/Logging/Log.php index bffac47c9792..a51a02de1d7b 100644 --- a/src/Illuminate/Contracts/Logging/Log.php +++ b/src/Illuminate/Contracts/Logging/Log.php @@ -9,7 +9,7 @@ interface Log { * @param array $context * @return void */ - public function alert($message, array $context = array()); + public function alert($message, array $context = []); /** * Log a critical message to the logs. @@ -18,7 +18,7 @@ public function alert($message, array $context = array()); * @param array $context * @return void */ - public function critical($message, array $context = array()); + public function critical($message, array $context = []); /** * Log an error message to the logs. @@ -27,7 +27,7 @@ public function critical($message, array $context = array()); * @param array $context * @return void */ - public function error($message, array $context = array()); + public function error($message, array $context = []); /** * Log a warning message to the logs. @@ -36,7 +36,7 @@ public function error($message, array $context = array()); * @param array $context * @return void */ - public function warning($message, array $context = array()); + public function warning($message, array $context = []); /** * Log a notice to the logs. @@ -45,7 +45,7 @@ public function warning($message, array $context = array()); * @param array $context * @return void */ - public function notice($message, array $context = array()); + public function notice($message, array $context = []); /** * Log an informational message to the logs. @@ -54,7 +54,7 @@ public function notice($message, array $context = array()); * @param array $context * @return void */ - public function info($message, array $context = array()); + public function info($message, array $context = []); /** * Log a debug message to the logs. @@ -63,7 +63,7 @@ public function info($message, array $context = array()); * @param array $context * @return void */ - public function debug($message, array $context = array()); + public function debug($message, array $context = []); /** * Log a message to the logs. @@ -73,7 +73,7 @@ public function debug($message, array $context = array()); * @param array $context * @return void */ - public function log($level, $message, array $context = array()); + public function log($level, $message, array $context = []); /** * Register a file log handler. diff --git a/src/Illuminate/Contracts/Queue/Queue.php b/src/Illuminate/Contracts/Queue/Queue.php index 5e728e80e8d3..50b31483ce1f 100644 --- a/src/Illuminate/Contracts/Queue/Queue.php +++ b/src/Illuminate/Contracts/Queue/Queue.php @@ -20,7 +20,7 @@ public function push($job, $data = '', $queue = null); * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()); + public function pushRaw($payload, $queue = null, array $options = []); /** * Push a new job onto the queue after a delay. diff --git a/src/Illuminate/Contracts/Redis/Database.php b/src/Illuminate/Contracts/Redis/Database.php index 3f86ea12b7b8..9ba20b2a7e96 100644 --- a/src/Illuminate/Contracts/Redis/Database.php +++ b/src/Illuminate/Contracts/Redis/Database.php @@ -9,6 +9,6 @@ interface Database { * @param array $parameters * @return mixed */ - public function command($method, array $parameters = array()); + public function command($method, array $parameters = []); } diff --git a/src/Illuminate/Contracts/Routing/Registrar.php b/src/Illuminate/Contracts/Routing/Registrar.php index 90f45c6c0e6d..cb0f55471466 100644 --- a/src/Illuminate/Contracts/Routing/Registrar.php +++ b/src/Illuminate/Contracts/Routing/Registrar.php @@ -76,7 +76,7 @@ public function match($methods, $uri, $action); * @param array $options * @return void */ - public function resource($name, $controller, array $options = array()); + public function resource($name, $controller, array $options = []); /** * Create a route group with shared attributes. diff --git a/src/Illuminate/Contracts/Routing/ResponseFactory.php b/src/Illuminate/Contracts/Routing/ResponseFactory.php index fe0209226c1a..694987cdabba 100644 --- a/src/Illuminate/Contracts/Routing/ResponseFactory.php +++ b/src/Illuminate/Contracts/Routing/ResponseFactory.php @@ -10,7 +10,7 @@ interface ResponseFactory { * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function make($content = '', $status = 200, array $headers = array()); + public function make($content = '', $status = 200, array $headers = []); /** * Return a new view response from the application. @@ -21,7 +21,7 @@ public function make($content = '', $status = 200, array $headers = array()); * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function view($view, $data = array(), $status = 200, array $headers = array()); + public function view($view, $data = [], $status = 200, array $headers = array()); /** * Return a new JSON response from the application. @@ -32,7 +32,7 @@ public function view($view, $data = array(), $status = 200, array $headers = arr * @param int $options * @return \Symfony\Component\HttpFoundation\Response */ - public function json($data = array(), $status = 200, array $headers = array(), $options = 0); + public function json($data = [], $status = 200, array $headers = array(), $options = 0); /** * Return a new JSONP response from the application. @@ -44,7 +44,7 @@ public function json($data = array(), $status = 200, array $headers = array(), $ * @param int $options * @return \Symfony\Component\HttpFoundation\Response */ - public function jsonp($callback, $data = array(), $status = 200, array $headers = array(), $options = 0); + public function jsonp($callback, $data = [], $status = 200, array $headers = array(), $options = 0); /** * Return a new streamed response from the application. @@ -54,7 +54,7 @@ public function jsonp($callback, $data = array(), $status = 200, array $headers * @param array $headers * @return \Symfony\Component\HttpFoundation\StreamedResponse */ - public function stream($callback, $status = 200, array $headers = array()); + public function stream($callback, $status = 200, array $headers = []); /** * Create a new file download response. @@ -65,7 +65,7 @@ public function stream($callback, $status = 200, array $headers = array()); * @param null|string $disposition * @return \Symfony\Component\HttpFoundation\BinaryFileResponse */ - public function download($file, $name = null, array $headers = array(), $disposition = 'attachment'); + public function download($file, $name = null, array $headers = [], $disposition = 'attachment'); /** * Create a new redirect response to the given path. @@ -76,7 +76,7 @@ public function download($file, $name = null, array $headers = array(), $disposi * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectTo($path, $status = 302, $headers = array(), $secure = null); + public function redirectTo($path, $status = 302, $headers = [], $secure = null); /** * Create a new redirect response to a named route. @@ -87,7 +87,7 @@ public function redirectTo($path, $status = 302, $headers = array(), $secure = n * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToRoute($route, $parameters = array(), $status = 302, $headers = array()); + public function redirectToRoute($route, $parameters = [], $status = 302, $headers = array()); /** * Create a new redirect response to a controller action. @@ -98,7 +98,7 @@ public function redirectToRoute($route, $parameters = array(), $status = 302, $h * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array()); + public function redirectToAction($action, $parameters = [], $status = 302, $headers = array()); /** * Create a new redirect response, while putting the current URL in the session. @@ -109,7 +109,7 @@ public function redirectToAction($action, $parameters = array(), $status = 302, * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectGuest($path, $status = 302, $headers = array(), $secure = null); + public function redirectGuest($path, $status = 302, $headers = [], $secure = null); /** * Create a new redirect response to the previously intended location. @@ -120,6 +120,6 @@ public function redirectGuest($path, $status = 302, $headers = array(), $secure * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToIntended($default = '/', $status = 302, $headers = array(), $secure = null); + public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null); } diff --git a/src/Illuminate/Contracts/Routing/UrlGenerator.php b/src/Illuminate/Contracts/Routing/UrlGenerator.php index 28fbdd2573f7..66d5ba31456d 100644 --- a/src/Illuminate/Contracts/Routing/UrlGenerator.php +++ b/src/Illuminate/Contracts/Routing/UrlGenerator.php @@ -10,7 +10,7 @@ interface UrlGenerator { * @param bool $secure * @return string */ - public function to($path, $extra = array(), $secure = null); + public function to($path, $extra = [], $secure = null); /** * Generate a secure, absolute URL to the given path. @@ -19,7 +19,7 @@ public function to($path, $extra = array(), $secure = null); * @param array $parameters * @return string */ - public function secure($path, $parameters = array()); + public function secure($path, $parameters = []); /** * Generate a URL to an application asset. @@ -40,7 +40,7 @@ public function asset($path, $secure = null); * * @throws \InvalidArgumentException */ - public function route($name, $parameters = array(), $absolute = true); + public function route($name, $parameters = [], $absolute = true); /** * Get the URL to a controller action. @@ -50,7 +50,7 @@ public function route($name, $parameters = array(), $absolute = true); * @param bool $absolute * @return string */ - public function action($action, $parameters = array(), $absolute = true); + public function action($action, $parameters = [], $absolute = true); /** * Set the root controller namespace. diff --git a/src/Illuminate/Contracts/Validation/Factory.php b/src/Illuminate/Contracts/Validation/Factory.php index 99734d3cda72..e0de3d232369 100644 --- a/src/Illuminate/Contracts/Validation/Factory.php +++ b/src/Illuminate/Contracts/Validation/Factory.php @@ -11,7 +11,7 @@ interface Factory { * @param array $customAttributes * @return \Illuminate\Contracts\Validation\Validator */ - public function make(array $data, array $rules, array $messages = array(), array $customAttributes = array()); + public function make(array $data, array $rules, array $messages = [], array $customAttributes = array()); /** * Register a custom validator extension. diff --git a/src/Illuminate/Contracts/View/Factory.php b/src/Illuminate/Contracts/View/Factory.php index fb4562089a97..db4bfdfe3f6f 100644 --- a/src/Illuminate/Contracts/View/Factory.php +++ b/src/Illuminate/Contracts/View/Factory.php @@ -18,7 +18,7 @@ public function exists($view); * @param array $mergeData * @return \Illuminate\Contracts\View\View */ - public function file($path, $data = array(), $mergeData = array()); + public function file($path, $data = [], $mergeData = array()); /** * Get the evaluated view contents for the given view. @@ -28,7 +28,7 @@ public function file($path, $data = array(), $mergeData = array()); * @param array $mergeData * @return \Illuminate\Contracts\View\View */ - public function make($view, $data = array(), $mergeData = array()); + public function make($view, $data = [], $mergeData = array()); /** * Add a piece of shared data to the environment. diff --git a/src/Illuminate/Cookie/CookieJar.php b/src/Illuminate/Cookie/CookieJar.php index f69207176246..ed60360f1d26 100755 --- a/src/Illuminate/Cookie/CookieJar.php +++ b/src/Illuminate/Cookie/CookieJar.php @@ -24,7 +24,7 @@ class CookieJar implements JarContract { * * @var array */ - protected $queued = array(); + protected $queued = []; /** * Create a new cookie instance. diff --git a/src/Illuminate/Cookie/Middleware/EncryptCookies.php b/src/Illuminate/Cookie/Middleware/EncryptCookies.php index 0198e0ef4168..a2e4db7afde0 100644 --- a/src/Illuminate/Cookie/Middleware/EncryptCookies.php +++ b/src/Illuminate/Cookie/Middleware/EncryptCookies.php @@ -84,7 +84,7 @@ protected function decryptCookie($cookie) */ protected function decryptArray(array $cookie) { - $decrypted = array(); + $decrypted = []; foreach ($cookie as $key => $value) $decrypted[$key] = $this->encrypter->decrypt($value); diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php index f58e5510cad3..6af419bccd71 100755 --- a/src/Illuminate/Database/Connection.php +++ b/src/Illuminate/Database/Connection.php @@ -80,7 +80,7 @@ class Connection implements ConnectionInterface { * * @var array */ - protected $queryLog = array(); + protected $queryLog = []; /** * Indicates whether queries are being logged. @@ -115,7 +115,7 @@ class Connection implements ConnectionInterface { * * @var array */ - protected $config = array(); + protected $config = []; /** * Create a new database connection instance. @@ -126,7 +126,7 @@ class Connection implements ConnectionInterface { * @param array $config * @return void */ - public function __construct(PDO $pdo, $database = '', $tablePrefix = '', array $config = array()) + public function __construct(PDO $pdo, $database = '', $tablePrefix = '', array $config = []) { $this->pdo = $pdo; @@ -249,7 +249,7 @@ public function raw($value) * @param array $bindings * @return mixed */ - public function selectOne($query, $bindings = array()) + public function selectOne($query, $bindings = []) { $records = $this->select($query, $bindings); @@ -263,7 +263,7 @@ public function selectOne($query, $bindings = array()) * @param array $bindings * @return array */ - public function selectFromWriteConnection($query, $bindings = array()) + public function selectFromWriteConnection($query, $bindings = []) { return $this->select($query, $bindings, false); } @@ -276,7 +276,7 @@ public function selectFromWriteConnection($query, $bindings = array()) * @param bool $useReadPdo * @return array */ - public function select($query, $bindings = array(), $useReadPdo = true) + public function select($query, $bindings = [], $useReadPdo = true) { return $this->run($query, $bindings, function($me, $query, $bindings) use ($useReadPdo) { @@ -311,7 +311,7 @@ protected function getPdoForSelect($useReadPdo = true) * @param array $bindings * @return bool */ - public function insert($query, $bindings = array()) + public function insert($query, $bindings = []) { return $this->statement($query, $bindings); } @@ -323,7 +323,7 @@ public function insert($query, $bindings = array()) * @param array $bindings * @return int */ - public function update($query, $bindings = array()) + public function update($query, $bindings = []) { return $this->affectingStatement($query, $bindings); } @@ -335,7 +335,7 @@ public function update($query, $bindings = array()) * @param array $bindings * @return int */ - public function delete($query, $bindings = array()) + public function delete($query, $bindings = []) { return $this->affectingStatement($query, $bindings); } @@ -347,7 +347,7 @@ public function delete($query, $bindings = array()) * @param array $bindings * @return bool */ - public function statement($query, $bindings = array()) + public function statement($query, $bindings = []) { return $this->run($query, $bindings, function($me, $query, $bindings) { @@ -366,7 +366,7 @@ public function statement($query, $bindings = array()) * @param array $bindings * @return int */ - public function affectingStatement($query, $bindings = array()) + public function affectingStatement($query, $bindings = []) { return $this->run($query, $bindings, function($me, $query, $bindings) { @@ -534,7 +534,7 @@ public function pretend(Closure $callback) { $this->pretending = true; - $this->queryLog = array(); + $this->queryLog = []; // Basically to make the database connection "pretend", we will just return // the default values for all the query methods, then we will return an @@ -1017,7 +1017,7 @@ public function getQueryLog() */ public function flushQueryLog() { - $this->queryLog = array(); + $this->queryLog = []; } /** diff --git a/src/Illuminate/Database/ConnectionInterface.php b/src/Illuminate/Database/ConnectionInterface.php index 48d69b3341c1..dc42e121d096 100755 --- a/src/Illuminate/Database/ConnectionInterface.php +++ b/src/Illuminate/Database/ConnectionInterface.php @@ -27,7 +27,7 @@ public function raw($value); * @param array $bindings * @return mixed */ - public function selectOne($query, $bindings = array()); + public function selectOne($query, $bindings = []); /** * Run a select statement against the database. @@ -36,7 +36,7 @@ public function selectOne($query, $bindings = array()); * @param array $bindings * @return array */ - public function select($query, $bindings = array()); + public function select($query, $bindings = []); /** * Run an insert statement against the database. @@ -45,7 +45,7 @@ public function select($query, $bindings = array()); * @param array $bindings * @return bool */ - public function insert($query, $bindings = array()); + public function insert($query, $bindings = []); /** * Run an update statement against the database. @@ -54,7 +54,7 @@ public function insert($query, $bindings = array()); * @param array $bindings * @return int */ - public function update($query, $bindings = array()); + public function update($query, $bindings = []); /** * Run a delete statement against the database. @@ -63,7 +63,7 @@ public function update($query, $bindings = array()); * @param array $bindings * @return int */ - public function delete($query, $bindings = array()); + public function delete($query, $bindings = []); /** * Execute an SQL statement and return the boolean result. @@ -72,7 +72,7 @@ public function delete($query, $bindings = array()); * @param array $bindings * @return bool */ - public function statement($query, $bindings = array()); + public function statement($query, $bindings = []); /** * Run an SQL statement and get the number of rows affected. @@ -81,7 +81,7 @@ public function statement($query, $bindings = array()); * @param array $bindings * @return int */ - public function affectingStatement($query, $bindings = array()); + public function affectingStatement($query, $bindings = []); /** * Run a raw, unprepared query against the PDO connection. diff --git a/src/Illuminate/Database/ConnectionResolver.php b/src/Illuminate/Database/ConnectionResolver.php index 79469b20e50b..b3ec239329b0 100755 --- a/src/Illuminate/Database/ConnectionResolver.php +++ b/src/Illuminate/Database/ConnectionResolver.php @@ -7,7 +7,7 @@ class ConnectionResolver implements ConnectionResolverInterface { * * @var array */ - protected $connections = array(); + protected $connections = []; /** * The default connection name. @@ -22,7 +22,7 @@ class ConnectionResolver implements ConnectionResolverInterface { * @param array $connections * @return void */ - public function __construct(array $connections = array()) + public function __construct(array $connections = []) { foreach ($connections as $name => $connection) { diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index 37dd69fca7a1..5dda439c9c36 100755 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -203,7 +203,7 @@ public function createConnector(array $config) * * @throws \InvalidArgumentException */ - protected function createConnection($driver, PDO $connection, $database, $prefix = '', array $config = array()) + protected function createConnection($driver, PDO $connection, $database, $prefix = '', array $config = []) { if ($this->container->bound($key = "db.connection.{$driver}")) { diff --git a/src/Illuminate/Database/DatabaseManager.php b/src/Illuminate/Database/DatabaseManager.php index 45cde61b577b..5195d30a500c 100755 --- a/src/Illuminate/Database/DatabaseManager.php +++ b/src/Illuminate/Database/DatabaseManager.php @@ -25,14 +25,14 @@ class DatabaseManager implements ConnectionResolverInterface { * * @var array */ - protected $connections = array(); + protected $connections = []; /** * The custom connection resolvers. * * @var array */ - protected $extensions = array(); + protected $extensions = []; /** * Create a new database manager instance. diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index 72ec84780526..c52b27430583 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -28,14 +28,14 @@ class Builder { * * @var array */ - protected $eagerLoad = array(); + protected $eagerLoad = []; /** * All of the registered builder macros. * * @var array */ - protected $macros = array(); + protected $macros = []; /** * A replacement for the typical delete function. @@ -296,7 +296,7 @@ public function update(array $values) * @param array $extra * @return int */ - public function increment($column, $amount = 1, array $extra = array()) + public function increment($column, $amount = 1, array $extra = []) { $extra = $this->addUpdatedAtColumn($extra); @@ -311,7 +311,7 @@ public function increment($column, $amount = 1, array $extra = array()) * @param array $extra * @return int */ - public function decrement($column, $amount = 1, array $extra = array()) + public function decrement($column, $amount = 1, array $extra = []) { $extra = $this->addUpdatedAtColumn($extra); @@ -384,7 +384,7 @@ public function getModels($columns = array('*')) $connection = $this->model->getConnectionName(); - $models = array(); + $models = []; // Once we have the results, we can spin through them and instantiate a fresh // model instance for each records we retrieved from the database. We will @@ -487,7 +487,7 @@ public function getRelation($relation) */ protected function nestedRelations($relation) { - $nested = array(); + $nested = []; // We are basically looking for any relationships that are nested deeper than // the given top-level relationship. We will just check for any relations @@ -765,7 +765,7 @@ public function with($relations) */ protected function parseRelations(array $relations) { - $results = array(); + $results = []; foreach ($relations as $name => $constraints) { @@ -799,7 +799,7 @@ protected function parseRelations(array $relations) */ protected function parseNested($name, $results) { - $progress = array(); + $progress = []; // If the relation has already been set on the result array, we will not set it // again, since that would override any constraints that were already placed diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index ae661431d6cc..151a98ad6f18 100755 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -236,7 +236,7 @@ public function getDictionary($items = null) { $items = is_null($items) ? $this->items : $items; - $dictionary = array(); + $dictionary = []; foreach ($items as $value) { diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 52ea4d582e74..73eb32ab90ed 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -74,49 +74,49 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * * @var array */ - protected $attributes = array(); + protected $attributes = []; /** * The model attribute's original state. * * @var array */ - protected $original = array(); + protected $original = []; /** * The loaded relationships for the model. * * @var array */ - protected $relations = array(); + protected $relations = []; /** * The attributes that should be hidden for arrays. * * @var array */ - protected $hidden = array(); + protected $hidden = []; /** * The attributes that should be visible in arrays. * * @var array */ - protected $visible = array(); + protected $visible = []; /** * The accessors to append to the model's array form. * * @var array */ - protected $appends = array(); + protected $appends = []; /** * The attributes that are mass assignable. * * @var array */ - protected $fillable = array(); + protected $fillable = []; /** * The attributes that aren't mass assignable. @@ -130,35 +130,35 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * * @var array */ - protected $dates = array(); + protected $dates = []; /** * The attributes that should be casted to native types. * * @var array */ - protected $casts = array(); + protected $casts = []; /** * The relationships that should be touched on save. * * @var array */ - protected $touches = array(); + protected $touches = []; /** * User exposed observable events * * @var array */ - protected $observables = array(); + protected $observables = []; /** * The relations to eager load on every query. * * @var array */ - protected $with = array(); + protected $with = []; /** * The class name to be used in polymorphic relations. @@ -200,14 +200,14 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * * @var array */ - protected static $booted = array(); + protected static $booted = []; /** * The array of global scopes on the model. * * @var array */ - protected static $globalScopes = array(); + protected static $globalScopes = []; /** * Indicates if all mass assignment is enabled. @@ -221,7 +221,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * * @var array */ - protected static $mutatorCache = array(); + protected static $mutatorCache = []; /** * The many to many relationship methods. @@ -250,7 +250,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * @param array $attributes * @return void */ - public function __construct(array $attributes = array()) + public function __construct(array $attributes = []) { $this->bootIfNotBooted(); @@ -289,7 +289,7 @@ protected static function boot() { $class = get_called_class(); - static::$mutatorCache[$class] = array(); + static::$mutatorCache[$class] = []; // Here we will extract all of the mutated attributes so that we can quickly // spin through them after we export models to their array form, which we @@ -465,7 +465,7 @@ protected function fillableFromArray(array $attributes) * @param bool $exists * @return static */ - public function newInstance($attributes = array(), $exists = false) + public function newInstance($attributes = [], $exists = false) { // This method just provides a convenient way for us to generate fresh model // instances of this current model. It is particularly useful during the @@ -483,7 +483,7 @@ public function newInstance($attributes = array(), $exists = false) * @param array $attributes * @return static */ - public function newFromBuilder($attributes = array()) + public function newFromBuilder($attributes = []) { $instance = $this->newInstance(array(), true); @@ -526,7 +526,7 @@ public static function hydrate(array $items, $connection = null) * @param string $connection * @return \Illuminate\Database\Eloquent\Collection */ - public static function hydrateRaw($query, $bindings = array(), $connection = null) + public static function hydrateRaw($query, $bindings = [], $connection = null) { $instance = new static; @@ -611,7 +611,7 @@ public static function firstOrNew(array $attributes) * @param array $values * @return static */ - public static function updateOrCreate(array $attributes, array $values = array()) + public static function updateOrCreate(array $attributes, array $values = []) { $instance = static::firstOrNew($attributes); @@ -734,7 +734,7 @@ public static function findOrFail($id, $columns = array('*')) * @param array $with * @return $this */ - public function fresh(array $with = array()) + public function fresh(array $with = []) { $key = $this->getKeyName(); @@ -1453,7 +1453,7 @@ protected function incrementOrDecrementAttributeValue($column, $amount, $method) * @param array $attributes * @return bool|int */ - public function update(array $attributes = array()) + public function update(array $attributes = []) { if ( ! $this->exists) { @@ -1495,7 +1495,7 @@ public function push() * @param array $options * @return bool */ - public function save(array $options = array()) + public function save(array $options = []) { $query = $this->newQueryWithoutScopes(); @@ -1926,7 +1926,7 @@ protected function newBaseQueryBuilder() * @param array $models * @return \Illuminate\Database\Eloquent\Collection */ - public function newCollection(array $models = array()) + public function newCollection(array $models = []) { return new Collection($models); } @@ -2480,7 +2480,7 @@ protected function getArrayableAppends() */ public function relationsToArray() { - $attributes = array(); + $attributes = []; foreach ($this->getArrayableRelations() as $key => $value) { @@ -3028,7 +3028,7 @@ public function isDirty($attributes = null) */ public function getDirty() { - $dirty = array(); + $dirty = []; foreach ($this->attributes as $key => $value) { diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php index 8cd1337619cb..864f1447600d 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php @@ -115,7 +115,7 @@ public function addEagerConstraints(array $models) */ protected function getEagerModelKeys(array $models) { - $keys = array(); + $keys = []; // First we need to gather all of the keys from the parent models so we know what // to query for via the eager loading query. We will add them to an array then @@ -173,7 +173,7 @@ public function match(array $models, Collection $results, $relation) // First we will get to build a dictionary of the child models by their primary // key of the relationship, then we can easily match the children back onto // the parents using that dictionary and the primary key of the children. - $dictionary = array(); + $dictionary = []; foreach ($results as $result) { diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 6c491b0ecd98..1f3811923738 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -41,7 +41,7 @@ class BelongsToMany extends Relation { * * @var array */ - protected $pivotColumns = array(); + protected $pivotColumns = []; /** * Any pivot table restrictions. @@ -195,7 +195,7 @@ protected function hydratePivotRelation(array $models) */ protected function cleanPivotAttributes(Model $model) { - $values = array(); + $values = []; foreach ($model->getAttributes() as $key => $value) { @@ -302,7 +302,7 @@ protected function getAliasedPivotColumns() // We need to alias all of the pivot columns with the "pivot_" prefix so we // can easily extract them out of the models and put them into the pivot // relationships when they are retrieved and hydrated into the models. - $columns = array(); + $columns = []; foreach (array_merge($defaults, $this->pivotColumns) as $column) { @@ -428,7 +428,7 @@ protected function buildDictionary(Collection $results) // First we will build a dictionary of child models keyed by the foreign key // of the relation so that we will easily and quickly match them to their // parents without having a possibly slow inner loops for every models. - $dictionary = array(); + $dictionary = []; foreach ($results as $result) { @@ -484,7 +484,7 @@ public function getRelatedIds() * @param bool $touch * @return \Illuminate\Database\Eloquent\Model */ - public function save(Model $model, array $joining = array(), $touch = true) + public function save(Model $model, array $joining = [], $touch = true) { $model->save(array('touch' => false)); @@ -500,7 +500,7 @@ public function save(Model $model, array $joining = array(), $touch = true) * @param array $joinings * @return array */ - public function saveMany(array $models, array $joinings = array()) + public function saveMany(array $models, array $joinings = []) { foreach ($models as $key => $model) { @@ -590,7 +590,7 @@ public function updateOrCreate(array $attributes, array $values = [], array $joi * @param bool $touch * @return \Illuminate\Database\Eloquent\Model */ - public function create(array $attributes, array $joining = array(), $touch = true) + public function create(array $attributes, array $joining = [], $touch = true) { $instance = $this->related->newInstance($attributes); @@ -611,9 +611,9 @@ public function create(array $attributes, array $joining = array(), $touch = tru * @param array $joinings * @return \Illuminate\Database\Eloquent\Model */ - public function createMany(array $records, array $joinings = array()) + public function createMany(array $records, array $joinings = []) { - $instances = array(); + $instances = []; foreach ($records as $key => $record) { @@ -682,7 +682,7 @@ public function sync($ids, $detaching = true) */ protected function formatSyncList(array $records) { - $results = array(); + $results = []; foreach ($records as $id => $attributes) { @@ -764,7 +764,7 @@ public function updateExistingPivot($id, array $attributes, $touch = true) * @param bool $touch * @return void */ - public function attach($id, array $attributes = array(), $touch = true) + public function attach($id, array $attributes = [], $touch = true) { if ($id instanceof Model) $id = $id->getKey(); @@ -784,7 +784,7 @@ public function attach($id, array $attributes = array(), $touch = true) */ protected function createAttachRecords($ids, array $attributes) { - $records = array(); + $records = []; $timed = ($this->hasPivotColumn($this->createdAt()) || $this->hasPivotColumn($this->updatedAt())); @@ -894,7 +894,7 @@ protected function setTimestampsOnAttach(array $record, $exists = false) * @param bool $touch * @return int */ - public function detach($ids = array(), $touch = true) + public function detach($ids = [], $touch = true) { if ($ids instanceof Model) $ids = (array) $ids->getKey(); @@ -997,7 +997,7 @@ public function newPivotStatementForId($id) * @param bool $exists * @return \Illuminate\Database\Eloquent\Relations\Pivot */ - public function newPivot(array $attributes = array(), $exists = false) + public function newPivot(array $attributes = [], $exists = false) { $pivot = $this->related->newPivot($this->parent, $attributes, $this->table, $exists); @@ -1010,7 +1010,7 @@ public function newPivot(array $attributes = array(), $exists = false) * @param array $attributes * @return \Illuminate\Database\Eloquent\Relations\Pivot */ - public function newExistingPivot(array $attributes = array()) + public function newExistingPivot(array $attributes = []) { return $this->newPivot($attributes, true); } diff --git a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php index 249286e86351..40d8a441d59f 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php @@ -167,7 +167,7 @@ public function match(array $models, Collection $results, $relation) */ protected function buildDictionary(Collection $results) { - $dictionary = array(); + $dictionary = []; $foreign = $this->firstKey; diff --git a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php b/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php index 2102e49ba101..02f12ae1471d 100755 --- a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php @@ -141,7 +141,7 @@ protected function getRelationValue(array $dictionary, $key, $type) */ protected function buildDictionary(Collection $results) { - $dictionary = array(); + $dictionary = []; $foreign = $this->getPlainForeignKey(); @@ -281,7 +281,7 @@ public function create(array $attributes) */ public function createMany(array $records) { - $instances = array(); + $instances = []; foreach ($records as $record) { diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index ecbd0f845fb5..fd4ce133a6b2 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -26,7 +26,7 @@ class MorphTo extends BelongsTo { * * @var array */ - protected $dictionary = array(); + protected $dictionary = []; /* * Indicates if soft-deleted model instances should be fetched. diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php b/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php index 2d8d6ac9da5d..1bafa6f1248a 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php @@ -124,7 +124,7 @@ protected function newPivotQuery() * @param bool $exists * @return \Illuminate\Database\Eloquent\Relations\Pivot */ - public function newPivot(array $attributes = array(), $exists = false) + public function newPivot(array $attributes = [], $exists = false) { $pivot = new MorphPivot($this->parent, $attributes, $this->table, $exists); diff --git a/src/Illuminate/Database/Eloquent/Relations/Pivot.php b/src/Illuminate/Database/Eloquent/Relations/Pivot.php index 365477e05444..a6712fd24d58 100755 --- a/src/Illuminate/Database/Eloquent/Relations/Pivot.php +++ b/src/Illuminate/Database/Eloquent/Relations/Pivot.php @@ -31,7 +31,7 @@ class Pivot extends Model { * * @var array */ - protected $guarded = array(); + protected $guarded = []; /** * Create a new pivot model instance. diff --git a/src/Illuminate/Database/Eloquent/Relations/Relation.php b/src/Illuminate/Database/Eloquent/Relations/Relation.php index 47165f51d392..f4bca83c139f 100755 --- a/src/Illuminate/Database/Eloquent/Relations/Relation.php +++ b/src/Illuminate/Database/Eloquent/Relations/Relation.php @@ -121,7 +121,7 @@ public function touch() * @param array $attributes * @return int */ - public function rawUpdate(array $attributes = array()) + public function rawUpdate(array $attributes = []) { return $this->query->update($attributes); } diff --git a/src/Illuminate/Database/Grammar.php b/src/Illuminate/Database/Grammar.php index e1e600691a5d..ed5bf5dd5c13 100755 --- a/src/Illuminate/Database/Grammar.php +++ b/src/Illuminate/Database/Grammar.php @@ -56,7 +56,7 @@ public function wrap($value, $prefixAlias = false) return $this->wrap($segments[0]).' as '.$this->wrapValue($segments[2]); } - $wrapped = array(); + $wrapped = []; $segments = explode('.', $value); diff --git a/src/Illuminate/Database/Migrations/MigrationCreator.php b/src/Illuminate/Database/Migrations/MigrationCreator.php index e70b627b5422..921321236a68 100755 --- a/src/Illuminate/Database/Migrations/MigrationCreator.php +++ b/src/Illuminate/Database/Migrations/MigrationCreator.php @@ -17,7 +17,7 @@ class MigrationCreator { * * @var array */ - protected $postCreate = array(); + protected $postCreate = []; /** * Create a new migration creator instance. diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php index fcb0e41bd659..fe0235736ddd 100755 --- a/src/Illuminate/Database/Migrations/Migrator.php +++ b/src/Illuminate/Database/Migrations/Migrator.php @@ -38,7 +38,7 @@ class Migrator { * * @var array */ - protected $notes = array(); + protected $notes = []; /** * Create a new migrator instance. @@ -66,7 +66,7 @@ public function __construct(MigrationRepositoryInterface $repository, */ public function run($path, $pretend = false) { - $this->notes = array(); + $this->notes = []; $files = $this->getMigrationFiles($path); @@ -150,7 +150,7 @@ protected function runUp($file, $batch, $pretend) */ public function rollback($pretend = false) { - $this->notes = array(); + $this->notes = []; // We want to pull in the last batch of migrations that ran on the previous // migration operation. We'll then reverse those migrations and run each diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index c9f2c2f57430..343d6f8b3d1f 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -222,7 +222,7 @@ public function select($columns = array('*')) * @param array $bindings * @return \Illuminate\Database\Query\Builder|static */ - public function selectRaw($expression, array $bindings = array()) + public function selectRaw($expression, array $bindings = []) { $this->addSelect(new Expression($expression)); @@ -538,7 +538,7 @@ protected function invalidOperatorAndValue($operator, $value) * @param string $boolean * @return $this */ - public function whereRaw($sql, array $bindings = array(), $boolean = 'and') + public function whereRaw($sql, array $bindings = [], $boolean = 'and') { $type = 'raw'; @@ -556,7 +556,7 @@ public function whereRaw($sql, array $bindings = array(), $boolean = 'and') * @param array $bindings * @return \Illuminate\Database\Query\Builder|static */ - public function orWhereRaw($sql, array $bindings = array()) + public function orWhereRaw($sql, array $bindings = []) { return $this->whereRaw($sql, $bindings, 'or'); } @@ -1084,7 +1084,7 @@ public function orHaving($column, $operator = null, $value = null) * @param string $boolean * @return $this */ - public function havingRaw($sql, array $bindings = array(), $boolean = 'and') + public function havingRaw($sql, array $bindings = [], $boolean = 'and') { $type = 'raw'; @@ -1102,7 +1102,7 @@ public function havingRaw($sql, array $bindings = array(), $boolean = 'and') * @param array $bindings * @return \Illuminate\Database\Query\Builder|static */ - public function orHavingRaw($sql, array $bindings = array()) + public function orHavingRaw($sql, array $bindings = []) { return $this->havingRaw($sql, $bindings, 'or'); } @@ -1153,7 +1153,7 @@ public function oldest($column = 'created_at') * @param array $bindings * @return $this */ - public function orderByRaw($sql, $bindings = array()) + public function orderByRaw($sql, $bindings = []) { $type = 'raw'; @@ -1696,7 +1696,7 @@ public function insert(array $values) // We'll treat every insert like a batch insert so we can easily insert each // of the records into the database consistently. This will make it much // easier on the grammars to just handle one type of record insertion. - $bindings = array(); + $bindings = []; foreach ($values as $record) { @@ -1755,7 +1755,7 @@ public function update(array $values) * @param array $extra * @return int */ - public function increment($column, $amount = 1, array $extra = array()) + public function increment($column, $amount = 1, array $extra = []) { $wrapped = $this->grammar->wrap($column); @@ -1772,7 +1772,7 @@ public function increment($column, $amount = 1, array $extra = array()) * @param array $extra * @return int */ - public function decrement($column, $amount = 1, array $extra = array()) + public function decrement($column, $amount = 1, array $extra = []) { $wrapped = $this->grammar->wrap($column); diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index efbd936d8e1b..9239c31e0372 100755 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -46,7 +46,7 @@ public function compileSelect(Builder $query) */ protected function compileComponents(Builder $query) { - $sql = array(); + $sql = []; foreach ($this->selectComponents as $component) { @@ -126,7 +126,7 @@ protected function compileFrom(Builder $query, $table) */ protected function compileJoins(Builder $query, $joins) { - $sql = array(); + $sql = []; foreach ($joins as $join) { @@ -135,7 +135,7 @@ protected function compileJoins(Builder $query, $joins) // First we need to build all of the "on" clauses for the join. There may be many // of these clauses so we will need to iterate through each one and build them // separately, then we'll join them up into a single string when we're done. - $clauses = array(); + $clauses = []; foreach ($join->clauses as $clause) { @@ -190,7 +190,7 @@ protected function compileJoinConstraint(array $clause) */ protected function compileWheres(Builder $query) { - $sql = array(); + $sql = []; if (is_null($query->wheres)) return ''; @@ -664,7 +664,7 @@ public function compileUpdate(Builder $query, $values) // Each one of the columns in the update statements needs to be wrapped in the // keyword identifiers, also a place-holder needs to be created for each of // the values in the list of bindings so we can make the sets statements. - $columns = array(); + $columns = []; foreach ($values as $key => $value) { diff --git a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php index 7a8df9c4c2b3..811a306ef7ee 100755 --- a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php @@ -60,7 +60,7 @@ public function compileUpdate(Builder $query, $values) */ protected function compileUpdateColumns($values) { - $columns = array(); + $columns = []; // When gathering the columns for an update statement, we'll wrap each of the // columns and convert it to a parameter value. Then we will concatenate a @@ -83,7 +83,7 @@ protected function compileUpdateFrom(Builder $query) { if ( ! isset($query->joins)) return ''; - $froms = array(); + $froms = []; // When using Postgres, updates with joins list the joined tables in the from // clause, which is different than other systems like MySQL. Here, we will @@ -129,7 +129,7 @@ protected function compileUpdateWheres(Builder $query) */ protected function compileUpdateJoinWheres(Builder $query) { - $joinWheres = array(); + $joinWheres = []; // Here we will just loop through all of the join constraints and compile them // all out then implode them. This should give us "where" like syntax after diff --git a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php index 01558d35c25f..541d473762bc 100755 --- a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php @@ -44,7 +44,7 @@ public function compileInsert(Builder $query, array $values) $names = $this->columnize(array_keys(reset($values))); - $columns = array(); + $columns = []; // SQLite requires us to build the multi-row insert as a listing of select with // unions joining them together. So we'll build out this list of columns and @@ -69,7 +69,7 @@ public function compileTruncate(Builder $query) { $sql = array('delete from sqlite_sequence where name = ?' => array($query->from)); - $sql['delete from '.$this->wrapTable($query->from)] = array(); + $sql['delete from '.$this->wrapTable($query->from)] = []; return $sql; } diff --git a/src/Illuminate/Database/Query/JoinClause.php b/src/Illuminate/Database/Query/JoinClause.php index cea79ed4c513..b9e150d1f894 100755 --- a/src/Illuminate/Database/Query/JoinClause.php +++ b/src/Illuminate/Database/Query/JoinClause.php @@ -21,14 +21,14 @@ class JoinClause { * * @var array */ - public $clauses = array(); + public $clauses = []; /** * The "on" bindings for the join. * * @var array */ - public $bindings = array(); + public $bindings = []; /** * Create a new join clause instance. diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 0d91ac6ba28b..61badd332dcb 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -19,14 +19,14 @@ class Blueprint { * * @var array */ - protected $columns = array(); + protected $columns = []; /** * The commands that should be run for the table. * * @var array */ - protected $commands = array(); + protected $commands = []; /** * The storage engine that should be used for the table. @@ -75,7 +75,7 @@ public function toSql(Connection $connection, Grammar $grammar) { $this->addImpliedCommands(); - $statements = array(); + $statements = []; // Each type of command has a corresponding compiler function on the schema // grammar which is used to build the necessary SQL statements to build @@ -709,7 +709,7 @@ public function rememberToken() */ protected function dropIndexCommand($command, $type, $index) { - $columns = array(); + $columns = []; // If the given "index" is actually an array of columns, the developer means // to drop an index merely by specifying the columns involved without the @@ -769,7 +769,7 @@ protected function createIndexName($type, array $columns) * @param array $parameters * @return \Illuminate\Support\Fluent */ - protected function addColumn($type, $name, array $parameters = array()) + protected function addColumn($type, $name, array $parameters = []) { $attributes = array_merge(compact('type', 'name'), $parameters); @@ -801,7 +801,7 @@ public function removeColumn($name) * @param array $parameters * @return \Illuminate\Support\Fluent */ - protected function addCommand($name, array $parameters = array()) + protected function addCommand($name, array $parameters = []) { $this->commands[] = $command = $this->createCommand($name, $parameters); @@ -815,7 +815,7 @@ protected function addCommand($name, array $parameters = array()) * @param array $parameters * @return \Illuminate\Support\Fluent */ - protected function createCommand($name, array $parameters = array()) + protected function createCommand($name, array $parameters = []) { return new Fluent(array_merge(compact('name'), $parameters)); } diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index de2bb9d75fa8..23a91aad9e8f 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -117,7 +117,7 @@ public function compileForeign(Blueprint $blueprint, Fluent $command) */ protected function getColumns(Blueprint $blueprint, $change = false) { - $columns = array(); + $columns = []; foreach ($change ? $blueprint->getChangedColumns() : $blueprint->getAddedColumns() as $column) { diff --git a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php index b0c279eab34a..8a922bd90b20 100755 --- a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -148,7 +148,7 @@ public function compileAdd(Blueprint $blueprint, Fluent $command) $columns = $this->prefixArray('add column', $this->getColumns($blueprint)); - $statements = array(); + $statements = []; foreach ($columns as $column) { diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 11048a91103b..2201ec543254 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -20,28 +20,28 @@ class Dispatcher implements DispatcherContract { * * @var array */ - protected $listeners = array(); + protected $listeners = []; /** * The wildcard listeners. * * @var array */ - protected $wildcards = array(); + protected $wildcards = []; /** * The sorted event listeners. * * @var array */ - protected $sorted = array(); + protected $sorted = []; /** * The event firing stack. * * @var array */ - protected $firing = array(); + protected $firing = []; /** * The queue resolver instance. @@ -116,7 +116,7 @@ public function hasListeners($eventName) * @param array $payload * @return void */ - public function push($event, $payload = array()) + public function push($event, $payload = []) { $this->listen($event.'_pushed', function() use ($event, $payload) { @@ -160,7 +160,7 @@ protected function resolveSubscriber($subscriber) * @param array $payload * @return mixed */ - public function until($event, $payload = array()) + public function until($event, $payload = []) { return $this->fire($event, $payload, true); } @@ -194,7 +194,7 @@ public function firing() * @param bool $halt * @return array|null */ - public function fire($event, $payload = array(), $halt = false) + public function fire($event, $payload = [], $halt = false) { // When the given "event" is actually an object we will assume it is an event // object and use the class as the event name and this event itself as the @@ -204,7 +204,7 @@ public function fire($event, $payload = array(), $halt = false) list($payload, $event) = [[$event], get_class($event)]; } - $responses = array(); + $responses = []; // If an array is not given to us as the payload, we will turn it into one so // we can easily use call_user_func_array on the listeners, passing in the @@ -266,7 +266,7 @@ public function getListeners($eventName) */ protected function getWildcardListeners($eventName) { - $wildcards = array(); + $wildcards = []; foreach ($this->wildcards as $key => $listeners) { @@ -284,7 +284,7 @@ protected function getWildcardListeners($eventName) */ protected function sortListeners($eventName) { - $this->sorted[$eventName] = array(); + $this->sorted[$eventName] = []; // If listeners exist for the given event, we will sort them by the priority // so that we can call them in the correct order. We will cache off these diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index aa45fcca8143..aaa58ec2e6c6 100755 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -284,7 +284,7 @@ public function allFiles($directory) */ public function directories($directory) { - $directories = array(); + $directories = []; foreach (Finder::create()->in($directory)->directories()->depth(0) as $dir) { diff --git a/src/Illuminate/Foundation/AliasLoader.php b/src/Illuminate/Foundation/AliasLoader.php index bd0841773327..09aad6cc7039 100755 --- a/src/Illuminate/Foundation/AliasLoader.php +++ b/src/Illuminate/Foundation/AliasLoader.php @@ -39,7 +39,7 @@ private function __construct($aliases) * @param array $aliases * @return \Illuminate\Foundation\AliasLoader */ - public static function getInstance(array $aliases = array()) + public static function getInstance(array $aliases = []) { if (is_null(static::$instance)) return static::$instance = new static($aliases); diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 73155b344dee..193ae0a3b063 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -48,35 +48,35 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var array */ - protected $bootingCallbacks = array(); + protected $bootingCallbacks = []; /** * The array of booted callbacks. * * @var array */ - protected $bootedCallbacks = array(); + protected $bootedCallbacks = []; /** * All of the registered service providers. * * @var array */ - protected $serviceProviders = array(); + protected $serviceProviders = []; /** * The names of the loaded service providers. * * @var array */ - protected $loadedProviders = array(); + protected $loadedProviders = []; /** * The deferred services and their providers. * * @var array */ - protected $deferredServices = array(); + protected $deferredServices = []; /** * The environment file to load during bootstrapping. @@ -377,7 +377,7 @@ public function registerConfiguredProviders() * @param bool $force * @return \Illuminate\Support\ServiceProvider */ - public function register($provider, $options = array(), $force = false) + public function register($provider, $options = [], $force = false) { if ($registered = $this->getProvider($provider) && ! $force) return $registered; @@ -470,7 +470,7 @@ public function loadDeferredProviders() $this->loadDeferredProvider($service); } - $this->deferredServices = array(); + $this->deferredServices = []; } /** @@ -526,7 +526,7 @@ public function registerDeferredProvider($provider, $service = null) * @param array $parameters * @return mixed */ - public function make($abstract, $parameters = array()) + public function make($abstract, $parameters = []) { $abstract = $this->getAlias($abstract); @@ -715,7 +715,7 @@ public function down(Closure $callback) * * @throws \Symfony\Component\HttpKernel\Exception\HttpException */ - public function abort($code, $message = '', array $headers = array()) + public function abort($code, $message = '', array $headers = []) { if ($code == 404) { diff --git a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php index 53de827a0c3b..e78710c7b581 100644 --- a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php @@ -50,7 +50,7 @@ public function bootstrap(Application $app) * * @throws \ErrorException */ - public function handleError($level, $message, $file = '', $line = 0, $context = array()) + public function handleError($level, $message, $file = '', $line = 0, $context = []) { if (error_reporting() & $level) { diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index c1dc8caf42be..7d4b0ac1b09e 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -118,7 +118,7 @@ protected function schedule(Schedule $schedule) * @param array $parameters * @return int */ - public function call($command, array $parameters = array()) + public function call($command, array $parameters = []) { $this->bootstrap(); @@ -137,7 +137,7 @@ public function call($command, array $parameters = array()) * @param array $parameters * @return void */ - public function queue($command, array $parameters = array()) + public function queue($command, array $parameters = []) { $this->app['Illuminate\Contracts\Queue\Queue']->push( 'Illuminate\Foundation\Console\QueuedJob', func_get_args() diff --git a/src/Illuminate/Foundation/Console/RouteListCommand.php b/src/Illuminate/Foundation/Console/RouteListCommand.php index c85ea05beffc..3e0917ef0d73 100755 --- a/src/Illuminate/Foundation/Console/RouteListCommand.php +++ b/src/Illuminate/Foundation/Console/RouteListCommand.php @@ -81,7 +81,7 @@ public function fire() */ protected function getRoutes() { - $results = array(); + $results = []; foreach ($this->routes as $route) { @@ -143,7 +143,7 @@ protected function getMiddleware($route) */ protected function getPatternFilters($route) { - $patterns = array(); + $patterns = []; foreach ($route->methods() as $method) { diff --git a/src/Illuminate/Foundation/Testing/AssertionsTrait.php b/src/Illuminate/Foundation/Testing/AssertionsTrait.php index c278b5a2049c..5bc1b32b4b2c 100644 --- a/src/Illuminate/Foundation/Testing/AssertionsTrait.php +++ b/src/Illuminate/Foundation/Testing/AssertionsTrait.php @@ -98,7 +98,7 @@ public function assertViewMissing($key) * @param array $with * @return void */ - public function assertRedirectedTo($uri, $with = array()) + public function assertRedirectedTo($uri, $with = []) { PHPUnit::assertInstanceOf('Illuminate\Http\RedirectResponse', $this->response); @@ -115,7 +115,7 @@ public function assertRedirectedTo($uri, $with = array()) * @param array $with * @return void */ - public function assertRedirectedToRoute($name, $parameters = array(), $with = array()) + public function assertRedirectedToRoute($name, $parameters = [], $with = array()) { $this->assertRedirectedTo($this->app['url']->route($name, $parameters), $with); } @@ -128,7 +128,7 @@ public function assertRedirectedToRoute($name, $parameters = array(), $with = ar * @param array $with * @return void */ - public function assertRedirectedToAction($name, $parameters = array(), $with = array()) + public function assertRedirectedToAction($name, $parameters = [], $with = array()) { $this->assertRedirectedTo($this->app['url']->action($name, $parameters), $with); } @@ -182,7 +182,7 @@ public function assertSessionHasAll(array $bindings) * @param mixed $format * @return void */ - public function assertSessionHasErrors($bindings = array(), $format = null) + public function assertSessionHasErrors($bindings = [], $format = null) { $this->assertSessionHas('errors'); diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index b5c5917a0e76..ad4130573e5c 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -13,7 +13,7 @@ * @throws \Symfony\Component\HttpKernel\Exception\HttpException * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ - function abort($code, $message = '', array $headers = array()) + function abort($code, $message = '', array $headers = []) { return app()->abort($code, $message, $headers); } @@ -28,7 +28,7 @@ function abort($code, $message = '', array $headers = array()) * @param array $parameters * @return string */ - function action($name, $parameters = array()) + function action($name, $parameters = []) { return app('url')->action($name, $parameters); } @@ -105,7 +105,7 @@ function base_path($path = '') * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - function back($status = 302, $headers = array()) + function back($status = 302, $headers = []) { return app('redirect')->back($status, $headers); } @@ -120,7 +120,7 @@ function back($status = 302, $headers = array()) * @param array $options * @return string */ - function bcrypt($value, $options = array()) + function bcrypt($value, $options = []) { return app('hash')->make($value, $options); } @@ -238,7 +238,7 @@ function get($uri, $action) * @param array $context * @return void */ - function info($message, $context = array()) + function info($message, $context = []) { return app('log')->info($message, $context); } @@ -253,7 +253,7 @@ function info($message, $context = array()) * @param array $context * @return void */ - function logger($message = null, array $context = array()) + function logger($message = null, array $context = []) { if (is_null($message)) return app('log'); @@ -346,7 +346,7 @@ function public_path($path = '') * @param bool $secure * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse */ - function redirect($to = null, $status = 302, $headers = array(), $secure = null) + function redirect($to = null, $status = 302, $headers = [], $secure = null) { if (is_null($to)) return app('redirect'); @@ -364,7 +364,7 @@ function redirect($to = null, $status = 302, $headers = array(), $secure = null) * @param array $headers * @return \Symfony\Component\HttpFoundation\Response|\Illuminate\Contracts\Routing\ResponseFactory */ - function response($content = '', $status = 200, array $headers = array()) + function response($content = '', $status = 200, array $headers = []) { $factory = app('Illuminate\Contracts\Routing\ResponseFactory'); @@ -388,7 +388,7 @@ function response($content = '', $status = 200, array $headers = array()) * @param \Illuminate\Routing\Route $route * @return string */ - function route($name, $parameters = array(), $absolute = true, $route = null) + function route($name, $parameters = [], $absolute = true, $route = null) { return app('url')->route($name, $parameters, $absolute, $route); } @@ -417,7 +417,7 @@ function secure_asset($path) * @param mixed $parameters * @return string */ - function secure_url($path, $parameters = array()) + function secure_url($path, $parameters = []) { return url($path, $parameters, true); } @@ -469,7 +469,7 @@ function storage_path($path = '') * @param string $locale * @return string */ - function trans($id = null, $parameters = array(), $domain = 'messages', $locale = null) + function trans($id = null, $parameters = [], $domain = 'messages', $locale = null) { if (is_null($id)) return app('translator'); @@ -489,7 +489,7 @@ function trans($id = null, $parameters = array(), $domain = 'messages', $locale * @param string $locale * @return string */ - function trans_choice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) + function trans_choice($id, $number, array $parameters = [], $domain = 'messages', $locale = null) { return app('translator')->transChoice($id, $number, $parameters, $domain, $locale); } @@ -505,7 +505,7 @@ function trans_choice($id, $number, array $parameters = array(), $domain = 'mess * @param bool $secure * @return string */ - function url($path = null, $parameters = array(), $secure = null) + function url($path = null, $parameters = [], $secure = null) { return app('Illuminate\Contracts\Routing\UrlGenerator')->to($path, $parameters, $secure); } @@ -521,7 +521,7 @@ function url($path = null, $parameters = array(), $secure = null) * @param array $mergeData * @return \Illuminate\View\View */ - function view($view = null, $data = array(), $mergeData = array()) + function view($view = null, $data = [], $mergeData = array()) { $factory = app('Illuminate\Contracts\View\Factory'); @@ -582,7 +582,7 @@ function env($key, $default = null) * @param bool $halt * @return array|null */ - function event($event, $payload = array(), $halt = false) + function event($event, $payload = [], $halt = false) { return app('events')->fire($event, $payload, $halt); } diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index ccf6f98d141b..bacb943911eb 100755 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -21,7 +21,7 @@ class BcryptHasher implements HasherContract { * * @throws \RuntimeException */ - public function make($value, array $options = array()) + public function make($value, array $options = []) { $cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds; @@ -43,7 +43,7 @@ public function make($value, array $options = array()) * @param array $options * @return bool */ - public function check($value, $hashedValue, array $options = array()) + public function check($value, $hashedValue, array $options = []) { return password_verify($value, $hashedValue); } @@ -55,7 +55,7 @@ public function check($value, $hashedValue, array $options = array()) * @param array $options * @return bool */ - public function needsRehash($hashedValue, array $options = array()) + public function needsRehash($hashedValue, array $options = []) { $cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds; diff --git a/src/Illuminate/Http/JsonResponse.php b/src/Illuminate/Http/JsonResponse.php index 83a3c2cec513..05e078b3bcbd 100755 --- a/src/Illuminate/Http/JsonResponse.php +++ b/src/Illuminate/Http/JsonResponse.php @@ -22,7 +22,7 @@ class JsonResponse extends BaseJsonResponse { * @param array $headers * @param int $options */ - public function __construct($data = null, $status = 200, $headers = array(), $options = 0) + public function __construct($data = null, $status = 200, $headers = [], $options = 0) { $this->jsonOptions = $options; @@ -44,7 +44,7 @@ public function getData($assoc = false, $depth = 512) /** * {@inheritdoc} */ - public function setData($data = array()) + public function setData($data = []) { $this->data = $data instanceof Jsonable ? $data->toJson($this->jsonOptions) diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index 2d58f94a427f..1e57ae9b363d 100755 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -449,7 +449,7 @@ public function old($key = null, $default = null) * @param array $keys * @return void */ - public function flash($filter = null, $keys = array()) + public function flash($filter = null, $keys = []) { $flash = ( ! is_null($filter)) ? $this->$filter($keys) : $this->input(); diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index a4fb48f619b7..0a8fe9496be8 100755 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -71,7 +71,7 @@ public function __construct(MonologLogger $monolog, Dispatcher $dispatcher = nul * @param array $context * @return void */ - public function emergency($message, array $context = array()) + public function emergency($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -83,7 +83,7 @@ public function emergency($message, array $context = array()) * @param array $context * @return void */ - public function alert($message, array $context = array()) + public function alert($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -95,7 +95,7 @@ public function alert($message, array $context = array()) * @param array $context * @return void */ - public function critical($message, array $context = array()) + public function critical($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -107,7 +107,7 @@ public function critical($message, array $context = array()) * @param array $context * @return void */ - public function error($message, array $context = array()) + public function error($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -119,7 +119,7 @@ public function error($message, array $context = array()) * @param array $context * @return void */ - public function warning($message, array $context = array()) + public function warning($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -131,7 +131,7 @@ public function warning($message, array $context = array()) * @param array $context * @return void */ - public function notice($message, array $context = array()) + public function notice($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -143,7 +143,7 @@ public function notice($message, array $context = array()) * @param array $context * @return void */ - public function info($message, array $context = array()) + public function info($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -155,7 +155,7 @@ public function info($message, array $context = array()) * @param array $context * @return void */ - public function debug($message, array $context = array()) + public function debug($message, array $context = []) { return $this->writeLog(__FUNCTION__, $message, $context); } @@ -168,7 +168,7 @@ public function debug($message, array $context = array()) * @param array $context * @return void */ - public function log($level, $message, array $context = array()) + public function log($level, $message, array $context = []) { return $this->writeLog($level, $message, $context); } @@ -181,7 +181,7 @@ public function log($level, $message, array $context = array()) * @param array $context * @return void */ - public function write($level, $message, array $context = array()) + public function write($level, $message, array $context = []) { return $this->log($level, $message, $context); } @@ -287,7 +287,7 @@ public function listen(Closure $callback) * @param array $context * @return void */ - protected function fireLogEvent($level, $message, array $context = array()) + protected function fireLogEvent($level, $message, array $context = []) { // If the event dispatcher is set, we will pass along the parameters to the // log listeners. These are useful for building profilers or other tools diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index f54d28b3c005..ed30e8a2ca2b 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -76,14 +76,14 @@ class Mailer implements MailerContract, MailQueueContract { * * @var array */ - protected $failedRecipients = array(); + protected $failedRecipients = []; /** * Array of parsed views containing html and text view name. * * @var array */ - protected $parsedViews = array(); + protected $parsedViews = []; /** * Create a new Mailer instance. diff --git a/src/Illuminate/Mail/Message.php b/src/Illuminate/Mail/Message.php index 4085571849a9..eb023a7a21d4 100755 --- a/src/Illuminate/Mail/Message.php +++ b/src/Illuminate/Mail/Message.php @@ -167,7 +167,7 @@ public function priority($level) * @param array $options * @return $this */ - public function attach($file, array $options = array()) + public function attach($file, array $options = []) { $attachment = $this->createAttachmentFromPath($file); @@ -193,7 +193,7 @@ protected function createAttachmentFromPath($file) * @param array $options * @return $this */ - public function attachData($data, $name, array $options = array()) + public function attachData($data, $name, array $options = []) { $attachment = $this->createAttachmentFromData($data, $name); @@ -245,7 +245,7 @@ public function embedData($data, $name, $contentType = null) * @param array $options * @return $this */ - protected function prepAttachment($attachment, $options = array()) + protected function prepAttachment($attachment, $options = []) { // First we will check for a MIME type on the message, which instructs the // mail client on what type of attachment the file is so that it may be diff --git a/src/Illuminate/Pipeline/Pipeline.php b/src/Illuminate/Pipeline/Pipeline.php index f9406f69f0e3..bb0bc3fe5a7f 100644 --- a/src/Illuminate/Pipeline/Pipeline.php +++ b/src/Illuminate/Pipeline/Pipeline.php @@ -25,7 +25,7 @@ class Pipeline implements PipelineContract { * * @var array */ - protected $pipes = array(); + protected $pipes = []; /** * The method to call on each pipe. diff --git a/src/Illuminate/Queue/BeanstalkdQueue.php b/src/Illuminate/Queue/BeanstalkdQueue.php index 34f6780c3496..d4b87858c5e5 100755 --- a/src/Illuminate/Queue/BeanstalkdQueue.php +++ b/src/Illuminate/Queue/BeanstalkdQueue.php @@ -64,7 +64,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { return $this->pheanstalk->useTube($this->getQueue($queue))->put( $payload, Pheanstalk::DEFAULT_PRIORITY, Pheanstalk::DEFAULT_DELAY, $this->timeToRun diff --git a/src/Illuminate/Queue/Console/ListFailedCommand.php b/src/Illuminate/Queue/Console/ListFailedCommand.php index 03bc411bc385..0492aa25f9e9 100644 --- a/src/Illuminate/Queue/Console/ListFailedCommand.php +++ b/src/Illuminate/Queue/Console/ListFailedCommand.php @@ -25,7 +25,7 @@ class ListFailedCommand extends Command { */ public function fire() { - $rows = array(); + $rows = []; foreach ($this->laravel['queue.failer']->all() as $failed) { diff --git a/src/Illuminate/Queue/DatabaseQueue.php b/src/Illuminate/Queue/DatabaseQueue.php index 9927a3ef96f4..97138e6a6db2 100644 --- a/src/Illuminate/Queue/DatabaseQueue.php +++ b/src/Illuminate/Queue/DatabaseQueue.php @@ -75,7 +75,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { return $this->pushToDatabase(0, $queue, $payload); } diff --git a/src/Illuminate/Queue/IronQueue.php b/src/Illuminate/Queue/IronQueue.php index 48b113ca449b..9eecfdcfa875 100755 --- a/src/Illuminate/Queue/IronQueue.php +++ b/src/Illuminate/Queue/IronQueue.php @@ -74,7 +74,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { if ($this->shouldEncrypt) $payload = $this->crypt->encrypt($payload); diff --git a/src/Illuminate/Queue/NullQueue.php b/src/Illuminate/Queue/NullQueue.php index e8d92ef3c202..3c6122a66e75 100644 --- a/src/Illuminate/Queue/NullQueue.php +++ b/src/Illuminate/Queue/NullQueue.php @@ -25,7 +25,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { // } diff --git a/src/Illuminate/Queue/QueueManager.php b/src/Illuminate/Queue/QueueManager.php index 4f8f47a361fc..178825004649 100755 --- a/src/Illuminate/Queue/QueueManager.php +++ b/src/Illuminate/Queue/QueueManager.php @@ -19,7 +19,7 @@ class QueueManager implements FactoryContract, MonitorContract { * * @var array */ - protected $connections = array(); + protected $connections = []; /** * Create a new queue manager instance. diff --git a/src/Illuminate/Queue/RedisQueue.php b/src/Illuminate/Queue/RedisQueue.php index d349eb7ff25b..ca589377ba2a 100644 --- a/src/Illuminate/Queue/RedisQueue.php +++ b/src/Illuminate/Queue/RedisQueue.php @@ -70,7 +70,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { $this->getConnection()->rpush($this->getQueue($queue), $payload); diff --git a/src/Illuminate/Queue/SqsQueue.php b/src/Illuminate/Queue/SqsQueue.php index 7bfd5d7dccec..febb02372b7e 100755 --- a/src/Illuminate/Queue/SqsQueue.php +++ b/src/Illuminate/Queue/SqsQueue.php @@ -54,7 +54,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { $response = $this->sqs->sendMessage(array('QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload)); diff --git a/src/Illuminate/Queue/SyncQueue.php b/src/Illuminate/Queue/SyncQueue.php index 0b836b016e71..e91e4e8d03b8 100755 --- a/src/Illuminate/Queue/SyncQueue.php +++ b/src/Illuminate/Queue/SyncQueue.php @@ -27,7 +27,7 @@ public function push($job, $data = '', $queue = null) * @param array $options * @return mixed */ - public function pushRaw($payload, $queue = null, array $options = array()) + public function pushRaw($payload, $queue = null, array $options = []) { // } diff --git a/src/Illuminate/Redis/Database.php b/src/Illuminate/Redis/Database.php index faddd71ede7f..79119c86b3fa 100755 --- a/src/Illuminate/Redis/Database.php +++ b/src/Illuminate/Redis/Database.php @@ -18,7 +18,7 @@ class Database implements DatabaseContract { * @param array $servers * @return void */ - public function __construct(array $servers = array()) + public function __construct(array $servers = []) { if (isset($servers['cluster']) && $servers['cluster']) { @@ -51,7 +51,7 @@ protected function createAggregateClient(array $servers) */ protected function createSingleClients(array $servers) { - $clients = array(); + $clients = []; foreach ($servers as $key => $server) { @@ -79,7 +79,7 @@ public function connection($name = 'default') * @param array $parameters * @return mixed */ - public function command($method, array $parameters = array()) + public function command($method, array $parameters = []) { return call_user_func_array(array($this->clients['default'], $method), $parameters); } diff --git a/src/Illuminate/Routing/Controller.php b/src/Illuminate/Routing/Controller.php index a422f0308e23..2a6678e5725d 100644 --- a/src/Illuminate/Routing/Controller.php +++ b/src/Illuminate/Routing/Controller.php @@ -18,14 +18,14 @@ abstract class Controller { * * @var array */ - protected $beforeFilters = array(); + protected $beforeFilters = []; /** * The "after" filters registered on the controller. * * @var array */ - protected $afterFilters = array(); + protected $afterFilters = []; /** * The router instance. @@ -41,7 +41,7 @@ abstract class Controller { * @param array $options * @return void */ - public function middleware($middleware, array $options = array()) + public function middleware($middleware, array $options = []) { $this->middleware[$middleware] = $options; } @@ -53,7 +53,7 @@ public function middleware($middleware, array $options = array()) * @param array $options * @return void */ - public function beforeFilter($filter, array $options = array()) + public function beforeFilter($filter, array $options = []) { $this->beforeFilters[] = $this->parseFilter($filter, $options); } @@ -65,7 +65,7 @@ public function beforeFilter($filter, array $options = array()) * @param array $options * @return void */ - public function afterFilter($filter, array $options = array()) + public function afterFilter($filter, array $options = []) { $this->afterFilters[] = $this->parseFilter($filter, $options); } @@ -79,7 +79,7 @@ public function afterFilter($filter, array $options = array()) */ protected function parseFilter($filter, array $options) { - $parameters = array(); + $parameters = []; $original = $filter; diff --git a/src/Illuminate/Routing/ControllerInspector.php b/src/Illuminate/Routing/ControllerInspector.php index d10d476d4afc..96439613eb76 100644 --- a/src/Illuminate/Routing/ControllerInspector.php +++ b/src/Illuminate/Routing/ControllerInspector.php @@ -23,7 +23,7 @@ class ControllerInspector { */ public function getRoutable($controller, $prefix) { - $routable = array(); + $routable = []; $reflection = new ReflectionClass($controller); diff --git a/src/Illuminate/Routing/Redirector.php b/src/Illuminate/Routing/Redirector.php index bc6e39dc6fdc..1d85f2093b86 100755 --- a/src/Illuminate/Routing/Redirector.php +++ b/src/Illuminate/Routing/Redirector.php @@ -48,7 +48,7 @@ public function home($status = 302) * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function back($status = 302, $headers = array()) + public function back($status = 302, $headers = []) { $back = $this->generator->previous(); @@ -62,7 +62,7 @@ public function back($status = 302, $headers = array()) * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function refresh($status = 302, $headers = array()) + public function refresh($status = 302, $headers = []) { return $this->to($this->generator->getRequest()->path(), $status, $headers); } @@ -76,7 +76,7 @@ public function refresh($status = 302, $headers = array()) * @param bool $secure * @return \Illuminate\Http\RedirectResponse */ - public function guest($path, $status = 302, $headers = array(), $secure = null) + public function guest($path, $status = 302, $headers = [], $secure = null) { $this->session->put('url.intended', $this->generator->full()); @@ -92,7 +92,7 @@ public function guest($path, $status = 302, $headers = array(), $secure = null) * @param bool $secure * @return \Illuminate\Http\RedirectResponse */ - public function intended($default = '/', $status = 302, $headers = array(), $secure = null) + public function intended($default = '/', $status = 302, $headers = [], $secure = null) { $path = $this->session->pull('url.intended', $default); @@ -108,7 +108,7 @@ public function intended($default = '/', $status = 302, $headers = array(), $sec * @param bool $secure * @return \Illuminate\Http\RedirectResponse */ - public function to($path, $status = 302, $headers = array(), $secure = null) + public function to($path, $status = 302, $headers = [], $secure = null) { $path = $this->generator->to($path, array(), $secure); @@ -123,7 +123,7 @@ public function to($path, $status = 302, $headers = array(), $secure = null) * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function away($path, $status = 302, $headers = array()) + public function away($path, $status = 302, $headers = []) { return $this->createRedirect($path, $status, $headers); } @@ -136,7 +136,7 @@ public function away($path, $status = 302, $headers = array()) * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function secure($path, $status = 302, $headers = array()) + public function secure($path, $status = 302, $headers = []) { return $this->to($path, $status, $headers, true); } @@ -150,7 +150,7 @@ public function secure($path, $status = 302, $headers = array()) * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function route($route, $parameters = array(), $status = 302, $headers = array()) + public function route($route, $parameters = [], $status = 302, $headers = array()) { $path = $this->generator->route($route, $parameters); @@ -166,7 +166,7 @@ public function route($route, $parameters = array(), $status = 302, $headers = a * @param array $headers * @return \Illuminate\Http\RedirectResponse */ - public function action($action, $parameters = array(), $status = 302, $headers = array()) + public function action($action, $parameters = [], $status = 302, $headers = array()) { $path = $this->generator->action($action, $parameters); diff --git a/src/Illuminate/Routing/ResourceRegistrar.php b/src/Illuminate/Routing/ResourceRegistrar.php index 5a7354170a99..2dace66b5743 100644 --- a/src/Illuminate/Routing/ResourceRegistrar.php +++ b/src/Illuminate/Routing/ResourceRegistrar.php @@ -35,7 +35,7 @@ public function __construct(Router $router) * @param array $options * @return void */ - public function register($name, $controller, array $options = array()) + public function register($name, $controller, array $options = []) { // If the resource name contains a slash, we will assume the developer wishes to // register these resource routes with a prefix so we will set that up out of diff --git a/src/Illuminate/Routing/ResponseFactory.php b/src/Illuminate/Routing/ResponseFactory.php index 82b49e202c7c..4ec7d1be45a1 100644 --- a/src/Illuminate/Routing/ResponseFactory.php +++ b/src/Illuminate/Routing/ResponseFactory.php @@ -49,7 +49,7 @@ public function __construct(ViewFactory $view, Redirector $redirector) * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function make($content = '', $status = 200, array $headers = array()) + public function make($content = '', $status = 200, array $headers = []) { return new Response($content, $status, $headers); } @@ -63,7 +63,7 @@ public function make($content = '', $status = 200, array $headers = array()) * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function view($view, $data = array(), $status = 200, array $headers = array()) + public function view($view, $data = [], $status = 200, array $headers = array()) { return static::make($this->view->make($view, $data), $status, $headers); } @@ -77,7 +77,7 @@ public function view($view, $data = array(), $status = 200, array $headers = arr * @param int $options * @return \Symfony\Component\HttpFoundation\Response */ - public function json($data = array(), $status = 200, array $headers = array(), $options = 0) + public function json($data = [], $status = 200, array $headers = array(), $options = 0) { if ($data instanceof Arrayable) { @@ -97,7 +97,7 @@ public function json($data = array(), $status = 200, array $headers = array(), $ * @param int $options * @return \Symfony\Component\HttpFoundation\Response */ - public function jsonp($callback, $data = array(), $status = 200, array $headers = array(), $options = 0) + public function jsonp($callback, $data = [], $status = 200, array $headers = array(), $options = 0) { return $this->json($data, $status, $headers, $options)->setCallback($callback); } @@ -110,7 +110,7 @@ public function jsonp($callback, $data = array(), $status = 200, array $headers * @param array $headers * @return \Symfony\Component\HttpFoundation\StreamedResponse */ - public function stream($callback, $status = 200, array $headers = array()) + public function stream($callback, $status = 200, array $headers = []) { return new StreamedResponse($callback, $status, $headers); } @@ -124,7 +124,7 @@ public function stream($callback, $status = 200, array $headers = array()) * @param null|string $disposition * @return \Symfony\Component\HttpFoundation\BinaryFileResponse */ - public function download($file, $name = null, array $headers = array(), $disposition = 'attachment') + public function download($file, $name = null, array $headers = [], $disposition = 'attachment') { $response = new BinaryFileResponse($file, 200, $headers, true, $disposition); @@ -145,7 +145,7 @@ public function download($file, $name = null, array $headers = array(), $disposi * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectTo($path, $status = 302, $headers = array(), $secure = null) + public function redirectTo($path, $status = 302, $headers = [], $secure = null) { return $this->redirector->to($path, $status, $headers, $secure); } @@ -159,7 +159,7 @@ public function redirectTo($path, $status = 302, $headers = array(), $secure = n * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToRoute($route, $parameters = array(), $status = 302, $headers = array()) + public function redirectToRoute($route, $parameters = [], $status = 302, $headers = array()) { return $this->redirector->route($route, $parameters, $status, $headers); } @@ -173,7 +173,7 @@ public function redirectToRoute($route, $parameters = array(), $status = 302, $h * @param array $headers * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array()) + public function redirectToAction($action, $parameters = [], $status = 302, $headers = array()) { return $this->redirector->action($action, $parameters, $status, $headers); } @@ -187,7 +187,7 @@ public function redirectToAction($action, $parameters = array(), $status = 302, * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectGuest($path, $status = 302, $headers = array(), $secure = null) + public function redirectGuest($path, $status = 302, $headers = [], $secure = null) { return $this->redirector->guest($path, $status, $headers, $secure); } @@ -201,7 +201,7 @@ public function redirectGuest($path, $status = 302, $headers = array(), $secure * @param bool $secure * @return \Symfony\Component\HttpFoundation\Response */ - public function redirectToIntended($default = '/', $status = 302, $headers = array(), $secure = null) + public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null) { return $this->redirector->intended($default, $status, $headers, $secure); } diff --git a/src/Illuminate/Routing/Route.php b/src/Illuminate/Routing/Route.php index 47975f04f59f..08d84a28ae65 100755 --- a/src/Illuminate/Routing/Route.php +++ b/src/Illuminate/Routing/Route.php @@ -43,14 +43,14 @@ class Route { * * @var array */ - protected $defaults = array(); + protected $defaults = []; /** * The regular expression requirements. * * @var array */ - protected $wheres = array(); + protected $wheres = []; /** * The array of matched parameters. @@ -318,7 +318,7 @@ protected static function explodeFilters($filters) */ protected static function explodeArrayFilters(array $filters) { - $results = array(); + $results = []; foreach ($filters as $filter) { diff --git a/src/Illuminate/Routing/RouteCollection.php b/src/Illuminate/Routing/RouteCollection.php index ebe74b64f0cc..ed01d73e18c1 100644 --- a/src/Illuminate/Routing/RouteCollection.php +++ b/src/Illuminate/Routing/RouteCollection.php @@ -15,28 +15,28 @@ class RouteCollection implements Countable, IteratorAggregate { * * @var array */ - protected $routes = array(); + protected $routes = []; /** * An flattened array of all of the routes. * * @var array */ - protected $allRoutes = array(); + protected $allRoutes = []; /** * A look-up table of routes by their names. * * @var array */ - protected $nameList = array(); + protected $nameList = []; /** * A look-up table of routes by controller action. * * @var array */ - protected $actionList = array(); + protected $actionList = []; /** * Add a Route instance to the collection. @@ -158,7 +158,7 @@ protected function checkForAlternateVerbs($request) // Here we will spin through all verbs except for the current request verb and // check to see if any routes respond to them. If they do, we will return a // proper error response with the correct headers on the response string. - $others = array(); + $others = []; foreach ($methods as $method) { diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index e8f132df25af..69bd53ad5389 100755 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -63,35 +63,35 @@ class Router implements RegistrarContract { * * @var array */ - protected $patternFilters = array(); + protected $patternFilters = []; /** * The registered regular expression based filters. * * @var array */ - protected $regexFilters = array(); + protected $regexFilters = []; /** * The registered route value binders. * * @var array */ - protected $binders = array(); + protected $binders = []; /** * The globally available parameter patterns. * * @var array */ - protected $patterns = array(); + protected $patterns = []; /** * The route group attribute stack. * * @var array */ - protected $groupStack = array(); + protected $groupStack = []; /** * All of the verbs supported by the router. @@ -235,7 +235,7 @@ public function controllers(array $controllers) * @param array $names * @return void */ - public function controller($uri, $controller, $names = array()) + public function controller($uri, $controller, $names = []) { $prepended = $controller; @@ -321,7 +321,7 @@ public function resources(array $resources) * @param array $options * @return void */ - public function resource($name, $controller, array $options = array()) + public function resource($name, $controller, array $options = []) { (new ResourceRegistrar($this))->register($name, $controller, $options); } @@ -1033,7 +1033,7 @@ protected function callPatternFilters($route, $request) */ public function findPatternFilters($request) { - $results = array(); + $results = []; list($path, $method) = array($request->path(), $request->getMethod()); @@ -1075,7 +1075,7 @@ public function findPatternFilters($request) */ protected function patternsByMethod($method, $filters) { - $results = array(); + $results = []; foreach ($filters as $filter) { diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index d1e240e8c412..dea71c294f0d 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -127,7 +127,7 @@ public function previous() * @param bool|null $secure * @return string */ - public function to($path, $extra = array(), $secure = null) + public function to($path, $extra = [], $secure = null) { // First we will check if the URL is already a valid URL. If it is we will not // try to generate a new one but will simply return the URL as is, which is @@ -157,7 +157,7 @@ public function to($path, $extra = array(), $secure = null) * @param array $parameters * @return string */ - public function secure($path, $parameters = array()) + public function secure($path, $parameters = []) { return $this->to($path, $parameters, true); } @@ -242,7 +242,7 @@ public function forceSchema($schema) * * @throws \InvalidArgumentException */ - public function route($name, $parameters = array(), $absolute = true) + public function route($name, $parameters = [], $absolute = true) { if ( ! is_null($route = $this->routes->getByName($name))) { @@ -361,7 +361,7 @@ protected function formatParameters($parameters) * @param array $parameters * @return array */ - protected function replaceRoutableParameters($parameters = array()) + protected function replaceRoutableParameters($parameters = []) { $parameters = is_array($parameters) ? $parameters : array($parameters); @@ -519,7 +519,7 @@ protected function getRouteScheme($route) * @param bool $absolute * @return string */ - public function action($action, $parameters = array(), $absolute = true) + public function action($action, $parameters = [], $absolute = true) { if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) { diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index 41a3593e3865..4df2b847c0fa 100755 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -27,14 +27,14 @@ class Store implements SessionInterface { * * @var array */ - protected $attributes = array(); + protected $attributes = []; /** * The session bags. * * @var array */ - protected $bags = array(); + protected $bags = []; /** * The meta-data bag instance. @@ -48,7 +48,7 @@ class Store implements SessionInterface { * * @var array */ - protected $bagData = array(); + protected $bagData = []; /** * The session handler implementation. @@ -213,7 +213,7 @@ public function setName($name) */ public function invalidate($lifetime = null) { - $this->attributes = array(); + $this->attributes = []; return $this->migrate(); } @@ -512,7 +512,7 @@ public function forget($key) */ public function clear() { - $this->attributes = array(); + $this->attributes = []; foreach ($this->bags as $bag) { diff --git a/src/Illuminate/Support/Arr.php b/src/Illuminate/Support/Arr.php index df6b86c660b1..a91d16ea375c 100755 --- a/src/Illuminate/Support/Arr.php +++ b/src/Illuminate/Support/Arr.php @@ -34,7 +34,7 @@ public static function add($array, $key, $value) */ public static function build($array, Closure $callback) { - $results = array(); + $results = []; foreach ($array as $key => $value) { @@ -66,7 +66,7 @@ public static function divide($array) */ public static function dot($array, $prepend = '') { - $results = array(); + $results = []; foreach ($array as $key => $value) { @@ -106,7 +106,7 @@ public static function fetch($array, $key) { foreach (explode('.', $key) as $segment) { - $results = array(); + $results = []; foreach ($array as $value) { @@ -161,7 +161,7 @@ public static function last($array, $callback, $default = null) */ public static function flatten($array) { - $return = array(); + $return = []; array_walk_recursive($array, function($x) use (&$return) { $return[] = $x; }); @@ -275,7 +275,7 @@ public static function only($array, $keys) */ public static function pluck($array, $value, $key = null) { - $results = array(); + $results = []; foreach ($array as $item) { @@ -341,7 +341,7 @@ public static function set(&$array, $key, $value) // values at the correct depth. Then we'll keep digging into the array. if ( ! isset($array[$key]) || ! is_array($array[$key])) { - $array[$key] = array(); + $array[$key] = []; } $array =& $array[$key]; @@ -373,7 +373,7 @@ public static function sort($array, Closure $callback) */ public static function where($array, Closure $callback) { - $filtered = array(); + $filtered = []; foreach ($array as $key => $value) { diff --git a/src/Illuminate/Support/ClassLoader.php b/src/Illuminate/Support/ClassLoader.php index 88cbde64ef45..db6368fcc7ef 100644 --- a/src/Illuminate/Support/ClassLoader.php +++ b/src/Illuminate/Support/ClassLoader.php @@ -7,7 +7,7 @@ class ClassLoader { * * @var array */ - protected static $directories = array(); + protected static $directories = []; /** * Indicates if a ClassLoader has been registered. @@ -86,7 +86,7 @@ public static function removeDirectories($directories = null) { if (is_null($directories)) { - static::$directories = array(); + static::$directories = []; } else { diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index ed4689759f7a..fc7ffc27385a 100755 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -17,7 +17,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * * @var array */ - protected $items = array(); + protected $items = []; /** * Create a new collection. @@ -25,7 +25,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * @param mixed $items * @return void */ - public function __construct($items = array()) + public function __construct($items = []) { $items = is_null($items) ? [] : $this->getArrayableItems($items); @@ -60,7 +60,7 @@ public function all() */ public function collapse() { - $results = array(); + $results = []; foreach ($this->items as $values) { @@ -231,7 +231,7 @@ public function get($key, $default = null) */ public function groupBy($groupBy) { - $results = array(); + $results = []; foreach ($this->items as $key => $value) { @@ -593,7 +593,7 @@ public function sort(Closure $callback) */ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) { - $results = array(); + $results = []; if (is_string($callback)) $callback = $this->valueRetriever($callback); @@ -642,7 +642,7 @@ public function sortByDesc($callback, $options = SORT_REGULAR) * @param mixed $replacement * @return static */ - public function splice($offset, $length = 0, $replacement = array()) + public function splice($offset, $length = 0, $replacement = []) { return new static(array_splice($this->items, $offset, $length, $replacement)); } diff --git a/src/Illuminate/Support/Facades/Facade.php b/src/Illuminate/Support/Facades/Facade.php index 9882b56333d7..8b9a919f1161 100755 --- a/src/Illuminate/Support/Facades/Facade.php +++ b/src/Illuminate/Support/Facades/Facade.php @@ -166,7 +166,7 @@ public static function clearResolvedInstance($name) */ public static function clearResolvedInstances() { - static::$resolvedInstance = array(); + static::$resolvedInstance = []; } /** diff --git a/src/Illuminate/Support/Fluent.php b/src/Illuminate/Support/Fluent.php index 69aa564f7065..53495c397da7 100755 --- a/src/Illuminate/Support/Fluent.php +++ b/src/Illuminate/Support/Fluent.php @@ -12,7 +12,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable { * * @var array */ - protected $attributes = array(); + protected $attributes = []; /** * Create a new fluent container instance. @@ -20,7 +20,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable { * @param array|object $attributes * @return void */ - public function __construct($attributes = array()) + public function __construct($attributes = []) { foreach ($attributes as $key => $value) { diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index aee3c061b0bb..84b681e1ddce 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -17,14 +17,14 @@ abstract class Manager { * * @var array */ - protected $customCreators = array(); + protected $customCreators = []; /** * The array of created "drivers". * * @var array */ - protected $drivers = array(); + protected $drivers = []; /** * Create a new manager instance. diff --git a/src/Illuminate/Support/MessageBag.php b/src/Illuminate/Support/MessageBag.php index 2c7793facb20..4fb9a4d7cd8e 100755 --- a/src/Illuminate/Support/MessageBag.php +++ b/src/Illuminate/Support/MessageBag.php @@ -14,7 +14,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me * * @var array */ - protected $messages = array(); + protected $messages = []; /** * Default format for message output. @@ -29,7 +29,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me * @param array $messages * @return void */ - public function __construct(array $messages = array()) + public function __construct(array $messages = []) { foreach ($messages as $key => $value) { @@ -153,7 +153,7 @@ public function all($format = null) { $format = $this->checkFormat($format); - $all = array(); + $all = []; foreach ($this->messages as $key => $messages) { diff --git a/src/Illuminate/Support/NamespacedItemResolver.php b/src/Illuminate/Support/NamespacedItemResolver.php index 6c3366ed33f4..809c602b57cc 100755 --- a/src/Illuminate/Support/NamespacedItemResolver.php +++ b/src/Illuminate/Support/NamespacedItemResolver.php @@ -7,7 +7,7 @@ class NamespacedItemResolver { * * @var array */ - protected $parsed = array(); + protected $parsed = []; /** * Parse a key into namespace, group, and item. diff --git a/src/Illuminate/Support/Traits/Macroable.php b/src/Illuminate/Support/Traits/Macroable.php index 7cf7450c178b..d9b083031735 100644 --- a/src/Illuminate/Support/Traits/Macroable.php +++ b/src/Illuminate/Support/Traits/Macroable.php @@ -10,7 +10,7 @@ trait Macroable { * * @var array */ - protected static $macros = array(); + protected static $macros = []; /** * Register a custom macro. diff --git a/src/Illuminate/Translation/FileLoader.php b/src/Illuminate/Translation/FileLoader.php index f455e604b3c8..7b73fc0ee74a 100755 --- a/src/Illuminate/Translation/FileLoader.php +++ b/src/Illuminate/Translation/FileLoader.php @@ -23,7 +23,7 @@ class FileLoader implements LoaderInterface { * * @var array */ - protected $hints = array(); + protected $hints = []; /** * Create a new file loader instance. diff --git a/src/Illuminate/Translation/Translator.php b/src/Illuminate/Translation/Translator.php index cc2476ba0210..5c4a8434f111 100755 --- a/src/Illuminate/Translation/Translator.php +++ b/src/Illuminate/Translation/Translator.php @@ -33,7 +33,7 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface { * * @var array */ - protected $loaded = array(); + protected $loaded = []; /** * Create a new translator instance. @@ -68,7 +68,7 @@ public function has($key, $locale = null) * @param string $locale * @return string */ - public function get($key, array $replace = array(), $locale = null) + public function get($key, array $replace = [], $locale = null) { list($namespace, $group, $item) = $this->parseKey($key); @@ -160,7 +160,7 @@ protected function sortReplacements(array $replace) * @param string $locale * @return string */ - public function choice($key, $number, array $replace = array(), $locale = null) + public function choice($key, $number, array $replace = [], $locale = null) { $line = $this->get($key, $replace, $locale = $locale ?: $this->locale); @@ -178,7 +178,7 @@ public function choice($key, $number, array $replace = array(), $locale = null) * @param string $locale * @return string */ - public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null) + public function trans($id, array $parameters = [], $domain = 'messages', $locale = null) { return $this->get($id, $parameters, $locale); } @@ -193,7 +193,7 @@ public function trans($id, array $parameters = array(), $domain = 'messages', $l * @param string $locale * @return string */ - public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) + public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null) { return $this->choice($id, $number, $parameters, $locale); } diff --git a/src/Illuminate/Validation/DatabasePresenceVerifier.php b/src/Illuminate/Validation/DatabasePresenceVerifier.php index 2558f6236aa1..8a966be4da3e 100755 --- a/src/Illuminate/Validation/DatabasePresenceVerifier.php +++ b/src/Illuminate/Validation/DatabasePresenceVerifier.php @@ -40,7 +40,7 @@ public function __construct(ConnectionResolverInterface $db) * @param array $extra * @return int */ - public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = array()) + public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) { $query = $this->table($collection)->where($column, '=', $value); @@ -66,7 +66,7 @@ public function getCount($collection, $column, $value, $excludeId = null, $idCol * @param array $extra * @return int */ - public function getMultiCount($collection, $column, array $values, array $extra = array()) + public function getMultiCount($collection, $column, array $values, array $extra = []) { $query = $this->table($collection)->whereIn($column, $values); diff --git a/src/Illuminate/Validation/Factory.php b/src/Illuminate/Validation/Factory.php index b38624c83dfd..6d44836ce21f 100755 --- a/src/Illuminate/Validation/Factory.php +++ b/src/Illuminate/Validation/Factory.php @@ -33,28 +33,28 @@ class Factory implements FactoryContract { * * @var array */ - protected $extensions = array(); + protected $extensions = []; /** * All of the custom implicit validator extensions. * * @var array */ - protected $implicitExtensions = array(); + protected $implicitExtensions = []; /** * All of the custom validator message replacers. * * @var array */ - protected $replacers = array(); + protected $replacers = []; /** * All of the fallback messages for custom rules. * * @var array */ - protected $fallbackMessages = array(); + protected $fallbackMessages = []; /** * The Validator resolver instance. @@ -85,7 +85,7 @@ public function __construct(TranslatorInterface $translator, Container $containe * @param array $customAttributes * @return \Illuminate\Validation\Validator */ - public function make(array $data, array $rules, array $messages = array(), array $customAttributes = array()) + public function make(array $data, array $rules, array $messages = [], array $customAttributes = array()) { // The presence verifier is responsible for checking the unique and exists data // for the validator. It is behind an interface so that multiple versions of diff --git a/src/Illuminate/Validation/PresenceVerifierInterface.php b/src/Illuminate/Validation/PresenceVerifierInterface.php index 32fd3f4872cb..dc81a52f48b6 100755 --- a/src/Illuminate/Validation/PresenceVerifierInterface.php +++ b/src/Illuminate/Validation/PresenceVerifierInterface.php @@ -13,7 +13,7 @@ interface PresenceVerifierInterface { * @param array $extra * @return int */ - public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = array()); + public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []); /** * Count the number of objects in a collection with the given values. @@ -24,6 +24,6 @@ public function getCount($collection, $column, $value, $excludeId = null, $idCol * @param array $extra * @return int */ - public function getMultiCount($collection, $column, array $values, array $extra = array()); + public function getMultiCount($collection, $column, array $values, array $extra = []); } diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index db71484326a8..f0e766b2678c 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -44,7 +44,7 @@ class Validator implements ValidatorContract { * * @var array */ - protected $failedRules = array(); + protected $failedRules = []; /** * The message bag instance. @@ -65,7 +65,7 @@ class Validator implements ValidatorContract { * * @var array */ - protected $files = array(); + protected $files = []; /** * The rules to be applied to the data. @@ -79,49 +79,49 @@ class Validator implements ValidatorContract { * * @var array */ - protected $after = array(); + protected $after = []; /** * The array of custom error messages. * * @var array */ - protected $customMessages = array(); + protected $customMessages = []; /** * The array of fallback error messages. * * @var array */ - protected $fallbackMessages = array(); + protected $fallbackMessages = []; /** * The array of custom attribute names. * * @var array */ - protected $customAttributes = array(); + protected $customAttributes = []; /** * The array of custom displayabled values. * * @var array */ - protected $customValues = array(); + protected $customValues = []; /** * All of the custom validator extensions. * * @var array */ - protected $extensions = array(); + protected $extensions = []; /** * All of the custom replacer extensions. * * @var array */ - protected $replacers = array(); + protected $replacers = []; /** * The size related validation rules. @@ -156,7 +156,7 @@ class Validator implements ValidatorContract { * @param array $customAttributes * @return void */ - public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array()) + public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = array()) { $this->translator = $translator; $this->customMessages = $messages; @@ -176,7 +176,7 @@ protected function parseData(array $data, $arrayKey = null) { if (is_null($arrayKey)) { - $this->files = array(); + $this->files = []; } foreach ($data as $key => $value) @@ -1133,7 +1133,7 @@ protected function getExtraExistConditions(array $parameters) */ protected function getExtraConditions(array $segments) { - $extra = array(); + $extra = []; $count = count($segments); @@ -1639,7 +1639,7 @@ protected function doReplacements($message, $attribute, $rule, $parameters) */ protected function getAttributeList(array $values) { - $attributes = array(); + $attributes = []; // For each attribute in the list we will simply get its displayable form as // this is convenient when replacing lists of parameters like some of the diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index b68fdf941c8a..04c9bbbf62cb 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -9,7 +9,7 @@ class BladeCompiler extends Compiler implements CompilerInterface { * * @var array */ - protected $extensions = array(); + protected $extensions = []; /** * The file currently being compiled. @@ -63,7 +63,7 @@ class BladeCompiler extends Compiler implements CompilerInterface { * * @var array */ - protected $footer = array(); + protected $footer = []; /** * Counter to keep track of nested forelse statements. @@ -80,7 +80,7 @@ class BladeCompiler extends Compiler implements CompilerInterface { */ public function compile($path = null) { - $this->footer = array(); + $this->footer = []; if ($path) { diff --git a/src/Illuminate/View/Engines/CompilerEngine.php b/src/Illuminate/View/Engines/CompilerEngine.php index 1fe35241240a..bf4b3bc371f0 100755 --- a/src/Illuminate/View/Engines/CompilerEngine.php +++ b/src/Illuminate/View/Engines/CompilerEngine.php @@ -17,7 +17,7 @@ class CompilerEngine extends PhpEngine { * * @var array */ - protected $lastCompiled = array(); + protected $lastCompiled = []; /** * Create a new Blade view engine instance. @@ -37,7 +37,7 @@ public function __construct(CompilerInterface $compiler) * @param array $data * @return string */ - public function get($path, array $data = array()) + public function get($path, array $data = []) { $this->lastCompiled[] = $path; diff --git a/src/Illuminate/View/Engines/EngineInterface.php b/src/Illuminate/View/Engines/EngineInterface.php index 53687347619c..6847c036e9fb 100755 --- a/src/Illuminate/View/Engines/EngineInterface.php +++ b/src/Illuminate/View/Engines/EngineInterface.php @@ -9,6 +9,6 @@ interface EngineInterface { * @param array $data * @return string */ - public function get($path, array $data = array()); + public function get($path, array $data = []); } diff --git a/src/Illuminate/View/Engines/EngineResolver.php b/src/Illuminate/View/Engines/EngineResolver.php index e030c261a724..5e27c87d643b 100755 --- a/src/Illuminate/View/Engines/EngineResolver.php +++ b/src/Illuminate/View/Engines/EngineResolver.php @@ -10,14 +10,14 @@ class EngineResolver { * * @var array */ - protected $resolvers = array(); + protected $resolvers = []; /** * The resolved engine instances. * * @var array */ - protected $resolved = array(); + protected $resolved = []; /** * Register a new engine resolver. diff --git a/src/Illuminate/View/Engines/PhpEngine.php b/src/Illuminate/View/Engines/PhpEngine.php index f43828ee1653..e5ec9b297394 100755 --- a/src/Illuminate/View/Engines/PhpEngine.php +++ b/src/Illuminate/View/Engines/PhpEngine.php @@ -11,7 +11,7 @@ class PhpEngine implements EngineInterface { * @param array $data * @return string */ - public function get($path, array $data = array()) + public function get($path, array $data = []) { return $this->evaluatePath($path, $data); } diff --git a/src/Illuminate/View/Factory.php b/src/Illuminate/View/Factory.php index eb85ccee3bbf..d6ca88477be4 100755 --- a/src/Illuminate/View/Factory.php +++ b/src/Illuminate/View/Factory.php @@ -43,21 +43,21 @@ class Factory implements FactoryContract { * * @var array */ - protected $shared = array(); + protected $shared = []; /** * Array of registered view name aliases. * * @var array */ - protected $aliases = array(); + protected $aliases = []; /** * All of the registered view names. * * @var array */ - protected $names = array(); + protected $names = []; /** * The extension to engine bindings. @@ -71,21 +71,21 @@ class Factory implements FactoryContract { * * @var array */ - protected $composers = array(); + protected $composers = []; /** * All of the finished, captured sections. * * @var array */ - protected $sections = array(); + protected $sections = []; /** * The stack of in-progress sections. * * @var array */ - protected $sectionStack = array(); + protected $sectionStack = []; /** * The number of active rendering operations. @@ -119,7 +119,7 @@ public function __construct(EngineResolver $engines, ViewFinderInterface $finder * @param array $mergeData * @return \Illuminate\View\View */ - public function file($path, $data = array(), $mergeData = array()) + public function file($path, $data = [], $mergeData = array()) { $data = array_merge($mergeData, $this->parseData($data)); @@ -136,7 +136,7 @@ public function file($path, $data = array(), $mergeData = array()) * @param array $mergeData * @return \Illuminate\View\View */ - public function make($view, $data = array(), $mergeData = array()) + public function make($view, $data = [], $mergeData = array()) { if (isset($this->aliases[$view])) $view = $this->aliases[$view]; @@ -190,7 +190,7 @@ protected function parseData($data) * @param mixed $data * @return \Illuminate\View\View */ - public function of($view, $data = array()) + public function of($view, $data = []) { return $this->make($this->names[$view], $data); } @@ -345,7 +345,7 @@ public function share($key, $value = null) */ public function creator($views, $callback) { - $creators = array(); + $creators = []; foreach ((array) $views as $view) { @@ -363,7 +363,7 @@ public function creator($views, $callback) */ public function composers(array $composers) { - $registered = array(); + $registered = []; foreach ($composers as $callback => $views) { @@ -383,7 +383,7 @@ public function composers(array $composers) */ public function composer($views, $callback, $priority = null) { - $composers = array(); + $composers = []; foreach ((array) $views as $view) { @@ -654,9 +654,9 @@ public function yieldContent($section, $default = '') */ public function flushSections() { - $this->sections = array(); + $this->sections = []; - $this->sectionStack = array(); + $this->sectionStack = []; } /** diff --git a/src/Illuminate/View/FileViewFinder.php b/src/Illuminate/View/FileViewFinder.php index 94efedb72a3a..29c0a3e4b31d 100755 --- a/src/Illuminate/View/FileViewFinder.php +++ b/src/Illuminate/View/FileViewFinder.php @@ -24,14 +24,14 @@ class FileViewFinder implements ViewFinderInterface { * * @var array */ - protected $views = array(); + protected $views = []; /** * The namespace to file path hints. * * @var array */ - protected $hints = array(); + protected $hints = []; /** * Register a view extension with the finder. diff --git a/src/Illuminate/View/View.php b/src/Illuminate/View/View.php index c7aa1df5d319..8dca084e5f16 100755 --- a/src/Illuminate/View/View.php +++ b/src/Illuminate/View/View.php @@ -57,7 +57,7 @@ class View implements ArrayAccess, ViewContract { * @param array $data * @return void */ - public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = array()) + public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = []) { $this->view = $view; $this->path = $path; @@ -185,7 +185,7 @@ public function with($key, $value = null) * @param array $data * @return $this */ - public function nest($key, $view, array $data = array()) + public function nest($key, $view, array $data = []) { return $this->with($key, $this->factory->make($view, $data)); } diff --git a/tests/Cache/CacheTableCommandTest.php b/tests/Cache/CacheTableCommandTest.php index 3e1f410dc2ec..bf30b8fe1dc5 100644 --- a/tests/Cache/CacheTableCommandTest.php +++ b/tests/Cache/CacheTableCommandTest.php @@ -34,7 +34,7 @@ public function testCreateMakesMigration() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } @@ -43,7 +43,7 @@ protected function runCommand($command, $input = array()) class CacheTableCommandTestStub extends CacheTableCommand { - public function call($command, array $arguments = array()) + public function call($command, array $arguments = []) { // } diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index ef756714f078..2b2c9efc91bd 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -349,7 +349,7 @@ public function testInternalClassWithDefaultParameters() { $this->setExpectedException('Illuminate\Container\BindingResolutionException', 'Unresolvable dependency resolving [Parameter #0 [ $first ]] in class ContainerMixedPrimitiveStub'); $container = new Container; - $parameters = array(); + $parameters = []; $container->make('ContainerMixedPrimitiveStub', $parameters); } @@ -357,14 +357,14 @@ public function testInternalClassWithDefaultParameters() public function testCallWithDependencies() { $container = new Container; - $result = $container->call(function(StdClass $foo, $bar = array()) { + $result = $container->call(function(StdClass $foo, $bar = []) { return func_get_args(); }); $this->assertInstanceOf('stdClass', $result[0]); $this->assertEquals([], $result[1]); - $result = $container->call(function(StdClass $foo, $bar = array()) { + $result = $container->call(function(StdClass $foo, $bar = []) { return func_get_args(); }, ['bar' => 'taylor']); @@ -374,7 +374,7 @@ public function testCallWithDependencies() /** * Wrap a function... */ - $result = $container->wrap(function(StdClass $foo, $bar = array()) { + $result = $container->wrap(function(StdClass $foo, $bar = []) { return func_get_args(); }, ['bar' => 'taylor']); diff --git a/tests/Database/DatabaseConnectionTest.php b/tests/Database/DatabaseConnectionTest.php index 631fda470485..19bd018d548f 100755 --- a/tests/Database/DatabaseConnectionTest.php +++ b/tests/Database/DatabaseConnectionTest.php @@ -260,7 +260,7 @@ public function testSchemaBuilderCanBeCreated() - protected function getMockConnection($methods = array(), $pdo = null) + protected function getMockConnection($methods = [], $pdo = null) { $pdo = $pdo ?: new DatabaseConnectionTestMockPDO; $defaults = array('getDefaultQueryGrammar', 'getDefaultPostProcessor', 'getDefaultSchemaGrammar'); diff --git a/tests/Database/DatabaseEloquentBelongsToManyTest.php b/tests/Database/DatabaseEloquentBelongsToManyTest.php index d3f955fe68a0..6b4b94c7e10f 100755 --- a/tests/Database/DatabaseEloquentBelongsToManyTest.php +++ b/tests/Database/DatabaseEloquentBelongsToManyTest.php @@ -110,7 +110,7 @@ public function testModelsAreProperlyMatchedToParents() public function testRelationIsProperlyInitialized() { $relation = $this->getRelation(); - $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = array()) { return new Collection($array); }); + $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = []) { return new Collection($array); }); $model = m::mock('Illuminate\Database\Eloquent\Model'); $model->shouldReceive('setRelation')->once()->with('foo', m::type('Illuminate\Database\Eloquent\Collection')); $models = $relation->initRelation(array($model), 'foo'); @@ -530,7 +530,7 @@ public function getRelationArguments() } class EloquentBelongsToManyModelStub extends Illuminate\Database\Eloquent\Model { - protected $guarded = array(); + protected $guarded = []; } class EloquentBelongsToManyModelPivotStub extends Illuminate\Database\Eloquent\Model { diff --git a/tests/Database/DatabaseEloquentHasManyTest.php b/tests/Database/DatabaseEloquentHasManyTest.php index 015f3ce7b43b..8b27e4fba20a 100755 --- a/tests/Database/DatabaseEloquentHasManyTest.php +++ b/tests/Database/DatabaseEloquentHasManyTest.php @@ -128,7 +128,7 @@ public function testRelationIsProperlyInitialized() { $relation = $this->getRelation(); $model = m::mock('Illuminate\Database\Eloquent\Model'); - $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = array()) { return new Collection($array); }); + $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = []) { return new Collection($array); }); $model->shouldReceive('setRelation')->once()->with('foo', m::type('Illuminate\Database\Eloquent\Collection')); $models = $relation->initRelation(array($model), 'foo'); diff --git a/tests/Database/DatabaseEloquentHasManyThroughTest.php b/tests/Database/DatabaseEloquentHasManyThroughTest.php index 53ce5861585d..83c602d88af2 100644 --- a/tests/Database/DatabaseEloquentHasManyThroughTest.php +++ b/tests/Database/DatabaseEloquentHasManyThroughTest.php @@ -16,7 +16,7 @@ public function testRelationIsProperlyInitialized() { $relation = $this->getRelation(); $model = m::mock('Illuminate\Database\Eloquent\Model'); - $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = array()) { return new Collection($array); }); + $relation->getRelated()->shouldReceive('newCollection')->andReturnUsing(function($array = []) { return new Collection($array); }); $model->shouldReceive('setRelation')->once()->with('foo', m::type('Illuminate\Database\Eloquent\Collection')); $models = $relation->initRelation(array($model), 'foo'); diff --git a/tests/Database/DatabaseEloquentModelTest.php b/tests/Database/DatabaseEloquentModelTest.php index f3b62b1d2808..81e65542aef4 100755 --- a/tests/Database/DatabaseEloquentModelTest.php +++ b/tests/Database/DatabaseEloquentModelTest.php @@ -1174,7 +1174,7 @@ public function saved() {} class EloquentModelStub extends Illuminate\Database\Eloquent\Model { protected $table = 'stub'; - protected $guarded = array(); + protected $guarded = []; protected $morph_to_stub_type = 'EloquentModelSaveStub'; public function getListItemsAttribute($value) { @@ -1235,8 +1235,8 @@ public function getDates() class EloquentModelSaveStub extends Illuminate\Database\Eloquent\Model { protected $table = 'save_stub'; - protected $guarded = array(); - public function save(array $options = array()) { $_SERVER['__eloquent.saved'] = true; } + protected $guarded = []; + public function save(array $options = []) { $_SERVER['__eloquent.saved'] = true; } public function setIncrementing($value) { $this->incrementing = $value; diff --git a/tests/Database/DatabaseEloquentMorphToManyTest.php b/tests/Database/DatabaseEloquentMorphToManyTest.php index a0ac29709bef..653b1198a88e 100644 --- a/tests/Database/DatabaseEloquentMorphToManyTest.php +++ b/tests/Database/DatabaseEloquentMorphToManyTest.php @@ -107,5 +107,5 @@ public function getRelationArguments() } class EloquentMorphToManyModelStub extends Illuminate\Database\Eloquent\Model { - protected $guarded = array(); + protected $guarded = []; } diff --git a/tests/Database/DatabaseMigrationInstallCommandTest.php b/tests/Database/DatabaseMigrationInstallCommandTest.php index 2d86f8b14b91..8261f8c44789 100755 --- a/tests/Database/DatabaseMigrationInstallCommandTest.php +++ b/tests/Database/DatabaseMigrationInstallCommandTest.php @@ -21,7 +21,7 @@ public function testFireCallsRepositoryToInstall() } - protected function runCommand($command, $options = array()) + protected function runCommand($command, $options = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($options), new Symfony\Component\Console\Output\NullOutput); } diff --git a/tests/Database/DatabaseMigrationMakeCommandTest.php b/tests/Database/DatabaseMigrationMakeCommandTest.php index 8b09b69e0522..afe906e69f51 100755 --- a/tests/Database/DatabaseMigrationMakeCommandTest.php +++ b/tests/Database/DatabaseMigrationMakeCommandTest.php @@ -58,7 +58,7 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenTableIsSet() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } diff --git a/tests/Database/DatabaseMigrationMigrateCommandTest.php b/tests/Database/DatabaseMigrationMigrateCommandTest.php index ec4ad27c0b6b..f901b03c28c2 100755 --- a/tests/Database/DatabaseMigrationMigrateCommandTest.php +++ b/tests/Database/DatabaseMigrationMigrateCommandTest.php @@ -70,7 +70,7 @@ public function testTheDatabaseMayBeSet() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } @@ -78,7 +78,7 @@ protected function runCommand($command, $input = array()) } class ApplicationDatabaseMigrationStub extends Application { - public function __construct(array $data = array()) { + public function __construct(array $data = []) { foreach ($data as $abstract => $instance) { $this->instance($abstract, $instance); } diff --git a/tests/Database/DatabaseMigrationResetCommandTest.php b/tests/Database/DatabaseMigrationResetCommandTest.php index 1e89d7239be2..f60bc9f80a0a 100755 --- a/tests/Database/DatabaseMigrationResetCommandTest.php +++ b/tests/Database/DatabaseMigrationResetCommandTest.php @@ -35,7 +35,7 @@ public function testResetCommandCanBePretended() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } diff --git a/tests/Database/DatabaseMigrationRollbackCommandTest.php b/tests/Database/DatabaseMigrationRollbackCommandTest.php index b68996b74dfa..121be2c58586 100755 --- a/tests/Database/DatabaseMigrationRollbackCommandTest.php +++ b/tests/Database/DatabaseMigrationRollbackCommandTest.php @@ -36,7 +36,7 @@ public function testRollbackCommandCanBePretended() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } diff --git a/tests/Log/LogWriterTest.php b/tests/Log/LogWriterTest.php index 0df221662227..98654461087b 100755 --- a/tests/Log/LogWriterTest.php +++ b/tests/Log/LogWriterTest.php @@ -49,7 +49,7 @@ public function testWriterFiresEventsDispatcher() $writer = new Writer($monolog = m::mock('Monolog\Logger'), $events = new Illuminate\Events\Dispatcher); $monolog->shouldReceive('error')->once()->with('foo', array()); - $events->listen('illuminate.log', function($level, $message, array $context = array()) + $events->listen('illuminate.log', function($level, $message, array $context = []) { $_SERVER['__log.level'] = $level; $_SERVER['__log.message'] = $message; diff --git a/tests/Session/SessionTableCommandTest.php b/tests/Session/SessionTableCommandTest.php index 3e929d0ae2cb..8cc5075cf5a6 100644 --- a/tests/Session/SessionTableCommandTest.php +++ b/tests/Session/SessionTableCommandTest.php @@ -34,7 +34,7 @@ public function testCreateMakesMigration() } - protected function runCommand($command, $input = array()) + protected function runCommand($command, $input = []) { return $command->run(new Symfony\Component\Console\Input\ArrayInput($input), new Symfony\Component\Console\Output\NullOutput); } @@ -43,7 +43,7 @@ protected function runCommand($command, $input = array()) class SessionTableCommandTestStub extends SessionTableCommand { - public function call($command, array $arguments = array()) + public function call($command, array $arguments = []) { // } diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index 4d5715428a0c..d6b36c78d89d 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -602,7 +602,7 @@ public function testPaginate() class TestAccessorEloquentTestStub { - protected $attributes = array(); + protected $attributes = []; public function __construct($attributes) { diff --git a/tests/Support/SupportFacadeTest.php b/tests/Support/SupportFacadeTest.php index 69989cb75547..ffa685644569 100755 --- a/tests/Support/SupportFacadeTest.php +++ b/tests/Support/SupportFacadeTest.php @@ -70,7 +70,7 @@ protected static function getFacadeAccessor() class ApplicationStub implements ArrayAccess { - protected $attributes = array(); + protected $attributes = []; public function setAttributes($attributes) { $this->attributes = $attributes; } public function instance($key, $instance) { $this->attributes[$key] = $instance; } diff --git a/tests/Support/SupportFluentTest.php b/tests/Support/SupportFluentTest.php index 6fc1b4f07404..99784ae06431 100755 --- a/tests/Support/SupportFluentTest.php +++ b/tests/Support/SupportFluentTest.php @@ -107,9 +107,9 @@ public function testToJsonEncodesTheToArrayResult() class FluentArrayIteratorStub implements \IteratorAggregate { - protected $items = array(); + protected $items = []; - public function __construct(array $items = array()) + public function __construct(array $items = []) { $this->items = (array) $items; } diff --git a/tests/Support/SupportHelpersTest.php b/tests/Support/SupportHelpersTest.php index 5272ec70871e..1967dacc74da 100755 --- a/tests/Support/SupportHelpersTest.php +++ b/tests/Support/SupportHelpersTest.php @@ -39,7 +39,7 @@ public function testArrayHas() public function testArraySet() { - $array = array(); + $array = []; array_set($array, 'names.developer', 'taylor'); $this->assertEquals('taylor', $array['names']['developer']); }