From 62072e5281fbf4c77c8bd7dc7d7a1f6230aeb11c Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Sat, 4 Feb 2012 21:30:52 +0000 Subject: [PATCH 1/2] PHPDoc fixes --- application/controllers/base.php | 2 +- laravel/autoloader.php | 4 ++-- laravel/bundle.php | 5 ++--- laravel/cache.php | 4 ++-- laravel/cache/drivers/database.php | 2 +- laravel/cache/drivers/driver.php | 1 - laravel/cache/drivers/redis.php | 4 ++-- laravel/cli/console.php | 2 +- laravel/cli/tasks/migrate/database.php | 2 +- laravel/cli/tasks/migrate/resolver.php | 2 +- laravel/cli/tasks/test/runner.php | 2 +- laravel/cookie.php | 2 +- laravel/database.php | 6 +++--- laravel/database/query.php | 2 +- laravel/database/schema/table.php | 5 +++-- laravel/file.php | 4 ++-- laravel/form.php | 5 +++-- laravel/helpers.php | 2 +- laravel/html.php | 1 + laravel/ioc.php | 1 + laravel/memcached.php | 6 +++--- laravel/messages.php | 1 + laravel/paginator.php | 6 ++++-- laravel/redirect.php | 4 ++-- laravel/routing/filter.php | 1 + laravel/routing/route.php | 2 +- laravel/routing/router.php | 2 +- laravel/session.php | 6 +++--- laravel/session/drivers/apc.php | 4 ++-- laravel/session/drivers/memcached.php | 4 ++-- laravel/session/drivers/redis.php | 4 ++-- laravel/session/payload.php | 2 +- laravel/str.php | 3 ++- laravel/validator.php | 2 +- laravel/view.php | 2 +- paths.php | 23 +++++++++++++++++------ 36 files changed, 74 insertions(+), 56 deletions(-) diff --git a/application/controllers/base.php b/application/controllers/base.php index 177d887a..71d03416 100644 --- a/application/controllers/base.php +++ b/application/controllers/base.php @@ -7,7 +7,7 @@ class Base_Controller extends Controller { * * @param string $method * @param array $parameters - * @return Response + * @return Laravel\Response */ public function __call($method, $parameters) { diff --git a/laravel/autoloader.php b/laravel/autoloader.php index e9975551..036585df 100644 --- a/laravel/autoloader.php +++ b/laravel/autoloader.php @@ -183,8 +183,8 @@ public static function psr($directory) /** * Map namespaces to directories. * - * @param string $namespace - * @param string $path + * @param array $mappings + * @return void */ public static function namespaces($mappings) { diff --git a/laravel/bundle.php b/laravel/bundle.php index dd0f9e54..825b31fe 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -27,8 +27,7 @@ class Bundle { * Register a bundle for the application. * * @param string $bundle - * @param string $location - * @param string $handles + * @param mixed $config Array of 'location', 'handles' and 'auto'; or string of location. * @return void */ public static function register($bundle, $config = array()) @@ -111,7 +110,7 @@ public static function routes($bundle) * * If no bundle is assigned to handle the URI, the default bundle is returned. * - * @param string $bundle + * @param string $uri * @return string */ public static function handles($uri) diff --git a/laravel/cache.php b/laravel/cache.php index a27db042..261bbddc 100644 --- a/laravel/cache.php +++ b/laravel/cache.php @@ -23,7 +23,7 @@ class Cache { * * * @param string $driver - * @return Cache\Driver + * @return Cache\Drivers\Driver */ public static function driver($driver = null) { @@ -41,7 +41,7 @@ public static function driver($driver = null) * Create a new cache driver instance. * * @param string $driver - * @return Driver + * @return Cache\Drivers\Driver */ protected static function factory($driver) { diff --git a/laravel/cache/drivers/database.php b/laravel/cache/drivers/database.php index 85e8b13d..3edd18d1 100644 --- a/laravel/cache/drivers/database.php +++ b/laravel/cache/drivers/database.php @@ -101,7 +101,7 @@ public function forget($key) /** * Get a query builder for the database table. * - * @return Query + * @return Laravel\Database\Query */ protected function table() { diff --git a/laravel/cache/drivers/driver.php b/laravel/cache/drivers/driver.php index d12de53f..b74ebe0a 100644 --- a/laravel/cache/drivers/driver.php +++ b/laravel/cache/drivers/driver.php @@ -23,7 +23,6 @@ abstract public function has($key); * * @param string $key * @param mixed $default - * @param string $driver * @return mixed */ public function get($key, $default = null) diff --git a/laravel/cache/drivers/redis.php b/laravel/cache/drivers/redis.php index cc3c621c..2ed3cac6 100644 --- a/laravel/cache/drivers/redis.php +++ b/laravel/cache/drivers/redis.php @@ -5,14 +5,14 @@ class Redis extends Driver { /** * The Redis database instance. * - * @var Redis + * @var Laravel\Redis */ protected $redis; /** * Create a new Redis cache driver instance. * - * @param Redis $redis + * @param Laravel\Redis $redis * @return void */ public function __construct(\Laravel\Redis $redis) diff --git a/laravel/cli/console.php b/laravel/cli/console.php index 1512aaa4..0591f938 100644 --- a/laravel/cli/console.php +++ b/laravel/cli/console.php @@ -6,7 +6,7 @@ class Console { * Parse the command line arguments and return the results. * * @param array $argv - * @param array + * @return array */ public static function options($argv) { diff --git a/laravel/cli/tasks/migrate/database.php b/laravel/cli/tasks/migrate/database.php index 29bfb154..a6aae9d5 100644 --- a/laravel/cli/tasks/migrate/database.php +++ b/laravel/cli/tasks/migrate/database.php @@ -74,7 +74,7 @@ public function batch() /** * Get a database query instance for the migration table. * - * @return Query + * @return Laravel\Database\Query */ protected function table() { diff --git a/laravel/cli/tasks/migrate/resolver.php b/laravel/cli/tasks/migrate/resolver.php index 67e5323c..f139195c 100644 --- a/laravel/cli/tasks/migrate/resolver.php +++ b/laravel/cli/tasks/migrate/resolver.php @@ -14,7 +14,7 @@ class Resolver { /** * Create a new instance of the migration resolver. * - * @param Database $datbase + * @param Database $database * @return void */ public function __construct(Database $database) diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index 06066c26..dbddf0f3 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -41,7 +41,7 @@ public function core() /** * Run the tests for a given bundle. * - * @param array $arguments + * @param array $bundles * @return void */ public function bundle($bundles = array()) diff --git a/laravel/cookie.php b/laravel/cookie.php index e5c5db99..fd605839 100644 --- a/laravel/cookie.php +++ b/laravel/cookie.php @@ -113,7 +113,7 @@ public static function get($name, $default = null) * @param string $path * @param string $domain * @param bool $secure - * @return bool + * @return void */ public static function put($name, $value, $minutes = 0, $path = '/', $domain = null, $secure = false) { diff --git a/laravel/database.php b/laravel/database.php index ef2389a0..447fa76b 100644 --- a/laravel/database.php +++ b/laravel/database.php @@ -26,7 +26,7 @@ class Database { * * * @param string $connection - * @return Connection + * @return Database\Connection */ public static function connection($connection = null) { @@ -62,7 +62,7 @@ protected static function connect($config) * Create a new database connector instance. * * @param string $driver - * @return Connector + * @return Database\Connectors\Connector */ protected static function connector($driver) { @@ -90,7 +90,7 @@ protected static function connector($driver) * * @param string $table * @param string $connection - * @return Queries\Query + * @return Database\Query */ public static function table($table, $connection = null) { diff --git a/laravel/database/query.php b/laravel/database/query.php index 6c7dbcdb..d3363a4a 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -625,7 +625,7 @@ public function get($columns = array('*')) /** * Get an aggregate value. * - * @param string $aggregate + * @param string $aggregator * @param string $column * @return mixed */ diff --git a/laravel/database/schema/table.php b/laravel/database/schema/table.php index 81516797..9eee0cca 100644 --- a/laravel/database/schema/table.php +++ b/laravel/database/schema/table.php @@ -99,7 +99,9 @@ public function fulltext($columns, $name) /** * Create a new index on the table. * - * @param string|array + * @param string|array $columns + * @param string $name + * @return Fluent */ public function index($columns, $name) { @@ -237,7 +239,6 @@ public function integer($name, $increment = false) * Add a float column to the table. * * @param string $name - * @param bool $increment * @return Fluent */ public function float($name) diff --git a/laravel/file.php b/laravel/file.php index bdf73b86..4bb02930 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -93,7 +93,7 @@ public static function type($path) /** * Get the file size of a given file. * - * @param string $file + * @param string $path * @return int */ public static function size($path) @@ -149,7 +149,7 @@ public static function mime($extension, $default = 'application/octet-stream') * $image = File::is(array('jpg', 'png', 'gif'), 'path/to/file'); * * - * @param array|string $extension + * @param array|string $extensions * @param string $path * @return bool */ diff --git a/laravel/form.php b/laravel/form.php index 6b3f3104..1fd97ca6 100644 --- a/laravel/form.php +++ b/laravel/form.php @@ -186,6 +186,7 @@ public static function label($name, $value, $attributes = array()) * echo Form::input('text', 'email', 'example@gmail.com'); * * + * @param string $type * @param string $name * @param mixed $value * @param array $attributes @@ -389,7 +390,7 @@ public static function select($name, $options = array(), $selected = null, $attr * * @param string $value * @param string $display - * @return string $selected + * @param string $selected * @return string */ protected static function option($value, $display, $selected) @@ -506,6 +507,7 @@ public static function reset($value, $attributes = array()) * * * @param string $url + * @param string $name * @param array $attributes * @return string */ @@ -519,7 +521,6 @@ public static function image($url, $name = null, $attributes = array()) /** * Create a HTML button element. * - * @param string $name * @param string $value * @param array $attributes * @return string diff --git a/laravel/helpers.php b/laravel/helpers.php index 4e4f6199..0700e550 100644 --- a/laravel/helpers.php +++ b/laravel/helpers.php @@ -26,7 +26,7 @@ function __($key, $replacements = array(), $language = null) return Laravel\Lang::line($key, $replacements, $language); } -/**a +/** * Get an item from an array using "dot" notation. * * diff --git a/laravel/html.php b/laravel/html.php index 76447310..9d5a9142 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -173,6 +173,7 @@ public static function link_to_secure_asset($url, $title, $attributes = array()) * @param string $title * @param array $parameters * @param array $attributes + * @param bool $https * @return string */ public static function link_to_route($name, $title, $parameters = array(), $attributes = array(), $https = false) diff --git a/laravel/ioc.php b/laravel/ioc.php index 0c3e168f..2c596468 100644 --- a/laravel/ioc.php +++ b/laravel/ioc.php @@ -21,6 +21,7 @@ class IoC { * * @param string $name * @param Closure $resolver + * @param bool $singleton * @return void */ public static function register($name, Closure $resolver, $singleton = false) diff --git a/laravel/memcached.php b/laravel/memcached.php index d073737f..548e2984 100644 --- a/laravel/memcached.php +++ b/laravel/memcached.php @@ -5,7 +5,7 @@ class Memcached { /** * The Memcached connection instance. * - * @var Memcache + * @var Memcached */ protected static $connection; @@ -20,7 +20,7 @@ class Memcached { * Memcached::connection()->set('name', 'Taylor'); * * - * @return Memcache + * @return Memcached */ public static function connection() { @@ -36,7 +36,7 @@ public static function connection() * Create a new Memcached connection instance. * * @param array $servers - * @return Memcache + * @return Memcached */ protected static function connect($servers) { diff --git a/laravel/messages.php b/laravel/messages.php index 4b499720..f0c449fd 100644 --- a/laravel/messages.php +++ b/laravel/messages.php @@ -12,6 +12,7 @@ class Messages { /** * Create a new Messages instance. * + * @param array $messages * @return void */ public function __construct($messages = array()) diff --git a/laravel/paginator.php b/laravel/paginator.php index c1942311..a3176e67 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -71,10 +71,10 @@ class Paginator { * Create a new Paginator instance. * * @param array $results - * @param int $last * @param int $page * @param int $total * @param int $per_page + * @param int $last * @return void */ protected function __construct($results, $page, $total, $per_page, $last) @@ -246,6 +246,7 @@ public function slider($adjacent = 3) * echo $paginator->previous('Go Back'); * * + * @param string $text * @return string */ public function previous($text = null) @@ -266,6 +267,7 @@ public function previous($text = null) * echo $paginator->next('Skip Forwards'); * * + * @param string $text * @return string */ public function next($text = null) @@ -364,7 +366,7 @@ protected function range($start, $end) * * @param int $page * @param string $text - * @param string $attributes + * @param string $class * @return string */ protected function link($page, $text, $class) diff --git a/laravel/redirect.php b/laravel/redirect.php index 2f19fa77..7dd606eb 100644 --- a/laravel/redirect.php +++ b/laravel/redirect.php @@ -28,7 +28,7 @@ public static function to($url, $status = 302, $https = false) * * @param string $url * @param int $status - * @return Response + * @return Redirect */ public static function to_secure($url, $status = 302) { @@ -82,7 +82,7 @@ public static function to_secure_route($route, $parameters = array(), $status = * * @param string $key * @param mixed $value - * @return Response + * @return Redirect */ public function with($key, $value) { diff --git a/laravel/routing/filter.php b/laravel/routing/filter.php index 86d71bcd..61e3def2 100644 --- a/laravel/routing/filter.php +++ b/laravel/routing/filter.php @@ -155,6 +155,7 @@ class Filter_Collection { * * @param string|array $filters * @param mixed $parameters + * @return void */ public function __construct($filters, $parameters = null) { diff --git a/laravel/routing/route.php b/laravel/routing/route.php index ce538ad5..3150499b 100644 --- a/laravel/routing/route.php +++ b/laravel/routing/route.php @@ -142,7 +142,7 @@ public function response() * * If the route belongs to a bundle, the bundle's global filters are returned too. * - * @param string $filter + * @param string $event * @return array */ protected function filters($event) diff --git a/laravel/routing/router.php b/laravel/routing/router.php index c5112edf..d67451f7 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -254,8 +254,8 @@ protected static function controller($bundle, $method, $destination, $segments) /** * Locate the URI segment matching a controller name. * - * @param string $directory * @param array $segments + * @param string $directory * @return int */ protected static function locate($segments, $directory) diff --git a/laravel/session.php b/laravel/session.php index 817e32a5..ee997776 100644 --- a/laravel/session.php +++ b/laravel/session.php @@ -5,7 +5,7 @@ class Session { /** * The session singleton instance for the request. * - * @var Payload + * @var Session\Payload */ public static $instance; @@ -31,7 +31,7 @@ public static function start($driver) * Create a new session driver instance. * * @param string $driver - * @return Driver + * @return Session\Drivers\Driver */ public static function factory($driver) { @@ -71,7 +71,7 @@ public static function factory($driver) * Session::instance()->put('name', 'Taylor'); * * - * @return Payload + * @return Session\Payload */ public static function instance() { diff --git a/laravel/session/drivers/apc.php b/laravel/session/drivers/apc.php index 61f7bcff..a45efaa0 100644 --- a/laravel/session/drivers/apc.php +++ b/laravel/session/drivers/apc.php @@ -5,14 +5,14 @@ class APC implements Driver { /** * The APC cache driver instance. * - * @var Cache\Drivers\APC + * @var Laravel\Cache\Drivers\APC */ private $apc; /** * Create a new APC session driver instance. * - * @param Cache\Drivers\APC $apc + * @param Laravel\Cache\Drivers\APC $apc * @return void */ public function __construct(\Laravel\Cache\Drivers\APC $apc) diff --git a/laravel/session/drivers/memcached.php b/laravel/session/drivers/memcached.php index 3c7a1305..f6c73e5a 100644 --- a/laravel/session/drivers/memcached.php +++ b/laravel/session/drivers/memcached.php @@ -5,14 +5,14 @@ class Memcached implements Driver { /** * The Memcache cache driver instance. * - * @var Cache\Drivers\Memcached + * @var Laravel\Cache\Drivers\Memcached */ private $memcached; /** * Create a new Memcached session driver instance. * - * @param Memcached $memcached + * @param Laravel\Cache\Drivers\Memcached $memcached * @return void */ public function __construct(\Laravel\Cache\Drivers\Memcached $memcached) diff --git a/laravel/session/drivers/redis.php b/laravel/session/drivers/redis.php index a45b9a16..1f93feab 100644 --- a/laravel/session/drivers/redis.php +++ b/laravel/session/drivers/redis.php @@ -5,14 +5,14 @@ class Redis implements Driver { /** * The Redis cache driver instance. * - * @var Cache\Drivers\Redis + * @var Laravel\Cache\Drivers\Redis */ protected $redis; /** * Create a new Redis session driver. * - * @param Cache\Drivers\Redis $redis + * @param Laravel\Cache\Drivers\Redis $redis * @return void */ public function __construct(\Laravel\Cache\Drivers\Redis $redis) diff --git a/laravel/session/payload.php b/laravel/session/payload.php index a640a962..52698166 100644 --- a/laravel/session/payload.php +++ b/laravel/session/payload.php @@ -202,7 +202,7 @@ public function reflash() * Session::keep(array('name', 'email')); * * - * @param string|array $key + * @param string|array $keys * @return void */ public function keep($keys) diff --git a/laravel/str.php b/laravel/str.php index 80fb0382..8f46282c 100644 --- a/laravel/str.php +++ b/laravel/str.php @@ -154,6 +154,7 @@ public static function singular($value) * * * @param string $value + * @param int $count * @return string */ public static function plural($value, $count = 2) @@ -177,7 +178,7 @@ public static function plural($value, $count = 2) * * * @param string $value - * @param int $length + * @param int $words * @param string $end * @return string */ diff --git a/laravel/validator.php b/laravel/validator.php index 3254ea71..73baebfa 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -946,7 +946,7 @@ public function connection(Database\Connection $connection) /** * Get the database connection for the Validator. * - * @return Connection + * @return Database\Connection */ protected function db() { diff --git a/laravel/view.php b/laravel/view.php index 3aa3f733..1b153d55 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -183,7 +183,7 @@ public static function name($view, $name) * * * @param string $view - * @param Closure + * @param Closure $composer * @return void */ public static function composer($view, $composer) diff --git a/paths.php b/paths.php index f4b0f451..b18b0671 100644 --- a/paths.php +++ b/paths.php @@ -68,17 +68,28 @@ $GLOBALS['laravel_paths'][$name] = realpath($path).DS; } -// -------------------------------------------------------------- -// Define a global path helper function. -// -------------------------------------------------------------- +/** + * A global path helper function. + * + * + * $storage = path('storage'); + * + * + * @param string $path + * @return string + */ function path($path) { return $GLOBALS['laravel_paths'][$path]; } -// -------------------------------------------------------------- -// Define a global path setter function. -// -------------------------------------------------------------- +/** + * A global path setter function. + * + * @param string $path + * @param string $value + * @return void + */ function set_path($path, $value) { $GLOBALS['laravel_paths'][$path] = $value; From 8e5a143bbead00bad72899fb7763eae8f259ce5d Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Sat, 4 Feb 2012 21:33:25 +0000 Subject: [PATCH 2/2] SQLServer::limit and ::offset return strings --- laravel/database/query/grammars/sqlserver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/database/query/grammars/sqlserver.php b/laravel/database/query/grammars/sqlserver.php index 15efafed..6b3c8127 100644 --- a/laravel/database/query/grammars/sqlserver.php +++ b/laravel/database/query/grammars/sqlserver.php @@ -124,7 +124,7 @@ protected function ansi_offset(Query $query, $components) */ protected function limit(Query $query) { - return; + return ''; } /** @@ -135,7 +135,7 @@ protected function limit(Query $query) */ protected function offset(Query $query) { - return; + return ''; } } \ No newline at end of file