From 22f26ff5280dd40d8bb746e0b633c778d6c6a76f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Thu, 17 Jan 2013 00:19:35 +0100 Subject: [PATCH 1/5] Update PHPDocs corrected the namespaces. --- src/Illuminate/Auth/AuthManager.php | 178 +++++++-------- src/Illuminate/Auth/DatabaseUserProvider.php | 12 +- src/Illuminate/Auth/EloquentUserProvider.php | 12 +- src/Illuminate/Auth/Guard.php | 34 +-- src/Illuminate/Auth/UserProviderInterface.php | 6 +- src/Illuminate/Cache/ApcStore.php | 4 +- src/Illuminate/Cache/CacheManager.php | 214 +++++++++--------- src/Illuminate/Cache/DatabaseStore.php | 12 +- src/Illuminate/Cache/FileStore.php | 6 +- src/Illuminate/Cache/MemcachedConnector.php | 4 +- src/Illuminate/Cache/RedisStore.php | 6 +- src/Illuminate/Config/FileLoader.php | 6 +- src/Illuminate/Config/Repository.php | 6 +- src/Illuminate/Console/Application.php | 28 +-- src/Illuminate/Console/Command.php | 20 +- 15 files changed, 274 insertions(+), 274 deletions(-) diff --git a/src/Illuminate/Auth/AuthManager.php b/src/Illuminate/Auth/AuthManager.php index b4b0519ec531..781c60ec999b 100644 --- a/src/Illuminate/Auth/AuthManager.php +++ b/src/Illuminate/Auth/AuthManager.php @@ -1,90 +1,90 @@ -setCookieJar($this->app['cookie']); - - $guard->setDispatcher($this->app['events']); - - return $guard; - } - - /** - * Create an instance of the database driver. - * - * @return Illuminate\Auth\Guard - */ - protected function createDatabaseDriver() - { - $provider = $this->createDatabaseProvider(); - - return new Guard($provider, $this->app['session']); - } - - /** - * Create an instance of the database user provider. - * - * @return Illuminate\Auth\DatabaseUserProvider - */ - protected function createDatabaseProvider() - { - $connection = $this->app['db']->connection(); - - // When using the basic database user provider, we need to inject the table we - // want to use, since this is not an Eloquent model we will have no way to - // know without telling the provider, so we'll inject the config value. - $table = $this->app['config']['auth.table']; - - return new DatabaseUserProvider($connection, $this->app['hash'], $table); - } - - /** - * Create an instance of the Eloquent driver. - * - * @return Illuminate\Auth\Guard - */ - public function createEloquentDriver() - { - $provider = $this->createEloquentProvider(); - - return new Guard($provider, $this->app['session']); - } - - /** - * Create an instance of the Eloquent user provider. - * - * @return Illuminate\Auth\EloquentUserProvider - */ - protected function createEloquentProvider() - { - $model = $this->app['config']['auth.model']; - - return new EloquentUserProvider($this->app['hash'], $model); - } - - /** - * Get the default authentication driver name. - * - * @return string - */ - protected function getDefaultDriver() - { - return $this->app['config']['auth.driver']; - } - +setCookieJar($this->app['cookie']); + + $guard->setDispatcher($this->app['events']); + + return $guard; + } + + /** + * Create an instance of the database driver. + * + * @return \Illuminate\Auth\Guard + */ + protected function createDatabaseDriver() + { + $provider = $this->createDatabaseProvider(); + + return new Guard($provider, $this->app['session']); + } + + /** + * Create an instance of the database user provider. + * + * @return \Illuminate\Auth\DatabaseUserProvider + */ + protected function createDatabaseProvider() + { + $connection = $this->app['db']->connection(); + + // When using the basic database user provider, we need to inject the table we + // want to use, since this is not an Eloquent model we will have no way to + // know without telling the provider, so we'll inject the config value. + $table = $this->app['config']['auth.table']; + + return new DatabaseUserProvider($connection, $this->app['hash'], $table); + } + + /** + * Create an instance of the Eloquent driver. + * + * @return \Illuminate\Auth\Guard + */ + public function createEloquentDriver() + { + $provider = $this->createEloquentProvider(); + + return new Guard($provider, $this->app['session']); + } + + /** + * Create an instance of the Eloquent user provider. + * + * @return \Illuminate\Auth\EloquentUserProvider + */ + protected function createEloquentProvider() + { + $model = $this->app['config']['auth.model']; + + return new EloquentUserProvider($this->app['hash'], $model); + } + + /** + * Get the default authentication driver name. + * + * @return string + */ + protected function getDefaultDriver() + { + return $this->app['config']['auth.driver']; + } + } \ No newline at end of file diff --git a/src/Illuminate/Auth/DatabaseUserProvider.php b/src/Illuminate/Auth/DatabaseUserProvider.php index fad75d39fce5..9d0e1224a54c 100644 --- a/src/Illuminate/Auth/DatabaseUserProvider.php +++ b/src/Illuminate/Auth/DatabaseUserProvider.php @@ -15,7 +15,7 @@ class DatabaseUserProvider implements UserProviderInterface { /** * The hasher implementation. * - * @var Illuminate\Hashing\HasherInterface + * @var \Illuminate\Hashing\HasherInterface */ protected $hasher; @@ -29,8 +29,8 @@ class DatabaseUserProvider implements UserProviderInterface { /** * Create a new database user provider. * - * @param Illuminate\Database\Connection $conn - * @param Illuminate\Hashing\HasherInterface $hasher + * @param \Illuminate\Database\Connection $conn + * @param \Illuminate\Hashing\HasherInterface $hasher * @param string $table * @return void */ @@ -45,7 +45,7 @@ public function __construct(Connection $conn, HasherInterface $hasher, $table) * Retrieve a user by their unique idenetifier. * * @param mixed $identifier - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByID($identifier) { @@ -61,7 +61,7 @@ public function retrieveByID($identifier) * Retrieve a user by the given credentials. * * @param array $credentials - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByCredentials(array $credentials) { @@ -92,7 +92,7 @@ public function retrieveByCredentials(array $credentials) /** * Validate a user against the given credentials. * - * @param Illuminate\Auth\UserInterface $user + * @param \Illuminate\Auth\UserInterface $user * @param array $credentials * @return bool */ diff --git a/src/Illuminate/Auth/EloquentUserProvider.php b/src/Illuminate/Auth/EloquentUserProvider.php index 773265036f27..4c2e11746e72 100644 --- a/src/Illuminate/Auth/EloquentUserProvider.php +++ b/src/Illuminate/Auth/EloquentUserProvider.php @@ -7,7 +7,7 @@ class EloquentUserProvider implements UserProviderInterface { /** * The hasher implementation. * - * @var Illuminate\Hashing\HasherInterface + * @var \Illuminate\Hashing\HasherInterface */ protected $hasher; @@ -21,7 +21,7 @@ class EloquentUserProvider implements UserProviderInterface { /** * Create a new database user provider. * - * @param Illuminate\Hashing\HasherInterface $hasher + * @param \Illuminate\Hashing\HasherInterface $hasher * @param string $model * @return void */ @@ -35,7 +35,7 @@ public function __construct(HasherInterface $hasher, $model) * Retrieve a user by their unique identifier. * * @param mixed $identifier - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByID($identifier) { @@ -46,7 +46,7 @@ public function retrieveByID($identifier) * Retrieve a user by the given credentials. * * @param array $credentials - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByCredentials(array $credentials) { @@ -66,7 +66,7 @@ public function retrieveByCredentials(array $credentials) /** * Validate a user against the given credentials. * - * @param Illuminate\Auth\UserInterface $user + * @param \Illuminate\Auth\UserInterface $user * @param array $credentials * @return bool */ @@ -80,7 +80,7 @@ public function validateCredentials(UserInterface $user, array $credentials) /** * Create a new instance of the model. * - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function createModel() { diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index 26106e390bb8..de2d71592593 100644 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -18,21 +18,21 @@ class Guard { /** * The user provider implementation. * - * @var Illuminate\Auth\UserProviderInterface + * @var \Illuminate\Auth\UserProviderInterface */ protected $provider; /** * The session store used by the guard. * - * @var Illuminate\Session\Store + * @var \Illuminate\Session\Store */ protected $session; /** * The Illuminate cookie creator service. * - * @var Illuminate\CookieJar + * @var \Illuminate\Cookie\CookieJar */ protected $cookie; @@ -46,15 +46,15 @@ class Guard { /** * The event dispatcher instance. * - * @var Illuminate\Events\Dispatcher + * @var \Illuminate\Events\Dispatcher */ protected $events; /** * Create a new authentication guard. * - * @param Illuminate\Auth\UserProviderInterface $provider - * @param Illuminate\Session\Store $session + * @param \Illuminate\Auth\UserProviderInterface $provider + * @param \Illuminate\Session\Store $session * @return void */ public function __construct(UserProviderInterface $provider, @@ -87,7 +87,7 @@ public function guest() /** * Get the currently authenticated user. * - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function user() { @@ -153,7 +153,7 @@ public function attempt(array $credentials = array(), $remember = false) /** * Log a user into the application. * - * @param Illuminate\Auth\UserInterface $user + * @param \Illuminate\Auth\UserInterface $user * @param bool $remember * @return void */ @@ -186,7 +186,7 @@ public function login(UserInterface $user, $remember = false) * Create a remember me cookie for a given ID. * * @param mixed $id - * @return Symfony\Component\HttpFoundation\Cookie + * @return \Symfony\Component\HttpFoundation\Cookie */ protected function createRecaller($id) { @@ -227,7 +227,7 @@ protected function clearUserDataFromStorage() /** * Get the cookie creator instance used by the guard. * - * @return Illuminate\CookieJar + * @return \Illuminate\CookieJar */ public function getCookieJar() { @@ -242,7 +242,7 @@ public function getCookieJar() /** * Set the cookie creator instance used by the guard. * - * @param Illuminate\CookieJar $cookie + * @param \Illuminate\CookieJar $cookie * @return void */ public function setCookieJar(CookieJar $cookie) @@ -253,7 +253,7 @@ public function setCookieJar(CookieJar $cookie) /** * Get the event dispatcher instance. * - * @return Illuminate\Events\Dispatcher + * @return \Illuminate\Events\Dispatcher */ public function getDispatcher() { @@ -263,7 +263,7 @@ public function getDispatcher() /** * Set the event dispatcher instance. * - * @param Illuminate\Events\Dispatcher + * @param \Illuminate\Events\Dispatcher $events */ public function setDispatcher(Dispatcher $events) { @@ -273,7 +273,7 @@ public function setDispatcher(Dispatcher $events) /** * Get the session store used by the guard. * - * @return Illuminate\Session\Store + * @return \Illuminate\Session\Store */ public function getSession() { @@ -293,7 +293,7 @@ public function getQueuedCookies() /** * Get the user provider used by the guard. * - * @return Illuminate\Auth\UserProviderInterface + * @return \Illuminate\Auth\UserProviderInterface */ public function getProvider() { @@ -303,7 +303,7 @@ public function getProvider() /** * Return the currently cached user of the application. * - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function getUser() { @@ -313,7 +313,7 @@ public function getUser() /** * Set the current user of the application. * - * @param Illuminate\Auth\UserInterface $user + * @param \Illuminate\Auth\UserInterface $user * @return void */ public function setUser(UserInterface $user) diff --git a/src/Illuminate/Auth/UserProviderInterface.php b/src/Illuminate/Auth/UserProviderInterface.php index cfe7b4d07dde..7a5ee44f49cd 100644 --- a/src/Illuminate/Auth/UserProviderInterface.php +++ b/src/Illuminate/Auth/UserProviderInterface.php @@ -6,7 +6,7 @@ interface UserProviderInterface { * Retrieve a user by their unique idenetifier. * * @param mixed $identifier - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByID($identifier); @@ -14,14 +14,14 @@ public function retrieveByID($identifier); * Retrieve a user by the given credentials. * * @param array $credentials - * @return Illuminate\Auth\UserInterface|null + * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByCredentials(array $credentials); /** * Validate a user against the given credentials. * - * @param Illuminate\Auth\UserInterface $user + * @param \Illuminate\Auth\UserInterface $user * @param array $credentials * @return bool */ diff --git a/src/Illuminate/Cache/ApcStore.php b/src/Illuminate/Cache/ApcStore.php index 3c423517c03a..b000a7d6726d 100644 --- a/src/Illuminate/Cache/ApcStore.php +++ b/src/Illuminate/Cache/ApcStore.php @@ -5,7 +5,7 @@ class ApcStore extends Store { /** * The APC wrapper instance. * - * @var Illuminate\Cache\ApcWrapper + * @var \Illuminate\Cache\ApcWrapper */ protected $apc; @@ -19,7 +19,7 @@ class ApcStore extends Store { /** * Create a new APC store. * - * @param Illuminate\Cache\ApcWrapper $apc + * @param \Illuminate\Cache\ApcWrapper $apc * @param string $prefix * @return void */ diff --git a/src/Illuminate/Cache/CacheManager.php b/src/Illuminate/Cache/CacheManager.php index ba5f27271f8c..8c497b974551 100644 --- a/src/Illuminate/Cache/CacheManager.php +++ b/src/Illuminate/Cache/CacheManager.php @@ -1,108 +1,108 @@ -app['config']['cache.path']; - - return new FileStore($this->app['files'], $path); - } - - /** - * Create an instance of the Memcached cache driver. - * - * @return Illuminate\Cache\MemcachedStore - */ - protected function createMemcachedDriver() - { - $servers = $this->app['config']['cache.memcached']; - - $memcached = $this->app['memcached.connector']->connect($servers); - - return new MemcachedStore($memcached, $this->app['config']['cache.prefix']); - } - - /** - * Create an instance of the Redis cache driver. - * - * @return Illuminate\Cache\RedisStore - */ - protected function createRedisDriver() - { - $redis = $this->app['redis']->connection(); - - return new RedisStore($redis, $this->app['config']['cache.prefix']); - } - - /** - * Create an instance of the database cache driver. - * - * @return Illuminate\Cache\DatabaseStore - */ - protected function createDatabaseDriver() - { - $connection = $this->getDatabaseConnection(); - - $encrypter = $this->app['encrypter']; - - // We allow the developer to specify which connection and table should be used - // to store the cached items. We also need to grab a prefix in case a table - // is being used by multiple applications although this is very unlikely. - $table = $this->app['config']['cache.table']; - - $prefix = $this->app['config']['cache.prefix']; - - return new DatabaseStore($connection, $encrypter, $table, $prefix); - } - - /** - * Get the database connection for the database driver. - * - * @return Illuminate\Database\Connection - */ - protected function getDatabaseConnection() - { - $connection = $this->app['config']['cache.connection']; - - return $this->app['db']->connection($connection); - } - - /** - * Get the default cache driver name. - * - * @return string - */ - protected function getDefaultDriver() - { - return $this->app['config']['cache.driver']; - } - +app['config']['cache.path']; + + return new FileStore($this->app['files'], $path); + } + + /** + * Create an instance of the Memcached cache driver. + * + * @return \Illuminate\Cache\MemcachedStore + */ + protected function createMemcachedDriver() + { + $servers = $this->app['config']['cache.memcached']; + + $memcached = $this->app['memcached.connector']->connect($servers); + + return new MemcachedStore($memcached, $this->app['config']['cache.prefix']); + } + + /** + * Create an instance of the Redis cache driver. + * + * @return \Illuminate\Cache\RedisStore + */ + protected function createRedisDriver() + { + $redis = $this->app['redis']->connection(); + + return new RedisStore($redis, $this->app['config']['cache.prefix']); + } + + /** + * Create an instance of the database cache driver. + * + * @return \Illuminate\Cache\DatabaseStore + */ + protected function createDatabaseDriver() + { + $connection = $this->getDatabaseConnection(); + + $encrypter = $this->app['encrypter']; + + // We allow the developer to specify which connection and table should be used + // to store the cached items. We also need to grab a prefix in case a table + // is being used by multiple applications although this is very unlikely. + $table = $this->app['config']['cache.table']; + + $prefix = $this->app['config']['cache.prefix']; + + return new DatabaseStore($connection, $encrypter, $table, $prefix); + } + + /** + * Get the database connection for the database driver. + * + * @return \Illuminate\Database\Connection + */ + protected function getDatabaseConnection() + { + $connection = $this->app['config']['cache.connection']; + + return $this->app['db']->connection($connection); + } + + /** + * Get the default cache driver name. + * + * @return string + */ + protected function getDefaultDriver() + { + return $this->app['config']['cache.driver']; + } + } \ No newline at end of file diff --git a/src/Illuminate/Cache/DatabaseStore.php b/src/Illuminate/Cache/DatabaseStore.php index d8cb9b880811..c8371c550a07 100644 --- a/src/Illuminate/Cache/DatabaseStore.php +++ b/src/Illuminate/Cache/DatabaseStore.php @@ -8,7 +8,7 @@ class DatabaseStore extends Store { /** * The database connection instance. * - * @var Illuminate\Database\Connection + * @var \Illuminate\Database\Connection */ protected $connection; @@ -36,8 +36,8 @@ class DatabaseStore extends Store { /** * Create a new database store. * - * @param Illuminate\Database\Connection $connection - * @param Illuminate\Encrypter $encrypter + * @param \Illuminate\Database\Connection $connection + * @param \Illuminate\Encryption\Encrypter $encrypter * @param string $table * @param string $prefix * @return void @@ -151,7 +151,7 @@ protected function flushItems() /** * Get a query builder for the cache table. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function table() { @@ -161,7 +161,7 @@ protected function table() /** * Get the underlying database connection. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function getConnection() { @@ -171,7 +171,7 @@ public function getConnection() /** * Get the encrypter instance. * - * @return Illuminate\Encrypter + * @return \Illuminate\Encryption\Encrypter */ public function getEncrypter() { diff --git a/src/Illuminate/Cache/FileStore.php b/src/Illuminate/Cache/FileStore.php index 2d5844fbf35e..109d779d22ee 100644 --- a/src/Illuminate/Cache/FileStore.php +++ b/src/Illuminate/Cache/FileStore.php @@ -5,7 +5,7 @@ class FileStore extends Store { /** * The Illuminate Filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -19,7 +19,7 @@ class FileStore extends Store { /** * Create a new file cache store instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @param string $directory * @return void */ @@ -137,7 +137,7 @@ protected function expiration($minutes) /** * Get the Filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { diff --git a/src/Illuminate/Cache/MemcachedConnector.php b/src/Illuminate/Cache/MemcachedConnector.php index 923a69dc9ff4..9a68d19ae89e 100644 --- a/src/Illuminate/Cache/MemcachedConnector.php +++ b/src/Illuminate/Cache/MemcachedConnector.php @@ -6,7 +6,7 @@ class MemcachedConnector { * Create a new Memcached connection. * * @param array $servers - * @return Memcached + * @return \Memcached */ public function connect(array $servers) { @@ -31,7 +31,7 @@ public function connect(array $servers) /** * Get a new Memcached instance. * - * @return Memcached + * @return \Memcached */ protected function getMemcached() { diff --git a/src/Illuminate/Cache/RedisStore.php b/src/Illuminate/Cache/RedisStore.php index d8c5eb3f4ad1..3e15e1aee4d2 100644 --- a/src/Illuminate/Cache/RedisStore.php +++ b/src/Illuminate/Cache/RedisStore.php @@ -7,7 +7,7 @@ class RedisStore extends Store { /** * The Redis database connection. * - * @var Illuminate\Redis\Database + * @var \Illuminate\Redis\Database */ protected $redis; @@ -21,7 +21,7 @@ class RedisStore extends Store { /** * Create a new APC store. * - * @param Illuminate\Redis\Database $redis + * @param \Illuminate\Redis\Database $redis * @param string $prefix * @return void */ @@ -96,7 +96,7 @@ protected function flushItems() /** * Get the Redis database instance. * - * @return Illuminate\Redis\Database + * @return \Illuminate\Redis\Database */ public function getRedis() { diff --git a/src/Illuminate/Config/FileLoader.php b/src/Illuminate/Config/FileLoader.php index 3a4d26c0dd36..e2a90aaee6a7 100644 --- a/src/Illuminate/Config/FileLoader.php +++ b/src/Illuminate/Config/FileLoader.php @@ -7,7 +7,7 @@ class FileLoader implements LoaderInterface { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -35,7 +35,7 @@ class FileLoader implements LoaderInterface { /** * Create a new file configuration loader. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @param string $defaultPath * @return void */ @@ -207,7 +207,7 @@ protected function getRequire($path) /** * Get the Filesystem instance. * - * @return Illuminate\Filesystem + * @return \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { diff --git a/src/Illuminate/Config/Repository.php b/src/Illuminate/Config/Repository.php index 1e9f638aff36..5c75ab8d2866 100644 --- a/src/Illuminate/Config/Repository.php +++ b/src/Illuminate/Config/Repository.php @@ -9,7 +9,7 @@ class Repository extends NamespacedItemResolver implements ArrayAccess { /** * The loader implementation. * - * @var Illuminate\Config\LoaderInterface + * @var \Illuminate\Config\LoaderInterface */ protected $loader; @@ -44,7 +44,7 @@ class Repository extends NamespacedItemResolver implements ArrayAccess { /** * Create a new configuration repository. * - * @param Illuminate\Config\LoaderInterface $loader + * @param \Illuminate\Config\LoaderInterface $loader * @param string $environment * @return void */ @@ -294,7 +294,7 @@ public function addNamespace($namespace, $hint) /** * Get the loader implementation. * - * @return Illuminate\Config\LoaderInterface + * @return \Illuminate\Config\LoaderInterface */ public function getLoader() { diff --git a/src/Illuminate/Console/Application.php b/src/Illuminate/Console/Application.php index 19df88b93305..17de1cd06cc1 100644 --- a/src/Illuminate/Console/Application.php +++ b/src/Illuminate/Console/Application.php @@ -9,22 +9,22 @@ class Application extends \Symfony\Component\Console\Application { /** * The exception handler instance. * - * @var Illuminate\Exception\Handler + * @var \Illuminate\Exception\Handler */ protected $exceptionHandler; /** * The Laravel application instance. * - * @var Illuminate\Foundation\Application + * @var \Illuminate\Foundation\Application */ protected $laravel; /** * Start a new Console application. * - * @param Illuminate\Foundation\Application $app - * @return Illuminate\Console\Application + * @param \Illuminate\Foundation\Application $app + * @return \Illuminate\Console\Application */ public static function start($app) { @@ -44,8 +44,8 @@ public static function start($app) /** * Add a command to the console. * - * @param Symfony\Component\Console\Command\Command $command - * @return Symfony\Component\Console\Command\Command + * @param \Symfony\Component\Console\Command\Command $command + * @return \Symfony\Component\Console\Command\Command */ public function add(SymfonyCommand $command) { @@ -60,8 +60,8 @@ public function add(SymfonyCommand $command) /** * Add the command to the parent instance. * - * @param Symfony\Component\Console\Command $command - * @return Symfony\Component\Console\Command + * @param \Symfony\Component\Console\Command $command + * @return \Symfony\Component\Console\Command */ protected function addToParent($command) { @@ -98,7 +98,7 @@ public function resolveCommands($commands) /** * Get the default input definitions for the applications. * - * @return Symfony\Component\Console\Input\InputDefinition + * @return \Symfony\Component\Console\Input\InputDefinition */ protected function getDefaultInputDefinition() { @@ -112,7 +112,7 @@ protected function getDefaultInputDefinition() /** * Get the global environment option for the definition. * - * @return Symfony\Component\Console\Input\InputOption + * @return \Symfony\Component\Console\Input\InputOption */ protected function getEnvironmentOption() { @@ -124,8 +124,8 @@ protected function getEnvironmentOption() /** * Render the given exception. * - * @param Exception $e - * @param Symfony\Component\Console\Output\OutputInterface $output + * @param \Exception $e + * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ public function renderException($e, $output) @@ -144,7 +144,7 @@ public function renderException($e, $output) /** * Set the exception handler instance. * - * @param Illuminate\Exception\Handler $handler + * @param \Illuminate\Exception\Handler $handler * @return void */ public function setExceptionHandler($handler) @@ -155,7 +155,7 @@ public function setExceptionHandler($handler) /** * Set the Laravel application instance. * - * @param Illuminate\Foundation\Application $laravel + * @param \Illuminate\Foundation\Application $laravel * @return void */ public function setLaravel($laravel) diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index 0b07258e5fe7..08e94737b6c5 100644 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -9,21 +9,21 @@ class Command extends \Symfony\Component\Console\Command\Command { /** * The Laravel application instance. * - * @var Illuminate\Foundation\Application + * @var \Illuminate\Foundation\Application */ protected $laravel; /** * The input interface implementation. * - * @var Symfony\Component\Console\Input\InputInterface + * @var \Symfony\Component\Console\Input\InputInterface */ protected $input; /** * The output interface implementation. * - * @var Symfony\Component\Console\Output\OutputInterface + * @var \Symfony\Component\Console\Output\OutputInterface */ protected $output; @@ -82,8 +82,8 @@ protected function specifyParameters() /** * Run the conosle command. * - * @param Symfony\Component\Console\Input\InputInterface $input - * @param Symfony\Component\Console\Output\OutputInterface $output + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output * @return mixed */ public function run(InputInterface $input, OutputInterface $output) @@ -98,8 +98,8 @@ public function run(InputInterface $input, OutputInterface $output) /** * Execute the console command. * - * @param Symfony\Component\Console\Input\InputInterface $input - * @param Symfony\Component\Console\Output\OutputInterface $output + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output * @return mixed */ protected function execute(InputInterface $input, OutputInterface $output) @@ -255,7 +255,7 @@ protected function getOptions() /** * Get the output implementation. * - * @return Symfony\Component\Console\Output\OutputInterface + * @return \Symfony\Component\Console\Output\OutputInterface */ public function getOutput() { @@ -265,7 +265,7 @@ public function getOutput() /** * Set the Laravel application instance. * - * @return Illuminate\Foundation\Application + * @return \Illuminate\Foundation\Application */ public function getLaravel() { @@ -275,7 +275,7 @@ public function getLaravel() /** * Set the Laravel application instance. * - * @param Illuminate\Foundation\Application $laravel + * @param \Illuminate\Foundation\Application $laravel * @return void */ public function setLaravel($laravel) From 17f102d59075b805079a54ee32be956b91a64aec Mon Sep 17 00:00:00 2001 From: ROMOPAT Date: Thu, 17 Jan 2013 08:24:25 +0100 Subject: [PATCH 2/5] Update PHPDocs for IDE support. I'm not done yet. The rest is still coming. --- src/Illuminate/Cookie/CookieJar.php | 16 +- src/Illuminate/Database/Connection.php | 38 +-- .../Database/ConnectionResolver.php | 4 +- .../Database/ConnectionResolverInterface.php | 2 +- .../Database/Connectors/ConnectionFactory.php | 6 +- .../Connectors/ConnectorInterface.php | 2 +- .../Database/Connectors/MySqlConnector.php | 2 +- .../Database/Connectors/SQLiteConnector.php | 2 +- .../Console/Migrations/InstallCommand.php | 4 +- .../Console/Migrations/MakeCommand.php | 4 +- .../Console/Migrations/MigrateCommand.php | 4 +- .../Console/Migrations/ResetCommand.php | 4 +- .../Console/Migrations/RollbackCommand.php | 4 +- .../Database/Console/SeedCommand.php | 12 +- src/Illuminate/Database/DatabaseManager.php | 290 +++++++++--------- src/Illuminate/Database/Eloquent/Builder.php | 30 +- .../Database/Eloquent/Collection.php | 2 +- src/Illuminate/Database/Eloquent/Model.php | 48 +-- .../Database/Eloquent/Relations/BelongsTo.php | 4 +- .../Eloquent/Relations/BelongsToMany.php | 36 +-- .../Database/Eloquent/Relations/HasMany.php | 2 +- .../Database/Eloquent/Relations/HasOne.php | 2 +- .../Eloquent/Relations/HasOneOrMany.php | 18 +- .../Database/Eloquent/Relations/MorphMany.php | 2 +- .../Database/Eloquent/Relations/MorphOne.php | 2 +- .../Eloquent/Relations/MorphOneOrMany.php | 6 +- .../Database/Eloquent/Relations/Relation.php | 14 +- src/Illuminate/Database/Grammar.php | 4 +- .../DatabaseMigrationRepository.php | 10 +- .../Database/Migrations/MigrationCreator.php | 6 +- .../MigrationRepositoryInterface.php | 2 +- .../Database/Migrations/Migrator.php | 20 +- src/Illuminate/Database/MySqlConnection.php | 6 +- .../Database/PostgresConnection.php | 6 +- src/Illuminate/Database/Query/Builder.php | 102 +++--- .../Database/Query/Grammars/Grammar.php | 54 ++-- .../Query/Grammars/PostgresGrammar.php | 2 +- .../Database/Query/Grammars/SQLiteGrammar.php | 4 +- .../Query/Grammars/SqlServerGrammar.php | 10 +- src/Illuminate/Database/Query/JoinClause.php | 4 +- .../Query/Processors/PostgresProcessor.php | 2 +- .../Database/Query/Processors/Processor.php | 4 +- src/Illuminate/Database/SQLiteConnection.php | 4 +- src/Illuminate/Database/Schema/Blueprint.php | 70 ++--- src/Illuminate/Database/Schema/Builder.php | 26 +- .../Database/Schema/Grammars/Grammar.php | 18 +- .../Database/Schema/Grammars/MySqlGrammar.php | 96 +++--- .../Schema/Grammars/PostgresGrammar.php | 88 +++--- .../Schema/Grammars/SQLiteGrammar.php | 84 ++--- .../Schema/Grammars/SqlServerGrammar.php | 84 ++--- src/Illuminate/Database/Seeder.php | 10 +- .../Database/SqlServerConnection.php | 4 +- src/Illuminate/Events/Dispatcher.php | 240 +++++++-------- .../Exception/ExceptionServiceProvider.php | 258 ++++++++-------- src/Illuminate/Exception/Handler.php | 3 +- .../Exception/StubShutdownHandler.php | 3 +- src/Illuminate/Foundation/AliasLoader.php | 6 +- src/Illuminate/Foundation/Application.php | 18 +- src/Illuminate/Foundation/Artisan.php | 10 +- src/Illuminate/Foundation/AssetPublisher.php | 4 +- src/Illuminate/Foundation/ClassLoader.php | 4 +- src/Illuminate/Foundation/Composer.php | 6 +- src/Illuminate/Foundation/ConfigPublisher.php | 4 +- .../Console/AssetPublishCommand.php | 4 +- .../Foundation/Console/CommandMakeCommand.php | 2 +- .../Console/ConfigPublishCommand.php | 4 +- .../Foundation/Console/KeyGenerateCommand.php | 2 +- .../Foundation/ProviderRepository.php | 16 +- src/Illuminate/Foundation/Testing/Client.php | 4 +- .../Foundation/Testing/TestCase.php | 12 +- 70 files changed, 941 insertions(+), 939 deletions(-) diff --git a/src/Illuminate/Cookie/CookieJar.php b/src/Illuminate/Cookie/CookieJar.php index 2e6d3620dc21..40134b9a3020 100644 --- a/src/Illuminate/Cookie/CookieJar.php +++ b/src/Illuminate/Cookie/CookieJar.php @@ -18,7 +18,7 @@ class CookieJar { /** * The encrypter instance. * - * @var Illuminate\Encryption\Encrypter + * @var \Illuminate\Encryption\Encrypter */ protected $encrypter; @@ -32,8 +32,8 @@ class CookieJar { /** * Create a new cookie manager instance. * - * @param Symfony\Component\HttpFoundation\Request $request - * @param Illuminate\Encryption\Encrypter $encrypter + * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Illuminate\Encryption\Encrypter $encrypter * @param array $defaults * @return void */ @@ -98,7 +98,7 @@ protected function decrypt($value) * @param string $name * @param string $value * @param int $minutes - * @return Symfony\Component\HttpFoundation\Cookie + * @return \Symfony\Component\HttpFoundation\Cookie */ public function make($name, $value, $minutes = 0) { @@ -119,7 +119,7 @@ public function make($name, $value, $minutes = 0) * * @param string $name * @param string $value - * @return Symfony\Component\HttpFoundation\Cookie + * @return \Symfony\Component\HttpFoundation\Cookie */ public function forever($name, $value) { @@ -130,7 +130,7 @@ public function forever($name, $value) * Expire the given cookie. * * @param string $name - * @return Symfony\Component\HttpFoundation\Cookie + * @return \Symfony\Component\HttpFoundation\Cookie */ public function forget($name) { @@ -140,7 +140,7 @@ public function forget($name) /** * Get the request instance. * - * @return Symfony\Component\HttpFoundation\Request + * @return \Symfony\Component\HttpFoundation\Request */ public function getRequest() { @@ -150,7 +150,7 @@ public function getRequest() /** * Get the encrypter instance. * - * @return Illuminate\Encrypter + * @return \Illuminate\Encryption\Encrypter */ public function getEncrypter() { diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php index 2f36d913a4c9..a54f824c4d72 100644 --- a/src/Illuminate/Database/Connection.php +++ b/src/Illuminate/Database/Connection.php @@ -17,35 +17,35 @@ class Connection implements ConnectionInterface { /** * The query grammar implementation. * - * @var Illuminate\Database\Query\Grammars\Grammar + * @var \Illuminate\Database\Query\Grammars\Grammar */ protected $queryGrammar; /** * The schema grammar implementation. * - * @var Illuminate\Database\Schema\Grammars\Grammar + * @var \Illuminate\Database\Schema\Grammars\Grammar */ protected $schemaGrammar; /** * The query post processor implementation. * - * @var Illuminate\Database\Query\Processors\Processor + * @var \Illuminate\Database\Query\Processors\Processor */ protected $postProcessor; /** * The event dispatcher instance. * - * @var Illuminate\Events\Dispatcher + * @var \Illuminate\Events\Dispatcher */ protected $events; /** * The paginator environment instance. * - * @var Illuminate\Pagination\Paginator + * @var \Illuminate\Pagination\Paginator */ protected $paginator; @@ -124,7 +124,7 @@ public function useDefaultQueryGrammar() /** * Get the default query grammar instance. * - * @return Illuminate\Database\Query\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { @@ -144,7 +144,7 @@ public function useDefaultSchemaGrammar() /** * Get the default schema grammar instance. * - * @return Illuminate\Database\Schema\Grammars\Grammar + * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getDefaultSchemaGrammar() {} @@ -161,7 +161,7 @@ public function useDefaultPostProcessor() /** * Get the default post processor instance. * - * @return Illuminate\Database\Query\Processors\Processor + * @return \Illuminate\Database\Query\Processors\Processor */ protected function getDefaultPostProcessor() { @@ -171,7 +171,7 @@ protected function getDefaultPostProcessor() /** * Get a schema builder instance for the connection. * - * @return Illuminate\Database\Schema\Builder + * @return \Illuminate\Database\Schema\Builder */ public function getSchemaBuilder() { @@ -184,7 +184,7 @@ public function getSchemaBuilder() * Begin a fluent query against a database table. * * @param string $table - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function table($table) { @@ -199,7 +199,7 @@ public function table($table) * Get a new raw query expression. * * @param mixed $value - * @return Illuminate\Database\Query\Expression + * @return \Illuminate\Database\Query\Expression */ public function raw($value) { @@ -472,7 +472,7 @@ public function getDriverName() /** * Get the query grammar used by the connection. * - * @return Illuminate\Database\Query\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ public function getQueryGrammar() { @@ -493,7 +493,7 @@ public function setQueryGrammar(Query\Grammars\Grammar $grammar) /** * Get the schema grammar used by the connection. * - * @return Illuminate\Database\Query\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ public function getSchemaGrammar() { @@ -514,7 +514,7 @@ public function setSchemaGrammar(Schema\Grammars\Grammar $grammar) /** * Get the query post processor used by the connection. * - * @return Illuminate\Database\Query\Processors\Processor + * @return \Illuminate\Database\Query\Processors\Processor */ public function getPostProcessor() { @@ -535,7 +535,7 @@ public function setPostProcessor(Processor $processor) /** * Get the event dispatcher used by the connection. * - * @return Illuminate\Events\Dispatcher + * @return \Illuminate\Events\Dispatcher */ public function getEventDispatcher() { @@ -556,7 +556,7 @@ public function setEventDispatcher(\Illuminate\Events\Dispatcher $events) /** * Get the paginator environment instance. * - * @return Illuminate\Pagination\Environment + * @return \Illuminate\Pagination\Environment */ public function getPaginator() { @@ -571,7 +571,7 @@ public function getPaginator() /** * Set the pagination environment instance. * - * @param Illuminate\Pagination\Environment|Closure $paginator + * @param \Illuminate\Pagination\Environment|Closure $paginator * @return void */ public function setPaginator($paginator) @@ -654,8 +654,8 @@ public function getTablePrefix() /** * Set the table prefix and return the grammar. * - * @param Illuminate\Database\Grammar $grammar - * @return Illuminate\Database\Grammar + * @param \Illuminate\Database\Grammar $grammar + * @return \Illuminate\Database\Grammar */ public function withTablePrefix(Grammar $grammar) { diff --git a/src/Illuminate/Database/ConnectionResolver.php b/src/Illuminate/Database/ConnectionResolver.php index 52ad672c06aa..d05cfe2e2313 100644 --- a/src/Illuminate/Database/ConnectionResolver.php +++ b/src/Illuminate/Database/ConnectionResolver.php @@ -34,7 +34,7 @@ public function __construct(array $connections = array()) * Get a database connection instance. * * @param string $name - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function connection($name = null) { @@ -47,7 +47,7 @@ public function connection($name = null) * Add a connection to the resolver. * * @param string $name - * @param Illuminate\Database\Connection $connection + * @param \Illuminate\Database\Connection $connection * @return void */ public function addConnection($name, Connection $connection) diff --git a/src/Illuminate/Database/ConnectionResolverInterface.php b/src/Illuminate/Database/ConnectionResolverInterface.php index d0166d5bbb4f..7e9cfd651501 100644 --- a/src/Illuminate/Database/ConnectionResolverInterface.php +++ b/src/Illuminate/Database/ConnectionResolverInterface.php @@ -6,7 +6,7 @@ interface ConnectionResolverInterface { * Get a database connection instance. * * @param string $name - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function connection($name = null); diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index a7e91a65d14f..b74dd216d3a9 100644 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -12,7 +12,7 @@ class ConnectionFactory { * Establish a PDO connection based on the configuration. * * @param array $config - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function make(array $config) { @@ -30,7 +30,7 @@ public function make(array $config) * Create a connector instance based on the configuration. * * @param array $config - * @return Illuminate\Database\Connectors\ConnectorInterface + * @return \Illuminate\Database\Connectors\ConnectorInterface */ public function createConnector(array $config) { @@ -64,7 +64,7 @@ public function createConnector(array $config) * @param PDO $connection * @param string $database * @param string $tablePrefix - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ protected function createConnection($driver, PDO $connection, $database, $tablePrefix = '') { diff --git a/src/Illuminate/Database/Connectors/ConnectorInterface.php b/src/Illuminate/Database/Connectors/ConnectorInterface.php index c734f9dbe06c..a3f5ea5715f1 100644 --- a/src/Illuminate/Database/Connectors/ConnectorInterface.php +++ b/src/Illuminate/Database/Connectors/ConnectorInterface.php @@ -6,7 +6,7 @@ interface ConnectorInterface { * Establish a database connection. * * @param array $config - * @return PDO + * @return \PDO */ public function connect(array $config); diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index b0c62eb81692..f6012d3e059b 100644 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -6,7 +6,7 @@ class MySqlConnector extends Connector implements ConnectorInterface { * Establish a database connection. * * @param array $options - * @return PDO + * @return \PDO */ public function connect(array $config) { diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index b795b3b6fa1e..44163941a516 100644 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -6,7 +6,7 @@ class SQLiteConnector extends Connector implements ConnectorInterface { * Establish a database connection. * * @param array $options - * @return PDO + * @return \PDO */ public function connect(array $config) { diff --git a/src/Illuminate/Database/Console/Migrations/InstallCommand.php b/src/Illuminate/Database/Console/Migrations/InstallCommand.php index d50264576b5d..09b63f439c70 100644 --- a/src/Illuminate/Database/Console/Migrations/InstallCommand.php +++ b/src/Illuminate/Database/Console/Migrations/InstallCommand.php @@ -23,14 +23,14 @@ class InstallCommand extends Command { /** * The repository instance. * - * @var Illuminate\Database\Console\Migrations\MigrationRepositoryInterface + * @var \Illuminate\Database\Migrations\MigrationRepositoryInterface */ protected $repository; /** * Create a new migration install command instance. * - * @param Illuminate\Database\Console\Migrations\MigrationRepositoryInterface $repository + * @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository * @return void */ public function __construct(MigrationRepositoryInterface $repository) diff --git a/src/Illuminate/Database/Console/Migrations/MakeCommand.php b/src/Illuminate/Database/Console/Migrations/MakeCommand.php index 08531f6429f7..39645a5fd20d 100644 --- a/src/Illuminate/Database/Console/Migrations/MakeCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MakeCommand.php @@ -24,7 +24,7 @@ class MakeCommand extends BaseCommand { /** * The migration creaotor instance. * - * @var Illuminate\Database\Migrations\MigrationCreator + * @var \Illuminate\Database\Migrations\MigrationCreator */ protected $creator; @@ -38,7 +38,7 @@ class MakeCommand extends BaseCommand { /** * Create a new migration install command instance. * - * @param Illuminate\Database\Migrations\MigrationCreator $creator + * @param \Illuminate\Database\Migrations\MigrationCreator $creator * @param string $packagePath * @return void */ diff --git a/src/Illuminate/Database/Console/Migrations/MigrateCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateCommand.php index 3360fccc0f09..800507d2f8cc 100644 --- a/src/Illuminate/Database/Console/Migrations/MigrateCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateCommand.php @@ -24,7 +24,7 @@ class MigrateCommand extends BaseCommand { /** * The migrator instance. * - * @var Illuminate\Database\Migrations\Migrator + * @var \Illuminate\Database\Migrations\Migrator */ protected $migrator; @@ -36,7 +36,7 @@ class MigrateCommand extends BaseCommand { /** * Create a new migration command instance. * - * @param Illuminate\Database\Migrations\Migrator $migrator + * @param \Illuminate\Database\Migrations\Migrator $migrator * @param string $packagePath * @return void */ diff --git a/src/Illuminate/Database/Console/Migrations/ResetCommand.php b/src/Illuminate/Database/Console/Migrations/ResetCommand.php index a65b044e6667..386858daa9d4 100644 --- a/src/Illuminate/Database/Console/Migrations/ResetCommand.php +++ b/src/Illuminate/Database/Console/Migrations/ResetCommand.php @@ -23,14 +23,14 @@ class ResetCommand extends Command { /** * The migrator instance. * - * @var Illuminate\Database\Migrations\Migrator + * @var \Illuminate\Database\Migrations\Migrator */ protected $migrator; /** * Create a new migration rollback command instance. * - * @param Illuminate\Database\Migrations\Migrator $migrator + * @param \Illuminate\Database\Migrations\Migrator $migrator * @return void */ public function __construct(Migrator $migrator) diff --git a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php index 5ff560d02f65..5d2ab4becdb7 100644 --- a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php @@ -23,14 +23,14 @@ class RollbackCommand extends Command { /** * The migrator instance. * - * @var Illuminate\Database\Migrations\Migrator + * @var \Illuminate\Database\Migrations\Migrator */ protected $migrator; /** * Create a new migration rollback command instance. * - * @param Illuminate\Database\Migrations\Migrator $migrator + * @param \Illuminate\Database\Migrations\Migrator $migrator * @return void */ public function __construct(Migrator $migrator) diff --git a/src/Illuminate/Database/Console/SeedCommand.php b/src/Illuminate/Database/Console/SeedCommand.php index 343b55ef9515..bd5aa8217a1c 100644 --- a/src/Illuminate/Database/Console/SeedCommand.php +++ b/src/Illuminate/Database/Console/SeedCommand.php @@ -26,21 +26,21 @@ class SeedCommand extends Command { /** * The connection resolver instance. * - * @var Illuminate\Database\ConnectionResolverInterface + * @var \Illuminate\Database\ConnectionResolverInterface */ protected $resolver; /** * The database seeder instance. * - * @var Illuminate\Database\Seeder + * @var \Illuminate\Database\Seeder */ protected $seeder; /** * The event dispatcher instance. * - * @var Illuminate\Events\Dispatcher + * @var \Illuminate\Events\Dispatcher */ protected $events; @@ -54,9 +54,9 @@ class SeedCommand extends Command { /** * Create a new database seed command instance. * - * @param Illuminate\Database\ConnectionResolverInterface $resolver - * @param Illuminate\Database\Seeder $seeder - * @param Illuminate\Events\Dispatcher $events + * @param \Illuminate\Database\ConnectionResolverInterface $resolver + * @param \Illuminate\Database\Seeder $seeder + * @param \Illuminate\Events\Dispatcher $events * @param string $path * @return void */ diff --git a/src/Illuminate/Database/DatabaseManager.php b/src/Illuminate/Database/DatabaseManager.php index 44bdfba1d24f..e2cb1b275a22 100644 --- a/src/Illuminate/Database/DatabaseManager.php +++ b/src/Illuminate/Database/DatabaseManager.php @@ -1,146 +1,146 @@ -app = $app; - $this->factory = $factory; - } - - /** - * Get a database connection instance. - * - * @param string $name - * @return Illuminate\Database\Connection - */ - public function connection($name = null) - { - $name = $name ?: $this->getDefaultConnection(); - - // If we haven't created this connection, we'll create it based on the config - // provided in the application. Once we've created the connections we will - // set the "fetch mode" for PDO which determines the query return types. - if ( ! isset($this->connections[$name])) - { - $connection = $this->factory->make($this->getConfig($name)); - - $this->connections[$name] = $this->prepare($connection); - } - - return $this->connections[$name]; - } - - /** - * Prepare the database connection instance. - * - * @param Illuminate\Database\Connection $connection - * @return Illuminate\Database\Connection - */ - protected function prepare(Connection $connection) - { - $connection->setFetchMode($this->app['config']['database.fetch']); - - $connection->setEventDispatcher($this->app['events']); - - // We will setup a Closure to resolve the paginator instance on the connection - // since the Paginator isn't sued on every request and needs quite a few of - // our dependencies. It'll be more efficient to lazily resolve instances. - $app = $this->app; - - $connection->setPaginator(function() use ($app) - { - return $app['paginator']; - }); - - return $connection; - } - - /** - * Get the configuration for a connection. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - $name = $name ?: $this->getDefaultConnection(); - - // To get the database connection configuration, we will just pull each of the - // connection configurations and get the configurations for the given name. - // If the configuration doesn't exist, we'll throw an exception and bail. - $connections = $this->app['config']['database.connections']; - - if (is_null($config = array_get($connections, $name))) - { - throw new \InvalidArgumentException("Database [$name] not configured."); - } - - return $config; - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection() - { - return $this->app['config']['database.default']; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name) - { - $this->app['config']['database.default'] = $name; - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return call_user_func_array(array($this->connection(), $method), $parameters); - } - +app = $app; + $this->factory = $factory; + } + + /** + * Get a database connection instance. + * + * @param string $name + * @return \Illuminate\Database\Connection + */ + public function connection($name = null) + { + $name = $name ?: $this->getDefaultConnection(); + + // If we haven't created this connection, we'll create it based on the config + // provided in the application. Once we've created the connections we will + // set the "fetch mode" for PDO which determines the query return types. + if ( ! isset($this->connections[$name])) + { + $connection = $this->factory->make($this->getConfig($name)); + + $this->connections[$name] = $this->prepare($connection); + } + + return $this->connections[$name]; + } + + /** + * Prepare the database connection instance. + * + * @param \Illuminate\Database\Connection $connection + * @return \Illuminate\Database\Connection + */ + protected function prepare(Connection $connection) + { + $connection->setFetchMode($this->app['config']['database.fetch']); + + $connection->setEventDispatcher($this->app['events']); + + // We will setup a Closure to resolve the paginator instance on the connection + // since the Paginator isn't sued on every request and needs quite a few of + // our dependencies. It'll be more efficient to lazily resolve instances. + $app = $this->app; + + $connection->setPaginator(function() use ($app) + { + return $app['paginator']; + }); + + return $connection; + } + + /** + * Get the configuration for a connection. + * + * @param string $name + * @return array + */ + protected function getConfig($name) + { + $name = $name ?: $this->getDefaultConnection(); + + // To get the database connection configuration, we will just pull each of the + // connection configurations and get the configurations for the given name. + // If the configuration doesn't exist, we'll throw an exception and bail. + $connections = $this->app['config']['database.connections']; + + if (is_null($config = array_get($connections, $name))) + { + throw new \InvalidArgumentException("Database [$name] not configured."); + } + + return $config; + } + + /** + * Get the default connection name. + * + * @return string + */ + public function getDefaultConnection() + { + return $this->app['config']['database.default']; + } + + /** + * Set the default connection name. + * + * @param string $name + * @return void + */ + public function setDefaultConnection($name) + { + $this->app['config']['database.default'] = $name; + } + + /** + * Dynamically pass methods to the default connection. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return call_user_func_array(array($this->connection(), $method), $parameters); + } + } \ No newline at end of file diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index 397f3e117d46..c07c94ca2318 100644 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -9,14 +9,14 @@ class Builder { /** * The base query builder instance. * - * @var Illuminate\Database\Query\Builder + * @var \Illuminate\Database\Query\Builder */ protected $query; /** * The model being queried. * - * @var Illuminate\Database\Eloquent\Model + * @var \Illuminate\Database\Eloquent\Model */ protected $model; @@ -40,7 +40,7 @@ class Builder { /** * Create a new Eloquent query builder instance. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @return void */ public function __construct(QueryBuilder $query) @@ -53,7 +53,7 @@ public function __construct(QueryBuilder $query) * * @param mixed $id * @param array $columns - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function find($id, $columns = array('*')) { @@ -77,7 +77,7 @@ public function first($columns = array('*')) * Execute the query as a "select" statement. * * @param array $columns - * @return Illuminate\Database\Eloquent\Collection + * @return \Illuminate\Database\Eloquent\Collection */ public function get($columns = array('*')) { @@ -99,7 +99,7 @@ public function get($columns = array('*')) * * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function paginate($perPage = null, $columns = array('*')) { @@ -120,10 +120,10 @@ public function paginate($perPage = null, $columns = array('*')) /** * Get a paginator for a grouped statement. * - * @param Illuminate\Pagination\Environment $paginator + * @param \Illuminate\Pagination\Environment $paginator * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ protected function groupedPaginate($paginator, $perPage, $columns) { @@ -135,10 +135,10 @@ protected function groupedPaginate($paginator, $perPage, $columns) /** * Get a paginator for an ungrouped statement. * - * @param Illuminate\Pagination\Environment $paginator + * @param \Illuminate\Pagination\Environment $paginator * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ protected function ungroupedPaginate($paginator, $perPage, $columns) { @@ -295,7 +295,7 @@ protected function nestedRelations($relation) * Set the relationships that should be eager loaded. * * @param dynamic $relation - * @return Illuminate\Database\Eloquent\Builder + * @return \Illuminate\Database\Eloquent\Builder */ public function with($relations) { @@ -369,7 +369,7 @@ protected function parseNestedRelations($name, $results) /** * Get the underlying query builder instance. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function getQuery() { @@ -379,7 +379,7 @@ public function getQuery() /** * Set the underlying query builder instance. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @return void */ public function setQuery($query) @@ -411,7 +411,7 @@ public function setEagerLoads(array $eagerLoad) /** * Get the model instance being queried. * - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function getModel() { @@ -421,7 +421,7 @@ public function getModel() /** * Set a model instance for the model being queried. * - * @param Illuminate\Database\Eloquent\Model $model + * @param \Illuminate\Database\Eloquent\Model $model * @return void */ public function setModel(Model $model) diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index acf348b6e6ee..e4a9443ad339 100644 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -54,7 +54,7 @@ public function load() * Add an item to the collection. * * @param mixed $item - * @return Illuminate\Database\Eloquent\Collection + * @return \Illuminate\Database\Eloquent\Collection */ public function add($item) { diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index fd68f9f394a5..e696b02af804 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -117,7 +117,7 @@ abstract class Model implements ArrayableInterface, JsonableInterface { /** * The connection resolver instance. * - * @var Illuminate\Database\ConnectionResolverInterface + * @var \Illuminate\Database\ConnectionResolverInterface */ protected static $resolver; @@ -136,7 +136,7 @@ public function __construct(array $attributes = array()) * Fill the model with an array of attributes. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function fill(array $attributes) { @@ -159,7 +159,7 @@ public function fill(array $attributes) * * @param array $attributes * @param bool $exists - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function newInstance($attributes = array(), $exists = false) { @@ -177,7 +177,7 @@ public function newInstance($attributes = array(), $exists = false) * Create a new model instance that is existing. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function newExisting($attributes = array()) { @@ -188,7 +188,7 @@ public function newExisting($attributes = array()) * Save a new model and return the instance. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public static function create(array $attributes) { @@ -203,7 +203,7 @@ public static function create(array $attributes) * Begin querying the model on a given connection. * * @param string $connection - * @return Illuminate\Database\Eloquent\Builder + * @return \Illuminate\Database\Eloquent\Builder */ public static function on($connection) { @@ -221,7 +221,7 @@ public static function on($connection) * Get all of the models from the database. * * @param array $columns - * @return Illuminate\Database\Eloquent\Collection + * @return \Illuminate\Database\Eloquent\Collection */ public static function all($columns = array('*')) { @@ -235,7 +235,7 @@ public static function all($columns = array('*')) * * @param mixed $id * @param array $columns - * @return Illuminate\Database\Eloquent\Model|Collection + * @return \Illuminate\Database\Eloquent\Model|Collection */ public static function find($id, $columns = array('*')) { @@ -253,7 +253,7 @@ public static function find($id, $columns = array('*')) * Being querying a model with eager loading. * * @param array $relations - * @return Illuminate\Database\Eloquent\Builder + * @return \Illuminate\Database\Eloquent\Builder */ public static function with($relations) { @@ -269,7 +269,7 @@ public static function with($relations) * * @param string $related * @param string $foreignKey - * @return Illuminate\Database\Eloquent\Relation\HasOne + * @return \Illuminate\Database\Eloquent\Relations\HasOne */ public function hasOne($related, $foreignKey = null) { @@ -286,7 +286,7 @@ public function hasOne($related, $foreignKey = null) * @param string $related * @param string $name * @param string $foreignKey - * @return Illuminate\Database\Eloquent\Relation\MorphOne + * @return \Illuminate\Database\Eloquent\Relations\MorphOne */ public function morphOne($related, $name) { @@ -300,7 +300,7 @@ public function morphOne($related, $name) * * @param string $related * @param string $foreignKey - * @return Illuminate\Database\Eloquent\Relations\BelongsTo + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function belongsTo($related, $foreignKey = null) { @@ -328,7 +328,7 @@ public function belongsTo($related, $foreignKey = null) * Define an polymorphic, inverse one-to-one or many relationship. * * @param string $name - * @return Illuminate\Database\Eloquent\Relations\BelongsTo + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function morphTo($name = null) { @@ -350,7 +350,7 @@ public function morphTo($name = null) * * @param string $related * @param string $foreignKey - * @return Illuminate\Database\Eloquent\Relations\HasMany + * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function hasMany($related, $foreignKey = null) { @@ -367,7 +367,7 @@ public function hasMany($related, $foreignKey = null) * @param string $related * @param string $name * @param string $foreignKey - * @return Illuminate\Database\Eloquent\Relation\MorphMany + * @return \Illuminate\Database\Eloquent\Relation\MorphMany */ public function morphMany($related, $name) { @@ -383,7 +383,7 @@ public function morphMany($related, $name) * @param string $table * @param string $foreignKey * @param string $otherKey - * @return Illuminate\Database\Eloquent\Relations\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null) { @@ -555,7 +555,7 @@ public function newQuery() /** * Get a new query builder instance for the connection. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function newBaseQueryBuilder() { @@ -570,7 +570,7 @@ protected function newBaseQueryBuilder() * Create a new Eloquent Collection instance. * * @param array $models - * @return Illuminate\Database\Eloquent\Collection + * @return \Illuminate\Database\Eloquent\Collection */ public function newCollection(array $models = array()) { @@ -694,7 +694,7 @@ public function getFillable() * Set the fillable attributes for the model. * * @param array $fillable - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function fillable(array $fillable) { @@ -707,7 +707,7 @@ public function fillable(array $fillable) * Set the guarded attributes for the model. * * @param array $guarded - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function guard(array $guarded) { @@ -1055,7 +1055,7 @@ public function setRelation($relation, $value) /** * Get the database connection for the model. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function getConnection() { @@ -1087,7 +1087,7 @@ public function setConnection($name) * Resolve a connection instance by name. * * @param string $connection - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public static function resolveConnection($connection) { @@ -1097,7 +1097,7 @@ public static function resolveConnection($connection) /** * Get the connection resolver instance. * - * @return Illuminate\Database\ConnectionResolverInterface + * @return \Illuminate\Database\ConnectionResolverInterface */ public static function getConnectionResolver() { @@ -1107,7 +1107,7 @@ public static function getConnectionResolver() /** * Set the connection resolver instance. * - * @param Illuminate\Database\ConnectionResolverInterface $resolver + * @param \Illuminate\Database\ConnectionResolverInterface $resolver * @return void */ public static function setConnectionResolver(Resolver $resolver) diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php index c84a2d3907f4..12a2cbb49936 100644 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php @@ -16,8 +16,8 @@ class BelongsTo extends Relation { /** * Create a new has many relationship instance. * - * @param Illuminate\Database\Eloquent\Builder $query - * @param Illuminate\Database\Eloquent\Model $parent + * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Model $parent * @param string $foreignKey * @return void */ diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 7ed284d03f4f..2dae860fa06b 100644 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -38,8 +38,8 @@ class BelongsToMany extends Relation { /** * Create a new has many relationship instance. * - * @param Illuminate\Database\Eloquent\Builder $query - * @param Illuminate\Database\Eloquent\Model $parent + * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Model $parent * @param string $table * @param string $foreignKey * @param string $otherKey @@ -68,7 +68,7 @@ public function getResults() * Execute the query as a "select" statement. * * @param array $columns - * @return Illuminate\Database\Eloquent\Collection + * @return \Illuminate\Database\Eloquent\Collection */ public function get($columns = array('*')) { @@ -111,7 +111,7 @@ protected function hydratePivotRelation(array $models) /** * Get the pivot attributes from a model. * - * @param Illuminate\Database\Eloquent\Model $model + * @param \Illuminate\Database\Eloquent\Model $model * @return array */ protected function cleanPivotAttributes(Model $model) @@ -147,7 +147,7 @@ public function addConstraints() /** * Set the select clause for the relation query. * - * @return Illuminate\Database\Eloquent\Relation\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ protected function getSelectColumns() { @@ -181,7 +181,7 @@ protected function getAliasedPivotColumns() /** * Set the join clause for the relation query. * - * @return Illuminate\Database\Eloquent\Relation\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ protected function setJoin() { @@ -200,7 +200,7 @@ protected function setJoin() /** * Set the where clause for the relation query. * - * @return Illuminate\Database\Eloquent\Relation\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ protected function setWhere() { @@ -243,7 +243,7 @@ public function initRelation(array $models, $relation) * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ @@ -270,7 +270,7 @@ public function match(array $models, Collection $results, $relation) /** * Build model dictionary keyed by the relation's foreign key. * - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @return array */ protected function buildDictionary(Collection $results) @@ -293,9 +293,9 @@ protected function buildDictionary(Collection $results) /** * Save a new model and attach it to the parent model. * - * @param Illuminate\Database\Eloquent\Model $model + * @param \Illuminate\Database\Eloquent\Model $model * @param array $joining - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function save(Model $model, array $joining = array()) { @@ -311,7 +311,7 @@ public function save(Model $model, array $joining = array()) * * @param array $attributes * @param array $joining - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function create(array $attributes, array $joining = array()) { @@ -486,7 +486,7 @@ public function delete() /** * Create a new query builder for the pivot table. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function newPivotQuery() { @@ -498,7 +498,7 @@ protected function newPivotQuery() /** * Get a new plain query builder for the pivot table. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function newPivotStatement() { @@ -510,7 +510,7 @@ public function newPivotStatement() * * @param array $attributes * @param bool $exists - * @return Illuminate\Database\Eloquent\Relation\Pivot + * @return \Illuminate\Database\Eloquent\Relations\Pivot */ public function newPivot(array $attributes = array(), $exists = false) { @@ -527,7 +527,7 @@ public function newPivot(array $attributes = array(), $exists = false) * Create a new existing pivot model instance. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Relations\Pivot + * @return \Illuminate\Database\Eloquent\Relations\Pivot */ public function newExistingPivot(array $attributes = array()) { @@ -538,7 +538,7 @@ public function newExistingPivot(array $attributes = array()) * Set the columns on the pivot table to retrieve. * * @param array $columns - * @return Illuminate\Database\Eloquent\Relations\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function withPivot($columns) { @@ -550,7 +550,7 @@ public function withPivot($columns) /** * Specify that the pivot table has creation and update timestamps. * - * @return Illuminate\Database\Eloquent\Relations\BelongsToMany + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function withTimestamps() { diff --git a/src/Illuminate/Database/Eloquent/Relations/HasMany.php b/src/Illuminate/Database/Eloquent/Relations/HasMany.php index 0c875c16d074..171858258e7a 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasMany.php @@ -35,7 +35,7 @@ public function initRelation(array $models, $relation) * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ diff --git a/src/Illuminate/Database/Eloquent/Relations/HasOne.php b/src/Illuminate/Database/Eloquent/Relations/HasOne.php index f0371be352f6..69437c2ade9e 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasOne.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasOne.php @@ -35,7 +35,7 @@ public function initRelation(array $models, $relation) * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ diff --git a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php b/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php index cc8ac57143d8..7f8d4b19d340 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php @@ -16,8 +16,8 @@ abstract class HasOneOrMany extends Relation { /** * Create a new has many relationship instance. * - * @param Illuminate\Database\Eloquent\Builder $query - * @param Illuminate\Database\Eloquent\Model $parent + * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Model $parent * @param string $foreignKey * @return void */ @@ -55,7 +55,7 @@ public function addEagerConstraints(array $models) * Match the eagerly loaded results to their single parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ @@ -68,7 +68,7 @@ public function matchOne(array $models, Collection $results, $relation) * Match the eagerly loaded results to their many parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ @@ -81,7 +81,7 @@ public function matchMany(array $models, Collection $results, $relation) * Match the eagerly loaded results to their many parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @param string $type * @return array @@ -125,7 +125,7 @@ protected function getRelationValue(array $dictionary, $key, $type) /** * Build model dictionary keyed by the relation's foreign key. * - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @return array */ protected function buildDictionary(Collection $results) @@ -146,8 +146,8 @@ protected function buildDictionary(Collection $results) /** * Attach a model instance to the parent model. * - * @param Illuminate\Database\Eloquent\Model $model - * @return Illuminate\Database\Eloquent\Model + * @param \Illuminate\Database\Eloquent\Model $model + * @return \Illuminate\Database\Eloquent\Model */ public function save(Model $model) { @@ -162,7 +162,7 @@ public function save(Model $model) * Create a new instance of the related model. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function create(array $attributes) { diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphMany.php b/src/Illuminate/Database/Eloquent/Relations/MorphMany.php index 5412042e90a5..710fab5fba59 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphMany.php @@ -35,7 +35,7 @@ public function initRelation(array $models, $relation) * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphOne.php b/src/Illuminate/Database/Eloquent/Relations/MorphOne.php index 3d7981d1190f..9d00c539b4a9 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphOne.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphOne.php @@ -35,7 +35,7 @@ public function initRelation(array $models, $relation) * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php b/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php index 58042eba0a28..407d3d0b98d1 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php @@ -22,8 +22,8 @@ abstract class MorphOneOrMany extends HasOneOrMany { /** * Create a new has many relationship instance. * - * @param Illuminate\Database\Eloquent\Builder $query - * @param Illuminate\Database\Eloquent\Model $parent + * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Model $parent * @param string $morphName * @return void */ @@ -82,7 +82,7 @@ public function getAndResetWheres() * Create a new instance of the related model. * * @param array $attributes - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function create(array $attributes) { diff --git a/src/Illuminate/Database/Eloquent/Relations/Relation.php b/src/Illuminate/Database/Eloquent/Relations/Relation.php index 1f7d1aace593..b1f56db42e1d 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Relation.php +++ b/src/Illuminate/Database/Eloquent/Relations/Relation.php @@ -9,21 +9,21 @@ abstract class Relation { /** * The Eloquent query builder instance. * - * @var Illuminate\Database\Eloquent\Builder + * @var \Illuminate\Database\Eloquent\Builder */ protected $query; /** * The parent model instance. * - * @var Illuminate\Database\Eloquent\Model + * @var \Illuminate\Database\Eloquent\Model */ protected $parent; /** * The related model instance. * - * @var Illuminate\Database\Eloquent\Model + * @var \Illuminate\Database\Eloquent\Model */ protected $related; @@ -71,7 +71,7 @@ abstract public function initRelation(array $models, $relation); * Match the eagerly loaded results to their parents. * * @param array $models - * @param Illuminate\Database\Eloquent\Collection $results + * @param \Illuminate\Database\Eloquent\Collection $results * @param string $relation * @return array */ @@ -133,7 +133,7 @@ protected function getKeys(array $models) /** * Get the underlying query for the relation. * - * @return Illuminate\Database\Eloquent\Builder + * @return \Illuminate\Database\Eloquent\Builder */ public function getQuery() { @@ -143,7 +143,7 @@ public function getQuery() /** * Get the base query builder driving the Eloquent builder. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function getBaseQuery() { @@ -163,7 +163,7 @@ public function getParent() /** * Get the related model of the relation. * - * @return Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Model */ public function getRelated() { diff --git a/src/Illuminate/Database/Grammar.php b/src/Illuminate/Database/Grammar.php index 294eeacaff99..fec01bb829d8 100644 --- a/src/Illuminate/Database/Grammar.php +++ b/src/Illuminate/Database/Grammar.php @@ -122,7 +122,7 @@ public function parameter($value) /** * Get the value of a raw expression. * - * @param Illuminate\Database\Query\Expression $expression + * @param \Illuminate\Database\Query\Expression $expression * @return string */ public function getValue($expression) @@ -165,7 +165,7 @@ public function getTablePrefix() * Set the grammar's table prefix. * * @param string $prefix - * @return Illuminate\Database\Grammar + * @return \Illuminate\Database\Grammar */ public function setTablePrefix($prefix) { diff --git a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php index 76008985afd9..a71ebddeb0e7 100644 --- a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php +++ b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php @@ -9,7 +9,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface { /** * The database connection resolver instance. * - * @var Illuminate\Database\ConnectionResolverInterface + * @var \Illuminate\Database\ConnectionResolverInterface */ protected $resolver; @@ -30,7 +30,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface { /** * Create a new database migration repository instance. * - * @param Illuminate\Database\ConnectionResolverInterface $resolver + * @param \Illuminate\Database\ConnectionResolverInterface $resolver * @return void */ public function __construct(Resolver $resolver, $table) @@ -143,7 +143,7 @@ public function repositoryExists() /** * Get a query builder for the migration table. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function table() { @@ -153,7 +153,7 @@ protected function table() /** * Get the connection resolver instance. * - * @return Illuminate\Database\ConnectionResolverInterface + * @return \Illuminate\Database\ConnectionResolverInterface */ public function getConnectionResolver() { @@ -163,7 +163,7 @@ public function getConnectionResolver() /** * Resolve the database connection instance. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function getConnection() { diff --git a/src/Illuminate/Database/Migrations/MigrationCreator.php b/src/Illuminate/Database/Migrations/MigrationCreator.php index c0547bf02f5f..3ec85d84fdcc 100644 --- a/src/Illuminate/Database/Migrations/MigrationCreator.php +++ b/src/Illuminate/Database/Migrations/MigrationCreator.php @@ -8,7 +8,7 @@ class MigrationCreator { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -22,7 +22,7 @@ class MigrationCreator { /** * Create a new migration creator instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @return void */ public function __construct(Filesystem $files) @@ -159,7 +159,7 @@ public function getStubPath() /** * Get the filesystem instance. * - * @return Illuminate\Filesystem + * @return \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { diff --git a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php index 41e24eb9d684..a6263f1aff25 100644 --- a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php +++ b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php @@ -28,7 +28,7 @@ public function log($file, $batch); /** * Remove that a migration from the log. * - * @param StdClass $migration + * @param \StdClass $migration * @return void */ public function delete($migration); diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php index e4fb63057960..b5dfa9dfdabe 100644 --- a/src/Illuminate/Database/Migrations/Migrator.php +++ b/src/Illuminate/Database/Migrations/Migrator.php @@ -12,21 +12,21 @@ class Migrator { /** * The migration repository implementation. * - * @var Illuminate\Database\Migrations\MigrationRepositoryInterface + * @var \Illuminate\Database\Migrations\MigrationRepositoryInterface */ protected $repository; /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** * The connection resolver instance. * - * @var Illuminate\Database\ConnectionResolverInterface + * @var \Illuminate\Database\ConnectionResolverInterface */ protected $resolver; @@ -47,9 +47,9 @@ class Migrator { /** * Create a new migrator instance. * - * @param Illuminate\Database\Migrations\MigrationRepositoryInterface $repository - * @param Illuminate\Database\ConnectionResolverInterface $resolver - * @param Illuminate\Filesystem $files + * @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository + * @param \Illuminate\Database\ConnectionResolverInterface $resolver + * @param \Illuminate\Filesystem\Filesystem $files * @return void */ public function __construct(MigrationRepositoryInterface $repository, @@ -180,7 +180,7 @@ public function rollback($pretend = false) /** * Run "down" a migration instance. * - * @param StdClass $migration + * @param \StdClass $migration * @param bool $pretend * @return void */ @@ -314,7 +314,7 @@ public function getNotes() /** * Resolve the database connection instance. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function resolveConnection() { @@ -342,7 +342,7 @@ public function setConnection($name) /** * Get the migration repository instance. * - * @return Illuminate\Database\Migrations\MigrationRepositoryInterface + * @return \Illuminate\Database\Migrations\MigrationRepositoryInterface */ public function getRepository() { @@ -362,7 +362,7 @@ public function repositoryExists() /** * Get the file system instance. * - * @return Illuminate\Filesystem + * @return \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { diff --git a/src/Illuminate/Database/MySqlConnection.php b/src/Illuminate/Database/MySqlConnection.php index bcf7f26a6e7c..9dcdcfc66c74 100644 --- a/src/Illuminate/Database/MySqlConnection.php +++ b/src/Illuminate/Database/MySqlConnection.php @@ -5,7 +5,7 @@ class MySqlConnection extends Connection { /** * Get a schema builder instance for the connection. * - * @return Illuminate\Database\Schema\Builder + * @return \Illuminate\Database\Schema\Builder */ public function getSchemaBuilder() { @@ -17,7 +17,7 @@ public function getSchemaBuilder() /** * Get the default query grammar instance. * - * @return Illuminate\Database\Query\Grammars\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { @@ -27,7 +27,7 @@ protected function getDefaultQueryGrammar() /** * Get the default schema grammar instance. * - * @return Illuminate\Database\Schema\Grammars\Grammar + * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getDefaultSchemaGrammar() { diff --git a/src/Illuminate/Database/PostgresConnection.php b/src/Illuminate/Database/PostgresConnection.php index f9fc023e8cff..e4c32dd0c7f3 100644 --- a/src/Illuminate/Database/PostgresConnection.php +++ b/src/Illuminate/Database/PostgresConnection.php @@ -5,7 +5,7 @@ class PostgresConnection extends Connection { /** * Get the default query grammar instance. * - * @return Illuminate\Database\Query\Grammars\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { @@ -15,7 +15,7 @@ protected function getDefaultQueryGrammar() /** * Get the default schema grammar instance. * - * @return Illuminate\Database\Schema\Grammars\Grammar + * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getDefaultSchemaGrammar() { @@ -25,7 +25,7 @@ protected function getDefaultSchemaGrammar() /** * Get the default post processor instance. * - * @return Illuminate\Database\Query\Processors\Processor + * @return \Illuminate\Database\Query\Processors\Processor */ protected function getDefaultPostProcessor() { diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index d22de29c31fd..355516df4d17 100644 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -10,21 +10,21 @@ class Builder { /** * The database connection instance. * - * @var Illuminate\Database\Connection + * @var \Illuminate\Database\Connection */ protected $connection; /** * The database query grammar instance. * - * @var Illuminate\Database\Query\Grammars\Grammar + * @var \Illuminate\Database\Query\Grammars\Grammar */ protected $grammar; /** * The database query post processor instance. * - * @var Illuminate\Database\Query\Processors\Processor + * @var \Illuminate\Database\Query\Processors\Processor */ protected $processor; @@ -125,9 +125,9 @@ class Builder { /** * Create a new query builder instance. * - * @param Illuminate\Database\ConnectionInterface $connection - * @param Illuminate\Database\Query\Grammars\Grammar $grammar - * @param Illuminate\Database\Query\Processors\Processor $processor + * @param \Illuminate\Database\ConnectionInterface $connection + * @param \Illuminate\Database\Query\Grammars\Grammar $grammar + * @param \Illuminate\Database\Query\Processors\Processor $processor * @return void */ public function __construct(ConnectionInterface $connection, @@ -143,7 +143,7 @@ public function __construct(ConnectionInterface $connection, * Set the columns to be selected. * * @param array $columns - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function select($columns = array('*')) { @@ -155,7 +155,7 @@ public function select($columns = array('*')) /** * Force the query to only return distinct results. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function distinct() { @@ -168,7 +168,7 @@ public function distinct() * Set the table which the query is targeting. * * @param string $table - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function from($table) { @@ -185,7 +185,7 @@ public function from($table) * @param string $operator * @param string $second * @param string $type - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function join($table, $first, $operator = null, $second = null, $type = 'inner') { @@ -221,7 +221,7 @@ public function join($table, $first, $operator = null, $second = null, $type = ' * @param string $first * @param string $operator * @param string $second - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function leftJoin($table, $first, $operator = null, $second = null) { @@ -235,7 +235,7 @@ public function leftJoin($table, $first, $operator = null, $second = null) * @param string $operator * @param mixed $value * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function where($column, $operator = null, $value = null, $boolean = 'and') { @@ -284,7 +284,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' * @param string $column * @param string $operator * @param mixed $value - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhere($column, $operator = null, $value = null) { @@ -297,7 +297,7 @@ public function orWhere($column, $operator = null, $value = null) * @param string $sql * @param array $bindings * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereRaw($sql, array $bindings = array(), $boolean = 'and') { @@ -315,7 +315,7 @@ public function whereRaw($sql, array $bindings = array(), $boolean = 'and') * * @param string $sql * @param array $bindings - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereRaw($sql, array $bindings = array()) { @@ -328,7 +328,7 @@ public function orWhereRaw($sql, array $bindings = array()) * @param string $column * @param array $values * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereBetween($column, array $values, $boolean = 'and') { @@ -346,7 +346,7 @@ public function whereBetween($column, array $values, $boolean = 'and') * * @param string $column * @param array $values - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereBetween($column, array $values) { @@ -358,7 +358,7 @@ public function orWhereBetween($column, array $values) * * @param Closure $callback * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereNested(Closure $callback, $boolean = 'and') { @@ -390,7 +390,7 @@ public function whereNested(Closure $callback, $boolean = 'and') * @param string $operator * @param Closure $callback * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function whereSub($column, $operator, Closure $callback, $boolean) { @@ -416,7 +416,7 @@ protected function whereSub($column, $operator, Closure $callback, $boolean) * @param Closure $callback * @param string $boolean * @param bool $not - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereExists(Closure $callback, $boolean = 'and', $not = false) { @@ -441,7 +441,7 @@ public function whereExists(Closure $callback, $boolean = 'and', $not = false) * * @param Closure $callback * @param bool $not - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereExists(Closure $callback, $not = false) { @@ -453,7 +453,7 @@ public function orWhereExists(Closure $callback, $not = false) * * @param Closure $calback * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereNotExists(Closure $callback, $boolean = 'and') { @@ -464,7 +464,7 @@ public function whereNotExists(Closure $callback, $boolean = 'and') * Add a where not exists clause to the query. * * @param Closure $calback - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereNotExists(Closure $callback) { @@ -478,7 +478,7 @@ public function orWhereNotExists(Closure $callback) * @param mixed $values * @param string $boolean * @param bool $not - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereIn($column, $values, $boolean = 'and', $not = false) { @@ -505,7 +505,7 @@ public function whereIn($column, $values, $boolean = 'and', $not = false) * @param string $column * @param mixed $values * @param mixed $value - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereIn($column, $values) { @@ -518,7 +518,7 @@ public function orWhereIn($column, $values) * @param string $column * @param mixed $values * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereNotIn($column, $values, $boolean = 'and') { @@ -530,7 +530,7 @@ public function whereNotIn($column, $values, $boolean = 'and') * * @param string $column * @param mixed $values - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereNotIn($column, $values) { @@ -544,7 +544,7 @@ public function orWhereNotIn($column, $values) * @param Closure $callback * @param string $boolean * @param bool $not - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function whereInSub($column, Closure $callback, $boolean, $not) { @@ -570,7 +570,7 @@ protected function whereInSub($column, Closure $callback, $boolean, $not) * @param string $column * @param string $boolean * @param bool $not - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereNull($column, $boolean = 'and', $not = false) { @@ -585,7 +585,7 @@ public function whereNull($column, $boolean = 'and', $not = false) * Add an "or where null" clause to the query. * * @param string $column - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereNull($column) { @@ -597,7 +597,7 @@ public function orWhereNull($column) * * @param string $column * @param string $boolean - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function whereNotNull($column, $boolean = 'and') { @@ -608,7 +608,7 @@ public function whereNotNull($column, $boolean = 'and') * Add an "or where not null" clause to the query. * * @param string $column - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orWhereNotNull($column) { @@ -619,7 +619,7 @@ public function orWhereNotNull($column) * Add a "group by" clause to the query. * * @param dynamic $columns - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function groupBy() { @@ -634,7 +634,7 @@ public function groupBy() * @param string $column * @param string $operator * @param string $value - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function having($column, $operator = null, $value = null) { @@ -650,7 +650,7 @@ public function having($column, $operator = null, $value = null) * * @param string $column * @param string $direction - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function orderBy($column, $direction = 'asc') { @@ -663,7 +663,7 @@ public function orderBy($column, $direction = 'asc') * Set the "offset" value of the query. * * @param int $value - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function skip($value) { @@ -676,7 +676,7 @@ public function skip($value) * Set the "limit" value of the query. * * @param int $value - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function take($value) { @@ -690,7 +690,7 @@ public function take($value) * * @param int $page * @param int $perPage - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function forPage($page, $perPage = 15) { @@ -813,7 +813,7 @@ public function lists($column, $key = null) * * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function paginate($perPage = 15, $columns = array('*')) { @@ -832,10 +832,10 @@ public function paginate($perPage = 15, $columns = array('*')) /** * Create a paginator for a grouped pagination statement. * - * @param Illuminate\Pagination\Environment $paginator + * @param \Illuminate\Pagination\Environment $paginator * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ protected function groupedPaginate($paginator, $perPage, $columns) { @@ -847,10 +847,10 @@ protected function groupedPaginate($paginator, $perPage, $columns) /** * Build a paginator instance from a raw result array. * - * @param Illuminate\Pagination\Environment $paginator + * @param \Illuminate\Pagination\Environment $paginator * @param array $results * @param int $perPage - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function buildRawPaginator($paginator, $results, $perPage) { @@ -867,10 +867,10 @@ public function buildRawPaginator($paginator, $results, $perPage) /** * Create a paginator for an un-grouped pagination statement. * - * @param Illuminate\Pagination\Environment $paginator + * @param \Illuminate\Pagination\Environment $paginator * @param int $perPage * @param array $columns - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ protected function ungroupedPaginate($paginator, $perPage, $columns) { @@ -1098,7 +1098,7 @@ public function delete($id = null) /** * Get a new instance of the query builder. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function newQuery() { @@ -1151,7 +1151,7 @@ protected function cleanBindings(array $bindings) * Create a raw database expression. * * @param mixed $value - * @return Illuminate\Database\Query\Expression + * @return \Illuminate\Database\Query\Expression */ public function raw($value) { @@ -1182,7 +1182,7 @@ public function setBindings(array $bindings) /** * Merge an array of bindings into our bindings. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @return void */ public function mergeBindings(Builder $query) @@ -1193,7 +1193,7 @@ public function mergeBindings(Builder $query) /** * Get the database connection instance. * - * @return Illuminate\Database\ConnectionInterface + * @return \Illuminate\Database\ConnectionInterface */ public function getConnection() { @@ -1203,7 +1203,7 @@ public function getConnection() /** * Get the database query processor instance. * - * @return Illuminate\Database\Query\Processors\Processor + * @return \Illuminate\Database\Query\Processors\Processor */ public function getProcessor() { @@ -1213,7 +1213,7 @@ public function getProcessor() /** * Get the query grammar instance. * - * @return Illuminate\Database\Grammar + * @return \Illuminate\Database\Grammar */ public function getGrammar() { diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index b0752d69d3cb..cea802ba820e 100644 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -70,7 +70,7 @@ protected function compileComponents(Builder $query) /** * Compile an aggregated select clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $aggregate * @return string */ @@ -92,7 +92,7 @@ protected function compileAggregate(Builder $query, $aggregate) /** * Compile the "select *" portion of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $columns * @return string */ @@ -111,7 +111,7 @@ protected function compileColumns(Builder $query, $columns) /** * Compile the "from" portion of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param string $table * @return string */ @@ -123,7 +123,7 @@ protected function compileFrom(Builder $query, $table) /** * Compile the "join" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $joins * @return string */ @@ -181,7 +181,7 @@ protected function compileJoinConstraint(array $clause) /** * Compile the "where" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @return string */ protected function compileWheres(Builder $query) @@ -214,7 +214,7 @@ protected function compileWheres(Builder $query) /** * Compile a nested where clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -228,7 +228,7 @@ protected function whereNested(Builder $query, $where) /** * Compile a where condition with a sub-select. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -242,7 +242,7 @@ protected function whereSub(Builder $query, $where) /** * Compile a basic where clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -256,7 +256,7 @@ protected function whereBasic(Builder $query, $where) /** * Compile a "between" where clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -268,7 +268,7 @@ protected function whereBetween(Builder $query, $where) /** * Compile a where exists clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -280,7 +280,7 @@ protected function whereExists(Builder $query, $where) /** * Compile a where exists clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -292,7 +292,7 @@ protected function whereNotExists(Builder $query, $where) /** * Compile a "where in" clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -306,7 +306,7 @@ protected function whereIn(Builder $query, $where) /** * Compile a "where not in" clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -320,7 +320,7 @@ protected function whereNotIn(Builder $query, $where) /** * Compile a where in sub-select clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -334,7 +334,7 @@ protected function whereInSub(Builder $query, $where) /** * Compile a where not in sub-select clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -348,7 +348,7 @@ protected function whereNotInSub(Builder $query, $where) /** * Compile a "where null" clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -360,7 +360,7 @@ protected function whereNull(Builder $query, $where) /** * Compile a "where not null" clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -372,7 +372,7 @@ protected function whereNotNull(Builder $query, $where) /** * Compile a raw where clause. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ @@ -384,7 +384,7 @@ protected function whereRaw(Builder $query, $where) /** * Compile the "group by" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $groups * @return string */ @@ -396,7 +396,7 @@ protected function compileGroups(Builder $query, $groups) /** * Compile the "having" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $havings * @return string */ @@ -418,7 +418,7 @@ protected function compileHavings(Builder $query, $havings) /** * Compile the "order by" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $orders * @return string */ @@ -436,7 +436,7 @@ protected function compileOrders(Builder $query, $orders) /** * Compile the "limit" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param int $limit * @return string */ @@ -448,7 +448,7 @@ protected function compileLimit(Builder $query, $limit) /** * Compile the "offset" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param int $offset * @return string */ @@ -460,7 +460,7 @@ protected function compileOffset(Builder $query, $offset) /** * Compile an insert statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @return string */ @@ -493,7 +493,7 @@ public function compileInsert(Builder $query, array $values) /** * Compile an insert and get ID statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @param string $sequence * @return string @@ -506,7 +506,7 @@ public function compileInsertGetId(Builder $query, $values, $sequence) /** * Compile an update statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @return string */ @@ -537,7 +537,7 @@ public function compileUpdate(Builder $query, $values) /** * Compile a delete statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @return string */ diff --git a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php index 685eead0edba..36a44cc52754 100644 --- a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php @@ -7,7 +7,7 @@ class PostgresGrammar extends Grammar { /** * Compile an insert and get ID statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @param string $sequence * @return string diff --git a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php index 4a59552d690e..d60259ba1bcc 100644 --- a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php @@ -7,7 +7,7 @@ class SQLiteGrammar extends Grammar { /** * Compile the "order by" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $orders * @return string */ @@ -25,7 +25,7 @@ protected function compileOrders(Builder $query, $orders) /** * Compile an insert statement into SQL. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @return string */ diff --git a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php index a059f84ae4a1..1b57e8a8f9fb 100644 --- a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php @@ -28,7 +28,7 @@ public function compileSelect(Builder $query) /** * Compile the "select *" portion of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $columns * @return string */ @@ -52,7 +52,7 @@ protected function compileColumns(Builder $query, $columns) /** * Create a full ANSI offset clause for the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $components * @return string */ @@ -104,7 +104,7 @@ protected function compileOver($orderings) /** * Compile the limit / offset row constraint for a query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @return string */ protected function compileRowConstraint($query) @@ -136,7 +136,7 @@ protected function compileTableExpression($sql, $constraint) /** * Compile the "limit" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param int $limit * @return string */ @@ -148,7 +148,7 @@ protected function compileLimit(Builder $query, $limit) /** * Compile the "offset" portions of the query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param int $offset * @return string */ diff --git a/src/Illuminate/Database/Query/JoinClause.php b/src/Illuminate/Database/Query/JoinClause.php index b840dcf8c121..d3f610ad2fd4 100644 --- a/src/Illuminate/Database/Query/JoinClause.php +++ b/src/Illuminate/Database/Query/JoinClause.php @@ -43,7 +43,7 @@ public function __construct($type, $table) * @param string $operator * @param string $second * @param string $boolean - * @return Illuminate\Database\Query\JoinClause + * @return \Illuminate\Database\Query\JoinClause */ public function on($first, $operator, $second, $boolean = 'and') { @@ -58,7 +58,7 @@ public function on($first, $operator, $second, $boolean = 'and') * @param string $first * @param string $operator * @param string $second - * @return Illuminate\Database\Query\JoinClause + * @return \Illuminate\Database\Query\JoinClause */ public function orOn($first, $operator, $second) { diff --git a/src/Illuminate/Database/Query/Processors/PostgresProcessor.php b/src/Illuminate/Database/Query/Processors/PostgresProcessor.php index 9808cbfb311c..d13e2ff3b068 100644 --- a/src/Illuminate/Database/Query/Processors/PostgresProcessor.php +++ b/src/Illuminate/Database/Query/Processors/PostgresProcessor.php @@ -7,7 +7,7 @@ class PostgresProcessor extends Processor { /** * Process an "insert get ID" query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param string $sql * @param array $values * @param string $sequence diff --git a/src/Illuminate/Database/Query/Processors/Processor.php b/src/Illuminate/Database/Query/Processors/Processor.php index 1d25fdb23286..3dd1e311f659 100644 --- a/src/Illuminate/Database/Query/Processors/Processor.php +++ b/src/Illuminate/Database/Query/Processors/Processor.php @@ -7,7 +7,7 @@ class Processor { /** * Process the results of a "select" query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $results * @return array */ @@ -19,7 +19,7 @@ public function processSelect(Builder $query, $results) /** * Process an "insert get ID" query. * - * @param Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param string $sql * @param array $values * @param string $sequence diff --git a/src/Illuminate/Database/SQLiteConnection.php b/src/Illuminate/Database/SQLiteConnection.php index 37f3c551ece4..df27fcc881c8 100644 --- a/src/Illuminate/Database/SQLiteConnection.php +++ b/src/Illuminate/Database/SQLiteConnection.php @@ -5,7 +5,7 @@ class SQLiteConnection extends Connection { /** * Get the default query grammar instance. * - * @return Illuminate\Database\Query\Grammars\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { @@ -15,7 +15,7 @@ protected function getDefaultQueryGrammar() /** * Get the default schema grammar instance. * - * @return Illuminate\Database\Schema\Grammars\Grammar + * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getDefaultSchemaGrammar() { diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 0adbbb72ff0a..49c8552d24c9 100644 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -45,8 +45,8 @@ public function __construct($table, Closure $callback = null) /** * Execute the blueprint against the database. * - * @param Illuminate\Database\Connection $connection - * @param Illuminate\Database\Schema\Grammars\Grammar $grammar + * @param \Illuminate\Database\Connection $connection + * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar * @return void */ public function build(Connection $connection, Grammar $grammar) @@ -60,7 +60,7 @@ public function build(Connection $connection, Grammar $grammar) /** * Get the raw SQL statements for the blueprint. * - * @param Illuminate\Database\Schema\Grammars\Grammar $grammar + * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar * @return array */ public function toSql(Grammar $grammar) @@ -155,7 +155,7 @@ protected function creating() /** * Indicate that the table needs to be created. * - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function create() { @@ -165,7 +165,7 @@ public function create() /** * Indicate that the table should be dropped. * - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function drop() { @@ -175,7 +175,7 @@ public function drop() /** * Indicate that the table should be dropped if it exists. * - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropIfExists() { @@ -186,7 +186,7 @@ public function dropIfExists() * Indicate that the given columns should be dropped. * * @param string|array $columns - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropColumn($columns) { @@ -199,7 +199,7 @@ public function dropColumn($columns) * Indicate that the given columns should be dropped. * * @param dynamic - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropColumns() { @@ -210,7 +210,7 @@ public function dropColumns() * Indicate that the given primary key should be dropped. * * @param string|array $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropPrimary($index = null) { @@ -221,7 +221,7 @@ public function dropPrimary($index = null) * Indicate that the given unique key should be dropped. * * @param string|array $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropUnique($index) { @@ -232,7 +232,7 @@ public function dropUnique($index) * Indicate that the given index should be dropped. * * @param string|array $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropIndex($index) { @@ -243,7 +243,7 @@ public function dropIndex($index) * Indicate that the given foreign key should be dropped. * * @param string $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dropForeign($index) { @@ -254,7 +254,7 @@ public function dropForeign($index) * Rename the table to a given name. * * @param string $to - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function rename($to) { @@ -266,7 +266,7 @@ public function rename($to) * * @param string|array $columns * @param string $name - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function primary($columns, $name = null) { @@ -278,7 +278,7 @@ public function primary($columns, $name = null) * * @param string|array $columns * @param string $name - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function unique($columns, $name = null) { @@ -290,7 +290,7 @@ public function unique($columns, $name = null) * * @param string|array $columns * @param string $name - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function index($columns, $name = null) { @@ -302,7 +302,7 @@ public function index($columns, $name = null) * * @param string|array $columns * @param string $name - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function foreign($columns, $name = null) { @@ -313,7 +313,7 @@ public function foreign($columns, $name = null) * Create a new auto-incrementing column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function increments($column) { @@ -325,7 +325,7 @@ public function increments($column) * * @param string $column * @param int $length - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function string($column, $length = 255) { @@ -336,7 +336,7 @@ public function string($column, $length = 255) * Create a new text column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function text($column) { @@ -347,7 +347,7 @@ public function text($column) * Create a new integer column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function integer($column, $autoIncrement = false) { @@ -360,7 +360,7 @@ public function integer($column, $autoIncrement = false) * @param string $column * @param int $total * @param int $places - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function float($column, $total = 8, $places = 2) { @@ -373,7 +373,7 @@ public function float($column, $total = 8, $places = 2) * @param string $column * @param int $total * @param int $places - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function decimal($column, $total = 8, $places = 2) { @@ -384,7 +384,7 @@ public function decimal($column, $total = 8, $places = 2) * Create a new boolean column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function boolean($column) { @@ -396,7 +396,7 @@ public function boolean($column) * * @param string $column * @param array $allowed - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function enum($column, array $allowed) { @@ -407,7 +407,7 @@ public function enum($column, array $allowed) * Create a new date column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function date($column) { @@ -418,7 +418,7 @@ public function date($column) * Create a new date-time column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function dateTime($column) { @@ -429,7 +429,7 @@ public function dateTime($column) * Create a new time column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function time($column) { @@ -440,7 +440,7 @@ public function time($column) * Create a new timestamp column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function timestamp($column) { @@ -463,7 +463,7 @@ public function timestamps() * Create a new binary column on the table. * * @param string $column - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function binary($column) { @@ -475,7 +475,7 @@ public function binary($column) * * @param string $type * @param string|array $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ protected function dropIndexCommand($type, $index) { @@ -500,7 +500,7 @@ protected function dropIndexCommand($type, $index) * @param string $type * @param string|array $columns * @param string $index - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ protected function indexCommand($type, $columns, $index) { @@ -537,7 +537,7 @@ protected function createIndexName($type, array $columns) * @param string $type * @param string $name * @param array $parameters - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ protected function addColumn($type, $name, array $parameters = array()) { @@ -553,7 +553,7 @@ protected function addColumn($type, $name, array $parameters = array()) * * @param string $name * @param array $parameters - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ protected function addCommand($name, array $parameters = array()) { @@ -567,7 +567,7 @@ protected function addCommand($name, array $parameters = array()) * * @param string $name * @param array $parameters - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ protected function createCommand($name, array $parameters = array()) { diff --git a/src/Illuminate/Database/Schema/Builder.php b/src/Illuminate/Database/Schema/Builder.php index 59619915b957..b202779c7b7a 100644 --- a/src/Illuminate/Database/Schema/Builder.php +++ b/src/Illuminate/Database/Schema/Builder.php @@ -9,21 +9,21 @@ class Builder { /** * The database connection instance. * - * @var Illuminate\Database\Connection + * @var \Illuminate\Database\Connection */ protected $connection; /** * The schema grammar instance. * - * @var Illuminate\Database\Schema\Grammars\Grammar + * @var \Illuminate\Database\Schema\Grammars\Grammar */ protected $grammar; /** * Create a new database Schema manager. * - * @param Illuminate\Database\Connection $connection + * @param \Illuminate\Database\Connection $connection * @return void */ public function __construct(Connection $connection) @@ -52,7 +52,7 @@ public function hasTable($table) * * @param string $table * @param Closure $callback - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ public function table($table, Closure $callback) { @@ -64,7 +64,7 @@ public function table($table, Closure $callback) * * @param string $table * @param Closure $callback - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ public function create($table, Closure $callback) { @@ -81,7 +81,7 @@ public function create($table, Closure $callback) * Drop a table from the schema. * * @param string $table - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ public function drop($table) { @@ -96,7 +96,7 @@ public function drop($table) * Drop a table from the schema if it exists. * * @param string $table - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ public function dropIfExists($table) { @@ -112,7 +112,7 @@ public function dropIfExists($table) * * @param string $from * @param string $to - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ public function rename($from, $to) { @@ -126,7 +126,7 @@ public function rename($from, $to) /** * Execute the blueprint to build / modify the table. * - * @param Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Database\Schema\Blueprint $blueprint * @return void */ protected function build(Blueprint $blueprint) @@ -139,7 +139,7 @@ protected function build(Blueprint $blueprint) * * @param string $table * @param Closure $callback - * @return Illuminate\Database\Schema\Blueprint + * @return \Illuminate\Database\Schema\Blueprint */ protected function createBlueprint($table, Closure $callback = null) { @@ -149,7 +149,7 @@ protected function createBlueprint($table, Closure $callback = null) /** * Get the database connection instance. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function getConnection() { @@ -159,8 +159,8 @@ public function getConnection() /** * Set the database connection instance. * - * @param Illuminate\Database\Connection - * @return Illuminate\Database\Schema + * @param \Illuminate\Database\Connection + * @return \Illuminate\Support\Facades\Schema */ public function setConnection(Connection $connection) { diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index 6eab37d20c63..acba5e9f57fb 100644 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -9,8 +9,8 @@ abstract class Grammar extends BaseGrammar { /** * Compile a foreign key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileForeign(Blueprint $blueprint, Fluent $command) @@ -49,7 +49,7 @@ public function compileForeign(Blueprint $blueprint, Fluent $command) /** * Compile the blueprint's column definitions. * - * @param Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Database\Schema\Blueprint $blueprint * @return array */ protected function getColumns(Blueprint $blueprint) @@ -73,8 +73,8 @@ protected function getColumns(Blueprint $blueprint) * Add the column modifiers to the definition. * * @param string $sql - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string */ protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) @@ -90,8 +90,8 @@ protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) /** * Get the primary key command if it exists on the blueprint. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @return Illuminate\Support\Fluent|null + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @return \Illuminate\Support\Fluent|null */ protected function getCommandByName(Blueprint $blueprint, $name) { @@ -106,7 +106,7 @@ protected function getCommandByName(Blueprint $blueprint, $name) /** * Get all of the commands with a given name. * - * @param Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param string $name * @return array */ @@ -121,7 +121,7 @@ protected function getCommandsByName(Blueprint $blueprint, $name) /** * Get the SQL for the column data type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function getType(Fluent $column) diff --git a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php index 42f2433634b3..13f3312be19f 100644 --- a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -32,8 +32,8 @@ public function compileTableExists() /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileCreate(Blueprint $blueprint, Fluent $command) @@ -46,8 +46,8 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileAdd(Blueprint $blueprint, Fluent $command) @@ -62,8 +62,8 @@ public function compileAdd(Blueprint $blueprint, Fluent $command) /** * Compile a primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compilePrimary(Blueprint $blueprint, Fluent $command) @@ -76,8 +76,8 @@ public function compilePrimary(Blueprint $blueprint, Fluent $command) /** * Compile a unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileUnique(Blueprint $blueprint, Fluent $command) @@ -88,8 +88,8 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) /** * Compile a plain index key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileIndex(Blueprint $blueprint, Fluent $command) @@ -100,8 +100,8 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) /** * Compile an index creation command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @param string $type * @return string */ @@ -117,8 +117,8 @@ protected function compileKey(Blueprint $blueprint, Fluent $command, $type) /** * Compile a drop table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDrop(Blueprint $blueprint, Fluent $command) @@ -129,8 +129,8 @@ public function compileDrop(Blueprint $blueprint, Fluent $command) /** * Compile a drop table (if exists) command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) @@ -141,8 +141,8 @@ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) /** * Compile a drop column command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropColumn(Blueprint $blueprint, Fluent $command) @@ -157,8 +157,8 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command) /** * Compile a drop primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) @@ -169,8 +169,8 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) /** * Compile a drop unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropUnique(Blueprint $blueprint, Fluent $command) @@ -183,8 +183,8 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) /** * Compile a drop index command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) @@ -197,8 +197,8 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) /** * Compile a drop foreign key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropForeign(Blueprint $blueprint, Fluent $command) @@ -211,8 +211,8 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) /** * Compile a rename table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileRename(Blueprint $blueprint, Fluent $command) @@ -225,7 +225,7 @@ public function compileRename(Blueprint $blueprint, Fluent $command) /** * Create the column definition for a string type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeString(Fluent $column) @@ -236,7 +236,7 @@ protected function typeString(Fluent $column) /** * Create the column definition for a text type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeText(Fluent $column) @@ -247,7 +247,7 @@ protected function typeText(Fluent $column) /** * Create the column definition for a integer type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeInteger(Fluent $column) @@ -258,7 +258,7 @@ protected function typeInteger(Fluent $column) /** * Create the column definition for a float type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeFloat(Fluent $column) @@ -269,7 +269,7 @@ protected function typeFloat(Fluent $column) /** * Create the column definition for a decimal type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDecimal(Fluent $column) @@ -280,7 +280,7 @@ protected function typeDecimal(Fluent $column) /** * Create the column definition for a boolean type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBoolean(Fluent $column) @@ -291,7 +291,7 @@ protected function typeBoolean(Fluent $column) /** * Create the column definition for a enum type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeEnum(Fluent $column) @@ -302,7 +302,7 @@ protected function typeEnum(Fluent $column) /** * Create the column definition for a date type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDate(Fluent $column) @@ -313,7 +313,7 @@ protected function typeDate(Fluent $column) /** * Create the column definition for a date-time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDateTime(Fluent $column) @@ -324,7 +324,7 @@ protected function typeDateTime(Fluent $column) /** * Create the column definition for a time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTime(Fluent $column) @@ -335,7 +335,7 @@ protected function typeTime(Fluent $column) /** * Create the column definition for a timestamp type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTimestamp(Fluent $column) @@ -346,7 +346,7 @@ protected function typeTimestamp(Fluent $column) /** * Create the column definition for a binary type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBinary(Fluent $column) @@ -357,8 +357,8 @@ protected function typeBinary(Fluent $column) /** * Get the SQL for an unsigned column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyUnsigned(Blueprint $blueprint, Fluent $column) @@ -372,8 +372,8 @@ protected function modifyUnsigned(Blueprint $blueprint, Fluent $column) /** * Get the SQL for a nullable column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) @@ -384,8 +384,8 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column) /** * Get the SQL for a default column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) @@ -399,8 +399,8 @@ protected function modifyDefault(Blueprint $blueprint, Fluent $column) /** * Get the SQL for an auto-increment column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyIncrement(Blueprint $blueprint, Fluent $column) diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index c8227e65c716..b3fc16112ce4 100644 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -32,8 +32,8 @@ public function compileTableExists() /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileCreate(Blueprint $blueprint, Fluent $command) @@ -46,8 +46,8 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileAdd(Blueprint $blueprint, Fluent $command) @@ -62,8 +62,8 @@ public function compileAdd(Blueprint $blueprint, Fluent $command) /** * Compile a primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compilePrimary(Blueprint $blueprint, Fluent $command) @@ -76,8 +76,8 @@ public function compilePrimary(Blueprint $blueprint, Fluent $command) /** * Compile a unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileUnique(Blueprint $blueprint, Fluent $command) @@ -92,8 +92,8 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) /** * Compile a plain index key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileIndex(Blueprint $blueprint, Fluent $command) @@ -106,8 +106,8 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) /** * Compile a drop table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDrop(Blueprint $blueprint, Fluent $command) @@ -118,8 +118,8 @@ public function compileDrop(Blueprint $blueprint, Fluent $command) /** * Compile a drop table (if exists) command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) @@ -130,8 +130,8 @@ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) /** * Compile a drop column command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropColumn(Blueprint $blueprint, Fluent $command) @@ -146,8 +146,8 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command) /** * Compile a drop primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) @@ -160,8 +160,8 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) /** * Compile a drop unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropUnique(Blueprint $blueprint, Fluent $command) @@ -174,8 +174,8 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) /** * Compile a drop index command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) @@ -186,8 +186,8 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) /** * Compile a drop foreign key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropForeign(Blueprint $blueprint, Fluent $command) @@ -200,8 +200,8 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) /** * Compile a rename table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileRename(Blueprint $blueprint, Fluent $command) @@ -214,7 +214,7 @@ public function compileRename(Blueprint $blueprint, Fluent $command) /** * Create the column definition for a string type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeString(Fluent $column) @@ -225,7 +225,7 @@ protected function typeString(Fluent $column) /** * Create the column definition for a text type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeText(Fluent $column) @@ -236,7 +236,7 @@ protected function typeText(Fluent $column) /** * Create the column definition for a integer type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeInteger(Fluent $column) @@ -247,7 +247,7 @@ protected function typeInteger(Fluent $column) /** * Create the column definition for a float type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeFloat(Fluent $column) @@ -258,7 +258,7 @@ protected function typeFloat(Fluent $column) /** * Create the column definition for a decimal type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDecimal(Fluent $column) @@ -269,7 +269,7 @@ protected function typeDecimal(Fluent $column) /** * Create the column definition for a boolean type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBoolean(Fluent $column) @@ -280,7 +280,7 @@ protected function typeBoolean(Fluent $column) /** * Create the column definition for an enum type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeEnum(Fluent $column) @@ -291,7 +291,7 @@ protected function typeEnum(Fluent $column) /** * Create the column definition for a date type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDate(Fluent $column) @@ -302,7 +302,7 @@ protected function typeDate(Fluent $column) /** * Create the column definition for a date-time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDateTime(Fluent $column) @@ -313,7 +313,7 @@ protected function typeDateTime(Fluent $column) /** * Create the column definition for a time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTime(Fluent $column) @@ -324,7 +324,7 @@ protected function typeTime(Fluent $column) /** * Create the column definition for a timestamp type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTimestamp(Fluent $column) @@ -335,7 +335,7 @@ protected function typeTimestamp(Fluent $column) /** * Create the column definition for a binary type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBinary(Fluent $column) @@ -346,8 +346,8 @@ protected function typeBinary(Fluent $column) /** * Get the SQL for a nullable column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) @@ -358,8 +358,8 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column) /** * Get the SQL for a default column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) @@ -373,8 +373,8 @@ protected function modifyDefault(Blueprint $blueprint, Fluent $column) /** * Get the SQL for an auto-increment column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyIncrement(Blueprint $blueprint, Fluent $column) diff --git a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php index af1fad4c343b..d8c6a2ae167e 100644 --- a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -32,8 +32,8 @@ public function compileTableExists() /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileCreate(Blueprint $blueprint, Fluent $command) @@ -55,7 +55,7 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) /** * Get the foreign key syntax for a table creation statement. * - * @param Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Database\Schema\Blueprint $blueprint * @return string|null */ protected function addForeignKeys(Blueprint $blueprint) @@ -84,7 +84,7 @@ protected function addForeignKeys(Blueprint $blueprint) /** * Get the primary key syntax for a table creation statement. * - * @param Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Database\Schema\Blueprint $blueprint * @return string|null */ protected function addPrimaryKeys(Blueprint $blueprint) @@ -102,8 +102,8 @@ protected function addPrimaryKeys(Blueprint $blueprint) /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileAdd(Blueprint $blueprint, Fluent $command) @@ -118,8 +118,8 @@ public function compileAdd(Blueprint $blueprint, Fluent $command) /** * Compile a unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileUnique(Blueprint $blueprint, Fluent $command) @@ -134,8 +134,8 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) /** * Compile a plain index key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileIndex(Blueprint $blueprint, Fluent $command) @@ -150,8 +150,8 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) /** * Compile a foreign key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileForeign(Blueprint $blueprint, Fluent $command) @@ -162,8 +162,8 @@ public function compileForeign(Blueprint $blueprint, Fluent $command) /** * Compile a drop table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDrop(Blueprint $blueprint, Fluent $command) @@ -174,8 +174,8 @@ public function compileDrop(Blueprint $blueprint, Fluent $command) /** * Compile a drop table (if exists) command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) @@ -186,8 +186,8 @@ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) /** * Compile a drop column command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropColumn(Blueprint $blueprint, Fluent $command) @@ -198,8 +198,8 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command) /** * Compile a drop unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropUnique(Blueprint $blueprint, Fluent $command) @@ -210,8 +210,8 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) /** * Compile a drop index command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) @@ -222,8 +222,8 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) /** * Compile a rename table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileRename(Blueprint $blueprint, Fluent $command) @@ -236,7 +236,7 @@ public function compileRename(Blueprint $blueprint, Fluent $command) /** * Create the column definition for a string type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeString(Fluent $column) @@ -247,7 +247,7 @@ protected function typeString(Fluent $column) /** * Create the column definition for a text type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeText(Fluent $column) @@ -258,7 +258,7 @@ protected function typeText(Fluent $column) /** * Create the column definition for a integer type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeInteger(Fluent $column) @@ -269,7 +269,7 @@ protected function typeInteger(Fluent $column) /** * Create the column definition for a float type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeFloat(Fluent $column) @@ -280,7 +280,7 @@ protected function typeFloat(Fluent $column) /** * Create the column definition for a decimal type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDecimal(Fluent $column) @@ -291,7 +291,7 @@ protected function typeDecimal(Fluent $column) /** * Create the column definition for a boolean type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBoolean(Fluent $column) @@ -302,7 +302,7 @@ protected function typeBoolean(Fluent $column) /** * Create the column definition for a enum type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeEnum(Fluent $column) @@ -313,7 +313,7 @@ protected function typeEnum(Fluent $column) /** * Create the column definition for a date type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDate(Fluent $column) @@ -324,7 +324,7 @@ protected function typeDate(Fluent $column) /** * Create the column definition for a date-time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDateTime(Fluent $column) @@ -335,7 +335,7 @@ protected function typeDateTime(Fluent $column) /** * Create the column definition for a time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTime(Fluent $column) @@ -346,7 +346,7 @@ protected function typeTime(Fluent $column) /** * Create the column definition for a timestamp type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTimestamp(Fluent $column) @@ -357,7 +357,7 @@ protected function typeTimestamp(Fluent $column) /** * Create the column definition for a binary type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBinary(Fluent $column) @@ -368,8 +368,8 @@ protected function typeBinary(Fluent $column) /** * Get the SQL for a nullable column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) @@ -380,8 +380,8 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column) /** * Get the SQL for a default column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) @@ -395,8 +395,8 @@ protected function modifyDefault(Blueprint $blueprint, Fluent $column) /** * Get the SQL for an auto-increment column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyIncrement(Blueprint $blueprint, Fluent $column) diff --git a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php index 12811ef5f48f..9f85a2ccf495 100644 --- a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php @@ -32,8 +32,8 @@ public function compileTableExists() /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileCreate(Blueprint $blueprint, Fluent $command) @@ -46,8 +46,8 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) /** * Compile a create table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileAdd(Blueprint $blueprint, Fluent $command) @@ -62,8 +62,8 @@ public function compileAdd(Blueprint $blueprint, Fluent $command) /** * Compile a primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compilePrimary(Blueprint $blueprint, Fluent $command) @@ -78,8 +78,8 @@ public function compilePrimary(Blueprint $blueprint, Fluent $command) /** * Compile a unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileUnique(Blueprint $blueprint, Fluent $command) @@ -94,8 +94,8 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) /** * Compile a plain index key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileIndex(Blueprint $blueprint, Fluent $command) @@ -110,8 +110,8 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) /** * Compile a drop table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDrop(Blueprint $blueprint, Fluent $command) @@ -122,8 +122,8 @@ public function compileDrop(Blueprint $blueprint, Fluent $command) /** * Compile a drop column command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropColumn(Blueprint $blueprint, Fluent $command) @@ -138,8 +138,8 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command) /** * Compile a drop primary key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) @@ -154,8 +154,8 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) /** * Compile a drop unique key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropUnique(Blueprint $blueprint, Fluent $command) @@ -168,8 +168,8 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) /** * Compile a drop index command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) @@ -182,8 +182,8 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) /** * Compile a drop foreign key command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropForeign(Blueprint $blueprint, Fluent $command) @@ -196,8 +196,8 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) /** * Compile a rename table command. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $command + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command * @return string */ public function compileRename(Blueprint $blueprint, Fluent $command) @@ -210,7 +210,7 @@ public function compileRename(Blueprint $blueprint, Fluent $command) /** * Create the column definition for a string type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeString(Fluent $column) @@ -221,7 +221,7 @@ protected function typeString(Fluent $column) /** * Create the column definition for a text type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeText(Fluent $column) @@ -232,7 +232,7 @@ protected function typeText(Fluent $column) /** * Create the column definition for a integer type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeInteger(Fluent $column) @@ -243,7 +243,7 @@ protected function typeInteger(Fluent $column) /** * Create the column definition for a float type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeFloat(Fluent $column) @@ -254,7 +254,7 @@ protected function typeFloat(Fluent $column) /** * Create the column definition for a decimal type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDecimal(Fluent $column) @@ -265,7 +265,7 @@ protected function typeDecimal(Fluent $column) /** * Create the column definition for a boolean type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBoolean(Fluent $column) @@ -276,7 +276,7 @@ protected function typeBoolean(Fluent $column) /** * Create the column definition for a enum type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeEnum(Fluent $column) @@ -287,7 +287,7 @@ protected function typeEnum(Fluent $column) /** * Create the column definition for a date type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDate(Fluent $column) @@ -298,7 +298,7 @@ protected function typeDate(Fluent $column) /** * Create the column definition for a date-time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeDateTime(Fluent $column) @@ -309,7 +309,7 @@ protected function typeDateTime(Fluent $column) /** * Create the column definition for a time type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTime(Fluent $column) @@ -320,7 +320,7 @@ protected function typeTime(Fluent $column) /** * Create the column definition for a timestamp type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeTimestamp(Fluent $column) @@ -331,7 +331,7 @@ protected function typeTimestamp(Fluent $column) /** * Create the column definition for a binary type. * - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Support\Fluent $column * @return string */ protected function typeBinary(Fluent $column) @@ -342,8 +342,8 @@ protected function typeBinary(Fluent $column) /** * Get the SQL for a nullable column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) @@ -354,8 +354,8 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column) /** * Get the SQL for a default column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) @@ -369,8 +369,8 @@ protected function modifyDefault(Blueprint $blueprint, Fluent $column) /** * Get the SQL for an auto-increment column modifier. * - * @param Illuminate\Database\Schema\Blueprint $blueprint - * @param Illuminate\Support\Fluent $column + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column * @return string|null */ protected function modifyIncrement(Blueprint $blueprint, Fluent $column) diff --git a/src/Illuminate/Database/Seeder.php b/src/Illuminate/Database/Seeder.php index 3f5847f84757..cfadb7f6bbb3 100644 --- a/src/Illuminate/Database/Seeder.php +++ b/src/Illuminate/Database/Seeder.php @@ -8,14 +8,14 @@ class Seeder { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** * The event dispatcher instance. * - * @var Illuminate\Events\Dispatcher + * @var \Illuminate\Events\Dispatcher */ protected $events; @@ -29,8 +29,8 @@ class Seeder { /** * Create a new database seeder instance. * - * @param Illuminate\Filesystem $files - * @param Illuminate\Events\Dispatcher $events + * @param \Illuminate\Filesystem\Filesystem $files + * @param \Illuminate\Events\Dispatcher $events * @return void */ public function __construct(Filesystem $files, Dispatcher $events = null) @@ -42,7 +42,7 @@ public function __construct(Filesystem $files, Dispatcher $events = null) /** * Seed the given connection from the given path. * - * @param Illuminate\Database\Connection $connection + * @param \Illuminate\Database\Connection $connection * @param string $path * @return int */ diff --git a/src/Illuminate/Database/SqlServerConnection.php b/src/Illuminate/Database/SqlServerConnection.php index 50c0b1126669..9ddd34e2dff5 100644 --- a/src/Illuminate/Database/SqlServerConnection.php +++ b/src/Illuminate/Database/SqlServerConnection.php @@ -5,7 +5,7 @@ class SqlServerConnection extends Connection { /** * Get the default query grammar instance. * - * @return Illuminate\Database\Query\Grammars\Grammars\Grammar + * @return \Illuminate\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { @@ -15,7 +15,7 @@ protected function getDefaultQueryGrammar() /** * Get the default schema grammar instance. * - * @return Illuminate\Database\Schema\Grammars\Grammar + * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getDefaultSchemaGrammar() { diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 86796be3df3d..d8cba2d9fd9e 100644 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -1,121 +1,121 @@ -container = $container; - } - - /** - * Register an event listener with the dispatcher. - * - * @param string $event - * @param mixed $listener - * @param int $priority - * @return void - */ - public function listen($event, $listener, $priority = 0) - { - return $this->addListener($event, $listener, $priority); - } - - /** - * Fire an event and call the listeners. - * - * @param string $eventName - * @param mixed $payload - * @return Symfony\Component\EventDispatcher\Event - */ - public function fire($eventName, $payload = array()) - { - if ( ! $payload instanceof SymfonyEvent) - { - $payload = new Event($payload); - } - - return parent::dispatch($eventName, $payload); - } - - /** - * Register an event subscriber class. - * - * @param Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber - * @return void - */ - public function subscribe(EventSubscriberInterface $subscriber) - { - return parent::addSubscriber($subscriber); - } - - /** - * Remove an event subscriber. - * - * @param Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber - * @return void - */ - public function unsubscribe(EventSubscriberInterface $subscriber) - { - return parent::removeSubscriber($subscriber); - } - - /** - * Register an event listener with the dispatcher. - * - * @param string $event - * @param mixed $listener - * @param int $priority - * @return void - */ - public function addListener($eventName, $listener, $priority = 0) - { - if (is_string($listener)) - { - $listener = $this->createClassListener($listener); - } - - return parent::addListener($eventName, $listener, $priority); - } - - /** - * Create a class based listener using the IoC container. - * - * @param mixed $listener - * @return Closure - */ - public function createClassListener($listener) - { - $container = $this->container; - - return function(SymfonyEvent $event) use ($listener, $container) - { - // If the listener has an @ sign, we will assume it is being used to delimit - // the class name from the handle method name. This allows for handlers - // to run multiple handler methods in a single class for convenience. - $segments = explode('@', $listener); - - $method = count($segments) == 2 ? $segments[1] : 'handle'; - - $container->make($segments[0])->$method($event); - }; - } - +container = $container; + } + + /** + * Register an event listener with the dispatcher. + * + * @param string $event + * @param mixed $listener + * @param int $priority + * @return void + */ + public function listen($event, $listener, $priority = 0) + { + return $this->addListener($event, $listener, $priority); + } + + /** + * Fire an event and call the listeners. + * + * @param string $eventName + * @param mixed $payload + * @return \Symfony\Component\EventDispatcher\Event + */ + public function fire($eventName, $payload = array()) + { + if ( ! $payload instanceof SymfonyEvent) + { + $payload = new Event($payload); + } + + return parent::dispatch($eventName, $payload); + } + + /** + * Register an event subscriber class. + * + * @param \Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber + * @return void + */ + public function subscribe(EventSubscriberInterface $subscriber) + { + return parent::addSubscriber($subscriber); + } + + /** + * Remove an event subscriber. + * + * @param \Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber + * @return void + */ + public function unsubscribe(EventSubscriberInterface $subscriber) + { + return parent::removeSubscriber($subscriber); + } + + /** + * Register an event listener with the dispatcher. + * + * @param string $event + * @param mixed $listener + * @param int $priority + * @return void + */ + public function addListener($eventName, $listener, $priority = 0) + { + if (is_string($listener)) + { + $listener = $this->createClassListener($listener); + } + + return parent::addListener($eventName, $listener, $priority); + } + + /** + * Create a class based listener using the IoC container. + * + * @param mixed $listener + * @return \Closure + */ + public function createClassListener($listener) + { + $container = $this->container; + + return function(SymfonyEvent $event) use ($listener, $container) + { + // If the listener has an @ sign, we will assume it is being used to delimit + // the class name from the handle method name. This allows for handlers + // to run multiple handler methods in a single class for convenience. + $segments = explode('@', $listener); + + $method = count($segments) == 2 ? $segments[1] : 'handle'; + + $container->make($segments[0])->$method($event); + }; + } + } diff --git a/src/Illuminate/Exception/ExceptionServiceProvider.php b/src/Illuminate/Exception/ExceptionServiceProvider.php index 6d8bc783785f..7656398fe5aa 100644 --- a/src/Illuminate/Exception/ExceptionServiceProvider.php +++ b/src/Illuminate/Exception/ExceptionServiceProvider.php @@ -1,130 +1,130 @@ -setExceptionHandler($app['exception.function']); - - // By registering the error handler with a level of -1, we state that we want - // all PHP errors converted into ErrorExceptions and thrown which provides - // a very strict development environment but prevents any unseen errors. - $app['kernel.error']->register(-1); - - if (isset($app['env']) and $app['env'] != 'testing') - { - $this->registerShutdownHandler(); - } - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->registerKernelHandlers(); - - $this->app['exception'] = $this->app->share(function() - { - return new Handler; - }); - - $this->registerExceptionHandler(); - } - - /** - * Register the HttpKernel error and exception handlers. - * - * @return void - */ - protected function registerKernelHandlers() - { - $app = $this->app; - - $app['kernel.error'] = function() - { - return new ErrorHandler; - }; - - $this->app['kernel.exception'] = function() use ($app) - { - return new KernelHandler($app['config']['app.debug']); - }; - } - - /** - * Register the PHP exception handler function. - * - * @return void - */ - protected function registerExceptionHandler() - { - $app = $this->app; - - $app['exception.function'] = function() use ($app) - { - return function($exception) use ($app) - { - $response = $app['exception']->handle($exception); - - // If one of the custom error handlers returned a response, we will send that - // response back to the client after preparing it. This allows a specific - // type of exceptions to handled by a Closure giving great flexibility. - if ( ! is_null($response)) - { - $response = $app->prepareResponse($response, $app['request']); - - $response->send(); - } - else - { - $app['kernel.exception']->handle($exception); - } - }; - }; - } - - /** - * Register the shutdown handler Closure. - * - * @return void - */ - protected function registerShutdownHandler() - { - $app = $this->app; - - register_shutdown_function(function() use ($app) - { - set_exception_handler(array(new StubShutdownHandler($app), 'handle')); - - $app['kernel.error']->handleFatal(); - }); - } - - /** - * Set the given Closure as the exception handler. - * - * This function is mainly needed for mocking purposes. - * - * @param Closure $handler - * @return mixed - */ - protected function setExceptionHandler(Closure $handler) - { - return set_exception_handler($handler); - } - +setExceptionHandler($app['exception.function']); + + // By registering the error handler with a level of -1, we state that we want + // all PHP errors converted into ErrorExceptions and thrown which provides + // a very strict development environment but prevents any unseen errors. + $app['kernel.error']->register(-1); + + if (isset($app['env']) and $app['env'] != 'testing') + { + $this->registerShutdownHandler(); + } + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->registerKernelHandlers(); + + $this->app['exception'] = $this->app->share(function() + { + return new Handler; + }); + + $this->registerExceptionHandler(); + } + + /** + * Register the HttpKernel error and exception handlers. + * + * @return void + */ + protected function registerKernelHandlers() + { + $app = $this->app; + + $app['kernel.error'] = function() + { + return new ErrorHandler; + }; + + $this->app['kernel.exception'] = function() use ($app) + { + return new KernelHandler($app['config']['app.debug']); + }; + } + + /** + * Register the PHP exception handler function. + * + * @return void + */ + protected function registerExceptionHandler() + { + $app = $this->app; + + $app['exception.function'] = function() use ($app) + { + return function($exception) use ($app) + { + $response = $app['exception']->handle($exception); + + // If one of the custom error handlers returned a response, we will send that + // response back to the client after preparing it. This allows a specific + // type of exceptions to handled by a Closure giving great flexibility. + if ( ! is_null($response)) + { + $response = $app->prepareResponse($response, $app['request']); + + $response->send(); + } + else + { + $app['kernel.exception']->handle($exception); + } + }; + }; + } + + /** + * Register the shutdown handler Closure. + * + * @return void + */ + protected function registerShutdownHandler() + { + $app = $this->app; + + register_shutdown_function(function() use ($app) + { + set_exception_handler(array(new StubShutdownHandler($app), 'handle')); + + $app['kernel.error']->handleFatal(); + }); + } + + /** + * Set the given Closure as the exception handler. + * + * This function is mainly needed for mocking purposes. + * + * @param Closure $handler + * @return mixed + */ + protected function setExceptionHandler(Closure $handler) + { + return set_exception_handler($handler); + } + } \ No newline at end of file diff --git a/src/Illuminate/Exception/Handler.php b/src/Illuminate/Exception/Handler.php index 41edcf4cc97e..fa66540136c4 100644 --- a/src/Illuminate/Exception/Handler.php +++ b/src/Illuminate/Exception/Handler.php @@ -1,6 +1,7 @@ Date: Thu, 17 Jan 2013 16:30:22 +0100 Subject: [PATCH 3/5] Update PHPDocs for IDE support. --- src/Illuminate/Http/RedirectResponse.php | 20 +- src/Illuminate/Http/Request.php | 12 +- src/Illuminate/Http/Response.php | 4 +- src/Illuminate/Log/Writer.php | 6 +- src/Illuminate/Mail/Mailer.php | 20 +- src/Illuminate/Mail/Message.php | 22 +- .../Pagination/BootstrapPresenter.php | 4 +- src/Illuminate/Pagination/Environment.php | 28 +- src/Illuminate/Pagination/Paginator.php | 10 +- src/Illuminate/Queue/BeanstalkdQueue.php | 208 +++--- .../Queue/Connectors/BeanstalkdConnector.php | 40 +- .../Queue/Connectors/ConnectorInterface.php | 24 +- .../Queue/Connectors/IronConnector.php | 40 +- .../Queue/Connectors/SyncConnector.php | 34 +- .../Queue/Console/ListenCommand.php | 184 +++--- src/Illuminate/Queue/IronQueue.php | 212 +++--- src/Illuminate/Queue/Jobs/BeanstalkdJob.php | 232 +++---- src/Illuminate/Queue/Jobs/IronJob.php | 246 +++---- src/Illuminate/Queue/Jobs/SyncJob.php | 150 ++--- src/Illuminate/Queue/Listener.php | 292 ++++----- src/Illuminate/Queue/Queue.php | 72 +-- src/Illuminate/Queue/QueueInterface.php | 66 +- src/Illuminate/Queue/QueueManager.php | 260 ++++---- src/Illuminate/Queue/QueueServiceProvider.php | 264 ++++---- src/Illuminate/Queue/SyncQueue.php | 102 +-- src/Illuminate/Redis/RedisManager.php | 218 +++---- .../Routing/Console/MakeControllerCommand.php | 4 +- .../Routing/Controllers/Controller.php | 28 +- src/Illuminate/Routing/Controllers/Filter.php | 8 +- .../Routing/Controllers/FilterParser.php | 10 +- .../Generators/ControllerGenerator.php | 4 +- src/Illuminate/Routing/Redirector.php | 20 +- src/Illuminate/Routing/Route.php | 20 +- src/Illuminate/Routing/Router.php | 72 +-- src/Illuminate/Routing/UrlGenerator.php | 20 +- src/Illuminate/Session/CacheDrivenStore.php | 8 +- src/Illuminate/Session/CookieStore.php | 10 +- src/Illuminate/Session/DatabaseStore.php | 18 +- src/Illuminate/Session/FileStore.php | 8 +- src/Illuminate/Session/SessionManager.php | 228 +++---- src/Illuminate/Session/Store.php | 14 +- .../Contracts/MessageProviderInterface.php | 22 +- src/Illuminate/Support/Facades/Facade.php | 6 +- src/Illuminate/Support/Facades/Response.php | 112 ++-- src/Illuminate/Support/Facades/Route.php | 114 ++-- src/Illuminate/Support/Facades/Schema.php | 50 +- src/Illuminate/Support/Fluent.php | 2 +- src/Illuminate/Support/Manager.php | 4 +- src/Illuminate/Support/MessageBag.php | 400 ++++++------ src/Illuminate/Support/ServiceProvider.php | 4 +- src/Illuminate/Translation/FileLoader.php | 4 +- src/Illuminate/Translation/Translator.php | 10 +- .../Validation/DatabasePresenceVerifier.php | 6 +- src/Illuminate/Validation/Factory.php | 16 +- src/Illuminate/Validation/Validator.php | 22 +- src/Illuminate/View/Compilers/Compiler.php | 2 +- .../View/Engines/CompilerEngine.php | 8 +- .../View/Engines/EngineResolver.php | 2 +- src/Illuminate/View/Environment.php | 30 +- src/Illuminate/View/FileViewFinder.php | 6 +- src/Illuminate/View/View.php | 16 +- src/Illuminate/View/ViewServiceProvider.php | 336 +++++----- .../Console/WorkbenchMakeCommand.php | 246 +++---- src/Illuminate/Workbench/PackageCreator.php | 608 +++++++++--------- src/Illuminate/Workbench/Starter.php | 56 +- 65 files changed, 2662 insertions(+), 2662 deletions(-) diff --git a/src/Illuminate/Http/RedirectResponse.php b/src/Illuminate/Http/RedirectResponse.php index 581712cb7e58..31938ee260b7 100644 --- a/src/Illuminate/Http/RedirectResponse.php +++ b/src/Illuminate/Http/RedirectResponse.php @@ -9,14 +9,14 @@ class RedirectResponse extends \Symfony\Component\HttpFoundation\RedirectRespons /** * The request instance. * - * @var Illuminate\Http\Request + * @var \Illuminate\Http\Request */ protected $request; /** * The session store implementation. * - * @var Illuminate\Session\Store + * @var \Illuminate\Session\Store */ protected $session; @@ -25,7 +25,7 @@ class RedirectResponse extends \Symfony\Component\HttpFoundation\RedirectRespons * * @param string $key * @param mixed $value - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function with($key, $value) { @@ -37,8 +37,8 @@ public function with($key, $value) /** * Add a cookie to the response. * - * @param Symfony\Component\HttpFoundation\Cookie $cookie - * @return Illuminate\Http\Response + * @param \Symfony\Component\HttpFoundation\Cookie $cookie + * @return \Illuminate\Http\Response */ public function withCookie(Cookie $cookie) { @@ -87,7 +87,7 @@ public function exceptInput() /** * Flash a container of errors to the session. * - * @param Illuminate\Support\Contracts\MessageProviderInterface|array $provider + * @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider * @return void */ public function withErrors($provider) @@ -107,7 +107,7 @@ public function withErrors($provider) /** * Get the request instance. * - * @return Illuminate\Http\Request + * @return \Illuminate\Http\Request */ public function getRequest() { @@ -117,7 +117,7 @@ public function getRequest() /** * Set the request instance. * - * @param Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return void */ public function setRequest(Request $request) @@ -128,7 +128,7 @@ public function setRequest(Request $request) /** * Get the session store implementation. * - * @return Illuminate\Session\Store + * @return \Illuminate\Session\Store */ public function getSession() { @@ -138,7 +138,7 @@ public function getSession() /** * Set the session store implementation. * - * @param Illuminate\Session\Store $store + * @param \Illuminate\Session\Store $store * @return void */ public function setSession(SessionStore $session) diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index 6ef325f3c892..67edabc5396f 100644 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -7,14 +7,14 @@ class Request extends \Symfony\Component\HttpFoundation\Request { /** * The Illuminate session store implementation. * - * @var Illuminate\Session\Store + * @var \Illuminate\Session\Store */ protected $sessionStore; /** * Return the Request instance. * - * @return Illuminate\Http\Request + * @return \Illuminate\Http\Request */ public function instance() { @@ -202,7 +202,7 @@ public function cookie($key = null, $default = null) * * @param string $key * @param mixed $default - * @return Symfony\Component\HttpFoundation\File\UploadedFile + * @return \Symfony\Component\HttpFoundation\File\UploadedFile */ public function file($key = null, $default = null) { @@ -361,7 +361,7 @@ public function json() /** * Get the input source for the request. * - * @return Symfony\Component\HttpFoundation\ParameterBag + * @return \Symfony\Component\HttpFoundation\ParameterBag */ protected function getInputSource() { @@ -371,7 +371,7 @@ protected function getInputSource() /** * Get the Illuminate session store implementation. * - * @return Illuminate\Session\Store + * @return \Illuminate\Session\Store */ public function getSessionStore() { @@ -386,7 +386,7 @@ public function getSessionStore() /** * Set the Illuminate session store implementation. * - * @param Illuminate\Session\Store $session + * @param \Illuminate\Session\Store $session * @return void */ public function setSessionStore(SessionStore $session) diff --git a/src/Illuminate/Http/Response.php b/src/Illuminate/Http/Response.php index d0dcf9645f04..d4121a68678f 100644 --- a/src/Illuminate/Http/Response.php +++ b/src/Illuminate/Http/Response.php @@ -16,8 +16,8 @@ class Response extends \Symfony\Component\HttpFoundation\Response { /** * Add a cookie to the response. * - * @param Symfony\Component\HttpFoundation\Cookie $cookie - * @return Illuminate\Http\Response + * @param \Symfony\Component\HttpFoundation\Cookie $cookie + * @return \Illuminate\Http\Response */ public function withCookie(Cookie $cookie) { diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index 308129b6f2f6..c9d13f9107a7 100644 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -9,7 +9,7 @@ class Writer { /** * The Monolog logger instance. * - * @var Monolog\Logger + * @var \Monolog\Logger */ protected $monolog; @@ -32,7 +32,7 @@ class Writer { /** * Create a new log writer instance. * - * @param Monolog\Logger $monolog + * @param \Monolog\Logger $monolog * @return void */ public function __construct(MonologLogger $monolog) @@ -111,7 +111,7 @@ protected function parseLevel($level) /** * Get the underlying Monolog instance. * - * @return Monolog\Logger + * @return \Monolog\Logger */ public function getMonolog() { diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index 040441d4e0a7..56b7a8f16b3e 100644 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -12,7 +12,7 @@ class Mailer { /** * The view environment instance. * - * @var Illuminate\View\Environment + * @var \Illuminate\View\Environment */ protected $views; @@ -33,14 +33,14 @@ class Mailer { /** * The log writer instance. * - * @var Illuminate\Log\Writer + * @var \Illuminate\Log\Writer */ protected $logger; /** * The IoC container instance. * - * @var Illuminate\Container + * @var \Illuminate\Container\Container */ protected $container; @@ -54,7 +54,7 @@ class Mailer { /** * Create a new Mailer instance. * - * @param Illuminate\View\Environment $views + * @param \Illuminate\View\Environment $views * @param Swift_Mailer $swift * @return void */ @@ -142,7 +142,7 @@ protected function logMessage($message) * Call the provided message builder. * * @param Closure|string $callback - * @param Illuminate\Mail\Message $message + * @param \Illuminate\Mail\Message $message * @return void */ protected function callMessageBuilder($callback, $message) @@ -162,7 +162,7 @@ protected function callMessageBuilder($callback, $message) /** * Create a new message instance. * - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ protected function createMessage() { @@ -184,7 +184,7 @@ protected function createMessage() * * @param string $view * @param array $data - * @return Illuminate\View\View + * @return \Illuminate\View\View */ protected function getView($view, $data) { @@ -205,7 +205,7 @@ public function pretend($value = true) /** * Get the view environment instance. * - * @return Illuminate\View\Environment + * @return \Illuminate\View\Environment */ public function getViewEnvironment() { @@ -236,7 +236,7 @@ public function setSwiftMailer($swift) /** * Set the log writer instance. * - * @param Illuminate\Log\Writer $logger + * @param \Illuminate\Log\Writer $logger * @return void */ public function setLogger(Writer $logger) @@ -247,7 +247,7 @@ public function setLogger(Writer $logger) /** * Set the IoC container instance. * - * @param Illuminate\Container $container + * @param \Illuminate\Container\Container $container * @return void */ public function setContainer(Container $container) diff --git a/src/Illuminate/Mail/Message.php b/src/Illuminate/Mail/Message.php index dc616d591283..cfbd7c4c0e1b 100644 --- a/src/Illuminate/Mail/Message.php +++ b/src/Illuminate/Mail/Message.php @@ -29,7 +29,7 @@ public function __construct($swift) * * @param string $address * @param string $name - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function from($address, $name = null) { @@ -43,7 +43,7 @@ public function from($address, $name = null) * * @param string $address * @param string $name - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function sender($address, $name = null) { @@ -56,7 +56,7 @@ public function sender($address, $name = null) * Set the "return path" of the message. * * @param string $address - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function returnPath($address) { @@ -70,7 +70,7 @@ public function returnPath($address) * * @param string $address * @param string $name - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function to($address, $name = null) { @@ -84,7 +84,7 @@ public function to($address, $name = null) * * @param string $address * @param string $name - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function cc($address, $name = null) { @@ -98,7 +98,7 @@ public function cc($address, $name = null) * * @param string $address * @param string $name - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function bcc($address, $name = null) { @@ -111,7 +111,7 @@ public function bcc($address, $name = null) * Set the subject of the message. * * @param string $subject - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function subject($subject) { @@ -124,7 +124,7 @@ public function subject($subject) * Set the message priority level. * * @param int $level - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function priority($level) { @@ -138,7 +138,7 @@ public function priority($level) * * @param string $file * @param array $options - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function attach($file, array $options = array()) { @@ -164,7 +164,7 @@ protected function createAttachmentFromPath($file) * @param string $data * @param string $name * @param array $options - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ public function attachData($data, $name, array $options = array()) { @@ -216,7 +216,7 @@ public function embedData($data, $name, $contentType = null) * * @param Swift_Attachment $attachment * @param array $options - * @return Illuminate\Mail\Message + * @return \Illuminate\Mail\Message */ protected function prepAttachment($attachment, $options = array()) { diff --git a/src/Illuminate/Pagination/BootstrapPresenter.php b/src/Illuminate/Pagination/BootstrapPresenter.php index 6dee04d079c6..dfeff91b03d8 100644 --- a/src/Illuminate/Pagination/BootstrapPresenter.php +++ b/src/Illuminate/Pagination/BootstrapPresenter.php @@ -5,7 +5,7 @@ class BootstrapPresenter { /** * The paginator instance being rendered. * - * @var Illuminate\Pagination\Paginator + * @var \Illuminate\Pagination\Paginator */ protected $paginator; @@ -26,7 +26,7 @@ class BootstrapPresenter { /** * Create a new Bootstrap presenter instance. * - * @param Illuminate\Pagination\Paginator $paginator + * @param \Illuminate\Pagination\Paginator $paginator * @return void */ public function __construct(Paginator $paginator) diff --git a/src/Illuminate/Pagination/Environment.php b/src/Illuminate/Pagination/Environment.php index baab8dab5882..91b1a0cecbc0 100644 --- a/src/Illuminate/Pagination/Environment.php +++ b/src/Illuminate/Pagination/Environment.php @@ -9,21 +9,21 @@ class Environment { /** * The request instance. * - * @var Symfony\Component\HttpFoundation\Request + * @var \Symfony\Component\HttpFoundation\Request */ protected $request; /** * The view environment instance. * - * @var Illuminate\View\Environment + * @var \Illuminate\View\Environment */ protected $view; /** * The translator implementation. * - * @var Symfony\Component\Translation\TranslatorInterface + * @var \Symfony\Component\Translation\TranslatorInterface */ protected $trans; @@ -51,9 +51,9 @@ class Environment { /** * Create a new pagination environment. * - * @param Symfony\Component\HttpFoundation\Request $request - * @param Illuminate\View\Environment $view - * @param Illuminate\Translation\TranslatorInterface $trans + * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Illuminate\View\Environment $view + * @param \Symfony\Component\Translation\TranslatorInterface $trans * @return void */ public function __construct(Request $request, ViewEnvironment $view, TranslatorInterface $trans) @@ -80,7 +80,7 @@ protected function setupPaginationEnvironment() * @param array $items * @param int $perPage * @param int $total - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function make(array $items, $total, $perPage) { @@ -92,8 +92,8 @@ public function make(array $items, $total, $perPage) /** * Get the pagination view. * - * @param Illuminate\Pagination\Paginator $paginator - * @return Illuminate\View\View + * @param \Illuminate\Pagination\Paginator $paginator + * @return \Illuminate\View\View */ public function getPaginationView(Paginator $paginator) { @@ -178,7 +178,7 @@ public function setLocale($locale) /** * Get the active request instance. * - * @return Symfony\Component\HttpFoundation\Request + * @return \Symfony\Component\HttpFoundation\Request */ public function getRequest() { @@ -188,7 +188,7 @@ public function getRequest() /** * Set the active request instance. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function setRequest(Request $request) @@ -199,7 +199,7 @@ public function setRequest(Request $request) /** * Get the current view driver. * - * @return Illuminate\View\Environment + * @return \Illuminate\View\Environment */ public function getViewDriver() { @@ -209,7 +209,7 @@ public function getViewDriver() /** * Set the current view driver. * - * @param Illuminate\View\Environment $view + * @param \Illuminate\View\Environment $view * @return void */ public function setViewDriver(ViewEnvironment $view) @@ -220,7 +220,7 @@ public function setViewDriver(ViewEnvironment $view) /** * Get the translator instance. * - * @return Symfony\Component\Translation\TranslatorInterface + * @return \Symfony\Component\Translation\TranslatorInterface */ public function getTranslator() { diff --git a/src/Illuminate/Pagination/Paginator.php b/src/Illuminate/Pagination/Paginator.php index 5ed2144a1f53..9b96017edb42 100644 --- a/src/Illuminate/Pagination/Paginator.php +++ b/src/Illuminate/Pagination/Paginator.php @@ -10,7 +10,7 @@ class Paginator implements ArrayAccess, Countable, IteratorAggregate { /** * The pagination environment. * - * @var Illuminate\Pagination\Environment + * @var \Illuminate\Pagination\Environment */ protected $env; @@ -59,7 +59,7 @@ class Paginator implements ArrayAccess, Countable, IteratorAggregate { /** * Create a new Paginator instance. * - * @param Illuminate\Pagination\Environment $env + * @param \Illuminate\Pagination\Environment $env * @param array $items * @param int $total * @param int $perPage @@ -76,7 +76,7 @@ public function __construct(Environment $env, array $items, $total, $perPage) /** * Setup the pagination context (current and last page). * - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function setupPaginationContext() { @@ -122,7 +122,7 @@ protected function isValidPageNumber($page) /** * Get the pagination links view. * - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function links() { @@ -155,7 +155,7 @@ public function getUrl($page) * * @param string $key * @param string $value - * @return Illuminate\Pagination\Paginator + * @return \Illuminate\Pagination\Paginator */ public function addQuery($key, $value) { diff --git a/src/Illuminate/Queue/BeanstalkdQueue.php b/src/Illuminate/Queue/BeanstalkdQueue.php index b9512224ebfc..73790e1de92c 100644 --- a/src/Illuminate/Queue/BeanstalkdQueue.php +++ b/src/Illuminate/Queue/BeanstalkdQueue.php @@ -1,105 +1,105 @@ -default = $default; - $this->pheanstalk = $pheanstalk; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string $queue - * @return void - */ - public function push($job, $data = '', $queue = null) - { - $payload = $this->createPayload($job, $data); - - $this->pheanstalk->useTube($this->getQueue($queue))->put($payload); - } - - /** - * Push a new job onto the queue after a delay. - * - * @param int $delay - * @param string $job - * @param mixed $data - * @param string $queue - * @return void - */ - public function later($delay, $job, $data = '', $queue = null) - { - $payload = $this->createPayload($job, $data); - - $pheanstalk = $this->pheanstalk->useTube($this->getQueue($queue)); - - $pheanstalk->put($payload, Pheanstalk::DEFAULT_PRIORITY, $delay); - } - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return Illuminate\Queue\Jobs\Job|null - */ - public function pop($queue = null) - { - $job = $this->pheanstalk->watchOnly($this->getQueue($queue))->reserve(); - - if ( ! is_null($job)) - { - return new BeanstalkdJob($this->container, $this->pheanstalk, $job); - } - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - protected function getQueue($queue) - { - return $queue ?: $this->default; - } - - /** - * Get the underlying Pheanstalk instance. - * - * @return Pheanstalk - */ - public function getPheanstalk() - { - return $this->pheanstalk; - } - +default = $default; + $this->pheanstalk = $pheanstalk; + } + + /** + * Push a new job onto the queue. + * + * @param string $job + * @param mixed $data + * @param string $queue + * @return void + */ + public function push($job, $data = '', $queue = null) + { + $payload = $this->createPayload($job, $data); + + $this->pheanstalk->useTube($this->getQueue($queue))->put($payload); + } + + /** + * Push a new job onto the queue after a delay. + * + * @param int $delay + * @param string $job + * @param mixed $data + * @param string $queue + * @return void + */ + public function later($delay, $job, $data = '', $queue = null) + { + $payload = $this->createPayload($job, $data); + + $pheanstalk = $this->pheanstalk->useTube($this->getQueue($queue)); + + $pheanstalk->put($payload, Pheanstalk::DEFAULT_PRIORITY, $delay); + } + + /** + * Pop the next job off of the queue. + * + * @param string $queue + * @return \Illuminate\Queue\Jobs\Job|null + */ + public function pop($queue = null) + { + $job = $this->pheanstalk->watchOnly($this->getQueue($queue))->reserve(); + + if ( ! is_null($job)) + { + return new BeanstalkdJob($this->container, $this->pheanstalk, $job); + } + } + + /** + * Get the queue or return the default. + * + * @param string|null $queue + * @return string + */ + protected function getQueue($queue) + { + return $queue ?: $this->default; + } + + /** + * Get the underlying Pheanstalk instance. + * + * @return Pheanstalk + */ + public function getPheanstalk() + { + return $this->pheanstalk; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php b/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php index cc0972d1aeab..c81416709464 100644 --- a/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php +++ b/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php @@ -1,21 +1,21 @@ - $config['token'], 'project_id' => $config['project']); - - return new IronQueue(new IronMQ($config), $config['queue']); - } - + $config['token'], 'project_id' => $config['project']); + + return new IronQueue(new IronMQ($config), $config['queue']); + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Connectors/SyncConnector.php b/src/Illuminate/Queue/Connectors/SyncConnector.php index bb6389ccc9a1..8a81c9f26de6 100644 --- a/src/Illuminate/Queue/Connectors/SyncConnector.php +++ b/src/Illuminate/Queue/Connectors/SyncConnector.php @@ -1,18 +1,18 @@ -listener = $listener; - } - - /** - * Execute the console command. - * - * @return void - */ - public function fire() - { - $queue = $this->input->getOption('queue'); - - $delay = $this->input->getOption('delay'); - - // The memory limit is the amount of memory we will allow the script to occupy - // before killing it and letting a process manager restart it for us, which - // is to protect us against any memory leaks that will be in the scripts. - $memory = $this->input->getOption('memory'); - - $connection = $this->input->getArgument('connection'); - - $this->listener->listen($connection, $queue, $delay, $memory); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return array( - array('connection', InputArgument::OPTIONAL, 'The name of connection', null), - ); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return array( - array('queue', null, InputOption::VALUE_OPTIONAL, 'The queue to listen on'), - - array('delay', null, InputOption::VALUE_OPTIONAL, 'Amount of time to delay failed jobs', 0), - - array('memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128), - ); - } - +listener = $listener; + } + + /** + * Execute the console command. + * + * @return void + */ + public function fire() + { + $queue = $this->input->getOption('queue'); + + $delay = $this->input->getOption('delay'); + + // The memory limit is the amount of memory we will allow the script to occupy + // before killing it and letting a process manager restart it for us, which + // is to protect us against any memory leaks that will be in the scripts. + $memory = $this->input->getOption('memory'); + + $connection = $this->input->getArgument('connection'); + + $this->listener->listen($connection, $queue, $delay, $memory); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return array( + array('connection', InputArgument::OPTIONAL, 'The name of connection', null), + ); + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return array( + array('queue', null, InputOption::VALUE_OPTIONAL, 'The queue to listen on'), + + array('delay', null, InputOption::VALUE_OPTIONAL, 'Amount of time to delay failed jobs', 0), + + array('memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128), + ); + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/IronQueue.php b/src/Illuminate/Queue/IronQueue.php index 9ab85129723c..566a1cb8ecf9 100644 --- a/src/Illuminate/Queue/IronQueue.php +++ b/src/Illuminate/Queue/IronQueue.php @@ -1,107 +1,107 @@ -iron = $iron; - $this->default = $default; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string $queue - * @return void - */ - public function push($job, $data = '', $queue = null) - { - $payload = $this->createPayload($job, $data); - - $this->iron->postMessage($this->getQueue($queue), $payload); - } - - /** - * Push a new job onto the queue after a delay. - * - * @param int $delay - * @param string $job - * @param mixed $data - * @param string $queue - * @return void - */ - public function later($delay, $job, $data = '', $queue = null) - { - $payload = $this->createPayload($job, $data); - - $payload = array('body' => $payload, 'delay' => $delay); - - $this->iron->postMessage($this->getQueue($queue), $payload); - } - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return Illuminate\Queue\Jobs\Job|null - */ - public function pop($queue = null) - { - $queue = $this->getQueue($queue); - - $job = $this->iron->getMessage($queue); - - if ( ! is_null($job)) - { - return new IronJob($this->container, $this->iron, $job, $queue); - } - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - protected function getQueue($queue) - { - return $queue ?: $this->default; - } - - /** - * Get the underlying IronMQ instance. - * - * @return IronMQ - */ - public function getIron() - { - return $this->iron; - } - +iron = $iron; + $this->default = $default; + } + + /** + * Push a new job onto the queue. + * + * @param string $job + * @param mixed $data + * @param string $queue + * @return void + */ + public function push($job, $data = '', $queue = null) + { + $payload = $this->createPayload($job, $data); + + $this->iron->postMessage($this->getQueue($queue), $payload); + } + + /** + * Push a new job onto the queue after a delay. + * + * @param int $delay + * @param string $job + * @param mixed $data + * @param string $queue + * @return void + */ + public function later($delay, $job, $data = '', $queue = null) + { + $payload = $this->createPayload($job, $data); + + $payload = array('body' => $payload, 'delay' => $delay); + + $this->iron->postMessage($this->getQueue($queue), $payload); + } + + /** + * Pop the next job off of the queue. + * + * @param string $queue + * @return \Illuminate\Queue\Jobs\Job|null + */ + public function pop($queue = null) + { + $queue = $this->getQueue($queue); + + $job = $this->iron->getMessage($queue); + + if ( ! is_null($job)) + { + return new IronJob($this->container, $this->iron, $job, $queue); + } + } + + /** + * Get the queue or return the default. + * + * @param string|null $queue + * @return string + */ + protected function getQueue($queue) + { + return $queue ?: $this->default; + } + + /** + * Get the underlying IronMQ instance. + * + * @return IronMQ + */ + public function getIron() + { + return $this->iron; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Jobs/BeanstalkdJob.php b/src/Illuminate/Queue/Jobs/BeanstalkdJob.php index 0f9ba8aad40c..2bab6f951bf3 100644 --- a/src/Illuminate/Queue/Jobs/BeanstalkdJob.php +++ b/src/Illuminate/Queue/Jobs/BeanstalkdJob.php @@ -1,117 +1,117 @@ -job = $job; - $this->container = $container; - $this->pheanstalk = $pheanstalk; - } - - /** - * Fire the job. - * - * @return void - */ - public function fire() - { - $payload = unserialize($this->job->getData()); - - // Once we have the message payload, we can create the given class and fire - // it off with the given data. The data is in the messages serialized so - // we will unserialize it and pass into the jobs in its original form. - $this->instance = $this->container->make($payload['job']); - - $this->instance->fire($this, $payload['data']); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - $this->pheanstalk->delete($this->job); - } - - /** - * Release the job back into the queue. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - $priority = Pheanstalk::DEFAULT_PRIORITY; - - $this->pheanstalk->release($this->job, $priority, $delay); - } - - /** - * Get the IoC container instance. - * - * @return Illuminate\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Get the underlying Pheanstalk instance. - * - * @return Pheanstalk - */ - public function getPheanstalk() - { - return $this->pheanstalk; - } - - /** - * Get the underlying Pheanstalk job. - * - * @return Pheanstalk_Job - */ - public function getPheanstalkJob() - { - return $this->job; - } - +job = $job; + $this->container = $container; + $this->pheanstalk = $pheanstalk; + } + + /** + * Fire the job. + * + * @return void + */ + public function fire() + { + $payload = unserialize($this->job->getData()); + + // Once we have the message payload, we can create the given class and fire + // it off with the given data. The data is in the messages serialized so + // we will unserialize it and pass into the jobs in its original form. + $this->instance = $this->container->make($payload['job']); + + $this->instance->fire($this, $payload['data']); + } + + /** + * Delete the job from the queue. + * + * @return void + */ + public function delete() + { + $this->pheanstalk->delete($this->job); + } + + /** + * Release the job back into the queue. + * + * @param int $delay + * @return void + */ + public function release($delay = 0) + { + $priority = Pheanstalk::DEFAULT_PRIORITY; + + $this->pheanstalk->release($this->job, $priority, $delay); + } + + /** + * Get the IoC container instance. + * + * @return \Illuminate\Container\Container + */ + public function getContainer() + { + return $this->container; + } + + /** + * Get the underlying Pheanstalk instance. + * + * @return Pheanstalk + */ + public function getPheanstalk() + { + return $this->pheanstalk; + } + + /** + * Get the underlying Pheanstalk job. + * + * @return Pheanstalk_Job + */ + public function getPheanstalkJob() + { + return $this->job; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Jobs/IronJob.php b/src/Illuminate/Queue/Jobs/IronJob.php index 7b5aa4e73579..a5a5bf772f3e 100644 --- a/src/Illuminate/Queue/Jobs/IronJob.php +++ b/src/Illuminate/Queue/Jobs/IronJob.php @@ -1,124 +1,124 @@ -job = $job; - $this->iron = $iron; - $this->queue = $queue; - $this->container = $container; - } - - /** - * Fire the job. - * - * @return void - */ - public function fire() - { - $payload = unserialize($this->job->body); - - // Once we have the message payload, we can create the given class and fire - // it off with the given data. The data is in the messages serialized so - // we will unserialize it and pass into the jobs in its original form. - $this->instance = $this->container->make($payload['job']); - - $this->instance->fire($this, $payload['data']); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - $this->iron->deleteMessage($this->queue, $this->job->id); - } - - /** - * Release the job back into the queue. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - // - } - - /** - * Get the IoC container instance. - * - * @return Illuminate\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Get the underlying IronMQ instance. - * - * @return IronMQ - */ - public function getIron() - { - return $this->iron; - } - - /** - * Get the underlying IronMQ job. - * - * @return array - */ - public function getIronJob() - { - return $this->job; - } - +job = $job; + $this->iron = $iron; + $this->queue = $queue; + $this->container = $container; + } + + /** + * Fire the job. + * + * @return void + */ + public function fire() + { + $payload = unserialize($this->job->body); + + // Once we have the message payload, we can create the given class and fire + // it off with the given data. The data is in the messages serialized so + // we will unserialize it and pass into the jobs in its original form. + $this->instance = $this->container->make($payload['job']); + + $this->instance->fire($this, $payload['data']); + } + + /** + * Delete the job from the queue. + * + * @return void + */ + public function delete() + { + $this->iron->deleteMessage($this->queue, $this->job->id); + } + + /** + * Release the job back into the queue. + * + * @param int $delay + * @return void + */ + public function release($delay = 0) + { + // + } + + /** + * Get the IoC container instance. + * + * @return \Illuminate\Container + */ + public function getContainer() + { + return $this->container; + } + + /** + * Get the underlying IronMQ instance. + * + * @return IronMQ + */ + public function getIron() + { + return $this->iron; + } + + /** + * Get the underlying IronMQ job. + * + * @return array + */ + public function getIronJob() + { + return $this->job; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Jobs/SyncJob.php b/src/Illuminate/Queue/Jobs/SyncJob.php index 31431d45b13e..9ca6e145b78f 100644 --- a/src/Illuminate/Queue/Jobs/SyncJob.php +++ b/src/Illuminate/Queue/Jobs/SyncJob.php @@ -1,76 +1,76 @@ -job = $job; - $this->data = $data; - $this->container = $container; - } - - /** - * Fire the job. - * - * @return void - */ - public function fire() - { - $this->instance = $this->container->make($this->job); - - $this->instance->fire($this, $this->data); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - // - } - - /** - * Release the job back into the queue. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - // - } - +job = $job; + $this->data = $data; + $this->container = $container; + } + + /** + * Fire the job. + * + * @return void + */ + public function fire() + { + $this->instance = $this->container->make($this->job); + + $this->instance->fire($this, $this->data); + } + + /** + * Delete the job from the queue. + * + * @return void + */ + public function delete() + { + // + } + + /** + * Release the job back into the queue. + * + * @param int $delay + * @return void + */ + public function release($delay = 0) + { + // + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Listener.php b/src/Illuminate/Queue/Listener.php index efc461237f6b..c00f4f8b6e8a 100644 --- a/src/Illuminate/Queue/Listener.php +++ b/src/Illuminate/Queue/Listener.php @@ -1,147 +1,147 @@ -manager = $manager; - } - - /** - * Listen to the given queue. - * - * @param string $connection - * @param string $queue - * @param int $delay - * @param int $memory - * @return void - */ - public function listen($connection, $queue = null, $delay = 0, $memory = 128) - { - $connection = $this->manager->connection($connection); - - while (true) - { - $job = $connection->pop($queue); - - // If we're able to pull a job off of the stack, we will process it and - // then make sure we are not exceeding our memory limits for the run - // which is to protect against run-away memory leakages from here. - if ( ! is_null($job)) - { - $this->process($job, $delay); - } - else - { - $this->sleep(1); - } - - // Once we have run the job we'll go check if the memory limit has been - // exceeded for the script. If it has, we will kill this script so a - // process managers will restart this with a clean slate of memory. - if ($this->memoryExceeded($memory)) - { - $this->stop(); return; - } - } - } - - /** - * Process a given job from the queue. - * - * @param Illuminate\Queue\Jobs\Job $job - * @param int $delay - * @return void - */ - public function process(Job $job, $delay) - { - try - { - // First we will fire off the job. Once it is done we will see if it will - // be auto-deleted after processing and if so we will go ahead and run - // the delete method on the job. Otherwise we will just keep moving. - $job->fire(); - - if ($job->autoDelete()) $job->delete(); - } - - catch (\Exception $e) - { - // If we catch an exception, we will attempt to release the job back onto - // the queue so it is not lost. This will let is be retried at a later - // time by another listener (or the same one). We will do that here. - $job->release($delay); - - throw $e; - } - } - - /** - * Determine if the memory limit has been exceeded. - * - * @param int $memoryLimit - * @return bool - */ - public function memoryExceeded($memoryLimit) - { - return (memory_get_usage() / 1024 / 1024) >= $memoryLimit; - } - - /** - * Sleep the script for a given number of seconds. - * - * @param int $seconds - * @return void - */ - public function sleep($seconds) - { - sleep($seconds); - } - - /** - * Stop listening and bail out of the script. - * - * @return void - */ - public function stop() - { - die; - } - - /** - * Get the queue manager instance. - * - * @return Illuminate\Queue\QueueManager - */ - public function getManager() - { - return $this->manager; - } - - /** - * Set the queue manager instance. - * - * @param Illuminate\Queue\QueueManager $manager - * @return void - */ - public function setManager(QueueManager $manager) - { - $this->manager = $manager; - } - +manager = $manager; + } + + /** + * Listen to the given queue. + * + * @param string $connection + * @param string $queue + * @param int $delay + * @param int $memory + * @return void + */ + public function listen($connection, $queue = null, $delay = 0, $memory = 128) + { + $connection = $this->manager->connection($connection); + + while (true) + { + $job = $connection->pop($queue); + + // If we're able to pull a job off of the stack, we will process it and + // then make sure we are not exceeding our memory limits for the run + // which is to protect against run-away memory leakages from here. + if ( ! is_null($job)) + { + $this->process($job, $delay); + } + else + { + $this->sleep(1); + } + + // Once we have run the job we'll go check if the memory limit has been + // exceeded for the script. If it has, we will kill this script so a + // process managers will restart this with a clean slate of memory. + if ($this->memoryExceeded($memory)) + { + $this->stop(); return; + } + } + } + + /** + * Process a given job from the queue. + * + * @param \Illuminate\Queue\Jobs\Job $job + * @param int $delay + * @return void + */ + public function process(Job $job, $delay) + { + try + { + // First we will fire off the job. Once it is done we will see if it will + // be auto-deleted after processing and if so we will go ahead and run + // the delete method on the job. Otherwise we will just keep moving. + $job->fire(); + + if ($job->autoDelete()) $job->delete(); + } + + catch (\Exception $e) + { + // If we catch an exception, we will attempt to release the job back onto + // the queue so it is not lost. This will let is be retried at a later + // time by another listener (or the same one). We will do that here. + $job->release($delay); + + throw $e; + } + } + + /** + * Determine if the memory limit has been exceeded. + * + * @param int $memoryLimit + * @return bool + */ + public function memoryExceeded($memoryLimit) + { + return (memory_get_usage() / 1024 / 1024) >= $memoryLimit; + } + + /** + * Sleep the script for a given number of seconds. + * + * @param int $seconds + * @return void + */ + public function sleep($seconds) + { + sleep($seconds); + } + + /** + * Stop listening and bail out of the script. + * + * @return void + */ + public function stop() + { + die; + } + + /** + * Get the queue manager instance. + * + * @return \Illuminate\Queue\QueueManager + */ + public function getManager() + { + return $this->manager; + } + + /** + * Set the queue manager instance. + * + * @param \Illuminate\Queue\QueueManager $manager + * @return void + */ + public function setManager(QueueManager $manager) + { + $this->manager = $manager; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/Queue.php b/src/Illuminate/Queue/Queue.php index cba4d0b080a9..2629f9bdb65f 100644 --- a/src/Illuminate/Queue/Queue.php +++ b/src/Illuminate/Queue/Queue.php @@ -1,37 +1,37 @@ - $job, 'data' => $data)); - } - - /** - * Set the IoC container instance. - * - * @param Illuminate\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } - + $job, 'data' => $data)); + } + + /** + * Set the IoC container instance. + * + * @param \Illuminate\Container\Container $container + * @return void + */ + public function setContainer(Container $container) + { + $this->container = $container; + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/QueueInterface.php b/src/Illuminate/Queue/QueueInterface.php index e0985034c933..42cc7a939d17 100644 --- a/src/Illuminate/Queue/QueueInterface.php +++ b/src/Illuminate/Queue/QueueInterface.php @@ -1,34 +1,34 @@ -app = $app; - } - - /** - * Resolve a queue connection instance. - * - * @param string $name - * @return Illuminate\Queue\QueueInterface - */ - public function connection($name = null) - { - $name = $name ?: $this->getDefault(); - - // If the connection has not been resolved yet we will resolve it now as all - // of the connections are resolved when they are actually needed so we do - // not make any unnecessary connection to the various queue end-points. - if ( ! isset($this->connections[$name])) - { - $this->connections[$name] = $this->resolve($name); - - $this->connections[$name]->setContainer($this->app); - } - - return $this->connections[$name]; - } - - /** - * Resolve a queue connection. - * - * @param string $name - * @return Illuminate\Queue\QueueInterface - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - return $this->getConnector($config['driver'])->connect($config); - } - - /** - * Get the connector for a given driver. - * - * @param string $driver - * @return Illuminate\Queue\Connectors\ConnectorInterface - */ - protected function getConnector($driver) - { - if (isset($this->connectors[$driver])) - { - return call_user_func($this->connectors[$driver]); - } - - throw new \InvalidArgumentException("No connector for [$driver]"); - } - - /** - * Add a queue connection resolver. - * - * @param string $driver - * @param Closure $resolver - * @return void - */ - public function addConnector($driver, Closure $resolver) - { - $this->connectors[$driver] = $resolver; - } - - /** - * Get the queue connection configuration. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - return $this->app['config']["queue.connections.{$name}"]; - } - - /** - * Get the name of the default queue connection. - * - * @return string - */ - protected function getDefault() - { - return $this->app['config']['queue.default']; - } - - /** - * Dyncamially pass calls to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - $callable = array($this->connection(), $method); - - return call_user_func_array($callable, $parameters); - } - +app = $app; + } + + /** + * Resolve a queue connection instance. + * + * @param string $name + * @return \Illuminate\Queue\QueueInterface + */ + public function connection($name = null) + { + $name = $name ?: $this->getDefault(); + + // If the connection has not been resolved yet we will resolve it now as all + // of the connections are resolved when they are actually needed so we do + // not make any unnecessary connection to the various queue end-points. + if ( ! isset($this->connections[$name])) + { + $this->connections[$name] = $this->resolve($name); + + $this->connections[$name]->setContainer($this->app); + } + + return $this->connections[$name]; + } + + /** + * Resolve a queue connection. + * + * @param string $name + * @return \Illuminate\Queue\QueueInterface + */ + protected function resolve($name) + { + $config = $this->getConfig($name); + + return $this->getConnector($config['driver'])->connect($config); + } + + /** + * Get the connector for a given driver. + * + * @param string $driver + * @return \Illuminate\Queue\Connectors\ConnectorInterface + */ + protected function getConnector($driver) + { + if (isset($this->connectors[$driver])) + { + return call_user_func($this->connectors[$driver]); + } + + throw new \InvalidArgumentException("No connector for [$driver]"); + } + + /** + * Add a queue connection resolver. + * + * @param string $driver + * @param Closure $resolver + * @return void + */ + public function addConnector($driver, Closure $resolver) + { + $this->connectors[$driver] = $resolver; + } + + /** + * Get the queue connection configuration. + * + * @param string $name + * @return array + */ + protected function getConfig($name) + { + return $this->app['config']["queue.connections.{$name}"]; + } + + /** + * Get the name of the default queue connection. + * + * @return string + */ + protected function getDefault() + { + return $this->app['config']['queue.default']; + } + + /** + * Dyncamially pass calls to the default connection. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + $callable = array($this->connection(), $method); + + return call_user_func_array($callable, $parameters); + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/QueueServiceProvider.php b/src/Illuminate/Queue/QueueServiceProvider.php index c43be5f647a9..0369dffcb2e2 100644 --- a/src/Illuminate/Queue/QueueServiceProvider.php +++ b/src/Illuminate/Queue/QueueServiceProvider.php @@ -1,133 +1,133 @@ -registerManager(); - - $this->registerListener(); - } - - /** - * Register the queue manager. - * - * @return void - */ - protected function registerManager() - { - $me = $this; - - $this->app['queue'] = $this->app->share(function($app) use ($me) - { - // Once we have an instance of the queue manager, we will register the various - // resolvers for the queue connectors. These connectors are responsible for - // creating the classes that accept queue configs and instantiate queues. - $manager = new QueueManager($app); - - $me->registerConnectors($manager); - - return $manager; - }); - } - - /** - * Register the queue listener. - * - * @return void - */ - protected function registerListener() - { - $this->registerListenerCommand(); - - $this->app['queue.listener'] = $this->app->share(function($app) - { - return new Listener($app['queue']); - }); - } - - /** - * Register the queue listener console command. - * - * @return void - */ - protected function registerListenerCommand() - { - $app = $this->app; - - $app['command.queue.listen'] = $app->share(function($app) - { - return new ListenCommand($app['queue.listener']); - }); - } - - /** - * Register the connectors on the queue manager. - * - * @param Illuminate\Queue\QueueManager $manager - * @return void - */ - public function registerConnectors($manager) - { - foreach (array('Sync', 'Beanstalkd') as $connector) - { - $this->{"register{$connector}Connector"}($manager); - } - } - - /** - * Register the Sync queue connector. - * - * @param Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerSyncConnector($manager) - { - $manager->addConnector('sync', function() - { - return new SyncConnector; - }); - } - - /** - * Register the Beanstalkd queue connector. - * - * @param Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerBeanstalkdConnector($manager) - { - $manager->addConnector('beanstalkd', function() - { - return new BeanstalkdConnector; - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return array('queue', 'queue.listener', 'command.queue.listen'); - } - +registerManager(); + + $this->registerListener(); + } + + /** + * Register the queue manager. + * + * @return void + */ + protected function registerManager() + { + $me = $this; + + $this->app['queue'] = $this->app->share(function($app) use ($me) + { + // Once we have an instance of the queue manager, we will register the various + // resolvers for the queue connectors. These connectors are responsible for + // creating the classes that accept queue configs and instantiate queues. + $manager = new QueueManager($app); + + $me->registerConnectors($manager); + + return $manager; + }); + } + + /** + * Register the queue listener. + * + * @return void + */ + protected function registerListener() + { + $this->registerListenerCommand(); + + $this->app['queue.listener'] = $this->app->share(function($app) + { + return new Listener($app['queue']); + }); + } + + /** + * Register the queue listener console command. + * + * @return void + */ + protected function registerListenerCommand() + { + $app = $this->app; + + $app['command.queue.listen'] = $app->share(function($app) + { + return new ListenCommand($app['queue.listener']); + }); + } + + /** + * Register the connectors on the queue manager. + * + * @param \Illuminate\Queue\QueueManager $manager + * @return void + */ + public function registerConnectors($manager) + { + foreach (array('Sync', 'Beanstalkd') as $connector) + { + $this->{"register{$connector}Connector"}($manager); + } + } + + /** + * Register the Sync queue connector. + * + * @param \Illuminate\Queue\QueueManager $manager + * @return void + */ + protected function registerSyncConnector($manager) + { + $manager->addConnector('sync', function() + { + return new SyncConnector; + }); + } + + /** + * Register the Beanstalkd queue connector. + * + * @param \Illuminate\Queue\QueueManager $manager + * @return void + */ + protected function registerBeanstalkdConnector($manager) + { + $manager->addConnector('beanstalkd', function() + { + return new BeanstalkdConnector; + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return array('queue', 'queue.listener', 'command.queue.listen'); + } + } \ No newline at end of file diff --git a/src/Illuminate/Queue/SyncQueue.php b/src/Illuminate/Queue/SyncQueue.php index 7c2c2d260fb2..af085d04829e 100644 --- a/src/Illuminate/Queue/SyncQueue.php +++ b/src/Illuminate/Queue/SyncQueue.php @@ -1,52 +1,52 @@ -resolveJob($job, $data)->fire(); - } - - /** - * Push a new job onto the queue after a delay. - * - * @param int $delay - * @param string $job - * @param mixed $data - * @param string $queue - * @return void - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->push($job, $data, $queue); - } - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return Illuminate\Queue\Jobs\Job|null - */ - public function pop($queue = null) {} - - /** - * Resolve a Sync job instance. - * - * @param string $job - * @param string $data - * @return Illuminate\Queue\Jobs\SyncJob - */ - protected function resolveJob($job, $data) - { - return new Jobs\SyncJob($this->container, $job, $data); - } - +resolveJob($job, $data)->fire(); + } + + /** + * Push a new job onto the queue after a delay. + * + * @param int $delay + * @param string $job + * @param mixed $data + * @param string $queue + * @return void + */ + public function later($delay, $job, $data = '', $queue = null) + { + return $this->push($job, $data, $queue); + } + + /** + * Pop the next job off of the queue. + * + * @param string $queue + * @return \Illuminate\Queue\Jobs\Job|null + */ + public function pop($queue = null) {} + + /** + * Resolve a Sync job instance. + * + * @param string $job + * @param string $data + * @return \Illuminate\Queue\Jobs\SyncJob + */ + protected function resolveJob($job, $data) + { + return new Jobs\SyncJob($this->container, $job, $data); + } + } \ No newline at end of file diff --git a/src/Illuminate/Redis/RedisManager.php b/src/Illuminate/Redis/RedisManager.php index 0cf5cb8ff3d9..8208ad99b905 100644 --- a/src/Illuminate/Redis/RedisManager.php +++ b/src/Illuminate/Redis/RedisManager.php @@ -1,110 +1,110 @@ -app = $app; - } - - /** - * Get a Redis connection instance. - * - * @param string $name - * @return Illuminate\Redis\Database - */ - public function connection($name = null) - { - if ( ! isset($this->connections[$name])) - { - $this->connections[$name] = $this->createConnection($name); - } - - return $this->connections[$name]; - } - - /** - * Create the given connection by name. - * - * @param string $name - * @return Illuminate\Redis\Database - */ - protected function createConnection($name) - { - $config = $this->getConfig($name); - - $connection = new Database($config['host'], $config['port'], $config['database']); - - $connection->connect(); - - return $connection; - } - - /** - * Get the configuration for a connection. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - $name = $name ?: $this->getDefaultConnection(); - - // To get the database connection configuration, we will just pull each of the - // connection configurations and get the configurations for the given name. - // If the configuration doesn't exist, we'll throw an exception and bail. - $connections = $this->app['config']['database.redis']; - - if (is_null($config = array_get($connections, $name))) - { - throw new \InvalidArgumentException("Redis [$name] not configured."); - } - - return $config; - } - - /** - * Get the default connection name. - * - * @return string - */ - protected function getDefaultConnection() - { - return 'default'; - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return call_user_func_array(array($this->connection(), $method), $parameters); - } - +app = $app; + } + + /** + * Get a Redis connection instance. + * + * @param string $name + * @return \Illuminate\Redis\Database + */ + public function connection($name = null) + { + if ( ! isset($this->connections[$name])) + { + $this->connections[$name] = $this->createConnection($name); + } + + return $this->connections[$name]; + } + + /** + * Create the given connection by name. + * + * @param string $name + * @return \Illuminate\Redis\Database + */ + protected function createConnection($name) + { + $config = $this->getConfig($name); + + $connection = new Database($config['host'], $config['port'], $config['database']); + + $connection->connect(); + + return $connection; + } + + /** + * Get the configuration for a connection. + * + * @param string $name + * @return array + */ + protected function getConfig($name) + { + $name = $name ?: $this->getDefaultConnection(); + + // To get the database connection configuration, we will just pull each of the + // connection configurations and get the configurations for the given name. + // If the configuration doesn't exist, we'll throw an exception and bail. + $connections = $this->app['config']['database.redis']; + + if (is_null($config = array_get($connections, $name))) + { + throw new \InvalidArgumentException("Redis [$name] not configured."); + } + + return $config; + } + + /** + * Get the default connection name. + * + * @return string + */ + protected function getDefaultConnection() + { + return 'default'; + } + + /** + * Dynamically pass methods to the default connection. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return call_user_func_array(array($this->connection(), $method), $parameters); + } + } \ No newline at end of file diff --git a/src/Illuminate/Routing/Console/MakeControllerCommand.php b/src/Illuminate/Routing/Console/MakeControllerCommand.php index cf87b6faae58..924181b37300 100644 --- a/src/Illuminate/Routing/Console/MakeControllerCommand.php +++ b/src/Illuminate/Routing/Console/MakeControllerCommand.php @@ -24,7 +24,7 @@ class MakeControllerCommand extends Command { /** * The controller generator instance. * - * @var Illuminate\Routing\Generators\ControllerGenerator + * @var \Illuminate\Routing\Generators\ControllerGenerator */ protected $generator; @@ -38,7 +38,7 @@ class MakeControllerCommand extends Command { /** * Create a new make controller command instance. * - * @param Illuminate\Routing\Generators\ControllerGenerator $generator + * @param \Illuminate\Routing\Generators\ControllerGenerator $generator * @param string $path * @return void */ diff --git a/src/Illuminate/Routing/Controllers/Controller.php b/src/Illuminate/Routing/Controllers/Controller.php index 8adf98d3fbb3..e51165ef42b1 100644 --- a/src/Illuminate/Routing/Controllers/Controller.php +++ b/src/Illuminate/Routing/Controllers/Controller.php @@ -12,7 +12,7 @@ class Controller { /** * The controller filter parser. * - * @var Illuminate\Routing\FilterParser + * @var \Illuminate\Routing\Controllers\FilterParser */ protected $filterParser; @@ -33,7 +33,7 @@ class Controller { /** * The layout used by the controller. * - * @var Illuminate\View\View + * @var \Illuminate\View\View */ protected $layout; @@ -94,11 +94,11 @@ protected function prepareFilter($filter, $options) /** * Execute an action on the controller. * - * @param Illuminate\Container $container - * @param Illuminate\Routing\Router $router + * @param \Illuminate\Container\Container $container + * @param \Illuminate\Routing\Router $router * @param string $method * @param array $parameters - * @return Symfony\Component\HttpFoundation\Response + * @return \Symfony\Component\HttpFoundation\Response */ public function callAction(Container $container, Router $router, $method, $parameters) { @@ -142,10 +142,10 @@ protected function directCallAction($method, $parameters) /** * Process a controller action response. * - * @param Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router * @param string $method * @param mixed $response - * @return Symfony\Component\HttpFoundation\Response + * @return \Symfony\Component\HttpFoundation\Response */ protected function processResponse($router, $method, $response) { @@ -164,7 +164,7 @@ protected function processResponse($router, $method, $response) /** * Call the before filters on the controller. * - * @param Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router * @param string $method * @return mixed */ @@ -192,7 +192,7 @@ protected function callBeforeFilters($router, $method) /** * Get the before filters for the controller. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return array */ @@ -206,9 +206,9 @@ protected function getBeforeFilters($request, $method) /** * Call the after filters on the controller. * - * @param Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router * @param string $method - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return mixed */ protected function callAfterFilters($router, $method, $response) @@ -231,7 +231,7 @@ protected function callAfterFilters($router, $method, $response) /** * Get the after filters for the controller. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return array */ @@ -245,9 +245,9 @@ protected function getAfterFilters($request, $method) /** * Call the given route filter. * - * @param Illuminate\Routing\Route $route + * @param \Illuminate\Routing\Route $route * @param string $filter - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param array $parameters * @return mixed */ diff --git a/src/Illuminate/Routing/Controllers/Filter.php b/src/Illuminate/Routing/Controllers/Filter.php index ad92b482a317..563139892415 100644 --- a/src/Illuminate/Routing/Controllers/Filter.php +++ b/src/Illuminate/Routing/Controllers/Filter.php @@ -73,7 +73,7 @@ protected function prepareValues($values) /** * Determine if the filter applies to a request and method. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return bool */ @@ -95,7 +95,7 @@ public function applicable(Request $request, $method) /** * Determine if the filter applies based on the "on" rule. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return bool */ @@ -109,7 +109,7 @@ protected function excludedByRequest($request, $method) /** * Determine if the filter applies based on the "only" rule. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return bool */ @@ -121,7 +121,7 @@ protected function excludedByOnlyMethod($request, $method) /** * Determine if the filter applies based on the "except" rule. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return bool */ diff --git a/src/Illuminate/Routing/Controllers/FilterParser.php b/src/Illuminate/Routing/Controllers/FilterParser.php index 2b5f8f6c9197..0f8b979ffd58 100644 --- a/src/Illuminate/Routing/Controllers/FilterParser.php +++ b/src/Illuminate/Routing/Controllers/FilterParser.php @@ -7,8 +7,8 @@ class FilterParser { /** * Parse the given filters from the controller. * - * @param Illuminate\Routing\Controllers\Controller $controller - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Illuminate\Routing\Controllers\Controller $controller + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @param string $filter * @return array @@ -21,8 +21,8 @@ public function parse(Controller $controller, Request $request, $method, $filter /** * Get the filters that were specified in code. * - * @param Illuminate\Routing\Controllers\Controller $controller - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Illuminate\Routing\Controllers\Controller $controller + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @param string $filter * @return array @@ -53,7 +53,7 @@ protected function filterByClass($filters, $filter) * Filter the annotations by request and method. * * @param array $filters - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $method * @return array */ diff --git a/src/Illuminate/Routing/Generators/ControllerGenerator.php b/src/Illuminate/Routing/Generators/ControllerGenerator.php index 3b17399dad48..ff5ff3a35b87 100644 --- a/src/Illuminate/Routing/Generators/ControllerGenerator.php +++ b/src/Illuminate/Routing/Generators/ControllerGenerator.php @@ -7,7 +7,7 @@ class ControllerGenerator { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -29,7 +29,7 @@ class ControllerGenerator { /** * Create a new controller generator instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @return void */ public function __construct(Filesystem $files) diff --git a/src/Illuminate/Routing/Redirector.php b/src/Illuminate/Routing/Redirector.php index 33df303946df..c5a02294a533 100644 --- a/src/Illuminate/Routing/Redirector.php +++ b/src/Illuminate/Routing/Redirector.php @@ -8,21 +8,21 @@ class Redirector { /** * The URL generator instance. * - * @var Illuminate\Routing\UrlGenerator + * @var \Illuminate\Routing\UrlGenerator */ protected $generator; /** * The session store instance. * - * @var Illuminate\Session\Store + * @var \Illuminate\Session\Store */ protected $session; /** * Create a new Redirector instance. * - * @param Illuminate\Routing\UrlGenerator $generator + * @param \Illuminate\Routing\UrlGenerator $generator * @return void */ public function __construct(UrlGenerator $generator) @@ -35,7 +35,7 @@ public function __construct(UrlGenerator $generator) * * @param int $status * @param array $headers - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function back($status = 302, $headers = array()) { @@ -51,7 +51,7 @@ public function back($status = 302, $headers = array()) * @param int $status * @param array $headers * @param bool $secure - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function to($path, $status = 302, $headers = array(), $secure = false) { @@ -66,7 +66,7 @@ public function to($path, $status = 302, $headers = array(), $secure = false) * @param string $path * @param int $status * @param array $headers - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function secure($path, $status = 302, $headers = array()) { @@ -80,7 +80,7 @@ public function secure($path, $status = 302, $headers = array()) * @param array $parameters * @param int $status * @param array $headers - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function route($route, $parameters = array(), $status = 302, $headers = array()) { @@ -96,7 +96,7 @@ public function route($route, $parameters = array(), $status = 302, $headers = a * @param array $parameters * @param int $status * @param array $headers - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function action($action, $parameters = array(), $status = 302, $headers = array()) { @@ -111,7 +111,7 @@ public function action($action, $parameters = array(), $status = 302, $headers = * @param string $path * @param int $status * @param array $headers - * @return Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ protected function createRedirect($path, $status, $headers) { @@ -130,7 +130,7 @@ protected function createRedirect($path, $status, $headers) /** * Set the active session store. * - * @param Illuminate\Session\Store $session + * @param \Illuminate\Session\Store $session * @return void */ public function setSession(SessionStore $session) diff --git a/src/Illuminate/Routing/Route.php b/src/Illuminate/Routing/Route.php index 0dec3a037dec..cbd643dfc5c0 100644 --- a/src/Illuminate/Routing/Route.php +++ b/src/Illuminate/Routing/Route.php @@ -10,7 +10,7 @@ class Route extends BaseRoute implements ArrayAccess { /** * The router instance. * - * @var Illuminate\Routing\Router + * @var \Illuminate\Routing\Router */ protected $router; @@ -24,7 +24,7 @@ class Route extends BaseRoute implements ArrayAccess { /** * Execute the route and return the response. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return mixed */ public function run(Request $request) @@ -67,7 +67,7 @@ protected function callCallable() /** * Call all of the before filters on the route. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return mixed */ protected function callBeforeFilters(Request $request) @@ -90,7 +90,7 @@ protected function callBeforeFilters(Request $request) /** * Get all of the before filters to run on the route. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return array */ protected function getAllBeforeFilters(Request $request) @@ -104,7 +104,7 @@ protected function getAllBeforeFilters(Request $request) * Call a given filter with the parameters. * * @param string $name - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param array $parameters * @return mixed */ @@ -248,7 +248,7 @@ public function getVariableKeys() * * @param string $name * @param string $expression - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function where($name, $expression) { @@ -262,7 +262,7 @@ public function where($name, $expression) * * @param string $key * @param mixed $value - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function defaults($key, $value) { @@ -275,7 +275,7 @@ public function defaults($key, $value) * Set the before filters on the route. * * @param dynamic - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function before() { @@ -292,7 +292,7 @@ public function before() * Set the after filters on the route. * * @param dynamic - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function after() { @@ -361,7 +361,7 @@ public function setParameters($parameters) /** * Set the Router instance on the route. * - * @param Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router * @return void */ public function setRouter(Router $router) diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 2fa561fa42e1..d4f1694fb413 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -19,7 +19,7 @@ class Router { /** * The route collection instance. * - * @var Symfony\Component\Routing\RouteCollection + * @var \Symfony\Component\Routing\RouteCollection */ protected $routes; @@ -54,21 +54,21 @@ class Router { /** * The inversion of control container instance. * - * @var Illuminate\Container + * @var \Illuminate\Container\Container */ protected $container; /** * The current request being dispatched. * - * @var Symfony\Component\HttpFoundation\Request + * @var \Symfony\Component\HttpFoundation\Request */ protected $currentRequest; /** * The current route being executed. * - * @var Illuminate\Routing\Route + * @var \Illuminate\Routing\Route */ protected $currentRoute; @@ -82,7 +82,7 @@ class Router { /** * Create a new router instance. * - * @param Illuminate\Container $container + * @param \Illuminate\Container\Container $container * @return void */ public function __construct(Container $container = null) @@ -97,7 +97,7 @@ public function __construct(Container $container = null) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function get($pattern, $action) { @@ -109,7 +109,7 @@ public function get($pattern, $action) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function post($pattern, $action) { @@ -121,7 +121,7 @@ public function post($pattern, $action) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function put($pattern, $action) { @@ -133,7 +133,7 @@ public function put($pattern, $action) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function patch($pattern, $action) { @@ -145,7 +145,7 @@ public function patch($pattern, $action) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function delete($pattern, $action) { @@ -158,7 +158,7 @@ public function delete($pattern, $action) * @param string $method * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function match($method, $pattern, $action) { @@ -170,7 +170,7 @@ public function match($method, $pattern, $action) * * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function any($pattern, $action) { @@ -196,7 +196,7 @@ public function controllers(array $controllers) * * @param string $controller * @param string $uri - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function controller($controller, $uri) { @@ -352,7 +352,7 @@ public function group(array $attributes, Closure $callback) * @param string $method * @param string $pattern * @param mixed $action - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ protected function createRoute($method, $pattern, $action) { @@ -413,7 +413,7 @@ protected function parseAction($action) /** * Set the attributes and requirements on the route. * - * @param Illuminate\Routing\Route $route + * @param \Illuminate\Routing\Route $route * @param array $action * @param array $optional * @return void @@ -579,7 +579,7 @@ protected function createControllerCallback($attribute) /** * Replace any route back-references in a route. * - * @param Illuminate\Routing\Route $route + * @param \Illuminate\Routing\Route $route * @param string $original * @return void */ @@ -633,8 +633,8 @@ protected function formatMethod($method) /** * Get the response for a given request. * - * @param Symfony\Component\HttpFoundation\Request $request - * @return Symfony\Component\HttpFoundation\Response + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Symfony\Component\HttpFoundation\Response */ public function dispatch(Request $request) { @@ -665,8 +665,8 @@ public function dispatch(Request $request) /** * Match the given request to a route object. * - * @param Symfony\Component\HttpFoundation\Request $request - * @return Illuminate\Routing\Route + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Illuminate\Routing\Route */ protected function findRoute(Request $request) { @@ -826,7 +826,7 @@ public function matchFilter($pattern, $names) /** * Find the patterned filters matching a request. * - * @param Illuminate\Foundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return array */ public function findPatternFilters(Request $request) @@ -850,8 +850,8 @@ public function findPatternFilters(Request $request) /** * Call the "after" global filters. * - * @param Symfony\Component\HttpFoundation\Request $request - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Response $response * @return mixed */ protected function callAfterFilter(Request $request, SymfonyResponse $response) @@ -864,8 +864,8 @@ protected function callAfterFilter(Request $request, SymfonyResponse $response) /** * Call the "finish" global filter. * - * @param Symfony\Component\HttpFoundation\Request $request - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Response $response * @return mixed */ public function callFinishFilter(Request $request, SymfonyResponse $response) @@ -876,7 +876,7 @@ public function callFinishFilter(Request $request, SymfonyResponse $response) /** * Call a given global filter with the parameters. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @param string $name * @param array $parameters * @return mixed @@ -905,8 +905,8 @@ protected function callGlobalFilter(Request $request, $name, array $parameters = * Prepare the given value as a Response object. * * @param mixed $value - * @param Illuminate\Foundation\Request $request - * @return Symfony\Component\HttpFoundation\Response + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Symfony\Component\HttpFoundation\Response */ public function prepare($value, Request $request) { @@ -918,7 +918,7 @@ public function prepare($value, Request $request) /** * Convert routing exception to HttpKernel version. * - * @param Exception $e + * @param \Exception $e * @return void */ protected function handleRoutingException(\Exception $e) @@ -996,7 +996,7 @@ public function disableFilters() /** * Get the current request being dispatched. * - * @return Symfony\Component\HttpFoundation\Request + * @return \Symfony\Component\HttpFoundation\Request */ public function getRequest() { @@ -1006,7 +1006,7 @@ public function getRequest() /** * Get the current route being executed. * - * @return Illuminate\Routing\Route + * @return \Illuminate\Routing\Route */ public function getCurrentRoute() { @@ -1016,7 +1016,7 @@ public function getCurrentRoute() /** * Set the current route on the router. * - * @param Illuminate\Routing\Route $route + * @param \Illuminate\Routing\Route $route * @return void */ public function setCurrentRoute(Route $route) @@ -1027,8 +1027,8 @@ public function setCurrentRoute(Route $route) /** * Create a new URL matcher instance. * - * @param Symfony\Component\HttpFoundation\Request $request - * @return Symfony\Component\Routing\Matcher\UrlMatcher + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Symfony\Component\Routing\Matcher\UrlMatcher */ protected function getUrlMatcher(Request $request) { @@ -1042,7 +1042,7 @@ protected function getUrlMatcher(Request $request) /** * Retrieve the entire route collection. * - * @return Symfony\Component\Routing\RouteCollection + * @return \Symfony\Component\Routing\RouteCollection */ public function getRoutes() { @@ -1052,7 +1052,7 @@ public function getRoutes() /** * Set the container instance on the router. * - * @param Illuminate\Container $container + * @param \Illuminate\Container\Container $container * @return void */ public function setContainer(Container $container) diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 0dd0d24cfdb6..1dd269c26edc 100644 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -10,29 +10,29 @@ class UrlGenerator { /** * The route collection. * - * @var Symfony\Component\Routing\RouteCollection + * @var \Symfony\Component\Routing\RouteCollection */ protected $routes; /** * The request instance. * - * @var Symfony\Component\HttpFoundation\Request + * @var \Symfony\Component\HttpFoundation\Request */ protected $request; /** * The Symfony routing URL generator. * - * @var Symfony\Component\Routing\Generator\UrlGenerator + * @var \Symfony\Component\Routing\Generator\UrlGenerator */ protected $generator; /** * Create a new URL Generator instance. * - * @param Symfony\Component\Routing\RouteCollection $routes - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\Routing\RouteCollection $routes + * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function __construct(RouteCollection $routes, Request $request) @@ -164,7 +164,7 @@ protected function usingQuickParameters(array $parameters) /** * Build the parameter list for short circuit parameters. * - * @param Illuminate\Routing\Route $route + * @param \Illuminate\Routing\Route $route * @param array $parameters * @return array */ @@ -245,7 +245,7 @@ public function isValidUrl($path) /** * Get the request instance. * - * @return Symfony\Component\HttpFoundation\Request + * @return \Symfony\Component\HttpFoundation\Request */ public function getRequest() { @@ -255,7 +255,7 @@ public function getRequest() /** * Set the current request instance. * - * @param Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function setRequest(Request $request) @@ -272,7 +272,7 @@ public function setRequest(Request $request) /** * Get the Symfony URL generator instance. * - * @return Symfony\Component\Routing\Generator\UrlGenerator + * @return \Symfony\Component\Routing\Generator\UrlGenerator */ public function getGenerator() { @@ -282,7 +282,7 @@ public function getGenerator() /** * Get the Symfony URL generator instance. * - * @param Symfony\Component\Routing\Generator\UrlGenerator $generator + * @param \Symfony\Component\Routing\Generator\UrlGenerator $generator * @return void */ public function setGenerator(SymfonyGenerator $generator) diff --git a/src/Illuminate/Session/CacheDrivenStore.php b/src/Illuminate/Session/CacheDrivenStore.php index f1f7ca897f06..f7ef150997fc 100644 --- a/src/Illuminate/Session/CacheDrivenStore.php +++ b/src/Illuminate/Session/CacheDrivenStore.php @@ -7,14 +7,14 @@ class CacheDrivenStore extends Store { /** * The cache store instance. * - * @var Illuminate\Cache\Store + * @var \Illuminate\Cache\Store */ protected $cache; /** * Create a new Memcache session instance. * - * @param Illuminate\Cache\Store $cache + * @param \Illuminate\Cache\Store $cache * @return void */ public function __construct(\Illuminate\Cache\Store $cache) @@ -38,7 +38,7 @@ public function retrieveSession($id) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function createSession($id, array $session, Response $response) @@ -51,7 +51,7 @@ public function createSession($id, array $session, Response $response) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function updateSession($id, array $session, Response $response) diff --git a/src/Illuminate/Session/CookieStore.php b/src/Illuminate/Session/CookieStore.php index 2d3bfe4fde37..edc8fdb9fc07 100644 --- a/src/Illuminate/Session/CookieStore.php +++ b/src/Illuminate/Session/CookieStore.php @@ -8,7 +8,7 @@ class CookieStore extends Store { /** * The Illuminate cookie creator. * - * @var Illuminate\CookieJar + * @var \Illuminate\Cookie\CookieJar */ protected $cookies; @@ -22,7 +22,7 @@ class CookieStore extends Store { /** * Create a new Cookie based session store. * - * @param Illuminate\CookieJar $cookies + * @param \Illuminate\Cookie\CookieJar $cookies * @return void */ public function __construct(CookieJar $cookies) @@ -46,7 +46,7 @@ public function retrieveSession($id) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function createSession($id, array $session, Response $response) @@ -61,7 +61,7 @@ public function createSession($id, array $session, Response $response) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function updateSession($id, array $session, Response $response) @@ -83,7 +83,7 @@ public function setPayloadName($name) /** * Get the cookie jar instance. * - * @return Illuminate\CookieJar + * @return \Illuminate\Cookie\CookieJar */ public function getCookieJar() { diff --git a/src/Illuminate/Session/DatabaseStore.php b/src/Illuminate/Session/DatabaseStore.php index 287adaa8280a..4904e63023a0 100644 --- a/src/Illuminate/Session/DatabaseStore.php +++ b/src/Illuminate/Session/DatabaseStore.php @@ -9,14 +9,14 @@ class DatabaseStore extends Store implements Sweeper { /** * The database connection instance. * - * @var Illuminate\Database\Connection + * @var \Illuminate\Database\Connection */ protected $connection; /** * The encrypter instance. * - * @var Illuminate\Encrypter + * @var \Illuminate\Encryption\Encrypter */ protected $encrypter; @@ -30,8 +30,8 @@ class DatabaseStore extends Store implements Sweeper { /** * Create a new database session store. * - * @param Illuminate\Database\Connection $connection - * @param Illuminate\Encrypter $encrypter + * @param \Illuminate\Database\Connection $connection + * @param \Illuminate\Encryption\Encrypter $encrypter * @param string $table * @return void */ @@ -63,7 +63,7 @@ public function retrieveSession($id) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function createSession($id, array $session, Response $response) @@ -80,7 +80,7 @@ public function createSession($id, array $session, Response $response) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function updateSession($id, array $session, Response $response) @@ -106,7 +106,7 @@ public function sweep($expiration) /** * Get a query builder instance for the table. * - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function table() { @@ -116,7 +116,7 @@ protected function table() /** * Get the database connection instance. * - * @return Illuminate\Database\Connection + * @return \Illuminate\Database\Connection */ public function getConnection() { @@ -126,7 +126,7 @@ public function getConnection() /** * Get the encrypter instance. * - * @return Illuminate\Encrypter + * @return \Illuminate\Encryption\Encrypter */ public function getEncrypter() { diff --git a/src/Illuminate/Session/FileStore.php b/src/Illuminate/Session/FileStore.php index d67c40572748..e603b36bf3c2 100644 --- a/src/Illuminate/Session/FileStore.php +++ b/src/Illuminate/Session/FileStore.php @@ -8,7 +8,7 @@ class FileStore extends Store implements Sweeper { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -22,7 +22,7 @@ class FileStore extends Store implements Sweeper { /** * Create a new file session store instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @param string $path */ public function __construct(Filesystem $files, $path) @@ -50,7 +50,7 @@ public function retrieveSession($id) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function createSession($id, array $session, Response $response) @@ -63,7 +63,7 @@ public function createSession($id, array $session, Response $response) * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function updateSession($id, array $session, Response $response) diff --git a/src/Illuminate/Session/SessionManager.php b/src/Illuminate/Session/SessionManager.php index 9081ba62d63d..539ac080cde7 100644 --- a/src/Illuminate/Session/SessionManager.php +++ b/src/Illuminate/Session/SessionManager.php @@ -1,115 +1,115 @@ -app['cookie']); - } - - /** - * Create an instance of the file session driver. - * - * @return Illuminate\Session\FileStore - */ - protected function createFileDriver() - { - $path = $this->app['config']['session.path']; - - return new FileStore($this->app['files'], $path); - } - - /** - * Create an instance of the APC session driver. - * - * @return Illuminate\Session\CacheDrivenStore - */ - protected function createApcDriver() - { - return $this->createCacheBased('apc'); - } - - /** - * Create an instance of the Memcached session driver. - * - * @return Illuminate\Session\CacheDrivenStore - */ - protected function createMemcachedDriver() - { - return $this->createCacheBased('memcached'); - } - - /** - * Create an instance of the Redis session driver. - * - * @return Illuminate\Session\CacheDrivenStore - */ - protected function createRedisDriver() - { - return $this->createCacheBased('redis'); - } - - /** - * Create an instance of the "array" session driver. - * - * @return Illuminate\Session\CacheDrivenStore - */ - protected function createArrayDriver() - { - return $this->createCacheBased('array'); - } - - /** - * Create an instance of the database session driver. - * - * @return Illuminate\Session\DatabaseStore - */ - protected function createDatabaseDriver() - { - $connection = $this->getDatabaseConnection(); - - $table = $this->app['config']['session.table']; - - return new DatabaseStore($connection, $this->app['encrypter'], $table); - } - - /** - * Get the database connection for the database driver. - * - * @return Illuminate\Database\Connection - */ - protected function getDatabaseConnection() - { - $connection = $this->app['config']['session.connection']; - - return $this->app['db']->connection($connection); - } - - /** - * Create an instance of a cache driven driver. - * - * @return Illuminate\Session\CacheDrivenStore - */ - protected function createCacheBased($driver) - { - return new CacheDrivenStore($this->app['cache']->driver($driver)); - } - - /** - * Get the default session driver name. - * - * @return string - */ - protected function getDefaultDriver() - { - return $this->app['config']['session.driver']; - } - +app['cookie']); + } + + /** + * Create an instance of the file session driver. + * + * @return \Illuminate\Session\FileStore + */ + protected function createFileDriver() + { + $path = $this->app['config']['session.path']; + + return new FileStore($this->app['files'], $path); + } + + /** + * Create an instance of the APC session driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createApcDriver() + { + return $this->createCacheBased('apc'); + } + + /** + * Create an instance of the Memcached session driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createMemcachedDriver() + { + return $this->createCacheBased('memcached'); + } + + /** + * Create an instance of the Redis session driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createRedisDriver() + { + return $this->createCacheBased('redis'); + } + + /** + * Create an instance of the "array" session driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createArrayDriver() + { + return $this->createCacheBased('array'); + } + + /** + * Create an instance of the database session driver. + * + * @return \Illuminate\Session\DatabaseStore + */ + protected function createDatabaseDriver() + { + $connection = $this->getDatabaseConnection(); + + $table = $this->app['config']['session.table']; + + return new DatabaseStore($connection, $this->app['encrypter'], $table); + } + + /** + * Get the database connection for the database driver. + * + * @return \Illuminate\Database\Connection + */ + protected function getDatabaseConnection() + { + $connection = $this->app['config']['session.connection']; + + return $this->app['db']->connection($connection); + } + + /** + * Create an instance of a cache driven driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createCacheBased($driver) + { + return new CacheDrivenStore($this->app['cache']->driver($driver)); + } + + /** + * Get the default session driver name. + * + * @return string + */ + protected function getDefaultDriver() + { + return $this->app['config']['session.driver']; + } + } \ No newline at end of file diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index bf77ee3568ff..aeec2e49267f 100644 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -62,7 +62,7 @@ abstract public function retrieveSession($id); * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ abstract public function createSession($id, array $session, Response $response); @@ -72,7 +72,7 @@ abstract public function createSession($id, array $session, Response $response); * * @param string $id * @param array $session - * @param Symfony\Component\HttpFoundation\Response $response + * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ abstract public function updateSession($id, array $session, Response $response); @@ -80,7 +80,7 @@ abstract public function updateSession($id, array $session, Response $response); /** * Load the session for the request. * - * @param Illuminate\CookieJar $cookies + * @param \Illuminate\Cookie\CookieJar $cookies * @return void */ public function start(CookieJar $cookies) @@ -358,8 +358,8 @@ public function regenerate() /** * Finish the session handling for the request. * - * @param Symfony\Component\HttpFoundation\Response $response - * @param Illuminate\CookieJar $cookie + * @param \Symfony\Component\HttpFoundation\Response $response + * @param \Illuminate\Cookie\CookieJar $cookie * @param int $lifetime * @return void */ @@ -435,8 +435,8 @@ public function hitsLottery() * Write the session cookie to the response. * * @param string $id - * @param Symfony\Component\HttpFoundation\Response $response - * @param Illuminate\Jar $cookie + * @param \Symfony\Component\HttpFoundation\Response $response + * @param \Illuminate\Cookie\CookieJar $cookie * @param int $lifetime * @return void */ diff --git a/src/Illuminate/Support/Contracts/MessageProviderInterface.php b/src/Illuminate/Support/Contracts/MessageProviderInterface.php index b0a7fdc35aa7..99febecc9739 100644 --- a/src/Illuminate/Support/Contracts/MessageProviderInterface.php +++ b/src/Illuminate/Support/Contracts/MessageProviderInterface.php @@ -1,12 +1,12 @@ -addFilter($name, $callback); - } - - /** - * Tie a registered middleware to a URI pattern. - * - * @param string $pattern - * @param string|array $name - * @return void - */ - public static function when($pattern, $name) - { - return static::$app['router']->matchFilter($pattern, $name); - } - - /** - * Determine if the current route matches a given name. - * - * @param string $name - * @return bool - */ - public static function is($name) - { - return static::$app['router']->currentRouteNamed($name); - } - - /** - * Determine if the current route uses a given controller action. - * - * @param string $action - * @return bool - */ - public static function uses($action) - { - return static::$app['router']->currentRouteUses($action); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() { return 'router'; } - +addFilter($name, $callback); + } + + /** + * Tie a registered middleware to a URI pattern. + * + * @param string $pattern + * @param string|array $name + * @return void + */ + public static function when($pattern, $name) + { + return static::$app['router']->matchFilter($pattern, $name); + } + + /** + * Determine if the current route matches a given name. + * + * @param string $name + * @return bool + */ + public static function is($name) + { + return static::$app['router']->currentRouteNamed($name); + } + + /** + * Determine if the current route uses a given controller action. + * + * @param string $action + * @return bool + */ + public static function uses($action) + { + return static::$app['router']->currentRouteUses($action); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() { return 'router'; } + } \ No newline at end of file diff --git a/src/Illuminate/Support/Facades/Schema.php b/src/Illuminate/Support/Facades/Schema.php index 8d1476dba7c6..a3f101bef9c5 100644 --- a/src/Illuminate/Support/Facades/Schema.php +++ b/src/Illuminate/Support/Facades/Schema.php @@ -1,26 +1,26 @@ -connection($name)->getSchemaBuilder(); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return static::$app['db']->connection()->getSchemaBuilder(); - } - +connection($name)->getSchemaBuilder(); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return static::$app['db']->connection()->getSchemaBuilder(); + } + } \ No newline at end of file diff --git a/src/Illuminate/Support/Fluent.php b/src/Illuminate/Support/Fluent.php index 55990f2281ca..027ebd2e0436 100644 --- a/src/Illuminate/Support/Fluent.php +++ b/src/Illuminate/Support/Fluent.php @@ -57,7 +57,7 @@ public function getAttributes() * * @param string $method * @param array $parameters - * @return Illuminate\Support\Fluent + * @return \Illuminate\Support\Fluent */ public function __call($method, $parameters) { diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index a56e6910fac0..e7f03f940b27 100644 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -7,7 +7,7 @@ abstract class Manager { /** * The application instance. * - * @var Illuminate\Foundation\Application + * @var \Illuminate\Foundation\Application */ protected $app; @@ -28,7 +28,7 @@ abstract class Manager { /** * Create a new manager instance. * - * @param Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * @return void */ public function __construct($app) diff --git a/src/Illuminate/Support/MessageBag.php b/src/Illuminate/Support/MessageBag.php index 064fdddfa645..66559a3b724c 100644 --- a/src/Illuminate/Support/MessageBag.php +++ b/src/Illuminate/Support/MessageBag.php @@ -1,201 +1,201 @@ -:message'; - - /** - * Add a message to the bag. - * - * @param string $key - * @param string $message - * @return void - */ - public function add($key, $message) - { - if ($this->isUnique($key, $message)) - { - $this->messages[$key][] = $message; - } - } - - /** - * Determine if a key and message combination already exists. - * - * @param string $key - * @param string $message - * @return bool - */ - protected function isUnique($key, $message) - { - $messages = (array) $this->messages; - - return ! isset($messages[$key]) or ! in_array($message, $messages[$key]); - } - - /** - * Determine if messages exist for a given key. - * - * @param string $key - * @return bool - */ - public function has($key = null) - { - return $this->first($key) !== ''; - } - - /** - * Get the first message from the bag for a given key. - * - * @param string $key - * @param string $format - * @return string - */ - public function first($key = null, $format = null) - { - $messages = $this->get($key, $format); - - return (count($messages) > 0) ? $messages[0] : ''; - } - - /** - * Get all of the messages from the bag for a given key. - * - * @param string $key - * @param string $format - * @return array - */ - public function get($key, $format = null) - { - $format = $this->checkFormat($format); - - // If the message exists in the container, we will transform it and return - // the message. Otherwise, we'll return an empty array since the entire - // methods is to return back an array of messages in the first place. - if (array_key_exists($key, $this->messages)) - { - return $this->transform($this->messages[$key], $format); - } - - return array(); - } - - /** - * Get all of the messages for every key in the bag. - * - * @param string $format - * @return array - */ - public function all($format = null) - { - $format = $this->checkFormat($format); - - $all = array(); - - foreach ($this->messages as $messages) - { - $all = array_merge($all, $this->transform($messages, $format)); - } - - return $all; - } - - /** - * Format an array of messages. - * - * @param array $messages - * @param string $format - * @return array - */ - protected function transform($messages, $format) - { - $messages = (array) $messages; - - // We will simply spin through the given messages and transform each one - // replacing the :message place holder with the real message allowing - // the messages to be easily formatted to each developer's desires. - foreach ($messages as $key => &$message) - { - $message = str_replace(':message', $message, $format); - } - - return $messages; - } - - /** - * Get the appropriate format based on the given format. - * - * @param string $format - * @return string - */ - protected function checkFormat($format) - { - return ($format === null) ? $this->format : $format; - } - - /** - * Get the raw messages in the container. - * - * @return array - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Get the messages for the instance. - * - * @return ILluminate\Support\MessageBag - */ - public function getMessageBag() - { - return $this; - } - - /** - * Get the default message format. - * - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Set the default message format. - * - * @param string $format - */ - public function setFormat($format = ':message') - { - $this->format = $format; - } - - /** - * Get the number of messages in the container. - * - * @return int - */ - public function count() - { - return count($this->messages); - } - +:message'; + + /** + * Add a message to the bag. + * + * @param string $key + * @param string $message + * @return void + */ + public function add($key, $message) + { + if ($this->isUnique($key, $message)) + { + $this->messages[$key][] = $message; + } + } + + /** + * Determine if a key and message combination already exists. + * + * @param string $key + * @param string $message + * @return bool + */ + protected function isUnique($key, $message) + { + $messages = (array) $this->messages; + + return ! isset($messages[$key]) or ! in_array($message, $messages[$key]); + } + + /** + * Determine if messages exist for a given key. + * + * @param string $key + * @return bool + */ + public function has($key = null) + { + return $this->first($key) !== ''; + } + + /** + * Get the first message from the bag for a given key. + * + * @param string $key + * @param string $format + * @return string + */ + public function first($key = null, $format = null) + { + $messages = $this->get($key, $format); + + return (count($messages) > 0) ? $messages[0] : ''; + } + + /** + * Get all of the messages from the bag for a given key. + * + * @param string $key + * @param string $format + * @return array + */ + public function get($key, $format = null) + { + $format = $this->checkFormat($format); + + // If the message exists in the container, we will transform it and return + // the message. Otherwise, we'll return an empty array since the entire + // methods is to return back an array of messages in the first place. + if (array_key_exists($key, $this->messages)) + { + return $this->transform($this->messages[$key], $format); + } + + return array(); + } + + /** + * Get all of the messages for every key in the bag. + * + * @param string $format + * @return array + */ + public function all($format = null) + { + $format = $this->checkFormat($format); + + $all = array(); + + foreach ($this->messages as $messages) + { + $all = array_merge($all, $this->transform($messages, $format)); + } + + return $all; + } + + /** + * Format an array of messages. + * + * @param array $messages + * @param string $format + * @return array + */ + protected function transform($messages, $format) + { + $messages = (array) $messages; + + // We will simply spin through the given messages and transform each one + // replacing the :message place holder with the real message allowing + // the messages to be easily formatted to each developer's desires. + foreach ($messages as $key => &$message) + { + $message = str_replace(':message', $message, $format); + } + + return $messages; + } + + /** + * Get the appropriate format based on the given format. + * + * @param string $format + * @return string + */ + protected function checkFormat($format) + { + return ($format === null) ? $this->format : $format; + } + + /** + * Get the raw messages in the container. + * + * @return array + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Get the messages for the instance. + * + * @return \Illuminate\Support\MessageBag + */ + public function getMessageBag() + { + return $this; + } + + /** + * Get the default message format. + * + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * Set the default message format. + * + * @param string $format + */ + public function setFormat($format = ':message') + { + $this->format = $format; + } + + /** + * Get the number of messages in the container. + * + * @return int + */ + public function count() + { + return count($this->messages); + } + } \ No newline at end of file diff --git a/src/Illuminate/Support/ServiceProvider.php b/src/Illuminate/Support/ServiceProvider.php index cabed2fba1b1..4375afb4dd40 100644 --- a/src/Illuminate/Support/ServiceProvider.php +++ b/src/Illuminate/Support/ServiceProvider.php @@ -7,7 +7,7 @@ abstract class ServiceProvider { /** * The application instance. * - * @var Illuminate\Foundation\Application + * @var \Illuminate\Foundation\Application */ protected $app; @@ -21,7 +21,7 @@ abstract class ServiceProvider { /** * Create a new service provider instance. * - * @param Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * @return void */ public function __construct($app) diff --git a/src/Illuminate/Translation/FileLoader.php b/src/Illuminate/Translation/FileLoader.php index 7691cbfdcf63..bf8880578782 100644 --- a/src/Illuminate/Translation/FileLoader.php +++ b/src/Illuminate/Translation/FileLoader.php @@ -7,7 +7,7 @@ class FileLoader implements LoaderInterface { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -28,7 +28,7 @@ class FileLoader implements LoaderInterface { /** * Create a new file loader instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @return void */ public function __construct(Filesystem $files, $path) diff --git a/src/Illuminate/Translation/Translator.php b/src/Illuminate/Translation/Translator.php index ca66e68f8445..fce7862b278c 100644 --- a/src/Illuminate/Translation/Translator.php +++ b/src/Illuminate/Translation/Translator.php @@ -9,14 +9,14 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface { /** * The loader implementation. * - * @var Illuminate\Translation\LoaderInterface + * @var \Illuminate\Translation\LoaderInterface */ protected $loader; /** * The Symfony translator instance. * - * @var Symfony\Translation\Translator + * @var \Symfony\Translation\Translator */ protected $trans; @@ -48,7 +48,7 @@ public function __construct(LoaderInterface $loader, $default, $fallback) * * @param string $default * @param string $fallback - * @return Symfony\Component\Translation\Translator + * @return \Symfony\Component\Translation\Translator */ protected function createSymfonyTranslator($default, $fallback) { @@ -258,7 +258,7 @@ public function setLocale($locale) /** * Get the base Symfony translator instance. * - * @return Symfony\Translation\Translator + * @return \Symfony\Translation\Translator */ public function getSymfonyTranslator() { @@ -268,7 +268,7 @@ public function getSymfonyTranslator() /** * Get the base Symfony translator instance. * - * @param Symfony\Translation\Translator $trans + * @param \Symfony\Translation\Translator $trans * @return void */ public function setSymfonyTranslator(SymfonyTranslator $trans) diff --git a/src/Illuminate/Validation/DatabasePresenceVerifier.php b/src/Illuminate/Validation/DatabasePresenceVerifier.php index a030bc0be3dd..f166c2f3a8ff 100644 --- a/src/Illuminate/Validation/DatabasePresenceVerifier.php +++ b/src/Illuminate/Validation/DatabasePresenceVerifier.php @@ -7,7 +7,7 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface { /** * The database connection instance. * - * @var Illuminate\Database\ConnectionResolverInterface + * @var \Illuminate\Database\ConnectionResolverInterface */ protected $db; @@ -21,7 +21,7 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface { /** * Create a new database presence verifier. * - * @param Illuminate\Database\ConnectionResolverInterface $db + * @param \Illuminate\Database\ConnectionResolverInterface $db * @return void */ public function __construct(ConnectionResolverInterface $db) @@ -68,7 +68,7 @@ public function getMultiCount($collection, $column, array $values) * Get a query builder for the given table. * * @param string $table - * @return Illuminate\Database\Query\Builder + * @return \Illuminate\Database\Query\Builder */ protected function table($table) { diff --git a/src/Illuminate/Validation/Factory.php b/src/Illuminate/Validation/Factory.php index 57af0194ff1c..ba46e371a5ae 100644 --- a/src/Illuminate/Validation/Factory.php +++ b/src/Illuminate/Validation/Factory.php @@ -8,14 +8,14 @@ class Factory { /** * The Translator implementation. * - * @var Symfony\Component\Translator\TranslatorInterface + * @var \Symfony\Component\Translator\TranslatorInterface */ protected $translator; /** * The Presence Verifier implementation. * - * @var Illuminate\Validation\PresenceVerifierInterface + * @var \Illuminate\Validation\PresenceVerifierInterface */ protected $presenceVerifier; @@ -36,7 +36,7 @@ class Factory { /** * Create a new Validator factory instance. * - * @param Symfony\Component\Translation\TranslatorInterface $translator + * @param \Symfony\Component\Translation\TranslatorInterface $translator * @return void */ public function __construct(TranslatorInterface $translator) @@ -50,7 +50,7 @@ public function __construct(TranslatorInterface $translator) * @param array $data * @param array $rules * @param array $messages - * @return Illuminate\Validation\Validator + * @return \Illuminate\Validation\Validator */ public function make(array $data, array $rules, array $messages = array()) { @@ -72,7 +72,7 @@ public function make(array $data, array $rules, array $messages = array()) * @param array $data * @param array $rules * @param array $messages - * @return Illuminate\Validation\Validator + * @return \Illuminate\Validation\Validator */ protected function resolve($data, $rules, $messages) { @@ -112,7 +112,7 @@ public function resolver(Closure $resolver) /** * Get the Translator implementation. * - * @return Symfony\Component\Translation\TranslatorInterface + * @return \Symfony\Component\Translation\TranslatorInterface */ public function getTranslator() { @@ -122,7 +122,7 @@ public function getTranslator() /** * Get the Presence Verifier implementation. * - * @return Illuminate\Validation\PresenceVerifierInterface + * @return \Illuminate\Validation\PresenceVerifierInterface */ public function getPresenceVerifier() { @@ -132,7 +132,7 @@ public function getPresenceVerifier() /** * Set the Presence Verifier implementation. * - * @param Illuminate\Validation\PresenceVerifierInterface $presenceVerifier + * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier * @return void */ public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index eb0bb2bd7af4..74c9a7dc5b9c 100644 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -11,21 +11,21 @@ class Validator implements MessageProviderInterface { /** * The Translator implementation. * - * @var Symfony\Component\Translation\TranslatorInterface + * @var \Symfony\Component\Translation\TranslatorInterface */ protected $translator; /** * The Presence Verifier implementation. * - * @var Illuminate\Validation\PresenceVerifierInterface + * @var \Illuminate\Validation\PresenceVerifierInterface */ protected $presenceVerifier; /** * The message bag instance. * - * @var Illuminate\Support\MessageBag + * @var \Illuminate\Support\MessageBag */ protected $messages; @@ -1311,7 +1311,7 @@ public function getFiles() * Set the files under validation. * * @param array $files - * @return Illuminate\Validation\Validator + * @return \Illuminate\Validation\Validator */ public function setFiles(array $files) { @@ -1323,7 +1323,7 @@ public function setFiles(array $files) /** * Get the Presence Verifier implementation. * - * @return Illuminate\Validation\PresenceVerifierInterface + * @return \Illuminate\Validation\PresenceVerifierInterface */ public function getPresenceVerifier() { @@ -1338,7 +1338,7 @@ public function getPresenceVerifier() /** * Set the Presence Verifier implementation. * - * @param Illuminate\Validation\PresenceVerifierInterface $presenceVerifier + * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier * @return void */ public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) @@ -1349,7 +1349,7 @@ public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) /** * Get the Translator implementation. * - * @return Symfony\Component\Translation\TranslatorInterface + * @return \Symfony\Component\Translation\TranslatorInterface */ public function getTranslator() { @@ -1359,7 +1359,7 @@ public function getTranslator() /** * Set the Translator implementation. * - * @param Symfony\Component\Translation\TranslatorInterface $translator + * @param \Symfony\Component\Translation\TranslatorInterface $translator * @return void */ public function setTranslator(TranslatorInterface $translator) @@ -1370,7 +1370,7 @@ public function setTranslator(TranslatorInterface $translator) /** * Get the message container for the validator. * - * @return Illuminate\Support\MessageBag + * @return \Illuminate\Support\MessageBag */ public function messages() { @@ -1380,7 +1380,7 @@ public function messages() /** * An alternative more semantic shortcut to the message container. * - * @return Illuminate\Support\MessageBag + * @return \Illuminate\Support\MessageBag */ public function errors() { @@ -1390,7 +1390,7 @@ public function errors() /** * Get the messages for the instance. * - * @return ILluminate\Support\MessageBag + * @return \Illuminate\Support\MessageBag */ public function getMessageBag() { diff --git a/src/Illuminate/View/Compilers/Compiler.php b/src/Illuminate/View/Compilers/Compiler.php index f9e2f31d8b75..50ed7824afbb 100644 --- a/src/Illuminate/View/Compilers/Compiler.php +++ b/src/Illuminate/View/Compilers/Compiler.php @@ -7,7 +7,7 @@ abstract class Compiler { /** * The Filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; diff --git a/src/Illuminate/View/Engines/CompilerEngine.php b/src/Illuminate/View/Engines/CompilerEngine.php index ada6418f340e..952d6f137b50 100644 --- a/src/Illuminate/View/Engines/CompilerEngine.php +++ b/src/Illuminate/View/Engines/CompilerEngine.php @@ -7,14 +7,14 @@ class CompilerEngine extends PhpEngine { /** * The Blade compiler instance. * - * @var Illuminate\View\Compilers\CompilerInterface + * @var \Illuminate\View\Compilers\CompilerInterface */ protected $compiler; /** * Create a new Blade view engine instance. * - * @param Illuminate\View\Compilers\CompilerInterface $compiler + * @param \Illuminate\View\Compilers\CompilerInterface $compiler * @return void */ public function __construct(CompilerInterface $compiler) @@ -25,7 +25,7 @@ public function __construct(CompilerInterface $compiler) /** * Get the evaluated contents of the view. * - * @param Illuminate\View\Environment $environment + * @param \Illuminate\View\Environment $environment * @param string $view * @param array $data * @return string @@ -48,7 +48,7 @@ public function get($path, array $data = array()) /** * Get the compiler implementation. * - * @return Illuminate\View\Compilers\CompilerInterface + * @return \Illuminate\View\Compilers\CompilerInterface */ public function getCompiler() { diff --git a/src/Illuminate/View/Engines/EngineResolver.php b/src/Illuminate/View/Engines/EngineResolver.php index 026c12f8fb94..3ac4bbfb9b37 100644 --- a/src/Illuminate/View/Engines/EngineResolver.php +++ b/src/Illuminate/View/Engines/EngineResolver.php @@ -34,7 +34,7 @@ public function register($engine, Closure $resolver) * Resolver an engine instance by name. * * @param string $engine - * @return Illuminate\View\Engines\EngineInterface + * @return \Illuminate\View\Engines\EngineInterface */ public function resolve($engine) { diff --git a/src/Illuminate/View/Environment.php b/src/Illuminate/View/Environment.php index cb9cb59976e8..6fdc47faf221 100644 --- a/src/Illuminate/View/Environment.php +++ b/src/Illuminate/View/Environment.php @@ -10,28 +10,28 @@ class Environment { /** * The engine implementation. * - * @var Illuminate\View\Engines\EngineResolver + * @var \Illuminate\View\Engines\EngineResolver */ protected $engines; /** * The view finder implementation. * - * @var Illuminate\View\ViewFinderInterface + * @var \Illuminate\View\ViewFinderInterface */ protected $finder; /** * The event dispatcher instance. * - * @var Illuminate\Events\Dispatcher + * @var \Illuminate\Events\Dispatcher */ protected $events; /** * The IoC container instance. * - * @var Illuminate\Container + * @var \Illuminate\Container\Container */ protected $container; @@ -80,9 +80,9 @@ class Environment { /** * Create a new view environment instance. * - * @param Illuminate\View\Engines\EngineResolver $engines - * @param Illuminate\View\ViewFinderInterface $finder - * @param Illuminate\Events\Dispatcher $events + * @param \Illuminate\View\Engines\EngineResolver $engines + * @param \Illuminate\View\ViewFinderInterface $finder + * @param \Illuminate\Events\Dispatcher $events * @return void */ public function __construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events) @@ -99,7 +99,7 @@ public function __construct(EngineResolver $engines, ViewFinderInterface $finder * * @param string $view * @param array $data - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function make($view, array $data = array()) { @@ -156,7 +156,7 @@ public function renderEach($view, $data, $iterator, $empty = 'raw|') * Get the appropriate view engine for the given path. * * @param string $path - * @return Illuminate\View\Engines\EngineInterface + * @return \Illuminate\View\Engines\EngineInterface */ protected function getEngineFromPath($path) { @@ -246,7 +246,7 @@ protected function addClassComposer($view, $class) /** * Call the composer for a given view. * - * @param Illuminate\View\View $view + * @param \Illuminate\View\View $view * @return void */ public function callComposer(View $view) @@ -429,7 +429,7 @@ public function addExtension($extension, $engine, $resolver = null) /** * Get the engine resolver instance. * - * @return Illuminate\View\Engines\EngineResolver + * @return \Illuminate\View\Engines\EngineResolver */ public function getEngineResolver() { @@ -439,7 +439,7 @@ public function getEngineResolver() /** * Get the view finder instance. * - * @return Illuminate\View\ViewFinder + * @return \Illuminate\View\ViewFinderInterface */ public function getFinder() { @@ -449,7 +449,7 @@ public function getFinder() /** * Get the event dispatcher instance. * - * @return Illuminate\Events\Dispatcher + * @return \Illuminate\Events\Dispatcher */ public function getDispatcher() { @@ -459,7 +459,7 @@ public function getDispatcher() /** * Get the IoC container instance. * - * @return Illuminate\Container + * @return \Illuminate\Container\Container */ public function getContainer() { @@ -469,7 +469,7 @@ public function getContainer() /** * Set the IoC container instance. * - * @param Illuminate\Container $container + * @param \Illuminate\Container\Container $container * @return void */ public function setContainer(Container $container) diff --git a/src/Illuminate/View/FileViewFinder.php b/src/Illuminate/View/FileViewFinder.php index d9581af12186..e93f51d15c78 100644 --- a/src/Illuminate/View/FileViewFinder.php +++ b/src/Illuminate/View/FileViewFinder.php @@ -7,7 +7,7 @@ class FileViewFinder implements ViewFinderInterface { /** * The filesystem instance. * - * @var Illuminate\Filesystem + * @var \Illuminate\Filesystem\Filesystem */ protected $files; @@ -35,7 +35,7 @@ class FileViewFinder implements ViewFinderInterface { /** * Create a new file view loader instance. * - * @param Illuminate\Filesystem $files + * @param \Illuminate\Filesystem\Filesystem $files * @param array $paths * @param array $extensions * @return void @@ -182,7 +182,7 @@ public function addExtension($extension) /** * Get the filesystem instance. * - * @return Illuminate\Filesystem + * @return \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { diff --git a/src/Illuminate/View/View.php b/src/Illuminate/View/View.php index 878c98014783..f5696402a9e6 100644 --- a/src/Illuminate/View/View.php +++ b/src/Illuminate/View/View.php @@ -9,14 +9,14 @@ class View implements ArrayAccess, Renderable { /** * The view environment instance. * - * @var Illuminate\View\Environment + * @var \Illuminate\View\Environment */ protected $environment; /** * The engine implementation. * - * @var Illuminate\View\Engines\EngineInterface + * @var \Illuminate\View\Engines\EngineInterface */ protected $engine; @@ -44,8 +44,8 @@ class View implements ArrayAccess, Renderable { /** * Create a new view instance. * - * @param Illuminate\View\Environment $environment - * @param Illuminate\View\Engines\EngineInterface $engine + * @param \Illuminate\View\Environment $environment + * @param \Illuminate\View\Engines\EngineInterface $engine * @param string $view * @param string $path * @param array $data @@ -123,7 +123,7 @@ protected function gatherData() * * @param string|array $key * @param mixed $value - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function with($key, $value = null) { @@ -145,7 +145,7 @@ public function with($key, $value = null) * @param string $key * @param string $view * @param array $data - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function nest($key, $view, array $data = array()) { @@ -155,7 +155,7 @@ public function nest($key, $view, array $data = array()) /** * Get the view environment instance. * - * @return Illuminate\View\Environment + * @return \Illuminate\View\Environment */ public function getEnvironment() { @@ -165,7 +165,7 @@ public function getEnvironment() /** * Get the view's rendering engine. * - * @return Illuminate\View\Engines\EngineInterface + * @return \Illuminate\View\Engines\EngineInterface */ public function getEngine() { diff --git a/src/Illuminate/View/ViewServiceProvider.php b/src/Illuminate/View/ViewServiceProvider.php index cf58d1f5f699..b7f0af3d6ad4 100644 --- a/src/Illuminate/View/ViewServiceProvider.php +++ b/src/Illuminate/View/ViewServiceProvider.php @@ -1,169 +1,169 @@ -registerEngineResolver(); - - $this->registerViewFinder(); - - $this->registerEnvironment(); - } - - /** - * Register the engine resolver instance. - * - * @return void - */ - public function registerEngineResolver() - { - list($me, $app) = array($this, $this->app); - - $app['view.engine.resolver'] = $app->share(function($app) use ($me) - { - $resolver = new EngineResolver; - - // Next we will register the various engines with the resolver so that the - // environment can resolve the engines it needs for various views based - // on the extension of view files. We call a method for each engines. - foreach (array('php', 'blade') as $engine) - { - $me->{'register'.ucfirst($engine).'Engine'}($resolver); - } - - return $resolver; - }); - } - - /** - * Register the PHP engine implementation. - * - * @param Illuminate\View\Engines\EngineResolver $resolver - * @return void - */ - public function registerPhpEngine($resolver) - { - $resolver->register('php', function() { return new PhpEngine; }); - } - - /** - * Register the Blade engine implementation. - * - * @param Illuminate\View\Engines\EngineResolver $resolver - * @return void - */ - public function registerBladeEngine($resolver) - { - $app = $this->app; - - $resolver->register('blade', function() use ($app) - { - $cache = $app['path'].'/storage/views'; - - // The Compiler engine requires an instance of the CompilerInterface, which in - // this case will be the Blade compiler, so we'll first create the compiler - // instance to pass into the engine so it can compile the views properly. - $compiler = new BladeCompiler($app['files'], $cache); - - return new CompilerEngine($compiler, $app['files']); - }); - } - - /** - * Register the view finder implementation. - * - * @return void - */ - public function registerViewFinder() - { - $this->app['view.finder'] = $this->app->share(function($app) - { - $paths = $app['config']['view.paths']; - - return new FileViewFinder($app['files'], $paths); - }); - } - - /** - * Register the view environment. - * - * @return void - */ - public function registerEnvironment() - { - $me = $this; - - $this->app['view'] = $this->app->share(function($app) use ($me) - { - // Next we need to grab the engine resolver instance that will be used by the - // environment. The resolver will be used by an environment to get each of - // the various engine implementations such as plain PHP or Blade engine. - $resolver = $app['view.engine.resolver']; - - $finder = $app['view.finder']; - - $events = $app['events']; - - $environment = new Environment($resolver, $finder, $events); - - // If the current session has an "errors" variable bound to it, we will share - // its value with all view instances so the views can easily access errors - // without having to bind. An empty bag is set when there aren't errors. - if ($me->sessionHasErrors($app)) - { - $errors = $app['session']->get('errors'); - - $environment->share('errors', $errors); - } - - // Putting the errors in the view for every view allows the developer to just - // assume that some errors are always available, which is convenient since - // they don't have to continually run checks for the presence of errors. - else - { - $environment->share('errors', new MessageBag); - } - - // We will also set the container instance on this view environment since the - // view composers may be classes registered in the container, which allows - // for great testable, flexible composers for the application developer. - $environment->setContainer($app); - - $environment->share('app', $app); - - return $environment; - }); - } - - /** - * Determine if the application session has errors. - * - * @param Illuminate\Foundation\Application $app - * @return bool - */ - public function sessionHasErrors($app) - { - $config = $app['config']['session']; - - if (isset($app['session']) and ! is_null($config['driver'])) - { - return $app['session']->has('errors'); - } - - } - +registerEngineResolver(); + + $this->registerViewFinder(); + + $this->registerEnvironment(); + } + + /** + * Register the engine resolver instance. + * + * @return void + */ + public function registerEngineResolver() + { + list($me, $app) = array($this, $this->app); + + $app['view.engine.resolver'] = $app->share(function($app) use ($me) + { + $resolver = new EngineResolver; + + // Next we will register the various engines with the resolver so that the + // environment can resolve the engines it needs for various views based + // on the extension of view files. We call a method for each engines. + foreach (array('php', 'blade') as $engine) + { + $me->{'register'.ucfirst($engine).'Engine'}($resolver); + } + + return $resolver; + }); + } + + /** + * Register the PHP engine implementation. + * + * @param \Illuminate\View\Engines\EngineResolver $resolver + * @return void + */ + public function registerPhpEngine($resolver) + { + $resolver->register('php', function() { return new PhpEngine; }); + } + + /** + * Register the Blade engine implementation. + * + * @param \Illuminate\View\Engines\EngineResolver $resolver + * @return void + */ + public function registerBladeEngine($resolver) + { + $app = $this->app; + + $resolver->register('blade', function() use ($app) + { + $cache = $app['path'].'/storage/views'; + + // The Compiler engine requires an instance of the CompilerInterface, which in + // this case will be the Blade compiler, so we'll first create the compiler + // instance to pass into the engine so it can compile the views properly. + $compiler = new BladeCompiler($app['files'], $cache); + + return new CompilerEngine($compiler, $app['files']); + }); + } + + /** + * Register the view finder implementation. + * + * @return void + */ + public function registerViewFinder() + { + $this->app['view.finder'] = $this->app->share(function($app) + { + $paths = $app['config']['view.paths']; + + return new FileViewFinder($app['files'], $paths); + }); + } + + /** + * Register the view environment. + * + * @return void + */ + public function registerEnvironment() + { + $me = $this; + + $this->app['view'] = $this->app->share(function($app) use ($me) + { + // Next we need to grab the engine resolver instance that will be used by the + // environment. The resolver will be used by an environment to get each of + // the various engine implementations such as plain PHP or Blade engine. + $resolver = $app['view.engine.resolver']; + + $finder = $app['view.finder']; + + $events = $app['events']; + + $environment = new Environment($resolver, $finder, $events); + + // If the current session has an "errors" variable bound to it, we will share + // its value with all view instances so the views can easily access errors + // without having to bind. An empty bag is set when there aren't errors. + if ($me->sessionHasErrors($app)) + { + $errors = $app['session']->get('errors'); + + $environment->share('errors', $errors); + } + + // Putting the errors in the view for every view allows the developer to just + // assume that some errors are always available, which is convenient since + // they don't have to continually run checks for the presence of errors. + else + { + $environment->share('errors', new MessageBag); + } + + // We will also set the container instance on this view environment since the + // view composers may be classes registered in the container, which allows + // for great testable, flexible composers for the application developer. + $environment->setContainer($app); + + $environment->share('app', $app); + + return $environment; + }); + } + + /** + * Determine if the application session has errors. + * + * @param \Illuminate\Foundation\Application $app + * @return bool + */ + public function sessionHasErrors($app) + { + $config = $app['config']['session']; + + if (isset($app['session']) and ! is_null($config['driver'])) + { + return $app['session']->has('errors'); + } + + } + } \ No newline at end of file diff --git a/src/Illuminate/Workbench/Console/WorkbenchMakeCommand.php b/src/Illuminate/Workbench/Console/WorkbenchMakeCommand.php index 6dd3bdcfb00d..39a62056f172 100644 --- a/src/Illuminate/Workbench/Console/WorkbenchMakeCommand.php +++ b/src/Illuminate/Workbench/Console/WorkbenchMakeCommand.php @@ -1,123 +1,123 @@ -creator = $creator; - } - - /** - * Execute the console command. - * - * @return void - */ - public function fire() - { - $package = $this->buildPackage(); - - $this->info('Creating workbench...'); - - $path = $this->laravel['path.base'].'/workbench'; - - // A "plain" package simply does not contain the "views", "config" or any other - // Laravel intended directories. Plain packages don't contain those types of - // directories as they are primarily just plain libraries for consumption. - $plain = $this->input->getOption('plain'); - - $workbench = $this->creator->create($package, $path, $plain); - - $this->info('Package workbench created!'); - - // If the "composer" option has been specified, we will call composer update for - // the workbench so the dependencies will be installed and the classmaps get - // generated for the package. This will allow the devs to start migrating. - if ($this->input->getOption('composer')) - { - $this->comment('Installing dependencies for workbench...'); - - $this->callComposerUpdate($workbench); - } - } - - /** - * Call the composer update routine on the path. - * - * @param string $path - * @return void - */ - protected function callComposerUpdate($path) - { - chdir($path); - - passthru('composer install --dev'); - } - - /** - * Build the package details from user input. - * - * @return Illuminate\Workbench\Package - */ - protected function buildPackage() - { - $vendor = camel_case($this->ask('What is vendor name of the package?')); - - $name = camel_case($this->ask('What is the package name?')); - - $author = $this->ask('What is your name?'); - - $email = $this->ask('What is your e-mail address?'); - - return new Package($vendor, $name, $author, $email); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return array( - array('composer', null, InputOption::VALUE_NONE, 'Call "composer update" after workbench creation.'), - - array('plain', null, InputOption::VALUE_NONE, 'Skip creation of Laravel specific directories.'), - ); - } - -} +creator = $creator; + } + + /** + * Execute the console command. + * + * @return void + */ + public function fire() + { + $package = $this->buildPackage(); + + $this->info('Creating workbench...'); + + $path = $this->laravel['path.base'].'/workbench'; + + // A "plain" package simply does not contain the "views", "config" or any other + // Laravel intended directories. Plain packages don't contain those types of + // directories as they are primarily just plain libraries for consumption. + $plain = $this->input->getOption('plain'); + + $workbench = $this->creator->create($package, $path, $plain); + + $this->info('Package workbench created!'); + + // If the "composer" option has been specified, we will call composer update for + // the workbench so the dependencies will be installed and the classmaps get + // generated for the package. This will allow the devs to start migrating. + if ($this->input->getOption('composer')) + { + $this->comment('Installing dependencies for workbench...'); + + $this->callComposerUpdate($workbench); + } + } + + /** + * Call the composer update routine on the path. + * + * @param string $path + * @return void + */ + protected function callComposerUpdate($path) + { + chdir($path); + + passthru('composer install --dev'); + } + + /** + * Build the package details from user input. + * + * @return \Illuminate\Workbench\Package + */ + protected function buildPackage() + { + $vendor = camel_case($this->ask('What is vendor name of the package?')); + + $name = camel_case($this->ask('What is the package name?')); + + $author = $this->ask('What is your name?'); + + $email = $this->ask('What is your e-mail address?'); + + return new Package($vendor, $name, $author, $email); + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return array( + array('composer', null, InputOption::VALUE_NONE, 'Call "composer update" after workbench creation.'), + + array('plain', null, InputOption::VALUE_NONE, 'Skip creation of Laravel specific directories.'), + ); + } + +} diff --git a/src/Illuminate/Workbench/PackageCreator.php b/src/Illuminate/Workbench/PackageCreator.php index 83ec9fbeed35..2e0cfd33c706 100644 --- a/src/Illuminate/Workbench/PackageCreator.php +++ b/src/Illuminate/Workbench/PackageCreator.php @@ -1,305 +1,305 @@ -files = $files; - } - - /** - * Create a new package stub. - * - * @param Illuminate\Workbench\Package $package - * @param string $path - * @param bool $plain - * @return string - */ - public function create(Package $package, $path, $plain = false) - { - $directory = $this->createDirectory($package, $path); - - $blocks = $plain ? $this->basicBlocks : $this->blocks; - - foreach ($blocks as $block) - { - $this->{"write{$block}"}($package, $directory, $plain); - } - - return $directory; - } - - /** - * Write the support files to the package root. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - public function writeSupportFiles(Package $package, $directory, $plain) - { - foreach (array('PhpUnit', 'Travis', 'Composer') as $file) - { - $this->{"write{$file}File"}($package, $directory, $plain); - } - } - - /** - * Write the PHPUnit stub file. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - protected function writePhpUnitFile(Package $package, $directory) - { - $this->files->copy(__DIR__.'/stubs/phpunit.xml', $directory.'/phpunit.xml'); - } - - /** - * Write the Travis stub file. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - protected function writeTravisFile(Package $package, $directory) - { - $this->files->copy(__DIR__.'/stubs/.travis.yml', $directory.'/.travis.yml'); - } - - /** - * Write the Composer.json stub file. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - protected function writeComposerFile(Package $package, $directory, $plain) - { - $stub = $this->getComposerStub($plain); - - $stub = $this->formatPackageStub($stub, $package); - - $this->files->put($directory.'/composer.json', $stub); - } - - /** - * Get the Composer.json stub file contents. - * - * @param bool $plain - * @return string - */ - protected function getComposerStub($plain) - { - if ($plain) - { - return $this->files->get(__DIR__.'/stubs/plain.composer.json'); - } - else - { - return $this->files->get(__DIR__.'/stubs/composer.json'); - } - } - - /** - * Create the support directories for a package. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - public function writeSupportDirectories(Package $package, $directory) - { - foreach (array('config', 'lang', 'migrations', 'views') as $support) - { - // Once we create the source directory, we will write an empty file to the - // directory so that it will be kept in source control allowing the dev - // to go ahead and push these components to Github right on creation. - $path = $directory.'/src/'.$support; - - $this->files->makeDirectory($path, 0777, true); - - $this->files->put($path.'/.gitkeep', ''); - } - } - - /** - * Create the public directory for the pacakge. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - public function writePublicDirectory(Package $package, $directory, $plain) - { - if ($plain) return; - - $this->files->makeDirectory($directory.'/public'); - - $this->files->put($directory.'/public/.gitkeep', ''); - } - - /** - * Create the test directory for the pacakge. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - public function writeTestDirectory(Package $package, $directory) - { - $this->files->makeDirectory($directory.'/tests'); - - $this->files->put($directory.'/tests/.gitkeep', ''); - } - - /** - * Write the stub ServiceProvider for the package. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return void - */ - public function writeServiceProvider(Package $package, $directory, $plain) - { - // Once we have the service provider stub, we will need to format it and make - // the necessary replacements to the class, namespaces, etc. Then we'll be - // able to write it out into the package's workbench directory for them. - $stub = $this->getProviderStub($plain); - - $stub = $this->formatPackageStub($stub, $package); - - $path = $this->createClassDirectory($package, $directory); - - // The primary source directory where the package's classes will live may not - // exist yet, so we will need to create it before we write these providers - // out to that location. We'll go ahead and create now here before then. - $file = $path.'/'.$package->name.'ServiceProvider.php'; - - $this->files->put($file, $stub); - } - - /** - * Get the stub for a ServiceProvider. - * - * @param bool $plain - * @return string - */ - protected function getProviderStub($plain) - { - if ($plain) - { - return $this->files->get(__DIR__.'/stubs/plain.provider.php'); - } - else - { - return $this->files->get(__DIR__.'/stubs/provider.php'); - } - } - - /** - * Create the main source directory for the package. - * - * @param Illuminate\Workbench\Package $package - * @param string $directory - * @return string - */ - protected function createClassDirectory(Package $package, $directory) - { - $path = $directory.'/src/'.$package->vendor.'/'.$package->name; - - if ( ! $this->files->isDirectory($path)) - { - $this->files->makeDirectory($path, 0777, true); - } - - return $path; - } - - /** - * Format a generic package stub file. - * - * @param string $stub - * @param Illuminate\Workbench\Package $package - * @return string - */ - protected function formatPackageStub($stub, Package $package) - { - // When replacing values in the stub, we can just take the object vars of - // the package and snake case them. This should give us the array with - // all the necessary replacements variables present and ready to go. - foreach (get_object_vars($package) as $key => $value) - { - $key = '{{'.snake_case($key).'}}'; - - $stub = str_replace($key, $value, $stub); - } - - return $stub; - } - - /** - * Create a workbench directory for the package. - * - * @param Illuminate\Workbench\Package $package - * @param string $path - * @return string - */ - protected function createDirectory(Package $package, $path) - { - $fullPath = $path.'/'.$package->getFullName(); - - // If the directory doesn't exist, we will go ahead and create the package - // directory in the workbench location. We will use this entire package - // name when creating the directory to avoid any potential conflicts. - if ( ! $this->files->isDirectory($fullPath)) - { - $this->files->makeDirectory($fullPath, 0777, true); - - return $fullPath; - } - - throw new \InvalidArgumentException("Package exists."); - } - +files = $files; + } + + /** + * Create a new package stub. + * + * @param \Illuminate\Workbench\Package $package + * @param string $path + * @param bool $plain + * @return string + */ + public function create(Package $package, $path, $plain = false) + { + $directory = $this->createDirectory($package, $path); + + $blocks = $plain ? $this->basicBlocks : $this->blocks; + + foreach ($blocks as $block) + { + $this->{"write{$block}"}($package, $directory, $plain); + } + + return $directory; + } + + /** + * Write the support files to the package root. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + public function writeSupportFiles(Package $package, $directory, $plain) + { + foreach (array('PhpUnit', 'Travis', 'Composer') as $file) + { + $this->{"write{$file}File"}($package, $directory, $plain); + } + } + + /** + * Write the PHPUnit stub file. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + protected function writePhpUnitFile(Package $package, $directory) + { + $this->files->copy(__DIR__.'/stubs/phpunit.xml', $directory.'/phpunit.xml'); + } + + /** + * Write the Travis stub file. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + protected function writeTravisFile(Package $package, $directory) + { + $this->files->copy(__DIR__.'/stubs/.travis.yml', $directory.'/.travis.yml'); + } + + /** + * Write the Composer.json stub file. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + protected function writeComposerFile(Package $package, $directory, $plain) + { + $stub = $this->getComposerStub($plain); + + $stub = $this->formatPackageStub($stub, $package); + + $this->files->put($directory.'/composer.json', $stub); + } + + /** + * Get the Composer.json stub file contents. + * + * @param bool $plain + * @return string + */ + protected function getComposerStub($plain) + { + if ($plain) + { + return $this->files->get(__DIR__.'/stubs/plain.composer.json'); + } + else + { + return $this->files->get(__DIR__.'/stubs/composer.json'); + } + } + + /** + * Create the support directories for a package. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + public function writeSupportDirectories(Package $package, $directory) + { + foreach (array('config', 'lang', 'migrations', 'views') as $support) + { + // Once we create the source directory, we will write an empty file to the + // directory so that it will be kept in source control allowing the dev + // to go ahead and push these components to Github right on creation. + $path = $directory.'/src/'.$support; + + $this->files->makeDirectory($path, 0777, true); + + $this->files->put($path.'/.gitkeep', ''); + } + } + + /** + * Create the public directory for the pacakge. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + public function writePublicDirectory(Package $package, $directory, $plain) + { + if ($plain) return; + + $this->files->makeDirectory($directory.'/public'); + + $this->files->put($directory.'/public/.gitkeep', ''); + } + + /** + * Create the test directory for the pacakge. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + public function writeTestDirectory(Package $package, $directory) + { + $this->files->makeDirectory($directory.'/tests'); + + $this->files->put($directory.'/tests/.gitkeep', ''); + } + + /** + * Write the stub ServiceProvider for the package. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return void + */ + public function writeServiceProvider(Package $package, $directory, $plain) + { + // Once we have the service provider stub, we will need to format it and make + // the necessary replacements to the class, namespaces, etc. Then we'll be + // able to write it out into the package's workbench directory for them. + $stub = $this->getProviderStub($plain); + + $stub = $this->formatPackageStub($stub, $package); + + $path = $this->createClassDirectory($package, $directory); + + // The primary source directory where the package's classes will live may not + // exist yet, so we will need to create it before we write these providers + // out to that location. We'll go ahead and create now here before then. + $file = $path.'/'.$package->name.'ServiceProvider.php'; + + $this->files->put($file, $stub); + } + + /** + * Get the stub for a ServiceProvider. + * + * @param bool $plain + * @return string + */ + protected function getProviderStub($plain) + { + if ($plain) + { + return $this->files->get(__DIR__.'/stubs/plain.provider.php'); + } + else + { + return $this->files->get(__DIR__.'/stubs/provider.php'); + } + } + + /** + * Create the main source directory for the package. + * + * @param \Illuminate\Workbench\Package $package + * @param string $directory + * @return string + */ + protected function createClassDirectory(Package $package, $directory) + { + $path = $directory.'/src/'.$package->vendor.'/'.$package->name; + + if ( ! $this->files->isDirectory($path)) + { + $this->files->makeDirectory($path, 0777, true); + } + + return $path; + } + + /** + * Format a generic package stub file. + * + * @param string $stub + * @param \Illuminate\Workbench\Package $package + * @return string + */ + protected function formatPackageStub($stub, Package $package) + { + // When replacing values in the stub, we can just take the object vars of + // the package and snake case them. This should give us the array with + // all the necessary replacements variables present and ready to go. + foreach (get_object_vars($package) as $key => $value) + { + $key = '{{'.snake_case($key).'}}'; + + $stub = str_replace($key, $value, $stub); + } + + return $stub; + } + + /** + * Create a workbench directory for the package. + * + * @param \Illuminate\Workbench\Package $package + * @param string $path + * @return string + */ + protected function createDirectory(Package $package, $path) + { + $fullPath = $path.'/'.$package->getFullName(); + + // If the directory doesn't exist, we will go ahead and create the package + // directory in the workbench location. We will use this entire package + // name when creating the directory to avoid any potential conflicts. + if ( ! $this->files->isDirectory($fullPath)) + { + $this->files->makeDirectory($fullPath, 0777, true); + + return $fullPath; + } + + throw new \InvalidArgumentException("Package exists."); + } + } \ No newline at end of file diff --git a/src/Illuminate/Workbench/Starter.php b/src/Illuminate/Workbench/Starter.php index ea3396362d94..919f20cd1e48 100644 --- a/src/Illuminate/Workbench/Starter.php +++ b/src/Illuminate/Workbench/Starter.php @@ -1,29 +1,29 @@ -in($path)->files()->name('autoload.php'); - - foreach ($autoloads as $file) - { - $files->requireOnce($file->getRealPath()); - } - } - +in($path)->files()->name('autoload.php'); + + foreach ($autoloads as $file) + { + $files->requireOnce($file->getRealPath()); + } + } + } From e9c98dce31cd72ff8d60884cba37084625d382a7 Mon Sep 17 00:00:00 2001 From: ROMOPAT Date: Fri, 18 Jan 2013 09:36:40 +0100 Subject: [PATCH 4/5] L4 merge --- .gitattributes | 2 + composer.json | 155 ++++++------- readme.md | 7 + src/Illuminate/Auth/Guard.php | 14 ++ src/Illuminate/Cache/CacheManager.php | 10 + src/Illuminate/Cache/WinCacheStore.php | 85 +++++++ src/Illuminate/Database/Eloquent/Model.php | 2 +- src/Illuminate/Exception/Handler.php | 2 +- src/Illuminate/Hashing/BcryptHasher.php | 34 +-- src/Illuminate/Hashing/composer.json | 3 +- .../Routing/Controllers/Inspector.php | 129 +++++++++++ src/Illuminate/Routing/Router.php | 134 ++++++----- src/Illuminate/Session/SessionManager.php | 10 + src/Illuminate/Support/Pluralizer.php | 212 ++++++++++++++++++ src/Illuminate/Support/helpers.php | 34 ++- tests/Auth/AuthGuardTest.php | 12 + tests/Database/DatabaseEloquentModelTest.php | 11 +- ...tcherTest.php => EventsDispatcherTest.php} | 2 +- ...Test.php => FoundationAliasLoaderTest.php} | 2 +- ...Test.php => FoundationApplicationTest.php} | 2 +- ...isanTest.php => FoundationArtisanTest.php} | 2 +- ... => FoundationAssetPublishCommandTest.php} | 2 +- ...t.php => FoundationAssetPublisherTest.php} | 2 +- ...Test.php => FoundationClassLoaderTest.php} | 2 +- ...serTest.php => FoundationComposerTest.php} | 2 +- ...=> FoundationConfigPublishCommandTest.php} | 2 +- ....php => FoundationConfigPublisherTest.php} | 2 +- .../{RequestTest.php => HttpRequestTest.php} | 2 +- ...{ResponseTest.php => HttpResponseTest.php} | 2 +- .../Log/{WriterTest.php => LogWriterTest.php} | 2 +- .../{MailerTest.php => MailMailerTest.php} | 2 +- .../{MessageTest.php => MailMessageTest.php} | 2 +- ...p => PaginationBootstrapPresenterTest.php} | 2 +- ...Test.php => PaginationEnvironmentTest.php} | 2 +- ...orTest.php => PaginationPaginatorTest.php} | 2 +- ...JobTest.php => QueueBeanstalkdJobTest.php} | 100 ++++----- ...eTest.php => QueueBeanstalkdQueueTest.php} | 104 ++++----- ...ListenerTest.php => QueueListenerTest.php} | 174 +++++++------- .../{SyncJobTest.php => QueueSyncJobTest.php} | 46 ++-- ...ncQueueTest.php => QueueSyncQueueTest.php} | 44 ++-- ...php => RoutingControllerGeneratorTest.php} | 2 +- .../RoutingControllerInspectorTest.php | 28 +++ ...llerTest.php => RoutingControllerTest.php} | 2 +- ...erTest.php => RoutingFilterParserTest.php} | 2 +- .../{FilterTest.php => RoutingFilterTest.php} | 2 +- ...p => RoutingMakeControllerCommandTest.php} | 2 +- tests/Routing/RoutingTest.php | 61 ++--- ...orTest.php => RoutingUrlGeneratorTest.php} | 2 +- ...st.php => SessionCacheDrivenStoreTest.php} | 2 +- ...oreTest.php => SessionCookieStoreTest.php} | 2 +- ...eTest.php => SessionDatabaseStoreTest.php} | 2 +- ...StoreTest.php => SessionFileStoreTest.php} | 2 +- .../{StoreTest.php => SessionStoreTest.php} | 2 +- .../{FacadeTest.php => SupportFacadeTest.php} | 2 +- ...HelpersTest.php => SupportHelpersTest.php} | 2 +- ...eBagTest.php => SupportMessageBagTest.php} | 168 +++++++------- ... => SupportNamespacedItemResolverTest.php} | 2 +- tests/Support/SupportPluralizerTest.php | 15 ++ ...est.php => SupportServiceProviderTest.php} | 2 +- ...Test.php => TranslationTranslatorTest.php} | 2 +- ...orTest.php => ValidationValidatorTest.php} | 2 +- ...ilerTest.php => ViewBladeCompilerTest.php} | 2 +- ...ineTest.php => ViewCompilerEngineTest.php} | 2 +- ...verTest.php => ViewEngineResolverTest.php} | 2 +- ...derTest.php => ViewFileViewFinderTest.php} | 0 ...hpEngineTest.php => ViewPhpEngineTest.php} | 2 +- 66 files changed, 1086 insertions(+), 588 deletions(-) create mode 100644 .gitattributes create mode 100644 readme.md create mode 100644 src/Illuminate/Cache/WinCacheStore.php create mode 100644 src/Illuminate/Routing/Controllers/Inspector.php create mode 100644 src/Illuminate/Support/Pluralizer.php rename tests/Events/{DispatcherTest.php => EventsDispatcherTest.php} (94%) rename tests/Foundation/{AliasLoaderTest.php => FoundationAliasLoaderTest.php} (91%) rename tests/Foundation/{ApplicationTest.php => FoundationApplicationTest.php} (98%) rename tests/Foundation/{ArtisanTest.php => FoundationArtisanTest.php} (92%) rename tests/Foundation/{AssetPublishCommandTest.php => FoundationAssetPublishCommandTest.php} (86%) rename tests/Foundation/{AssetPublisherTest.php => FoundationAssetPublisherTest.php} (93%) rename tests/Foundation/{ClassLoaderTest.php => FoundationClassLoaderTest.php} (91%) rename tests/Foundation/{ComposerTest.php => FoundationComposerTest.php} (95%) rename tests/Foundation/{ConfigPublishCommandTest.php => FoundationConfigPublishCommandTest.php} (86%) rename tests/Foundation/{ConfigPublisherTest.php => FoundationConfigPublisherTest.php} (94%) rename tests/Http/{RequestTest.php => HttpRequestTest.php} (98%) rename tests/Http/{ResponseTest.php => HttpResponseTest.php} (97%) rename tests/Log/{WriterTest.php => LogWriterTest.php} (93%) rename tests/Mail/{MailerTest.php => MailMailerTest.php} (99%) rename tests/Mail/{MessageTest.php => MailMessageTest.php} (95%) rename tests/Pagination/{BootstrapPresenterTest.php => PaginationBootstrapPresenterTest.php} (98%) rename tests/Pagination/{EnvironmentTest.php => PaginationEnvironmentTest.php} (97%) rename tests/Pagination/{PaginatorTest.php => PaginationPaginatorTest.php} (97%) rename tests/Queue/{BeanstalkdJobTest.php => QueueBeanstalkdJobTest.php} (91%) rename tests/Queue/{BeanstalkdQueueTest.php => QueueBeanstalkdQueueTest.php} (94%) rename tests/Queue/{ListenerTest.php => QueueListenerTest.php} (94%) rename tests/Queue/{SyncJobTest.php => QueueSyncJobTest.php} (85%) rename tests/Queue/{SyncQueueTest.php => QueueSyncQueueTest.php} (84%) rename tests/Routing/{ControllerGeneratorTest.php => RoutingControllerGeneratorTest.php} (94%) create mode 100644 tests/Routing/RoutingControllerInspectorTest.php rename tests/Routing/{ControllerTest.php => RoutingControllerTest.php} (99%) rename tests/Routing/{FilterParserTest.php => RoutingFilterParserTest.php} (93%) rename tests/Routing/{FilterTest.php => RoutingFilterTest.php} (97%) rename tests/Routing/{MakeControllerCommandTest.php => RoutingMakeControllerCommandTest.php} (94%) rename tests/Routing/{UrlGeneratorTest.php => RoutingUrlGeneratorTest.php} (98%) rename tests/Session/{CacheDrivenStoreTest.php => SessionCacheDrivenStoreTest.php} (94%) rename tests/Session/{CookieStoreTest.php => SessionCookieStoreTest.php} (97%) rename tests/Session/{DatabaseStoreTest.php => SessionDatabaseStoreTest.php} (97%) rename tests/Session/{FileStoreTest.php => SessionFileStoreTest.php} (97%) rename tests/Session/{StoreTest.php => SessionStoreTest.php} (99%) rename tests/Support/{FacadeTest.php => SupportFacadeTest.php} (88%) rename tests/Support/{HelpersTest.php => SupportHelpersTest.php} (98%) rename tests/Support/{MessageBagTest.php => SupportMessageBagTest.php} (94%) rename tests/Support/{NamespacedItemResolverTest.php => SupportNamespacedItemResolverTest.php} (91%) create mode 100644 tests/Support/SupportPluralizerTest.php rename tests/Support/{ServiceProviderTest.php => SupportServiceProviderTest.php} (87%) rename tests/Translation/{TranslatorTest.php => TranslationTranslatorTest.php} (98%) rename tests/Validation/{ValidatorTest.php => ValidationValidatorTest.php} (99%) rename tests/View/{BladeCompilerTest.php => ViewBladeCompilerTest.php} (99%) rename tests/View/{CompilerEngineTest.php => ViewCompilerEngineTest.php} (95%) rename tests/View/{EngineResolverTest.php => ViewEngineResolverTest.php} (82%) rename tests/View/{FileViewFinderTest.php => ViewFileViewFinderTest.php} (100%) rename tests/View/{PhpEngineTest.php => ViewPhpEngineTest.php} (82%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..2e5533a77dfd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/build export-ignore +/tests export-ignore \ No newline at end of file diff --git a/composer.json b/composer.json index 438ba64c1536..f485bfa705e0 100644 --- a/composer.json +++ b/composer.json @@ -1,77 +1,78 @@ -{ - "name": "laravel/framework", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "monolog/monolog": "1.3.*", - "swiftmailer/swiftmailer": "4.3.*", - "symfony/browser-kit": "2.2.*", - "symfony/console": "2.2.*", - "symfony/css-selector": "2.2.*", - "symfony/dom-crawler": "2.2.*", - "symfony/event-dispatcher": "2.2.*", - "symfony/finder": "2.2.*", - "symfony/http-foundation": "2.2.*", - "symfony/http-kernel": "2.2.*", - "symfony/process": "2.2.*", - "symfony/routing": "2.2.*", - "symfony/translation": "2.2.*" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/cache": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/exception": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/foundation": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/mail": "self.version", - "illuminate/pagination": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version", - "illuminate/workbench": "self.version" - }, - "require-dev": { - "iron-io/iron_mq": "1.4.*", - "mockery/mockery": "0.7.2" - }, - "autoload": { - "classmap": [ - "src/Illuminate/Queue/Pheanstalk" - ], - "files": [ - "src/Illuminate/Support/helpers.php" - ], - "psr-0": { - "Illuminate": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "minimum-stability": "dev" -} +{ + "name": "laravel/framework", + "description": "The Laravel Framework.", + "keywords": ["framework", "laravel"], + "license": "MIT", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "ircmaxell/password-compat": "1.0.*", + "monolog/monolog": "1.3.*", + "swiftmailer/swiftmailer": "4.3.*", + "symfony/browser-kit": "2.2.*", + "symfony/console": "2.2.*", + "symfony/css-selector": "2.2.*", + "symfony/dom-crawler": "2.2.*", + "symfony/event-dispatcher": "2.2.*", + "symfony/finder": "2.2.*", + "symfony/http-foundation": "2.2.*", + "symfony/http-kernel": "2.2.*", + "symfony/process": "2.2.*", + "symfony/routing": "2.2.*", + "symfony/translation": "2.2.*" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/cache": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/exception": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/foundation": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/log": "self.version", + "illuminate/mail": "self.version", + "illuminate/pagination": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "illuminate/workbench": "self.version" + }, + "require-dev": { + "iron-io/iron_mq": "1.4.*", + "mockery/mockery": "0.7.2" + }, + "autoload": { + "classmap": [ + "src/Illuminate/Queue/Pheanstalk" + ], + "files": [ + "src/Illuminate/Support/helpers.php" + ], + "psr-0": { + "Illuminate": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "minimum-stability": "dev" +} diff --git a/readme.md b/readme.md new file mode 100644 index 000000000000..ebbce5ae1854 --- /dev/null +++ b/readme.md @@ -0,0 +1,7 @@ +# Laravel 4 Beta Change Log + +## Beta 2 + +- Migrated to ircmaxell's [password-compat](http://github.com/ircmaxell/password_compat) library for PHP 5.5 forward compatibility on hashes. No backward compatibility breaks. +- Inflector migrated to L4. Eloquent models now assume their table names if one is not specified. New helpers `str_plural` and `str_singular`. +- Improved `Route::controller` so that `URL::action` may be used with RESTful controllers. \ No newline at end of file diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index de2d71592593..a04bb32304a7 100644 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -182,6 +182,20 @@ public function login(UserInterface $user, $remember = false) $this->user = $user; } + /** + * Log the given user ID into the application. + * + * @param mixed $id + * @param bool $remember + * @return Illuminate\Auth\UserInterface + */ + public function loginUsingId($id, $remember = false) + { + $this->session->put($this->getName(), $id); + + return $this->login($this->user(), $remember); + } + /** * Create a remember me cookie for a given ID. * diff --git a/src/Illuminate/Cache/CacheManager.php b/src/Illuminate/Cache/CacheManager.php index 8c497b974551..476d3e0a4083 100644 --- a/src/Illuminate/Cache/CacheManager.php +++ b/src/Illuminate/Cache/CacheManager.php @@ -50,6 +50,16 @@ protected function createMemcachedDriver() return new MemcachedStore($memcached, $this->app['config']['cache.prefix']); } + /** + * Create an instance of the WinCache cache driver. + * + * @return \Illuminate\Cache\WinCacheStore + */ + protected function createWincacheDriver() + { + return new WinCacheStore($this->app['config']['cache.prefix']); + } + /** * Create an instance of the Redis cache driver. * diff --git a/src/Illuminate/Cache/WinCacheStore.php b/src/Illuminate/Cache/WinCacheStore.php new file mode 100644 index 000000000000..c72ed41ff097 --- /dev/null +++ b/src/Illuminate/Cache/WinCacheStore.php @@ -0,0 +1,85 @@ +prefix = $prefix; + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + protected function retrieveItem($key) + { + $value = wincache_ucache_get($this->prefix.$key); + + if ($value !== false) + { + return $value; + } + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param int $minutes + * @return void + */ + protected function storeItem($key, $value, $minutes) + { + wincache_ucache_add($this->prefix.$key, value, $minutes * 60); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + protected function storeItemForever($key, $value) + { + return $this->storeItem($key, $value, 0); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + protected function removeItem($key) + { + wincache_ucache_delete($this->prefix.$key); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + protected function flushItems() + { + wincache_ucache_clear(); + } + +} \ No newline at end of file diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index e696b02af804..a478ce54769c 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -584,7 +584,7 @@ public function newCollection(array $models = array()) */ public function getTable() { - return $this->table; + return $this->table ?: snake_case(str_plural(get_class($this))); } /** diff --git a/src/Illuminate/Exception/Handler.php b/src/Illuminate/Exception/Handler.php index fa66540136c4..c9417737baf0 100644 --- a/src/Illuminate/Exception/Handler.php +++ b/src/Illuminate/Exception/Handler.php @@ -107,7 +107,7 @@ protected function hints(ReflectionFunction $reflection, $exception) */ public function error(Closure $callback) { - $this->handlers[] = $callback; + array_unshift($this->handlers, $callback); } } \ No newline at end of file diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index fc5b0debe699..82068fe9cf26 100644 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -11,25 +11,9 @@ class BcryptHasher implements HasherInterface { */ public function make($value, array $options = array()) { - $rounds = isset($options['rounds']) ? $options['rounds'] : 8; + $cost = isset($options['rounds']) ? $options['rounds'] : 8; - $work = str_pad($rounds, 2, '0', STR_PAD_LEFT); - - // Bcrypt expects the salt to be 22 base64 encoded characters including dots - // and slashes. We will get rid of the plus signs included in the base64 - // data and replace them all with dots so it's appropriately encoded. - if (function_exists('openssl_random_pseudo_bytes')) - { - $salt = openssl_random_pseudo_bytes(16); - } - else - { - $salt = $this->getRandomSalt(); - } - - $salt = substr(strtr(base64_encode($salt), '+', '.'), 0 , 22); - - return crypt($value, '$2a$'.$work.'$'.$salt); + return password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost)); } /** @@ -42,19 +26,7 @@ public function make($value, array $options = array()) */ public function check($value, $hashedValue, array $options = array()) { - return crypt($value, $hashedValue) === $hashedValue; - } - - /** - * Get a random salt to use during hashing. - * - * @return string - */ - protected function getRandomSalt() - { - $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - return substr(str_shuffle(str_repeat($pool, 5)), 0, 40); + return password_verify($value, $hashedValue); } } \ No newline at end of file diff --git a/src/Illuminate/Hashing/composer.json b/src/Illuminate/Hashing/composer.json index 2e0c6473936b..1aeb313eafcb 100644 --- a/src/Illuminate/Hashing/composer.json +++ b/src/Illuminate/Hashing/composer.json @@ -10,7 +10,8 @@ ], "require": { "php": ">=5.3.0", - "illuminate/support": "4.0.x" + "illuminate/support": "4.0.x", + "ircmaxell/password-compat": "1.0.*" }, "autoload": { "psr-0": { diff --git a/src/Illuminate/Routing/Controllers/Inspector.php b/src/Illuminate/Routing/Controllers/Inspector.php new file mode 100644 index 000000000000..f5100e151c05 --- /dev/null +++ b/src/Illuminate/Routing/Controllers/Inspector.php @@ -0,0 +1,129 @@ +getMethods() as $method) + { + if ($this->isRoutable($method, $controller)) + { + $data = $this->getMethodData($method, $prefix); + + $routable[$method->name][] = $data; + + // If the routable method is an index method, we will create a special index + // route which is simply the prefix and the verb and does not contain any + // the wildcard place-holders that each "typical" routes would contain. + if ($data['plain'] == $prefix.'/index') + { + $index = $this->getIndexData($data, $prefix); + + $routable[$method->name][] = $index; + } + } + } + + return $routable; + } + + /** + * Determine if the given controller method is routable. + * + * @param ReflectionMethod $method + * @param string $controller + * @return bool + */ + public function isRoutable(ReflectionMethod $method, $controller) + { + if ($method->class != $controller) return false; + + return $method->isPublic() and starts_with($method->name, $this->verbs); + } + + /** + * Get the method data for a given method. + * + * @param ReflectionMethod $method + * @return array + */ + public function getMethodData(ReflectionMethod $method, $prefix) + { + $verb = $this->getVerb($name = $method->name); + + $uri = $this->addUriWildcards($plain = $this->getPlainUri($name, $prefix)); + + return compact('verb', 'plain', 'uri'); + } + + /** + * Extract the verb from a controller action. + * + * @param string $name + * @return string + */ + public function getVerb($name) + { + return head(explode('_', snake_case($name))); + } + + /** + * Determine the URI from the given method name. + * + * @param string $name + * @param string $prefix + * @return string + */ + public function getPlainUri($name, $prefix) + { + return $prefix.'/'.implode('-', array_slice(explode('_', snake_case($name)), 1)); + } + + /** + * Add wildcards to the given URI. + * + * @param string $uri + * @return string + */ + public function addUriWildcards($uri) + { + return $uri.'/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'; + } + + /** + * Get the routable data for an index method. + * + * @param array $data + * @param string $prefix + * @return array + */ + protected function getIndexData($data, $prefix) + { + return array('verb' => $data['verb'], 'plain' => $prefix, 'uri' => $prefix); + } + +} \ No newline at end of file diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index d4f1694fb413..3b7218222f16 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -5,6 +5,7 @@ use Illuminate\Container\Container; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\RequestContext; +use Illuminate\Routing\Controllers\Inspector; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Matcher\UrlMatcher; use Symfony\Component\Routing\Exception\ExceptionInterface; @@ -58,6 +59,13 @@ class Router { */ protected $container; + /** + * The controller inspector instance. + * + * @var \Illuminate\Routing\Controllers\Inspector + */ + protected $inspector; + /** * The current request being dispatched. * @@ -200,9 +208,18 @@ public function controllers(array $controllers) */ public function controller($controller, $uri) { - $uri = $uri.'/{method?}/{v1?}/{v2?}/{v3?}/{v4?}'; + $routable = $this->getInspector()->getRoutable($controller, $uri); - return $this->any($uri, $controller.'@{method}'); + // When a controller is routed using this method, we use Reflection to parse + // out all of the routable methods for the controller, then register each + // route explicitly for the developers, so reverse routing is possible. + foreach ($routable as $method => $routes) + { + foreach ($routes as $route) + { + $this->{$route['verb']}($route['uri'], $controller.'@'.$method); + } + } } /** @@ -554,21 +571,21 @@ protected function createControllerCallback($attribute) { $ioc = $this->container; + $me = $this; + // We'll return a Closure that is able to resolve the controller instance and // call the appropriate method on the controller, passing in the arguments // it receives. Controllers are created with the IoC container instance. - list($controller, $method) = explode('@', $attribute); - - $me = $this; - - return function() use ($me, $ioc, $controller, $method) + return function() use ($me, $ioc, $attribute) { + list($controller, $method) = explode('@', $attribute); + $route = $me->getCurrentRoute(); - // We will replace any back-references that may be present in the method name - // which allow the developer to use part of the incoming route inside of a - // route end-point declaration, setting up true "wildcard" style routes. - list($method, $args) = $me->makeReferences($route, $method); + // We will extract the passed in parameters off of the route object so we will + // pass them off to the controller method as arguments. We will not get the + // defaults so that the controllers will be able to use its own defaults. + $args = array_values($route->getVariablesWithoutDefaults()); $instance = $ioc->make($controller); @@ -576,60 +593,6 @@ protected function createControllerCallback($attribute) }; } - /** - * Replace any route back-references in a route. - * - * @param \Illuminate\Routing\Route $route - * @param string $original - * @return void - */ - public function makeReferences(Route $route, $original) - { - $method = $original; - - $parameters = $route->getVariablesWithoutDefaults(); - - // To replace the back-references we will just spin through the route variables - // and replace any instance of the variable in the method name with the real - // value of the given parameter, allowing for backreferences in the route. - foreach ($route->getVariables() as $key => $value) - { - $method = str_replace('{'.$key.'}', $value, $method, $c); - - if ($c > 0) unset($parameters[$key]); - } - - // If the method name has been changed due to a back-reference that was swapped - // in by the route, we will format it to make sure it is valid. If it is now - // empty we will swap it for "index". The request method is also prefixed. - if ($method != $original) - { - $method = $this->formatMethod($method); - } - - return array($method, array_values($parameters)); - } - - /** - * Format a controller back-referenced method. - * - * @param string $method - * @return string - */ - protected function formatMethod($method) - { - if ($method == '') $method = 'Index'; - - // We wil prepend the HTTP request method verb to the beginning of the method - // name so a controller is essentially "RESTful" even while using wildcard - // routing setups. Everything will stay RESTful by default in the route. - $verb = strtolower($this->currentRequest->getMethod()); - - if ($verb == 'head') $verb = 'get'; - - return $verb.camel_case($method); - } - /** * Get the response for a given request. * @@ -993,6 +956,16 @@ public function disableFilters() $this->runFilters = false; } + /** + * Retrieve the entire route collection. + * + * @return \Symfony\Component\Routing\RouteCollection + */ + public function getRoutes() + { + return $this->routes; + } + /** * Get the current request being dispatched. * @@ -1040,13 +1013,34 @@ protected function getUrlMatcher(Request $request) } /** - * Retrieve the entire route collection. - * - * @return \Symfony\Component\Routing\RouteCollection + * Get the controller inspector instance. + * + * @return \Illuminate\Routing\Controllers\Inspector */ - public function getRoutes() + public function getInspector() { - return $this->routes; + return $this->inspector ?: new Controllers\Inspector; + } + + /** + * Set the controller inspector instance. + * + * @param \Illuminate\Routing\Controllers\Inspector $inspector + * @return void + */ + public function setInspector(Inspector $inspector) + { + $this->inspector = $inspector; + } + + /** + * Get the container used by the router. + * + * @return \Illuminate\Container\Container + */ + public function getContainer() + { + return $this->container; } /** diff --git a/src/Illuminate/Session/SessionManager.php b/src/Illuminate/Session/SessionManager.php index 539ac080cde7..7da3e8daca50 100644 --- a/src/Illuminate/Session/SessionManager.php +++ b/src/Illuminate/Session/SessionManager.php @@ -46,6 +46,16 @@ protected function createMemcachedDriver() return $this->createCacheBased('memcached'); } + /** + * Create an instance of the Wincache session driver. + * + * @return \Illuminate\Session\CacheDrivenStore + */ + protected function createWincacheDriver() + { + return $this->createCacheBased('wincache'); + } + /** * Create an instance of the Redis session driver. * diff --git a/src/Illuminate/Support/Pluralizer.php b/src/Illuminate/Support/Pluralizer.php new file mode 100644 index 000000000000..11481e02e7dd --- /dev/null +++ b/src/Illuminate/Support/Pluralizer.php @@ -0,0 +1,212 @@ + "$1zes", + '/^(ox)$/i' => "$1en", + '/([m|l])ouse$/i' => "$1ice", + '/(matr|vert|ind)ix|ex$/i' => "$1ices", + '/(x|ch|ss|sh)$/i' => "$1es", + '/([^aeiouy]|qu)y$/i' => "$1ies", + '/(hive)$/i' => "$1s", + '/(?:([^f])fe|([lr])f)$/i' => "$1$2ves", + '/(shea|lea|loa|thie)f$/i' => "$1ves", + '/sis$/i' => "ses", + '/([ti])um$/i' => "$1a", + '/(tomat|potat|ech|her|vet)o$/i' => "$1oes", + '/(bu)s$/i' => "$1ses", + '/(alias)$/i' => "$1es", + '/(octop)us$/i' => "$1i", + '/(ax|test)is$/i' => "$1es", + '/(us)$/i' => "$1es", + '/s$/i' => "s", + '/$/' => "s", + ); + + /** + * Singular word form rules. + * + * @var array + */ + protected static $singular = array( + '/(quiz)zes$/i' => "$1", + '/(matr)ices$/i' => "$1ix", + '/(vert|ind)ices$/i' => "$1ex", + '/^(ox)en$/i' => "$1", + '/(alias)es$/i' => "$1", + '/(octop|vir)i$/i' => "$1us", + '/(cris|ax|test)es$/i' => "$1is", + '/(shoe)s$/i' => "$1", + '/(o)es$/i' => "$1", + '/(bus)es$/i' => "$1", + '/([m|l])ice$/i' => "$1ouse", + '/(x|ch|ss|sh)es$/i' => "$1", + '/(m)ovies$/i' => "$1ovie", + '/(s)eries$/i' => "$1eries", + '/([^aeiouy]|qu)ies$/i' => "$1y", + '/([lr])ves$/i' => "$1f", + '/(tive)s$/i' => "$1", + '/(hive)s$/i' => "$1", + '/(li|wi|kni)ves$/i' => "$1fe", + '/(shea|loa|lea|thie)ves$/i' => "$1f", + '/(^analy)ses$/i' => "$1sis", + '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => "$1$2sis", + '/([ti])a$/i' => "$1um", + '/(n)ews$/i' => "$1ews", + '/(h|bl)ouses$/i' => "$1ouse", + '/(corpse)s$/i' => "$1", + '/(us)es$/i' => "$1", + '/(us|ss)$/i' => "$1", + '/s$/i' => "", + ); + + /** + * Irregular word forms. + * + * @var array + */ + protected static $irregular = array( + 'child' => 'children', + 'foot' => 'feet', + 'goose' => 'geese', + 'man' => 'men', + 'move' => 'moves', + 'person' => 'people', + 'sex' => 'sexes', + 'tooth' => 'teeth', + ); + + /** + * Uncountable word forms. + * + * @var array + */ + protected static $uncountable = array( + 'audio', + 'equipment', + 'deer', + 'fish', + 'gold', + 'information', + 'money', + 'rice', + 'police', + 'series', + 'sheep', + 'species', + 'moose', + 'chassis', + 'traffic', + ); + + /** + * The cached copies of the plural inflections. + * + * @var array + */ + protected static $pluralCache = array(); + + /** + * The cached copies of the singular inflections. + * + * @var array + */ + protected static $singularCache = array(); + + /** + * Get the singular form of the given word. + * + * @param string $value + * @return string + */ + public static function singular($value) + { + if (isset(static::$singularCache[$value])) + { + return static::$singularCache[$value]; + } + + $result = static::inflect($value, static::$singular, static::$irregular); + + return static::$singularCache[$value] = $result ?: $value; + } + + /** + * Get the plural form of the given word. + * + * @param string $value + * @param int $count + * @return string + */ + public static function plural($value, $count = 2) + { + if ($count == 1) return $value; + + // First we'll check the cache of inflected values. We cache each word that + // is inflected so we don't have to spin through the regular expressions + // on each subsequent method calls for this word by the app developer. + if (isset(static::$pluralCache[$value])) + { + return static::$pluralCache[$value]; + } + + $irregular = array_flip(static::$irregular); + + // When doing the singular to plural transformation, we'll flip the irregular + // array since we need to swap sides on the keys and values. After we have + // the transformed value we will cache it in memory for faster look-ups. + $plural = static::$plural; + + $result = static::inflect($value, $plural, $irregular); + + return static::$pluralCache[$value] = $result; + } + + /** + * Perform auto inflection on an English word. + * + * @param string $value + * @param array $source + * @param array $irregular + * @return string + */ + protected static function inflect($value, $source, $irregular) + { + // If the word hasn't been cached, we'll check the list of words that are in + // this list of uncountable word forms. This will be a quick search since + // we will just hit the arrays directly for values without expressions. + if (in_array(strtolower($value), static::$uncountable)) + { + return $value; + } + + // Next, we will check the "irregular" patterns which contain words that are + // not easily summarized in regular expression rules, like "children" and + // "teeth", both of which cannot get inflected using our typical rules. + foreach ($irregular as $irregular => $pattern) + { + if (preg_match($pattern = '/'.$pattern.'$/i', $value)) + { + return preg_replace($pattern, $irregular, $value); + } + } + + // Finally, we'll spin through the array of regular expressions and look for + // matches for the word. If we find a match, we will cache and return the + // transformed value so we will quickly look it up on subsequent calls. + foreach ($source as $pattern => $inflected) + { + if (preg_match($pattern, $value)) + { + return preg_replace($pattern, $inflected, $value); + } + } + } + +} \ No newline at end of file diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index ddffdf7f9c50..8f03f70f096a 100644 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -390,12 +390,17 @@ function snake_case($value, $delimiter = '_') * Determine if a string starts with a given needle. * * @param string $haystack - * @param string $needle + * @param string|array $needle * @return bool */ -function starts_with($haystack, $needle) +function starts_with($haystack, $needles) { - return strpos($haystack, $needle) === 0; + foreach ((array) $needles as $needle) + { + if (strpos($haystack, $needle) === 0) return true; + } + + return false; } /** @@ -451,6 +456,29 @@ function str_is($pattern, $value) return (bool) preg_match('#^'.$pattern.'#', $value); } +/** + * Get the plural form of an English word. + * + * @param string $value + * @param int $count + * @return string + */ +function str_plural($value, $count = 2) +{ + return Illuminate\Support\Pluralizer::plural($value, $count); +} + +/** + * Get the singular form of an English word. + * + * @param string $value + * @return string + */ +function str_singular($value) +{ + return Illuminate\Support\Pluralizer::singular($value); +} + /** * Translate the given message. * diff --git a/tests/Auth/AuthGuardTest.php b/tests/Auth/AuthGuardTest.php index 676dfe38db51..a42ea8a09990 100644 --- a/tests/Auth/AuthGuardTest.php +++ b/tests/Auth/AuthGuardTest.php @@ -163,6 +163,18 @@ public function testLoginMethodQueuesCookieWhenRemembering() } + public function testLoginUsingIdStoresInSessionAndLogsInWithUser() + { + list($session, $provider, $request, $cookie) = $this->getMocks(); + $guard = $this->getMock('Illuminate\Auth\Guard', array('login', 'user'), array($provider, $session, $request)); + $guard->getSession()->shouldReceive('put')->once()->with($guard->getName(), 10); + $guard->expects($this->once())->method('user')->will($this->returnValue($user = m::mock('Illuminate\Auth\UserInterface'))); + $guard->expects($this->once())->method('login')->with($this->equalTo($user), $this->equalTo(false))->will($this->returnValue($user)); + + $this->assertEquals($user, $guard->loginUsingId(10)); + } + + public function testUserUsesRememberCookieIfItExists() { $guard = $this->getGuard(); diff --git a/tests/Database/DatabaseEloquentModelTest.php b/tests/Database/DatabaseEloquentModelTest.php index 4da0528cefa5..82643e75f9a9 100644 --- a/tests/Database/DatabaseEloquentModelTest.php +++ b/tests/Database/DatabaseEloquentModelTest.php @@ -411,6 +411,13 @@ public function testBelongsToManyCreatesProperRelation() } + public function testModelsAssumeTheirName() + { + $model = new EloquentModelWithoutTableStub; + $this->assertEquals('eloquent_model_without_table_stubs', $model->getTable()); + } + + protected function addMockConnection($model) { $model->setConnectionResolver($resolver = m::mock('Illuminate\Database\ConnectionResolverInterface')); @@ -492,4 +499,6 @@ public function newQuery() $mock->shouldReceive('with')->once()->with(array('foo', 'bar'))->andReturn('foo'); return $mock; } -} \ No newline at end of file +} + +class EloquentModelWithoutTableStub extends Illuminate\Database\Eloquent\Model {} \ No newline at end of file diff --git a/tests/Events/DispatcherTest.php b/tests/Events/EventsDispatcherTest.php similarity index 94% rename from tests/Events/DispatcherTest.php rename to tests/Events/EventsDispatcherTest.php index f516d0288a33..fd8b39742fc6 100644 --- a/tests/Events/DispatcherTest.php +++ b/tests/Events/EventsDispatcherTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Events\Dispatcher; -class DispatcherTest extends PHPUnit_Framework_TestCase { +class EventsDispatcherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/AliasLoaderTest.php b/tests/Foundation/FoundationAliasLoaderTest.php similarity index 91% rename from tests/Foundation/AliasLoaderTest.php rename to tests/Foundation/FoundationAliasLoaderTest.php index b9ebf0ebb459..00c12ca319d5 100644 --- a/tests/Foundation/AliasLoaderTest.php +++ b/tests/Foundation/FoundationAliasLoaderTest.php @@ -2,7 +2,7 @@ use Illuminate\Foundation\AliasLoader; -class AliasLoaderTest extends PHPUnit_Framework_TestCase { +class FoundationAliasLoaderTest extends PHPUnit_Framework_TestCase { public function testLoaderCanBeCreatedAndRegisteredOnce() { diff --git a/tests/Foundation/ApplicationTest.php b/tests/Foundation/FoundationApplicationTest.php similarity index 98% rename from tests/Foundation/ApplicationTest.php rename to tests/Foundation/FoundationApplicationTest.php index 50bc430d99d1..523b659ebf87 100644 --- a/tests/Foundation/ApplicationTest.php +++ b/tests/Foundation/FoundationApplicationTest.php @@ -4,7 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Foundation\Application; -class ApplicationTest extends PHPUnit_Framework_TestCase { +class FoundationApplicationTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/ArtisanTest.php b/tests/Foundation/FoundationArtisanTest.php similarity index 92% rename from tests/Foundation/ArtisanTest.php rename to tests/Foundation/FoundationArtisanTest.php index 2b8a35dd2e61..28a355fd8ca1 100644 --- a/tests/Foundation/ArtisanTest.php +++ b/tests/Foundation/FoundationArtisanTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class ArtisanTest extends PHPUnit_Framework_TestCase { +class FoundationArtisanTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/AssetPublishCommandTest.php b/tests/Foundation/FoundationAssetPublishCommandTest.php similarity index 86% rename from tests/Foundation/AssetPublishCommandTest.php rename to tests/Foundation/FoundationAssetPublishCommandTest.php index bc539698116b..415152d30f62 100644 --- a/tests/Foundation/AssetPublishCommandTest.php +++ b/tests/Foundation/FoundationAssetPublishCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class AssetPublishCommandTest extends PHPUnit_Framework_TestCase { +class FoundationAssetPublishCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/AssetPublisherTest.php b/tests/Foundation/FoundationAssetPublisherTest.php similarity index 93% rename from tests/Foundation/AssetPublisherTest.php rename to tests/Foundation/FoundationAssetPublisherTest.php index 203676a34170..ca217250ba4a 100644 --- a/tests/Foundation/AssetPublisherTest.php +++ b/tests/Foundation/FoundationAssetPublisherTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class AssetPublisherTest extends PHPUnit_Framework_TestCase { +class FoundationAssetPublisherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/ClassLoaderTest.php b/tests/Foundation/FoundationClassLoaderTest.php similarity index 91% rename from tests/Foundation/ClassLoaderTest.php rename to tests/Foundation/FoundationClassLoaderTest.php index 998bceb10911..e59d3d066878 100644 --- a/tests/Foundation/ClassLoaderTest.php +++ b/tests/Foundation/FoundationClassLoaderTest.php @@ -4,7 +4,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Foundation\ClassLoader; -class ClassLoaderTest extends PHPUnit_Framework_TestCase { +class FoundationClassLoaderTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/ComposerTest.php b/tests/Foundation/FoundationComposerTest.php similarity index 95% rename from tests/Foundation/ComposerTest.php rename to tests/Foundation/FoundationComposerTest.php index 29cfee224ccb..cd0ace63c2e8 100644 --- a/tests/Foundation/ComposerTest.php +++ b/tests/Foundation/FoundationComposerTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class ComposerTest extends PHPUnit_Framework_TestCase { +class FoundationComposerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/ConfigPublishCommandTest.php b/tests/Foundation/FoundationConfigPublishCommandTest.php similarity index 86% rename from tests/Foundation/ConfigPublishCommandTest.php rename to tests/Foundation/FoundationConfigPublishCommandTest.php index 851c909c41e2..2eeb73837e78 100644 --- a/tests/Foundation/ConfigPublishCommandTest.php +++ b/tests/Foundation/FoundationConfigPublishCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class ConfigPublishCommandTest extends PHPUnit_Framework_TestCase { +class FoundationConfigPublishCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/ConfigPublisherTest.php b/tests/Foundation/FoundationConfigPublisherTest.php similarity index 94% rename from tests/Foundation/ConfigPublisherTest.php rename to tests/Foundation/FoundationConfigPublisherTest.php index 4fb70bcd3fe2..72732122cf0b 100644 --- a/tests/Foundation/ConfigPublisherTest.php +++ b/tests/Foundation/FoundationConfigPublisherTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class ConfigPublisherTest extends PHPUnit_Framework_TestCase { +class FoundationConfigPublisherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Http/RequestTest.php b/tests/Http/HttpRequestTest.php similarity index 98% rename from tests/Http/RequestTest.php rename to tests/Http/HttpRequestTest.php index d395038820a1..753741143306 100644 --- a/tests/Http/RequestTest.php +++ b/tests/Http/HttpRequestTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Http\Request; -class RequestTest extends PHPUnit_Framework_TestCase { +class HttpRequestTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Http/ResponseTest.php b/tests/Http/HttpResponseTest.php similarity index 97% rename from tests/Http/ResponseTest.php rename to tests/Http/HttpResponseTest.php index b8c6b24310a4..4e34ed489612 100644 --- a/tests/Http/ResponseTest.php +++ b/tests/Http/HttpResponseTest.php @@ -5,7 +5,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Support\Contracts\JsonableInterface; -class ResponseTest extends PHPUnit_Framework_TestCase { +class HttpResponseTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Log/WriterTest.php b/tests/Log/LogWriterTest.php similarity index 93% rename from tests/Log/WriterTest.php rename to tests/Log/LogWriterTest.php index 4886ebddf1d7..5ae03b8b7ed2 100644 --- a/tests/Log/WriterTest.php +++ b/tests/Log/LogWriterTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Log\Writer; -class WriterTest extends PHPUnit_Framework_TestCase { +class LogWriterTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Mail/MailerTest.php b/tests/Mail/MailMailerTest.php similarity index 99% rename from tests/Mail/MailerTest.php rename to tests/Mail/MailMailerTest.php index 3ce940c6f816..067cd4fdfdf5 100644 --- a/tests/Mail/MailerTest.php +++ b/tests/Mail/MailMailerTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class MailerTest extends PHPUnit_Framework_TestCase { +class MailMailerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Mail/MessageTest.php b/tests/Mail/MailMessageTest.php similarity index 95% rename from tests/Mail/MessageTest.php rename to tests/Mail/MailMessageTest.php index a6241d392e74..364ff7ac9330 100644 --- a/tests/Mail/MessageTest.php +++ b/tests/Mail/MailMessageTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class MessageTest extends PHPUnit_Framework_TestCase { +class MailMessageTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/BootstrapPresenterTest.php b/tests/Pagination/PaginationBootstrapPresenterTest.php similarity index 98% rename from tests/Pagination/BootstrapPresenterTest.php rename to tests/Pagination/PaginationBootstrapPresenterTest.php index 85df1f52e4e6..2b303e46d239 100644 --- a/tests/Pagination/BootstrapPresenterTest.php +++ b/tests/Pagination/PaginationBootstrapPresenterTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\BootstrapPresenter; -class BootstrapPresenterTest extends PHPUnit_Framework_TestCase { +class PaginationBootstrapPresenterTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/EnvironmentTest.php b/tests/Pagination/PaginationEnvironmentTest.php similarity index 97% rename from tests/Pagination/EnvironmentTest.php rename to tests/Pagination/PaginationEnvironmentTest.php index 33c5af55cf5e..539bcd883405 100644 --- a/tests/Pagination/EnvironmentTest.php +++ b/tests/Pagination/PaginationEnvironmentTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\Environment; -class EnvironmentTest extends PHPUnit_Framework_TestCase { +class PaginationEnvironmentTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/PaginatorTest.php b/tests/Pagination/PaginationPaginatorTest.php similarity index 97% rename from tests/Pagination/PaginatorTest.php rename to tests/Pagination/PaginationPaginatorTest.php index ac2e34fc98e2..9b0694859ffa 100644 --- a/tests/Pagination/PaginatorTest.php +++ b/tests/Pagination/PaginationPaginatorTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\Paginator; -class PaginatorTest extends PHPUnit_Framework_TestCase { +class PaginationPaginatorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Queue/BeanstalkdJobTest.php b/tests/Queue/QueueBeanstalkdJobTest.php similarity index 91% rename from tests/Queue/BeanstalkdJobTest.php rename to tests/Queue/QueueBeanstalkdJobTest.php index b52e791ca668..dc4b77cc9648 100644 --- a/tests/Queue/BeanstalkdJobTest.php +++ b/tests/Queue/QueueBeanstalkdJobTest.php @@ -1,51 +1,51 @@ -getJob(); - $job->getPheanstalkJob()->shouldReceive('getData')->once()->andReturn(serialize(array('job' => 'foo', 'data' => array('data')))); - $job->getContainer()->shouldReceive('make')->once()->with('foo')->andReturn($handler = m::mock('StdClass')); - $handler->shouldReceive('fire')->once()->with($job, array('data')); - - $job->fire(); - } - - - public function testDeleteRemovesTheJobFromBeanstalkd() - { - $job = $this->getJob(); - $job->getPheanstalk()->shouldReceive('delete')->once()->with($job->getPheanstalkJob()); - - $job->delete(); - } - - - public function testReleaseProperlyReleasesJobOntoBeanstalkd() - { - $job = $this->getJob(); - $job->getPheanstalk()->shouldReceive('release')->once()->with($job->getPheanstalkJob(), Pheanstalk::DEFAULT_PRIORITY, 0); - - $job->release(); - } - - - protected function getJob() - { - return new Illuminate\Queue\Jobs\BeanstalkdJob( - m::mock('Illuminate\Container\Container'), - m::mock('Pheanstalk'), - m::mock('Pheanstalk_Job') - ); - } - +getJob(); + $job->getPheanstalkJob()->shouldReceive('getData')->once()->andReturn(serialize(array('job' => 'foo', 'data' => array('data')))); + $job->getContainer()->shouldReceive('make')->once()->with('foo')->andReturn($handler = m::mock('StdClass')); + $handler->shouldReceive('fire')->once()->with($job, array('data')); + + $job->fire(); + } + + + public function testDeleteRemovesTheJobFromBeanstalkd() + { + $job = $this->getJob(); + $job->getPheanstalk()->shouldReceive('delete')->once()->with($job->getPheanstalkJob()); + + $job->delete(); + } + + + public function testReleaseProperlyReleasesJobOntoBeanstalkd() + { + $job = $this->getJob(); + $job->getPheanstalk()->shouldReceive('release')->once()->with($job->getPheanstalkJob(), Pheanstalk::DEFAULT_PRIORITY, 0); + + $job->release(); + } + + + protected function getJob() + { + return new Illuminate\Queue\Jobs\BeanstalkdJob( + m::mock('Illuminate\Container\Container'), + m::mock('Pheanstalk'), + m::mock('Pheanstalk_Job') + ); + } + } \ No newline at end of file diff --git a/tests/Queue/BeanstalkdQueueTest.php b/tests/Queue/QueueBeanstalkdQueueTest.php similarity index 94% rename from tests/Queue/BeanstalkdQueueTest.php rename to tests/Queue/QueueBeanstalkdQueueTest.php index 231fa5d90384..73d71c1c3dd5 100644 --- a/tests/Queue/BeanstalkdQueueTest.php +++ b/tests/Queue/QueueBeanstalkdQueueTest.php @@ -1,53 +1,53 @@ -getPheanstalk(); - $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data')))); - - $queue->push('foo', array('data'), 'stack'); - $queue->push('foo', array('data')); - } - - - public function testDelayedPushProperlyPushesJobOntoBeanstalkd() - { - $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); - $pheanstalk = $queue->getPheanstalk(); - $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data'))), Pheanstalk::DEFAULT_PRIORITY, 5); - - $queue->later(5, 'foo', array('data'), 'stack'); - $queue->later(5, 'foo', array('data')); - } - - - public function testPopProperlyPopsJobOffOfBeanstalkd() - { - $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); - $queue->setContainer(m::mock('Illuminate\Container\Container')); - $pheanstalk = $queue->getPheanstalk(); - $pheanstalk->shouldReceive('watchOnly')->once()->with('default')->andReturn($pheanstalk); - $job = m::mock('Pheanstalk_Job'); - $pheanstalk->shouldReceive('reserve')->once()->andReturn($job); - - $result = $queue->pop(); - - $this->assertInstanceOf('Illuminate\Queue\Jobs\BeanstalkdJob', $result); - } - +getPheanstalk(); + $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data')))); + + $queue->push('foo', array('data'), 'stack'); + $queue->push('foo', array('data')); + } + + + public function testDelayedPushProperlyPushesJobOntoBeanstalkd() + { + $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); + $pheanstalk = $queue->getPheanstalk(); + $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data'))), Pheanstalk::DEFAULT_PRIORITY, 5); + + $queue->later(5, 'foo', array('data'), 'stack'); + $queue->later(5, 'foo', array('data')); + } + + + public function testPopProperlyPopsJobOffOfBeanstalkd() + { + $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); + $queue->setContainer(m::mock('Illuminate\Container\Container')); + $pheanstalk = $queue->getPheanstalk(); + $pheanstalk->shouldReceive('watchOnly')->once()->with('default')->andReturn($pheanstalk); + $job = m::mock('Pheanstalk_Job'); + $pheanstalk->shouldReceive('reserve')->once()->andReturn($job); + + $result = $queue->pop(); + + $this->assertInstanceOf('Illuminate\Queue\Jobs\BeanstalkdJob', $result); + } + } \ No newline at end of file diff --git a/tests/Queue/ListenerTest.php b/tests/Queue/QueueListenerTest.php similarity index 94% rename from tests/Queue/ListenerTest.php rename to tests/Queue/QueueListenerTest.php index fdddd3e879e8..7075fb54ee57 100644 --- a/tests/Queue/ListenerTest.php +++ b/tests/Queue/QueueListenerTest.php @@ -1,88 +1,88 @@ -setManager(m::mock('Illuminate\Queue\QueueManager')); - $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); - $queue->shouldReceive('pop')->twice()->with('queue')->andReturn($job = m::mock('Illuminate\Queue\Jobs\Job')); - $l->shouldReceive('process')->twice()->with($job, 1); - $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); - $l->shouldReceive('stop')->once(); - - $l->listen('foo', 'queue', 1, 128); - } - - - public function testListenerSleepsWhenNoJobToProcess() - { - $l = m::mock('Illuminate\Queue\Listener[process,memoryExceeded,stop,sleep]'); - $l->setManager(m::mock('Illuminate\Queue\QueueManager')); - $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); - $queue->shouldReceive('pop')->with('queue')->andReturn(null, $job = m::mock('Illuminate\Queue\Jobs\Job')); - $l->shouldReceive('sleep')->once()->with(1); - $l->shouldReceive('process')->once()->with($job, 1); - $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); - $l->shouldReceive('stop')->once(); - - $l->listen('foo', 'queue', 1, 128); - } - - - public function testProcessJobFiresJob() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once(); - $job->shouldReceive('autoDelete')->once()->andReturn(false); - - $l->process($job, 0); - } - - - public function testProcessJobFiresJobAndDeletesItWhenAutoDeleting() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once(); - $job->shouldReceive('autoDelete')->once()->andReturn(true); - $job->shouldReceive('delete')->once(); - - $l->process($job, 0); - } - - - /** - * @expectedException RuntimeException - */ - public function testJobIsReleasedWhenExceptionOccurs() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once()->andReturnUsing(function() - { - throw new RuntimeException; - }); - $job->shouldReceive('release')->once()->with(1); - - $l->process($job, 1); - } - - - protected function getListener() - { - return new Listener(m::mock('Illuminate\Queue\QueueManager')); - } - +setManager(m::mock('Illuminate\Queue\QueueManager')); + $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); + $queue->shouldReceive('pop')->twice()->with('queue')->andReturn($job = m::mock('Illuminate\Queue\Jobs\Job')); + $l->shouldReceive('process')->twice()->with($job, 1); + $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); + $l->shouldReceive('stop')->once(); + + $l->listen('foo', 'queue', 1, 128); + } + + + public function testListenerSleepsWhenNoJobToProcess() + { + $l = m::mock('Illuminate\Queue\Listener[process,memoryExceeded,stop,sleep]'); + $l->setManager(m::mock('Illuminate\Queue\QueueManager')); + $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); + $queue->shouldReceive('pop')->with('queue')->andReturn(null, $job = m::mock('Illuminate\Queue\Jobs\Job')); + $l->shouldReceive('sleep')->once()->with(1); + $l->shouldReceive('process')->once()->with($job, 1); + $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); + $l->shouldReceive('stop')->once(); + + $l->listen('foo', 'queue', 1, 128); + } + + + public function testProcessJobFiresJob() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once(); + $job->shouldReceive('autoDelete')->once()->andReturn(false); + + $l->process($job, 0); + } + + + public function testProcessJobFiresJobAndDeletesItWhenAutoDeleting() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once(); + $job->shouldReceive('autoDelete')->once()->andReturn(true); + $job->shouldReceive('delete')->once(); + + $l->process($job, 0); + } + + + /** + * @expectedException RuntimeException + */ + public function testJobIsReleasedWhenExceptionOccurs() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once()->andReturnUsing(function() + { + throw new RuntimeException; + }); + $job->shouldReceive('release')->once()->with(1); + + $l->process($job, 1); + } + + + protected function getListener() + { + return new Listener(m::mock('Illuminate\Queue\QueueManager')); + } + } \ No newline at end of file diff --git a/tests/Queue/SyncJobTest.php b/tests/Queue/QueueSyncJobTest.php similarity index 85% rename from tests/Queue/SyncJobTest.php rename to tests/Queue/QueueSyncJobTest.php index 76973034b322..402b17133df0 100644 --- a/tests/Queue/SyncJobTest.php +++ b/tests/Queue/QueueSyncJobTest.php @@ -1,24 +1,24 @@ -shouldReceive('make')->once()->with('Foo')->andReturn($handler); - $handler->shouldReceive('fire')->once()->with($job, 'data'); - - $job->fire(); - } - +shouldReceive('make')->once()->with('Foo')->andReturn($handler); + $handler->shouldReceive('fire')->once()->with($job, 'data'); + + $job->fire(); + } + } \ No newline at end of file diff --git a/tests/Queue/SyncQueueTest.php b/tests/Queue/QueueSyncQueueTest.php similarity index 84% rename from tests/Queue/SyncQueueTest.php rename to tests/Queue/QueueSyncQueueTest.php index 474aab9cf7f1..bd498f4fde4e 100644 --- a/tests/Queue/SyncQueueTest.php +++ b/tests/Queue/QueueSyncQueueTest.php @@ -1,23 +1,23 @@ -getMock('Illuminate\Queue\SyncQueue', array('resolveJob')); - $job = m::mock('StdClass'); - $sync->expects($this->once())->method('resolveJob')->with($this->equalTo('Foo'), $this->equalTo(''))->will($this->returnValue($job)); - $job->shouldReceive('fire')->once(); - - $sync->push('Foo'); - } - +getMock('Illuminate\Queue\SyncQueue', array('resolveJob')); + $job = m::mock('StdClass'); + $sync->expects($this->once())->method('resolveJob')->with($this->equalTo('Foo'), $this->equalTo(''))->will($this->returnValue($job)); + $job->shouldReceive('fire')->once(); + + $sync->push('Foo'); + } + } \ No newline at end of file diff --git a/tests/Routing/ControllerGeneratorTest.php b/tests/Routing/RoutingControllerGeneratorTest.php similarity index 94% rename from tests/Routing/ControllerGeneratorTest.php rename to tests/Routing/RoutingControllerGeneratorTest.php index 5d5e5ea1193e..4dfc212ddc94 100644 --- a/tests/Routing/ControllerGeneratorTest.php +++ b/tests/Routing/RoutingControllerGeneratorTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Routing\Generators\ControllerGenerator; -class ControllerGeneratorTest extends PHPUnit_Framework_TestCase { +class RoutingControllerGeneratorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingControllerInspectorTest.php b/tests/Routing/RoutingControllerInspectorTest.php new file mode 100644 index 000000000000..5d55eea6cbd4 --- /dev/null +++ b/tests/Routing/RoutingControllerInspectorTest.php @@ -0,0 +1,28 @@ +getRoutable('RoutingControllerInspectorStub', 'prefix'); + + $this->assertEquals(3, count($data)); + $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix', 'uri' => 'prefix'), $data['getIndex'][1]); + $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix/index', 'uri' => 'prefix/index/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['getIndex'][0]); + $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix/foo-bar', 'uri' => 'prefix/foo-bar/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['getFooBar'][0]); + $this->assertEquals(array('verb' => 'post', 'plain' => 'prefix/baz', 'uri' => 'prefix/baz/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['postBaz'][0]); + } + +} + +class RoutingControllerInspectorBaseStub { + public function getBreeze() {} +} + +class RoutingControllerInspectorStub extends RoutingControllerInspectorBaseStub { + public function getIndex() {} + public function getFooBar() {} + public function postBaz() {} + protected function getBoom() {} +} \ No newline at end of file diff --git a/tests/Routing/ControllerTest.php b/tests/Routing/RoutingControllerTest.php similarity index 99% rename from tests/Routing/ControllerTest.php rename to tests/Routing/RoutingControllerTest.php index ce5d85fc0603..547e0c4a9a2d 100644 --- a/tests/Routing/ControllerTest.php +++ b/tests/Routing/RoutingControllerTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Symfony\Component\HttpFoundation\Response; -class ControllerTest extends PHPUnit_Framework_TestCase { +class RoutingControllerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/FilterParserTest.php b/tests/Routing/RoutingFilterParserTest.php similarity index 93% rename from tests/Routing/FilterParserTest.php rename to tests/Routing/RoutingFilterParserTest.php index 444a9ea2fcb6..07a510b4fb5e 100644 --- a/tests/Routing/FilterParserTest.php +++ b/tests/Routing/RoutingFilterParserTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Symfony\Component\HttpFoundation\Request; -class FilterParserTest extends PHPUnit_Framework_TestCase { +class RoutingFilterParserTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/FilterTest.php b/tests/Routing/RoutingFilterTest.php similarity index 97% rename from tests/Routing/FilterTest.php rename to tests/Routing/RoutingFilterTest.php index 57047d45747d..e2dca943f3ff 100644 --- a/tests/Routing/FilterTest.php +++ b/tests/Routing/RoutingFilterTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class AnnotationTest extends PHPUnit_Framework_TestCase { +class RoutingFilterTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/MakeControllerCommandTest.php b/tests/Routing/RoutingMakeControllerCommandTest.php similarity index 94% rename from tests/Routing/MakeControllerCommandTest.php rename to tests/Routing/RoutingMakeControllerCommandTest.php index 6f030b0678f2..edf9cf98889d 100644 --- a/tests/Routing/MakeControllerCommandTest.php +++ b/tests/Routing/RoutingMakeControllerCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class MakeControllerCommandTest extends PHPUnit_Framework_TestCase { +class RoutingMakeControllerCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingTest.php b/tests/Routing/RoutingTest.php index 148755f30751..99d0354a5ec3 100644 --- a/tests/Routing/RoutingTest.php +++ b/tests/Routing/RoutingTest.php @@ -110,52 +110,6 @@ public function testControllersAreCalledFromControllerRoutes() } - public function testControllerMethodBackReferencesCanBeUsed() - { - $router = new Router; - $container = m::mock('Illuminate\Container\Container'); - $controller = m::mock('stdClass'); - $controller->shouldReceive('callAction')->once()->with($container, $router, 'getBar', array('1', 'taylor'))->andReturn('foo'); - $container->shouldReceive('make')->once()->with('home')->andReturn($controller); - $router->setContainer($container); - $request = Request::create('/foo/bar/1/taylor', 'GET'); - $router->get('/foo/{name}/{id}/{person}', 'home@{name}'); - - $this->assertEquals('foo', $router->dispatch($request)->getContent()); - } - - - public function testControllerMethodBackReferencesUseGetMethodOnHeadRequest() - { - $router = new Router; - $container = m::mock('Illuminate\Container\Container'); - $controller = m::mock('stdClass'); - $controller->shouldReceive('callAction')->once()->with($container, $router, 'getBar', array('1', 'taylor'))->andReturn('foo'); - $container->shouldReceive('make')->once()->with('home')->andReturn($controller); - $router->setContainer($container); - $request = Request::create('/foo/bar/1/taylor', 'HEAD'); - $router->get('/foo/{name}/{id}/{person}', 'home@{name}'); - - // HEAD requests won't return content - $this->assertEquals('', $router->dispatch($request)->getOriginalContent()); - } - - - public function testControllerMethodBackReferencesCanPointToIndex() - { - $router = new Router; - $container = m::mock('Illuminate\Container\Container'); - $controller = m::mock('stdClass'); - $controller->shouldReceive('callAction')->once()->with($container, $router, 'postIndex', array())->andReturn('foo'); - $container->shouldReceive('make')->once()->with('home')->andReturn($controller); - $router->setContainer($container); - $request = Request::create('/foo', 'POST'); - $router->post('/foo/{method?}', 'home@{method}'); - - $this->assertEquals('foo', $router->dispatch($request)->getContent()); - } - - public function testControllersAreCalledFromControllerRoutesWithUsesStatement() { $router = new Router; @@ -429,4 +383,19 @@ public function testCurrentRouteActionCanBeChecked() $this->assertFalse($router->currentRouteUses('bar.route@action')); } + + public function testControllerMethodProperlyRegistersRoutes() + { + $router = $this->getMock('Illuminate\Routing\Router', array('get'), array(new Illuminate\Container\Container)); + $router->setInspector($inspector = m::mock('Illuminate\Routing\Controllers\Inspector')); + $inspector->shouldReceive('getRoutable')->once()->with('FooController', 'prefix')->andReturn(array( + 'getFoo' => array( + array('verb' => 'get', 'uri' => 'foo'), + ) + )); + $router->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo('FooController@getFoo')); + + $router->controller('FooController', 'prefix'); + } + } \ No newline at end of file diff --git a/tests/Routing/UrlGeneratorTest.php b/tests/Routing/RoutingUrlGeneratorTest.php similarity index 98% rename from tests/Routing/UrlGeneratorTest.php rename to tests/Routing/RoutingUrlGeneratorTest.php index 9105a9919a34..8290ec0ad00d 100644 --- a/tests/Routing/UrlGeneratorTest.php +++ b/tests/Routing/RoutingUrlGeneratorTest.php @@ -5,7 +5,7 @@ use Illuminate\Routing\Router; use Illuminate\Routing\UrlGenerator; -class UrlGeneratorTest extends PHPUnit_Framework_TestCase { +class RoutingUrlGeneratorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/CacheDrivenStoreTest.php b/tests/Session/SessionCacheDrivenStoreTest.php similarity index 94% rename from tests/Session/CacheDrivenStoreTest.php rename to tests/Session/SessionCacheDrivenStoreTest.php index 85bb90ba8841..218bf093e11a 100644 --- a/tests/Session/CacheDrivenStoreTest.php +++ b/tests/Session/SessionCacheDrivenStoreTest.php @@ -2,7 +2,7 @@ use Symfony\Component\HttpFoundation\Response; -class CacheDrivenStoreTest extends PHPUnit_Framework_TestCase { +class SessionCacheDrivenStoreTest extends PHPUnit_Framework_TestCase { public function testRetrieveCallsCache() { diff --git a/tests/Session/CookieStoreTest.php b/tests/Session/SessionCookieStoreTest.php similarity index 97% rename from tests/Session/CookieStoreTest.php rename to tests/Session/SessionCookieStoreTest.php index a8b2f4ec5357..520414283174 100644 --- a/tests/Session/CookieStoreTest.php +++ b/tests/Session/SessionCookieStoreTest.php @@ -5,7 +5,7 @@ use Illuminate\Session\CookieStore; use Symfony\Component\HttpFoundation\Request; -class CookieStoreTest extends PHPUnit_Framework_TestCase { +class SessionCookieStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/DatabaseStoreTest.php b/tests/Session/SessionDatabaseStoreTest.php similarity index 97% rename from tests/Session/DatabaseStoreTest.php rename to tests/Session/SessionDatabaseStoreTest.php index d0b5800c7c7a..eb0371c90192 100644 --- a/tests/Session/DatabaseStoreTest.php +++ b/tests/Session/SessionDatabaseStoreTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Session\DatabaseStore; -class DatabaseStoreTest extends PHPUnit_Framework_TestCase { +class SessionDatabaseStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/FileStoreTest.php b/tests/Session/SessionFileStoreTest.php similarity index 97% rename from tests/Session/FileStoreTest.php rename to tests/Session/SessionFileStoreTest.php index 6188cf996727..1e91bea78fa6 100644 --- a/tests/Session/FileStoreTest.php +++ b/tests/Session/SessionFileStoreTest.php @@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -class FileStoreTest extends PHPUnit_Framework_TestCase { +class SessionFileStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/StoreTest.php b/tests/Session/SessionStoreTest.php similarity index 99% rename from tests/Session/StoreTest.php rename to tests/Session/SessionStoreTest.php index c941690a2864..6c5a5aab0ee8 100644 --- a/tests/Session/StoreTest.php +++ b/tests/Session/SessionStoreTest.php @@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -class StoreTest extends PHPUnit_Framework_TestCase { +class SessionStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Support/FacadeTest.php b/tests/Support/SupportFacadeTest.php similarity index 88% rename from tests/Support/FacadeTest.php rename to tests/Support/SupportFacadeTest.php index 3cb2a2b6940b..88cbf5b21bf7 100644 --- a/tests/Support/FacadeTest.php +++ b/tests/Support/SupportFacadeTest.php @@ -1,6 +1,6 @@ add('foo', 'bar'); - $container->add('foo', 'bar'); - $messages = $container->getMessages(); - $this->assertEquals(array('bar'), $messages['foo']); - } - - - public function testMessagesAreAdded() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $container->add('boom', 'bust'); - $messages = $container->getMessages(); - $this->assertEquals(array('bar', 'baz'), $messages['foo']); - $this->assertEquals(array('bust'), $messages['boom']); - } - - - public function testGetReturnsArrayOfMessagesByKey() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $this->assertEquals(array('bar', 'baz'), $container->get('foo')); - } - - - public function testFirstReturnsSingleMessage() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $messages = $container->getMessages(); - $this->assertEquals('bar', $container->first('foo')); - } - - - public function testHasIndicatesExistence() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $this->assertTrue($container->has('foo')); - $this->assertFalse($container->has('bar')); - } - - - public function testAllReturnsAllMessages() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('boom', 'baz'); - $this->assertEquals(array('bar', 'baz'), $container->all()); - } - - - public function testFormatIsRespected() - { - $container = new MessageBag; - $container->setFormat('

:message

'); - $container->add('foo', 'bar'); - $container->add('boom', 'baz'); - $this->assertEquals('

bar

', $container->first('foo')); - $this->assertEquals(array('

bar

'), $container->get('foo')); - $this->assertEquals(array('

bar

', '

baz

'), $container->all()); - $this->assertEquals('bar', $container->first('foo', ':message')); - $this->assertEquals(array('bar'), $container->get('foo', ':message')); - $this->assertEquals(array('bar', 'baz'), $container->all(':message')); - } - +add('foo', 'bar'); + $container->add('foo', 'bar'); + $messages = $container->getMessages(); + $this->assertEquals(array('bar'), $messages['foo']); + } + + + public function testMessagesAreAdded() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $container->add('boom', 'bust'); + $messages = $container->getMessages(); + $this->assertEquals(array('bar', 'baz'), $messages['foo']); + $this->assertEquals(array('bust'), $messages['boom']); + } + + + public function testGetReturnsArrayOfMessagesByKey() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $this->assertEquals(array('bar', 'baz'), $container->get('foo')); + } + + + public function testFirstReturnsSingleMessage() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $messages = $container->getMessages(); + $this->assertEquals('bar', $container->first('foo')); + } + + + public function testHasIndicatesExistence() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $this->assertTrue($container->has('foo')); + $this->assertFalse($container->has('bar')); + } + + + public function testAllReturnsAllMessages() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('boom', 'baz'); + $this->assertEquals(array('bar', 'baz'), $container->all()); + } + + + public function testFormatIsRespected() + { + $container = new MessageBag; + $container->setFormat('

:message

'); + $container->add('foo', 'bar'); + $container->add('boom', 'baz'); + $this->assertEquals('

bar

', $container->first('foo')); + $this->assertEquals(array('

bar

'), $container->get('foo')); + $this->assertEquals(array('

bar

', '

baz

'), $container->all()); + $this->assertEquals('bar', $container->first('foo', ':message')); + $this->assertEquals(array('bar'), $container->get('foo', ':message')); + $this->assertEquals(array('bar', 'baz'), $container->all(':message')); + } + } \ No newline at end of file diff --git a/tests/Support/NamespacedItemResolverTest.php b/tests/Support/SupportNamespacedItemResolverTest.php similarity index 91% rename from tests/Support/NamespacedItemResolverTest.php rename to tests/Support/SupportNamespacedItemResolverTest.php index 738c3dadb5d6..219af6348f2e 100644 --- a/tests/Support/NamespacedItemResolverTest.php +++ b/tests/Support/SupportNamespacedItemResolverTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\NamespacedItemResolver; -class NamespacedItemResolverTest extends PHPUnit_Framework_TestCase { +class SupportNamespacedItemResolverTest extends PHPUnit_Framework_TestCase { public function testResolution() { diff --git a/tests/Support/SupportPluralizerTest.php b/tests/Support/SupportPluralizerTest.php new file mode 100644 index 000000000000..36c90e083f5f --- /dev/null +++ b/tests/Support/SupportPluralizerTest.php @@ -0,0 +1,15 @@ +assertEquals('children', str_plural('child')); + $this->assertEquals('tests', str_plural('test')); + $this->assertEquals('deer', str_plural('deer')); + $this->assertEquals('child', str_singular('children')); + $this->assertEquals('test', str_singular('tests')); + $this->assertEquals('deer', str_singular('deer')); + } + +} \ No newline at end of file diff --git a/tests/Support/ServiceProviderTest.php b/tests/Support/SupportServiceProviderTest.php similarity index 87% rename from tests/Support/ServiceProviderTest.php rename to tests/Support/SupportServiceProviderTest.php index a3a25623f6ac..350dbbc6b6b0 100644 --- a/tests/Support/ServiceProviderTest.php +++ b/tests/Support/SupportServiceProviderTest.php @@ -1,6 +1,6 @@ Date: Fri, 18 Jan 2013 09:43:33 +0100 Subject: [PATCH 5/5] Revert "L4 merge" This reverts commit e9c98dce31cd72ff8d60884cba37084625d382a7. --- .gitattributes | 2 - composer.json | 155 +++++++------ readme.md | 7 - src/Illuminate/Auth/Guard.php | 14 -- src/Illuminate/Cache/CacheManager.php | 10 - src/Illuminate/Cache/WinCacheStore.php | 85 ------- src/Illuminate/Database/Eloquent/Model.php | 2 +- src/Illuminate/Exception/Handler.php | 2 +- src/Illuminate/Hashing/BcryptHasher.php | 34 ++- src/Illuminate/Hashing/composer.json | 3 +- .../Routing/Controllers/Inspector.php | 129 ----------- src/Illuminate/Routing/Router.php | 134 +++++------ src/Illuminate/Session/SessionManager.php | 10 - src/Illuminate/Support/Pluralizer.php | 212 ------------------ src/Illuminate/Support/helpers.php | 34 +-- tests/Auth/AuthGuardTest.php | 12 - tests/Database/DatabaseEloquentModelTest.php | 11 +- ...sDispatcherTest.php => DispatcherTest.php} | 2 +- ...liasLoaderTest.php => AliasLoaderTest.php} | 2 +- ...pplicationTest.php => ApplicationTest.php} | 2 +- ...ndationArtisanTest.php => ArtisanTest.php} | 2 +- ...ndTest.php => AssetPublishCommandTest.php} | 2 +- ...blisherTest.php => AssetPublisherTest.php} | 2 +- ...lassLoaderTest.php => ClassLoaderTest.php} | 2 +- ...ationComposerTest.php => ComposerTest.php} | 2 +- ...dTest.php => ConfigPublishCommandTest.php} | 2 +- ...lisherTest.php => ConfigPublisherTest.php} | 2 +- .../{HttpRequestTest.php => RequestTest.php} | 2 +- ...{HttpResponseTest.php => ResponseTest.php} | 2 +- .../Log/{LogWriterTest.php => WriterTest.php} | 2 +- .../{MailMailerTest.php => MailerTest.php} | 2 +- .../{MailMessageTest.php => MessageTest.php} | 2 +- ...terTest.php => BootstrapPresenterTest.php} | 2 +- ...nvironmentTest.php => EnvironmentTest.php} | 2 +- ...ionPaginatorTest.php => PaginatorTest.php} | 2 +- ...talkdJobTest.php => BeanstalkdJobTest.php} | 100 ++++----- ...dQueueTest.php => BeanstalkdQueueTest.php} | 104 ++++----- ...QueueListenerTest.php => ListenerTest.php} | 174 +++++++------- .../{QueueSyncJobTest.php => SyncJobTest.php} | 46 ++-- ...eueSyncQueueTest.php => SyncQueueTest.php} | 44 ++-- ...orTest.php => ControllerGeneratorTest.php} | 2 +- ...gControllerTest.php => ControllerTest.php} | 2 +- ...terParserTest.php => FilterParserTest.php} | 2 +- .../{RoutingFilterTest.php => FilterTest.php} | 2 +- ...Test.php => MakeControllerCommandTest.php} | 2 +- .../RoutingControllerInspectorTest.php | 28 --- tests/Routing/RoutingTest.php | 61 +++-- ...GeneratorTest.php => UrlGeneratorTest.php} | 2 +- ...StoreTest.php => CacheDrivenStoreTest.php} | 2 +- ...ookieStoreTest.php => CookieStoreTest.php} | 2 +- ...aseStoreTest.php => DatabaseStoreTest.php} | 2 +- ...ionFileStoreTest.php => FileStoreTest.php} | 2 +- .../{SessionStoreTest.php => StoreTest.php} | 2 +- .../{SupportFacadeTest.php => FacadeTest.php} | 2 +- ...SupportHelpersTest.php => HelpersTest.php} | 2 +- ...tMessageBagTest.php => MessageBagTest.php} | 168 +++++++------- ...est.php => NamespacedItemResolverTest.php} | 2 +- ...oviderTest.php => ServiceProviderTest.php} | 2 +- tests/Support/SupportPluralizerTest.php | 15 -- ...nTranslatorTest.php => TranslatorTest.php} | 2 +- ...ionValidatorTest.php => ValidatorTest.php} | 2 +- ...CompilerTest.php => BladeCompilerTest.php} | 2 +- ...rEngineTest.php => CompilerEngineTest.php} | 2 +- ...esolverTest.php => EngineResolverTest.php} | 2 +- ...wFinderTest.php => FileViewFinderTest.php} | 0 ...iewPhpEngineTest.php => PhpEngineTest.php} | 2 +- 66 files changed, 588 insertions(+), 1086 deletions(-) delete mode 100644 .gitattributes delete mode 100644 readme.md delete mode 100644 src/Illuminate/Cache/WinCacheStore.php delete mode 100644 src/Illuminate/Routing/Controllers/Inspector.php delete mode 100644 src/Illuminate/Support/Pluralizer.php rename tests/Events/{EventsDispatcherTest.php => DispatcherTest.php} (94%) rename tests/Foundation/{FoundationAliasLoaderTest.php => AliasLoaderTest.php} (91%) rename tests/Foundation/{FoundationApplicationTest.php => ApplicationTest.php} (98%) rename tests/Foundation/{FoundationArtisanTest.php => ArtisanTest.php} (92%) rename tests/Foundation/{FoundationAssetPublishCommandTest.php => AssetPublishCommandTest.php} (86%) rename tests/Foundation/{FoundationAssetPublisherTest.php => AssetPublisherTest.php} (93%) rename tests/Foundation/{FoundationClassLoaderTest.php => ClassLoaderTest.php} (91%) rename tests/Foundation/{FoundationComposerTest.php => ComposerTest.php} (95%) rename tests/Foundation/{FoundationConfigPublishCommandTest.php => ConfigPublishCommandTest.php} (86%) rename tests/Foundation/{FoundationConfigPublisherTest.php => ConfigPublisherTest.php} (94%) rename tests/Http/{HttpRequestTest.php => RequestTest.php} (98%) rename tests/Http/{HttpResponseTest.php => ResponseTest.php} (97%) rename tests/Log/{LogWriterTest.php => WriterTest.php} (93%) rename tests/Mail/{MailMailerTest.php => MailerTest.php} (99%) rename tests/Mail/{MailMessageTest.php => MessageTest.php} (95%) rename tests/Pagination/{PaginationBootstrapPresenterTest.php => BootstrapPresenterTest.php} (98%) rename tests/Pagination/{PaginationEnvironmentTest.php => EnvironmentTest.php} (97%) rename tests/Pagination/{PaginationPaginatorTest.php => PaginatorTest.php} (97%) rename tests/Queue/{QueueBeanstalkdJobTest.php => BeanstalkdJobTest.php} (91%) rename tests/Queue/{QueueBeanstalkdQueueTest.php => BeanstalkdQueueTest.php} (94%) rename tests/Queue/{QueueListenerTest.php => ListenerTest.php} (94%) rename tests/Queue/{QueueSyncJobTest.php => SyncJobTest.php} (85%) rename tests/Queue/{QueueSyncQueueTest.php => SyncQueueTest.php} (84%) rename tests/Routing/{RoutingControllerGeneratorTest.php => ControllerGeneratorTest.php} (94%) rename tests/Routing/{RoutingControllerTest.php => ControllerTest.php} (99%) rename tests/Routing/{RoutingFilterParserTest.php => FilterParserTest.php} (93%) rename tests/Routing/{RoutingFilterTest.php => FilterTest.php} (97%) rename tests/Routing/{RoutingMakeControllerCommandTest.php => MakeControllerCommandTest.php} (94%) delete mode 100644 tests/Routing/RoutingControllerInspectorTest.php rename tests/Routing/{RoutingUrlGeneratorTest.php => UrlGeneratorTest.php} (98%) rename tests/Session/{SessionCacheDrivenStoreTest.php => CacheDrivenStoreTest.php} (94%) rename tests/Session/{SessionCookieStoreTest.php => CookieStoreTest.php} (97%) rename tests/Session/{SessionDatabaseStoreTest.php => DatabaseStoreTest.php} (97%) rename tests/Session/{SessionFileStoreTest.php => FileStoreTest.php} (97%) rename tests/Session/{SessionStoreTest.php => StoreTest.php} (99%) rename tests/Support/{SupportFacadeTest.php => FacadeTest.php} (88%) rename tests/Support/{SupportHelpersTest.php => HelpersTest.php} (98%) rename tests/Support/{SupportMessageBagTest.php => MessageBagTest.php} (94%) rename tests/Support/{SupportNamespacedItemResolverTest.php => NamespacedItemResolverTest.php} (91%) rename tests/Support/{SupportServiceProviderTest.php => ServiceProviderTest.php} (87%) delete mode 100644 tests/Support/SupportPluralizerTest.php rename tests/Translation/{TranslationTranslatorTest.php => TranslatorTest.php} (98%) rename tests/Validation/{ValidationValidatorTest.php => ValidatorTest.php} (99%) rename tests/View/{ViewBladeCompilerTest.php => BladeCompilerTest.php} (99%) rename tests/View/{ViewCompilerEngineTest.php => CompilerEngineTest.php} (95%) rename tests/View/{ViewEngineResolverTest.php => EngineResolverTest.php} (82%) rename tests/View/{ViewFileViewFinderTest.php => FileViewFinderTest.php} (100%) rename tests/View/{ViewPhpEngineTest.php => PhpEngineTest.php} (82%) diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 2e5533a77dfd..000000000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/build export-ignore -/tests export-ignore \ No newline at end of file diff --git a/composer.json b/composer.json index f485bfa705e0..438ba64c1536 100644 --- a/composer.json +++ b/composer.json @@ -1,78 +1,77 @@ -{ - "name": "laravel/framework", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "ircmaxell/password-compat": "1.0.*", - "monolog/monolog": "1.3.*", - "swiftmailer/swiftmailer": "4.3.*", - "symfony/browser-kit": "2.2.*", - "symfony/console": "2.2.*", - "symfony/css-selector": "2.2.*", - "symfony/dom-crawler": "2.2.*", - "symfony/event-dispatcher": "2.2.*", - "symfony/finder": "2.2.*", - "symfony/http-foundation": "2.2.*", - "symfony/http-kernel": "2.2.*", - "symfony/process": "2.2.*", - "symfony/routing": "2.2.*", - "symfony/translation": "2.2.*" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/cache": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/exception": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/foundation": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/mail": "self.version", - "illuminate/pagination": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version", - "illuminate/workbench": "self.version" - }, - "require-dev": { - "iron-io/iron_mq": "1.4.*", - "mockery/mockery": "0.7.2" - }, - "autoload": { - "classmap": [ - "src/Illuminate/Queue/Pheanstalk" - ], - "files": [ - "src/Illuminate/Support/helpers.php" - ], - "psr-0": { - "Illuminate": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "minimum-stability": "dev" -} +{ + "name": "laravel/framework", + "description": "The Laravel Framework.", + "keywords": ["framework", "laravel"], + "license": "MIT", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "monolog/monolog": "1.3.*", + "swiftmailer/swiftmailer": "4.3.*", + "symfony/browser-kit": "2.2.*", + "symfony/console": "2.2.*", + "symfony/css-selector": "2.2.*", + "symfony/dom-crawler": "2.2.*", + "symfony/event-dispatcher": "2.2.*", + "symfony/finder": "2.2.*", + "symfony/http-foundation": "2.2.*", + "symfony/http-kernel": "2.2.*", + "symfony/process": "2.2.*", + "symfony/routing": "2.2.*", + "symfony/translation": "2.2.*" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/cache": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/exception": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/foundation": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/log": "self.version", + "illuminate/mail": "self.version", + "illuminate/pagination": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "illuminate/workbench": "self.version" + }, + "require-dev": { + "iron-io/iron_mq": "1.4.*", + "mockery/mockery": "0.7.2" + }, + "autoload": { + "classmap": [ + "src/Illuminate/Queue/Pheanstalk" + ], + "files": [ + "src/Illuminate/Support/helpers.php" + ], + "psr-0": { + "Illuminate": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "minimum-stability": "dev" +} diff --git a/readme.md b/readme.md deleted file mode 100644 index ebbce5ae1854..000000000000 --- a/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# Laravel 4 Beta Change Log - -## Beta 2 - -- Migrated to ircmaxell's [password-compat](http://github.com/ircmaxell/password_compat) library for PHP 5.5 forward compatibility on hashes. No backward compatibility breaks. -- Inflector migrated to L4. Eloquent models now assume their table names if one is not specified. New helpers `str_plural` and `str_singular`. -- Improved `Route::controller` so that `URL::action` may be used with RESTful controllers. \ No newline at end of file diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index a04bb32304a7..de2d71592593 100644 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -182,20 +182,6 @@ public function login(UserInterface $user, $remember = false) $this->user = $user; } - /** - * Log the given user ID into the application. - * - * @param mixed $id - * @param bool $remember - * @return Illuminate\Auth\UserInterface - */ - public function loginUsingId($id, $remember = false) - { - $this->session->put($this->getName(), $id); - - return $this->login($this->user(), $remember); - } - /** * Create a remember me cookie for a given ID. * diff --git a/src/Illuminate/Cache/CacheManager.php b/src/Illuminate/Cache/CacheManager.php index 476d3e0a4083..8c497b974551 100644 --- a/src/Illuminate/Cache/CacheManager.php +++ b/src/Illuminate/Cache/CacheManager.php @@ -50,16 +50,6 @@ protected function createMemcachedDriver() return new MemcachedStore($memcached, $this->app['config']['cache.prefix']); } - /** - * Create an instance of the WinCache cache driver. - * - * @return \Illuminate\Cache\WinCacheStore - */ - protected function createWincacheDriver() - { - return new WinCacheStore($this->app['config']['cache.prefix']); - } - /** * Create an instance of the Redis cache driver. * diff --git a/src/Illuminate/Cache/WinCacheStore.php b/src/Illuminate/Cache/WinCacheStore.php deleted file mode 100644 index c72ed41ff097..000000000000 --- a/src/Illuminate/Cache/WinCacheStore.php +++ /dev/null @@ -1,85 +0,0 @@ -prefix = $prefix; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - protected function retrieveItem($key) - { - $value = wincache_ucache_get($this->prefix.$key); - - if ($value !== false) - { - return $value; - } - } - - /** - * Store an item in the cache for a given number of minutes. - * - * @param string $key - * @param mixed $value - * @param int $minutes - * @return void - */ - protected function storeItem($key, $value, $minutes) - { - wincache_ucache_add($this->prefix.$key, value, $minutes * 60); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return void - */ - protected function storeItemForever($key, $value) - { - return $this->storeItem($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return void - */ - protected function removeItem($key) - { - wincache_ucache_delete($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return void - */ - protected function flushItems() - { - wincache_ucache_clear(); - } - -} \ No newline at end of file diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index a478ce54769c..e696b02af804 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -584,7 +584,7 @@ public function newCollection(array $models = array()) */ public function getTable() { - return $this->table ?: snake_case(str_plural(get_class($this))); + return $this->table; } /** diff --git a/src/Illuminate/Exception/Handler.php b/src/Illuminate/Exception/Handler.php index c9417737baf0..fa66540136c4 100644 --- a/src/Illuminate/Exception/Handler.php +++ b/src/Illuminate/Exception/Handler.php @@ -107,7 +107,7 @@ protected function hints(ReflectionFunction $reflection, $exception) */ public function error(Closure $callback) { - array_unshift($this->handlers, $callback); + $this->handlers[] = $callback; } } \ No newline at end of file diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index 82068fe9cf26..fc5b0debe699 100644 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -11,9 +11,25 @@ class BcryptHasher implements HasherInterface { */ public function make($value, array $options = array()) { - $cost = isset($options['rounds']) ? $options['rounds'] : 8; + $rounds = isset($options['rounds']) ? $options['rounds'] : 8; - return password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost)); + $work = str_pad($rounds, 2, '0', STR_PAD_LEFT); + + // Bcrypt expects the salt to be 22 base64 encoded characters including dots + // and slashes. We will get rid of the plus signs included in the base64 + // data and replace them all with dots so it's appropriately encoded. + if (function_exists('openssl_random_pseudo_bytes')) + { + $salt = openssl_random_pseudo_bytes(16); + } + else + { + $salt = $this->getRandomSalt(); + } + + $salt = substr(strtr(base64_encode($salt), '+', '.'), 0 , 22); + + return crypt($value, '$2a$'.$work.'$'.$salt); } /** @@ -26,7 +42,19 @@ public function make($value, array $options = array()) */ public function check($value, $hashedValue, array $options = array()) { - return password_verify($value, $hashedValue); + return crypt($value, $hashedValue) === $hashedValue; + } + + /** + * Get a random salt to use during hashing. + * + * @return string + */ + protected function getRandomSalt() + { + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + return substr(str_shuffle(str_repeat($pool, 5)), 0, 40); } } \ No newline at end of file diff --git a/src/Illuminate/Hashing/composer.json b/src/Illuminate/Hashing/composer.json index 1aeb313eafcb..2e0c6473936b 100644 --- a/src/Illuminate/Hashing/composer.json +++ b/src/Illuminate/Hashing/composer.json @@ -10,8 +10,7 @@ ], "require": { "php": ">=5.3.0", - "illuminate/support": "4.0.x", - "ircmaxell/password-compat": "1.0.*" + "illuminate/support": "4.0.x" }, "autoload": { "psr-0": { diff --git a/src/Illuminate/Routing/Controllers/Inspector.php b/src/Illuminate/Routing/Controllers/Inspector.php deleted file mode 100644 index f5100e151c05..000000000000 --- a/src/Illuminate/Routing/Controllers/Inspector.php +++ /dev/null @@ -1,129 +0,0 @@ -getMethods() as $method) - { - if ($this->isRoutable($method, $controller)) - { - $data = $this->getMethodData($method, $prefix); - - $routable[$method->name][] = $data; - - // If the routable method is an index method, we will create a special index - // route which is simply the prefix and the verb and does not contain any - // the wildcard place-holders that each "typical" routes would contain. - if ($data['plain'] == $prefix.'/index') - { - $index = $this->getIndexData($data, $prefix); - - $routable[$method->name][] = $index; - } - } - } - - return $routable; - } - - /** - * Determine if the given controller method is routable. - * - * @param ReflectionMethod $method - * @param string $controller - * @return bool - */ - public function isRoutable(ReflectionMethod $method, $controller) - { - if ($method->class != $controller) return false; - - return $method->isPublic() and starts_with($method->name, $this->verbs); - } - - /** - * Get the method data for a given method. - * - * @param ReflectionMethod $method - * @return array - */ - public function getMethodData(ReflectionMethod $method, $prefix) - { - $verb = $this->getVerb($name = $method->name); - - $uri = $this->addUriWildcards($plain = $this->getPlainUri($name, $prefix)); - - return compact('verb', 'plain', 'uri'); - } - - /** - * Extract the verb from a controller action. - * - * @param string $name - * @return string - */ - public function getVerb($name) - { - return head(explode('_', snake_case($name))); - } - - /** - * Determine the URI from the given method name. - * - * @param string $name - * @param string $prefix - * @return string - */ - public function getPlainUri($name, $prefix) - { - return $prefix.'/'.implode('-', array_slice(explode('_', snake_case($name)), 1)); - } - - /** - * Add wildcards to the given URI. - * - * @param string $uri - * @return string - */ - public function addUriWildcards($uri) - { - return $uri.'/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'; - } - - /** - * Get the routable data for an index method. - * - * @param array $data - * @param string $prefix - * @return array - */ - protected function getIndexData($data, $prefix) - { - return array('verb' => $data['verb'], 'plain' => $prefix, 'uri' => $prefix); - } - -} \ No newline at end of file diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 3b7218222f16..d4f1694fb413 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -5,7 +5,6 @@ use Illuminate\Container\Container; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\RequestContext; -use Illuminate\Routing\Controllers\Inspector; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Matcher\UrlMatcher; use Symfony\Component\Routing\Exception\ExceptionInterface; @@ -59,13 +58,6 @@ class Router { */ protected $container; - /** - * The controller inspector instance. - * - * @var \Illuminate\Routing\Controllers\Inspector - */ - protected $inspector; - /** * The current request being dispatched. * @@ -208,18 +200,9 @@ public function controllers(array $controllers) */ public function controller($controller, $uri) { - $routable = $this->getInspector()->getRoutable($controller, $uri); + $uri = $uri.'/{method?}/{v1?}/{v2?}/{v3?}/{v4?}'; - // When a controller is routed using this method, we use Reflection to parse - // out all of the routable methods for the controller, then register each - // route explicitly for the developers, so reverse routing is possible. - foreach ($routable as $method => $routes) - { - foreach ($routes as $route) - { - $this->{$route['verb']}($route['uri'], $controller.'@'.$method); - } - } + return $this->any($uri, $controller.'@{method}'); } /** @@ -571,21 +554,21 @@ protected function createControllerCallback($attribute) { $ioc = $this->container; - $me = $this; - // We'll return a Closure that is able to resolve the controller instance and // call the appropriate method on the controller, passing in the arguments // it receives. Controllers are created with the IoC container instance. - return function() use ($me, $ioc, $attribute) - { - list($controller, $method) = explode('@', $attribute); + list($controller, $method) = explode('@', $attribute); + $me = $this; + + return function() use ($me, $ioc, $controller, $method) + { $route = $me->getCurrentRoute(); - // We will extract the passed in parameters off of the route object so we will - // pass them off to the controller method as arguments. We will not get the - // defaults so that the controllers will be able to use its own defaults. - $args = array_values($route->getVariablesWithoutDefaults()); + // We will replace any back-references that may be present in the method name + // which allow the developer to use part of the incoming route inside of a + // route end-point declaration, setting up true "wildcard" style routes. + list($method, $args) = $me->makeReferences($route, $method); $instance = $ioc->make($controller); @@ -593,6 +576,60 @@ protected function createControllerCallback($attribute) }; } + /** + * Replace any route back-references in a route. + * + * @param \Illuminate\Routing\Route $route + * @param string $original + * @return void + */ + public function makeReferences(Route $route, $original) + { + $method = $original; + + $parameters = $route->getVariablesWithoutDefaults(); + + // To replace the back-references we will just spin through the route variables + // and replace any instance of the variable in the method name with the real + // value of the given parameter, allowing for backreferences in the route. + foreach ($route->getVariables() as $key => $value) + { + $method = str_replace('{'.$key.'}', $value, $method, $c); + + if ($c > 0) unset($parameters[$key]); + } + + // If the method name has been changed due to a back-reference that was swapped + // in by the route, we will format it to make sure it is valid. If it is now + // empty we will swap it for "index". The request method is also prefixed. + if ($method != $original) + { + $method = $this->formatMethod($method); + } + + return array($method, array_values($parameters)); + } + + /** + * Format a controller back-referenced method. + * + * @param string $method + * @return string + */ + protected function formatMethod($method) + { + if ($method == '') $method = 'Index'; + + // We wil prepend the HTTP request method verb to the beginning of the method + // name so a controller is essentially "RESTful" even while using wildcard + // routing setups. Everything will stay RESTful by default in the route. + $verb = strtolower($this->currentRequest->getMethod()); + + if ($verb == 'head') $verb = 'get'; + + return $verb.camel_case($method); + } + /** * Get the response for a given request. * @@ -956,16 +993,6 @@ public function disableFilters() $this->runFilters = false; } - /** - * Retrieve the entire route collection. - * - * @return \Symfony\Component\Routing\RouteCollection - */ - public function getRoutes() - { - return $this->routes; - } - /** * Get the current request being dispatched. * @@ -1013,34 +1040,13 @@ protected function getUrlMatcher(Request $request) } /** - * Get the controller inspector instance. - * - * @return \Illuminate\Routing\Controllers\Inspector - */ - public function getInspector() - { - return $this->inspector ?: new Controllers\Inspector; - } - - /** - * Set the controller inspector instance. - * - * @param \Illuminate\Routing\Controllers\Inspector $inspector - * @return void - */ - public function setInspector(Inspector $inspector) - { - $this->inspector = $inspector; - } - - /** - * Get the container used by the router. - * - * @return \Illuminate\Container\Container + * Retrieve the entire route collection. + * + * @return \Symfony\Component\Routing\RouteCollection */ - public function getContainer() + public function getRoutes() { - return $this->container; + return $this->routes; } /** diff --git a/src/Illuminate/Session/SessionManager.php b/src/Illuminate/Session/SessionManager.php index 7da3e8daca50..539ac080cde7 100644 --- a/src/Illuminate/Session/SessionManager.php +++ b/src/Illuminate/Session/SessionManager.php @@ -46,16 +46,6 @@ protected function createMemcachedDriver() return $this->createCacheBased('memcached'); } - /** - * Create an instance of the Wincache session driver. - * - * @return \Illuminate\Session\CacheDrivenStore - */ - protected function createWincacheDriver() - { - return $this->createCacheBased('wincache'); - } - /** * Create an instance of the Redis session driver. * diff --git a/src/Illuminate/Support/Pluralizer.php b/src/Illuminate/Support/Pluralizer.php deleted file mode 100644 index 11481e02e7dd..000000000000 --- a/src/Illuminate/Support/Pluralizer.php +++ /dev/null @@ -1,212 +0,0 @@ - "$1zes", - '/^(ox)$/i' => "$1en", - '/([m|l])ouse$/i' => "$1ice", - '/(matr|vert|ind)ix|ex$/i' => "$1ices", - '/(x|ch|ss|sh)$/i' => "$1es", - '/([^aeiouy]|qu)y$/i' => "$1ies", - '/(hive)$/i' => "$1s", - '/(?:([^f])fe|([lr])f)$/i' => "$1$2ves", - '/(shea|lea|loa|thie)f$/i' => "$1ves", - '/sis$/i' => "ses", - '/([ti])um$/i' => "$1a", - '/(tomat|potat|ech|her|vet)o$/i' => "$1oes", - '/(bu)s$/i' => "$1ses", - '/(alias)$/i' => "$1es", - '/(octop)us$/i' => "$1i", - '/(ax|test)is$/i' => "$1es", - '/(us)$/i' => "$1es", - '/s$/i' => "s", - '/$/' => "s", - ); - - /** - * Singular word form rules. - * - * @var array - */ - protected static $singular = array( - '/(quiz)zes$/i' => "$1", - '/(matr)ices$/i' => "$1ix", - '/(vert|ind)ices$/i' => "$1ex", - '/^(ox)en$/i' => "$1", - '/(alias)es$/i' => "$1", - '/(octop|vir)i$/i' => "$1us", - '/(cris|ax|test)es$/i' => "$1is", - '/(shoe)s$/i' => "$1", - '/(o)es$/i' => "$1", - '/(bus)es$/i' => "$1", - '/([m|l])ice$/i' => "$1ouse", - '/(x|ch|ss|sh)es$/i' => "$1", - '/(m)ovies$/i' => "$1ovie", - '/(s)eries$/i' => "$1eries", - '/([^aeiouy]|qu)ies$/i' => "$1y", - '/([lr])ves$/i' => "$1f", - '/(tive)s$/i' => "$1", - '/(hive)s$/i' => "$1", - '/(li|wi|kni)ves$/i' => "$1fe", - '/(shea|loa|lea|thie)ves$/i' => "$1f", - '/(^analy)ses$/i' => "$1sis", - '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => "$1$2sis", - '/([ti])a$/i' => "$1um", - '/(n)ews$/i' => "$1ews", - '/(h|bl)ouses$/i' => "$1ouse", - '/(corpse)s$/i' => "$1", - '/(us)es$/i' => "$1", - '/(us|ss)$/i' => "$1", - '/s$/i' => "", - ); - - /** - * Irregular word forms. - * - * @var array - */ - protected static $irregular = array( - 'child' => 'children', - 'foot' => 'feet', - 'goose' => 'geese', - 'man' => 'men', - 'move' => 'moves', - 'person' => 'people', - 'sex' => 'sexes', - 'tooth' => 'teeth', - ); - - /** - * Uncountable word forms. - * - * @var array - */ - protected static $uncountable = array( - 'audio', - 'equipment', - 'deer', - 'fish', - 'gold', - 'information', - 'money', - 'rice', - 'police', - 'series', - 'sheep', - 'species', - 'moose', - 'chassis', - 'traffic', - ); - - /** - * The cached copies of the plural inflections. - * - * @var array - */ - protected static $pluralCache = array(); - - /** - * The cached copies of the singular inflections. - * - * @var array - */ - protected static $singularCache = array(); - - /** - * Get the singular form of the given word. - * - * @param string $value - * @return string - */ - public static function singular($value) - { - if (isset(static::$singularCache[$value])) - { - return static::$singularCache[$value]; - } - - $result = static::inflect($value, static::$singular, static::$irregular); - - return static::$singularCache[$value] = $result ?: $value; - } - - /** - * Get the plural form of the given word. - * - * @param string $value - * @param int $count - * @return string - */ - public static function plural($value, $count = 2) - { - if ($count == 1) return $value; - - // First we'll check the cache of inflected values. We cache each word that - // is inflected so we don't have to spin through the regular expressions - // on each subsequent method calls for this word by the app developer. - if (isset(static::$pluralCache[$value])) - { - return static::$pluralCache[$value]; - } - - $irregular = array_flip(static::$irregular); - - // When doing the singular to plural transformation, we'll flip the irregular - // array since we need to swap sides on the keys and values. After we have - // the transformed value we will cache it in memory for faster look-ups. - $plural = static::$plural; - - $result = static::inflect($value, $plural, $irregular); - - return static::$pluralCache[$value] = $result; - } - - /** - * Perform auto inflection on an English word. - * - * @param string $value - * @param array $source - * @param array $irregular - * @return string - */ - protected static function inflect($value, $source, $irregular) - { - // If the word hasn't been cached, we'll check the list of words that are in - // this list of uncountable word forms. This will be a quick search since - // we will just hit the arrays directly for values without expressions. - if (in_array(strtolower($value), static::$uncountable)) - { - return $value; - } - - // Next, we will check the "irregular" patterns which contain words that are - // not easily summarized in regular expression rules, like "children" and - // "teeth", both of which cannot get inflected using our typical rules. - foreach ($irregular as $irregular => $pattern) - { - if (preg_match($pattern = '/'.$pattern.'$/i', $value)) - { - return preg_replace($pattern, $irregular, $value); - } - } - - // Finally, we'll spin through the array of regular expressions and look for - // matches for the word. If we find a match, we will cache and return the - // transformed value so we will quickly look it up on subsequent calls. - foreach ($source as $pattern => $inflected) - { - if (preg_match($pattern, $value)) - { - return preg_replace($pattern, $inflected, $value); - } - } - } - -} \ No newline at end of file diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 8f03f70f096a..ddffdf7f9c50 100644 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -390,17 +390,12 @@ function snake_case($value, $delimiter = '_') * Determine if a string starts with a given needle. * * @param string $haystack - * @param string|array $needle + * @param string $needle * @return bool */ -function starts_with($haystack, $needles) +function starts_with($haystack, $needle) { - foreach ((array) $needles as $needle) - { - if (strpos($haystack, $needle) === 0) return true; - } - - return false; + return strpos($haystack, $needle) === 0; } /** @@ -456,29 +451,6 @@ function str_is($pattern, $value) return (bool) preg_match('#^'.$pattern.'#', $value); } -/** - * Get the plural form of an English word. - * - * @param string $value - * @param int $count - * @return string - */ -function str_plural($value, $count = 2) -{ - return Illuminate\Support\Pluralizer::plural($value, $count); -} - -/** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ -function str_singular($value) -{ - return Illuminate\Support\Pluralizer::singular($value); -} - /** * Translate the given message. * diff --git a/tests/Auth/AuthGuardTest.php b/tests/Auth/AuthGuardTest.php index a42ea8a09990..676dfe38db51 100644 --- a/tests/Auth/AuthGuardTest.php +++ b/tests/Auth/AuthGuardTest.php @@ -163,18 +163,6 @@ public function testLoginMethodQueuesCookieWhenRemembering() } - public function testLoginUsingIdStoresInSessionAndLogsInWithUser() - { - list($session, $provider, $request, $cookie) = $this->getMocks(); - $guard = $this->getMock('Illuminate\Auth\Guard', array('login', 'user'), array($provider, $session, $request)); - $guard->getSession()->shouldReceive('put')->once()->with($guard->getName(), 10); - $guard->expects($this->once())->method('user')->will($this->returnValue($user = m::mock('Illuminate\Auth\UserInterface'))); - $guard->expects($this->once())->method('login')->with($this->equalTo($user), $this->equalTo(false))->will($this->returnValue($user)); - - $this->assertEquals($user, $guard->loginUsingId(10)); - } - - public function testUserUsesRememberCookieIfItExists() { $guard = $this->getGuard(); diff --git a/tests/Database/DatabaseEloquentModelTest.php b/tests/Database/DatabaseEloquentModelTest.php index 82643e75f9a9..4da0528cefa5 100644 --- a/tests/Database/DatabaseEloquentModelTest.php +++ b/tests/Database/DatabaseEloquentModelTest.php @@ -411,13 +411,6 @@ public function testBelongsToManyCreatesProperRelation() } - public function testModelsAssumeTheirName() - { - $model = new EloquentModelWithoutTableStub; - $this->assertEquals('eloquent_model_without_table_stubs', $model->getTable()); - } - - protected function addMockConnection($model) { $model->setConnectionResolver($resolver = m::mock('Illuminate\Database\ConnectionResolverInterface')); @@ -499,6 +492,4 @@ public function newQuery() $mock->shouldReceive('with')->once()->with(array('foo', 'bar'))->andReturn('foo'); return $mock; } -} - -class EloquentModelWithoutTableStub extends Illuminate\Database\Eloquent\Model {} \ No newline at end of file +} \ No newline at end of file diff --git a/tests/Events/EventsDispatcherTest.php b/tests/Events/DispatcherTest.php similarity index 94% rename from tests/Events/EventsDispatcherTest.php rename to tests/Events/DispatcherTest.php index fd8b39742fc6..f516d0288a33 100644 --- a/tests/Events/EventsDispatcherTest.php +++ b/tests/Events/DispatcherTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Events\Dispatcher; -class EventsDispatcherTest extends PHPUnit_Framework_TestCase { +class DispatcherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationAliasLoaderTest.php b/tests/Foundation/AliasLoaderTest.php similarity index 91% rename from tests/Foundation/FoundationAliasLoaderTest.php rename to tests/Foundation/AliasLoaderTest.php index 00c12ca319d5..b9ebf0ebb459 100644 --- a/tests/Foundation/FoundationAliasLoaderTest.php +++ b/tests/Foundation/AliasLoaderTest.php @@ -2,7 +2,7 @@ use Illuminate\Foundation\AliasLoader; -class FoundationAliasLoaderTest extends PHPUnit_Framework_TestCase { +class AliasLoaderTest extends PHPUnit_Framework_TestCase { public function testLoaderCanBeCreatedAndRegisteredOnce() { diff --git a/tests/Foundation/FoundationApplicationTest.php b/tests/Foundation/ApplicationTest.php similarity index 98% rename from tests/Foundation/FoundationApplicationTest.php rename to tests/Foundation/ApplicationTest.php index 523b659ebf87..50bc430d99d1 100644 --- a/tests/Foundation/FoundationApplicationTest.php +++ b/tests/Foundation/ApplicationTest.php @@ -4,7 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Foundation\Application; -class FoundationApplicationTest extends PHPUnit_Framework_TestCase { +class ApplicationTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationArtisanTest.php b/tests/Foundation/ArtisanTest.php similarity index 92% rename from tests/Foundation/FoundationArtisanTest.php rename to tests/Foundation/ArtisanTest.php index 28a355fd8ca1..2b8a35dd2e61 100644 --- a/tests/Foundation/FoundationArtisanTest.php +++ b/tests/Foundation/ArtisanTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationArtisanTest extends PHPUnit_Framework_TestCase { +class ArtisanTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationAssetPublishCommandTest.php b/tests/Foundation/AssetPublishCommandTest.php similarity index 86% rename from tests/Foundation/FoundationAssetPublishCommandTest.php rename to tests/Foundation/AssetPublishCommandTest.php index 415152d30f62..bc539698116b 100644 --- a/tests/Foundation/FoundationAssetPublishCommandTest.php +++ b/tests/Foundation/AssetPublishCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationAssetPublishCommandTest extends PHPUnit_Framework_TestCase { +class AssetPublishCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationAssetPublisherTest.php b/tests/Foundation/AssetPublisherTest.php similarity index 93% rename from tests/Foundation/FoundationAssetPublisherTest.php rename to tests/Foundation/AssetPublisherTest.php index ca217250ba4a..203676a34170 100644 --- a/tests/Foundation/FoundationAssetPublisherTest.php +++ b/tests/Foundation/AssetPublisherTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationAssetPublisherTest extends PHPUnit_Framework_TestCase { +class AssetPublisherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationClassLoaderTest.php b/tests/Foundation/ClassLoaderTest.php similarity index 91% rename from tests/Foundation/FoundationClassLoaderTest.php rename to tests/Foundation/ClassLoaderTest.php index e59d3d066878..998bceb10911 100644 --- a/tests/Foundation/FoundationClassLoaderTest.php +++ b/tests/Foundation/ClassLoaderTest.php @@ -4,7 +4,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Foundation\ClassLoader; -class FoundationClassLoaderTest extends PHPUnit_Framework_TestCase { +class ClassLoaderTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationComposerTest.php b/tests/Foundation/ComposerTest.php similarity index 95% rename from tests/Foundation/FoundationComposerTest.php rename to tests/Foundation/ComposerTest.php index cd0ace63c2e8..29cfee224ccb 100644 --- a/tests/Foundation/FoundationComposerTest.php +++ b/tests/Foundation/ComposerTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationComposerTest extends PHPUnit_Framework_TestCase { +class ComposerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationConfigPublishCommandTest.php b/tests/Foundation/ConfigPublishCommandTest.php similarity index 86% rename from tests/Foundation/FoundationConfigPublishCommandTest.php rename to tests/Foundation/ConfigPublishCommandTest.php index 2eeb73837e78..851c909c41e2 100644 --- a/tests/Foundation/FoundationConfigPublishCommandTest.php +++ b/tests/Foundation/ConfigPublishCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationConfigPublishCommandTest extends PHPUnit_Framework_TestCase { +class ConfigPublishCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Foundation/FoundationConfigPublisherTest.php b/tests/Foundation/ConfigPublisherTest.php similarity index 94% rename from tests/Foundation/FoundationConfigPublisherTest.php rename to tests/Foundation/ConfigPublisherTest.php index 72732122cf0b..4fb70bcd3fe2 100644 --- a/tests/Foundation/FoundationConfigPublisherTest.php +++ b/tests/Foundation/ConfigPublisherTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class FoundationConfigPublisherTest extends PHPUnit_Framework_TestCase { +class ConfigPublisherTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Http/HttpRequestTest.php b/tests/Http/RequestTest.php similarity index 98% rename from tests/Http/HttpRequestTest.php rename to tests/Http/RequestTest.php index 753741143306..d395038820a1 100644 --- a/tests/Http/HttpRequestTest.php +++ b/tests/Http/RequestTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Http\Request; -class HttpRequestTest extends PHPUnit_Framework_TestCase { +class RequestTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Http/HttpResponseTest.php b/tests/Http/ResponseTest.php similarity index 97% rename from tests/Http/HttpResponseTest.php rename to tests/Http/ResponseTest.php index 4e34ed489612..b8c6b24310a4 100644 --- a/tests/Http/HttpResponseTest.php +++ b/tests/Http/ResponseTest.php @@ -5,7 +5,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Support\Contracts\JsonableInterface; -class HttpResponseTest extends PHPUnit_Framework_TestCase { +class ResponseTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Log/LogWriterTest.php b/tests/Log/WriterTest.php similarity index 93% rename from tests/Log/LogWriterTest.php rename to tests/Log/WriterTest.php index 5ae03b8b7ed2..4886ebddf1d7 100644 --- a/tests/Log/LogWriterTest.php +++ b/tests/Log/WriterTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Log\Writer; -class LogWriterTest extends PHPUnit_Framework_TestCase { +class WriterTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Mail/MailMailerTest.php b/tests/Mail/MailerTest.php similarity index 99% rename from tests/Mail/MailMailerTest.php rename to tests/Mail/MailerTest.php index 067cd4fdfdf5..3ce940c6f816 100644 --- a/tests/Mail/MailMailerTest.php +++ b/tests/Mail/MailerTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class MailMailerTest extends PHPUnit_Framework_TestCase { +class MailerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Mail/MailMessageTest.php b/tests/Mail/MessageTest.php similarity index 95% rename from tests/Mail/MailMessageTest.php rename to tests/Mail/MessageTest.php index 364ff7ac9330..a6241d392e74 100644 --- a/tests/Mail/MailMessageTest.php +++ b/tests/Mail/MessageTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class MailMessageTest extends PHPUnit_Framework_TestCase { +class MessageTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/PaginationBootstrapPresenterTest.php b/tests/Pagination/BootstrapPresenterTest.php similarity index 98% rename from tests/Pagination/PaginationBootstrapPresenterTest.php rename to tests/Pagination/BootstrapPresenterTest.php index 2b303e46d239..85df1f52e4e6 100644 --- a/tests/Pagination/PaginationBootstrapPresenterTest.php +++ b/tests/Pagination/BootstrapPresenterTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\BootstrapPresenter; -class PaginationBootstrapPresenterTest extends PHPUnit_Framework_TestCase { +class BootstrapPresenterTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/PaginationEnvironmentTest.php b/tests/Pagination/EnvironmentTest.php similarity index 97% rename from tests/Pagination/PaginationEnvironmentTest.php rename to tests/Pagination/EnvironmentTest.php index 539bcd883405..33c5af55cf5e 100644 --- a/tests/Pagination/PaginationEnvironmentTest.php +++ b/tests/Pagination/EnvironmentTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\Environment; -class PaginationEnvironmentTest extends PHPUnit_Framework_TestCase { +class EnvironmentTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Pagination/PaginationPaginatorTest.php b/tests/Pagination/PaginatorTest.php similarity index 97% rename from tests/Pagination/PaginationPaginatorTest.php rename to tests/Pagination/PaginatorTest.php index 9b0694859ffa..ac2e34fc98e2 100644 --- a/tests/Pagination/PaginationPaginatorTest.php +++ b/tests/Pagination/PaginatorTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Pagination\Paginator; -class PaginationPaginatorTest extends PHPUnit_Framework_TestCase { +class PaginatorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Queue/QueueBeanstalkdJobTest.php b/tests/Queue/BeanstalkdJobTest.php similarity index 91% rename from tests/Queue/QueueBeanstalkdJobTest.php rename to tests/Queue/BeanstalkdJobTest.php index dc4b77cc9648..b52e791ca668 100644 --- a/tests/Queue/QueueBeanstalkdJobTest.php +++ b/tests/Queue/BeanstalkdJobTest.php @@ -1,51 +1,51 @@ -getJob(); - $job->getPheanstalkJob()->shouldReceive('getData')->once()->andReturn(serialize(array('job' => 'foo', 'data' => array('data')))); - $job->getContainer()->shouldReceive('make')->once()->with('foo')->andReturn($handler = m::mock('StdClass')); - $handler->shouldReceive('fire')->once()->with($job, array('data')); - - $job->fire(); - } - - - public function testDeleteRemovesTheJobFromBeanstalkd() - { - $job = $this->getJob(); - $job->getPheanstalk()->shouldReceive('delete')->once()->with($job->getPheanstalkJob()); - - $job->delete(); - } - - - public function testReleaseProperlyReleasesJobOntoBeanstalkd() - { - $job = $this->getJob(); - $job->getPheanstalk()->shouldReceive('release')->once()->with($job->getPheanstalkJob(), Pheanstalk::DEFAULT_PRIORITY, 0); - - $job->release(); - } - - - protected function getJob() - { - return new Illuminate\Queue\Jobs\BeanstalkdJob( - m::mock('Illuminate\Container\Container'), - m::mock('Pheanstalk'), - m::mock('Pheanstalk_Job') - ); - } - +getJob(); + $job->getPheanstalkJob()->shouldReceive('getData')->once()->andReturn(serialize(array('job' => 'foo', 'data' => array('data')))); + $job->getContainer()->shouldReceive('make')->once()->with('foo')->andReturn($handler = m::mock('StdClass')); + $handler->shouldReceive('fire')->once()->with($job, array('data')); + + $job->fire(); + } + + + public function testDeleteRemovesTheJobFromBeanstalkd() + { + $job = $this->getJob(); + $job->getPheanstalk()->shouldReceive('delete')->once()->with($job->getPheanstalkJob()); + + $job->delete(); + } + + + public function testReleaseProperlyReleasesJobOntoBeanstalkd() + { + $job = $this->getJob(); + $job->getPheanstalk()->shouldReceive('release')->once()->with($job->getPheanstalkJob(), Pheanstalk::DEFAULT_PRIORITY, 0); + + $job->release(); + } + + + protected function getJob() + { + return new Illuminate\Queue\Jobs\BeanstalkdJob( + m::mock('Illuminate\Container\Container'), + m::mock('Pheanstalk'), + m::mock('Pheanstalk_Job') + ); + } + } \ No newline at end of file diff --git a/tests/Queue/QueueBeanstalkdQueueTest.php b/tests/Queue/BeanstalkdQueueTest.php similarity index 94% rename from tests/Queue/QueueBeanstalkdQueueTest.php rename to tests/Queue/BeanstalkdQueueTest.php index 73d71c1c3dd5..231fa5d90384 100644 --- a/tests/Queue/QueueBeanstalkdQueueTest.php +++ b/tests/Queue/BeanstalkdQueueTest.php @@ -1,53 +1,53 @@ -getPheanstalk(); - $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data')))); - - $queue->push('foo', array('data'), 'stack'); - $queue->push('foo', array('data')); - } - - - public function testDelayedPushProperlyPushesJobOntoBeanstalkd() - { - $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); - $pheanstalk = $queue->getPheanstalk(); - $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); - $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data'))), Pheanstalk::DEFAULT_PRIORITY, 5); - - $queue->later(5, 'foo', array('data'), 'stack'); - $queue->later(5, 'foo', array('data')); - } - - - public function testPopProperlyPopsJobOffOfBeanstalkd() - { - $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); - $queue->setContainer(m::mock('Illuminate\Container\Container')); - $pheanstalk = $queue->getPheanstalk(); - $pheanstalk->shouldReceive('watchOnly')->once()->with('default')->andReturn($pheanstalk); - $job = m::mock('Pheanstalk_Job'); - $pheanstalk->shouldReceive('reserve')->once()->andReturn($job); - - $result = $queue->pop(); - - $this->assertInstanceOf('Illuminate\Queue\Jobs\BeanstalkdJob', $result); - } - +getPheanstalk(); + $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data')))); + + $queue->push('foo', array('data'), 'stack'); + $queue->push('foo', array('data')); + } + + + public function testDelayedPushProperlyPushesJobOntoBeanstalkd() + { + $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); + $pheanstalk = $queue->getPheanstalk(); + $pheanstalk->shouldReceive('useTube')->once()->with('stack')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('useTube')->once()->with('default')->andReturn($pheanstalk); + $pheanstalk->shouldReceive('put')->twice()->with(serialize(array('job' => 'foo', 'data' => array('data'))), Pheanstalk::DEFAULT_PRIORITY, 5); + + $queue->later(5, 'foo', array('data'), 'stack'); + $queue->later(5, 'foo', array('data')); + } + + + public function testPopProperlyPopsJobOffOfBeanstalkd() + { + $queue = new Illuminate\Queue\BeanstalkdQueue(m::mock('Pheanstalk'), 'default'); + $queue->setContainer(m::mock('Illuminate\Container\Container')); + $pheanstalk = $queue->getPheanstalk(); + $pheanstalk->shouldReceive('watchOnly')->once()->with('default')->andReturn($pheanstalk); + $job = m::mock('Pheanstalk_Job'); + $pheanstalk->shouldReceive('reserve')->once()->andReturn($job); + + $result = $queue->pop(); + + $this->assertInstanceOf('Illuminate\Queue\Jobs\BeanstalkdJob', $result); + } + } \ No newline at end of file diff --git a/tests/Queue/QueueListenerTest.php b/tests/Queue/ListenerTest.php similarity index 94% rename from tests/Queue/QueueListenerTest.php rename to tests/Queue/ListenerTest.php index 7075fb54ee57..fdddd3e879e8 100644 --- a/tests/Queue/QueueListenerTest.php +++ b/tests/Queue/ListenerTest.php @@ -1,88 +1,88 @@ -setManager(m::mock('Illuminate\Queue\QueueManager')); - $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); - $queue->shouldReceive('pop')->twice()->with('queue')->andReturn($job = m::mock('Illuminate\Queue\Jobs\Job')); - $l->shouldReceive('process')->twice()->with($job, 1); - $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); - $l->shouldReceive('stop')->once(); - - $l->listen('foo', 'queue', 1, 128); - } - - - public function testListenerSleepsWhenNoJobToProcess() - { - $l = m::mock('Illuminate\Queue\Listener[process,memoryExceeded,stop,sleep]'); - $l->setManager(m::mock('Illuminate\Queue\QueueManager')); - $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); - $queue->shouldReceive('pop')->with('queue')->andReturn(null, $job = m::mock('Illuminate\Queue\Jobs\Job')); - $l->shouldReceive('sleep')->once()->with(1); - $l->shouldReceive('process')->once()->with($job, 1); - $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); - $l->shouldReceive('stop')->once(); - - $l->listen('foo', 'queue', 1, 128); - } - - - public function testProcessJobFiresJob() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once(); - $job->shouldReceive('autoDelete')->once()->andReturn(false); - - $l->process($job, 0); - } - - - public function testProcessJobFiresJobAndDeletesItWhenAutoDeleting() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once(); - $job->shouldReceive('autoDelete')->once()->andReturn(true); - $job->shouldReceive('delete')->once(); - - $l->process($job, 0); - } - - - /** - * @expectedException RuntimeException - */ - public function testJobIsReleasedWhenExceptionOccurs() - { - $l = $this->getListener(); - $job = m::mock('Illuminate\Queue\Jobs\Job'); - $job->shouldReceive('fire')->once()->andReturnUsing(function() - { - throw new RuntimeException; - }); - $job->shouldReceive('release')->once()->with(1); - - $l->process($job, 1); - } - - - protected function getListener() - { - return new Listener(m::mock('Illuminate\Queue\QueueManager')); - } - +setManager(m::mock('Illuminate\Queue\QueueManager')); + $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); + $queue->shouldReceive('pop')->twice()->with('queue')->andReturn($job = m::mock('Illuminate\Queue\Jobs\Job')); + $l->shouldReceive('process')->twice()->with($job, 1); + $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); + $l->shouldReceive('stop')->once(); + + $l->listen('foo', 'queue', 1, 128); + } + + + public function testListenerSleepsWhenNoJobToProcess() + { + $l = m::mock('Illuminate\Queue\Listener[process,memoryExceeded,stop,sleep]'); + $l->setManager(m::mock('Illuminate\Queue\QueueManager')); + $l->getManager()->shouldReceive('connection')->with('foo')->andReturn($queue = m::mock('StdClass')); + $queue->shouldReceive('pop')->with('queue')->andReturn(null, $job = m::mock('Illuminate\Queue\Jobs\Job')); + $l->shouldReceive('sleep')->once()->with(1); + $l->shouldReceive('process')->once()->with($job, 1); + $l->shouldReceive('memoryExceeded')->with(128)->andReturn(false, true); + $l->shouldReceive('stop')->once(); + + $l->listen('foo', 'queue', 1, 128); + } + + + public function testProcessJobFiresJob() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once(); + $job->shouldReceive('autoDelete')->once()->andReturn(false); + + $l->process($job, 0); + } + + + public function testProcessJobFiresJobAndDeletesItWhenAutoDeleting() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once(); + $job->shouldReceive('autoDelete')->once()->andReturn(true); + $job->shouldReceive('delete')->once(); + + $l->process($job, 0); + } + + + /** + * @expectedException RuntimeException + */ + public function testJobIsReleasedWhenExceptionOccurs() + { + $l = $this->getListener(); + $job = m::mock('Illuminate\Queue\Jobs\Job'); + $job->shouldReceive('fire')->once()->andReturnUsing(function() + { + throw new RuntimeException; + }); + $job->shouldReceive('release')->once()->with(1); + + $l->process($job, 1); + } + + + protected function getListener() + { + return new Listener(m::mock('Illuminate\Queue\QueueManager')); + } + } \ No newline at end of file diff --git a/tests/Queue/QueueSyncJobTest.php b/tests/Queue/SyncJobTest.php similarity index 85% rename from tests/Queue/QueueSyncJobTest.php rename to tests/Queue/SyncJobTest.php index 402b17133df0..76973034b322 100644 --- a/tests/Queue/QueueSyncJobTest.php +++ b/tests/Queue/SyncJobTest.php @@ -1,24 +1,24 @@ -shouldReceive('make')->once()->with('Foo')->andReturn($handler); - $handler->shouldReceive('fire')->once()->with($job, 'data'); - - $job->fire(); - } - +shouldReceive('make')->once()->with('Foo')->andReturn($handler); + $handler->shouldReceive('fire')->once()->with($job, 'data'); + + $job->fire(); + } + } \ No newline at end of file diff --git a/tests/Queue/QueueSyncQueueTest.php b/tests/Queue/SyncQueueTest.php similarity index 84% rename from tests/Queue/QueueSyncQueueTest.php rename to tests/Queue/SyncQueueTest.php index bd498f4fde4e..474aab9cf7f1 100644 --- a/tests/Queue/QueueSyncQueueTest.php +++ b/tests/Queue/SyncQueueTest.php @@ -1,23 +1,23 @@ -getMock('Illuminate\Queue\SyncQueue', array('resolveJob')); - $job = m::mock('StdClass'); - $sync->expects($this->once())->method('resolveJob')->with($this->equalTo('Foo'), $this->equalTo(''))->will($this->returnValue($job)); - $job->shouldReceive('fire')->once(); - - $sync->push('Foo'); - } - +getMock('Illuminate\Queue\SyncQueue', array('resolveJob')); + $job = m::mock('StdClass'); + $sync->expects($this->once())->method('resolveJob')->with($this->equalTo('Foo'), $this->equalTo(''))->will($this->returnValue($job)); + $job->shouldReceive('fire')->once(); + + $sync->push('Foo'); + } + } \ No newline at end of file diff --git a/tests/Routing/RoutingControllerGeneratorTest.php b/tests/Routing/ControllerGeneratorTest.php similarity index 94% rename from tests/Routing/RoutingControllerGeneratorTest.php rename to tests/Routing/ControllerGeneratorTest.php index 4dfc212ddc94..5d5e5ea1193e 100644 --- a/tests/Routing/RoutingControllerGeneratorTest.php +++ b/tests/Routing/ControllerGeneratorTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Routing\Generators\ControllerGenerator; -class RoutingControllerGeneratorTest extends PHPUnit_Framework_TestCase { +class ControllerGeneratorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingControllerTest.php b/tests/Routing/ControllerTest.php similarity index 99% rename from tests/Routing/RoutingControllerTest.php rename to tests/Routing/ControllerTest.php index 547e0c4a9a2d..ce5d85fc0603 100644 --- a/tests/Routing/RoutingControllerTest.php +++ b/tests/Routing/ControllerTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Symfony\Component\HttpFoundation\Response; -class RoutingControllerTest extends PHPUnit_Framework_TestCase { +class ControllerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingFilterParserTest.php b/tests/Routing/FilterParserTest.php similarity index 93% rename from tests/Routing/RoutingFilterParserTest.php rename to tests/Routing/FilterParserTest.php index 07a510b4fb5e..444a9ea2fcb6 100644 --- a/tests/Routing/RoutingFilterParserTest.php +++ b/tests/Routing/FilterParserTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Symfony\Component\HttpFoundation\Request; -class RoutingFilterParserTest extends PHPUnit_Framework_TestCase { +class FilterParserTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingFilterTest.php b/tests/Routing/FilterTest.php similarity index 97% rename from tests/Routing/RoutingFilterTest.php rename to tests/Routing/FilterTest.php index e2dca943f3ff..57047d45747d 100644 --- a/tests/Routing/RoutingFilterTest.php +++ b/tests/Routing/FilterTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class RoutingFilterTest extends PHPUnit_Framework_TestCase { +class AnnotationTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingMakeControllerCommandTest.php b/tests/Routing/MakeControllerCommandTest.php similarity index 94% rename from tests/Routing/RoutingMakeControllerCommandTest.php rename to tests/Routing/MakeControllerCommandTest.php index edf9cf98889d..6f030b0678f2 100644 --- a/tests/Routing/RoutingMakeControllerCommandTest.php +++ b/tests/Routing/MakeControllerCommandTest.php @@ -2,7 +2,7 @@ use Mockery as m; -class RoutingMakeControllerCommandTest extends PHPUnit_Framework_TestCase { +class MakeControllerCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Routing/RoutingControllerInspectorTest.php b/tests/Routing/RoutingControllerInspectorTest.php deleted file mode 100644 index 5d55eea6cbd4..000000000000 --- a/tests/Routing/RoutingControllerInspectorTest.php +++ /dev/null @@ -1,28 +0,0 @@ -getRoutable('RoutingControllerInspectorStub', 'prefix'); - - $this->assertEquals(3, count($data)); - $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix', 'uri' => 'prefix'), $data['getIndex'][1]); - $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix/index', 'uri' => 'prefix/index/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['getIndex'][0]); - $this->assertEquals(array('verb' => 'get', 'plain' => 'prefix/foo-bar', 'uri' => 'prefix/foo-bar/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['getFooBar'][0]); - $this->assertEquals(array('verb' => 'post', 'plain' => 'prefix/baz', 'uri' => 'prefix/baz/{v1?}/{v2?}/{v3?}/{v4?}/{v5?}'), $data['postBaz'][0]); - } - -} - -class RoutingControllerInspectorBaseStub { - public function getBreeze() {} -} - -class RoutingControllerInspectorStub extends RoutingControllerInspectorBaseStub { - public function getIndex() {} - public function getFooBar() {} - public function postBaz() {} - protected function getBoom() {} -} \ No newline at end of file diff --git a/tests/Routing/RoutingTest.php b/tests/Routing/RoutingTest.php index 99d0354a5ec3..148755f30751 100644 --- a/tests/Routing/RoutingTest.php +++ b/tests/Routing/RoutingTest.php @@ -110,6 +110,52 @@ public function testControllersAreCalledFromControllerRoutes() } + public function testControllerMethodBackReferencesCanBeUsed() + { + $router = new Router; + $container = m::mock('Illuminate\Container\Container'); + $controller = m::mock('stdClass'); + $controller->shouldReceive('callAction')->once()->with($container, $router, 'getBar', array('1', 'taylor'))->andReturn('foo'); + $container->shouldReceive('make')->once()->with('home')->andReturn($controller); + $router->setContainer($container); + $request = Request::create('/foo/bar/1/taylor', 'GET'); + $router->get('/foo/{name}/{id}/{person}', 'home@{name}'); + + $this->assertEquals('foo', $router->dispatch($request)->getContent()); + } + + + public function testControllerMethodBackReferencesUseGetMethodOnHeadRequest() + { + $router = new Router; + $container = m::mock('Illuminate\Container\Container'); + $controller = m::mock('stdClass'); + $controller->shouldReceive('callAction')->once()->with($container, $router, 'getBar', array('1', 'taylor'))->andReturn('foo'); + $container->shouldReceive('make')->once()->with('home')->andReturn($controller); + $router->setContainer($container); + $request = Request::create('/foo/bar/1/taylor', 'HEAD'); + $router->get('/foo/{name}/{id}/{person}', 'home@{name}'); + + // HEAD requests won't return content + $this->assertEquals('', $router->dispatch($request)->getOriginalContent()); + } + + + public function testControllerMethodBackReferencesCanPointToIndex() + { + $router = new Router; + $container = m::mock('Illuminate\Container\Container'); + $controller = m::mock('stdClass'); + $controller->shouldReceive('callAction')->once()->with($container, $router, 'postIndex', array())->andReturn('foo'); + $container->shouldReceive('make')->once()->with('home')->andReturn($controller); + $router->setContainer($container); + $request = Request::create('/foo', 'POST'); + $router->post('/foo/{method?}', 'home@{method}'); + + $this->assertEquals('foo', $router->dispatch($request)->getContent()); + } + + public function testControllersAreCalledFromControllerRoutesWithUsesStatement() { $router = new Router; @@ -383,19 +429,4 @@ public function testCurrentRouteActionCanBeChecked() $this->assertFalse($router->currentRouteUses('bar.route@action')); } - - public function testControllerMethodProperlyRegistersRoutes() - { - $router = $this->getMock('Illuminate\Routing\Router', array('get'), array(new Illuminate\Container\Container)); - $router->setInspector($inspector = m::mock('Illuminate\Routing\Controllers\Inspector')); - $inspector->shouldReceive('getRoutable')->once()->with('FooController', 'prefix')->andReturn(array( - 'getFoo' => array( - array('verb' => 'get', 'uri' => 'foo'), - ) - )); - $router->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo('FooController@getFoo')); - - $router->controller('FooController', 'prefix'); - } - } \ No newline at end of file diff --git a/tests/Routing/RoutingUrlGeneratorTest.php b/tests/Routing/UrlGeneratorTest.php similarity index 98% rename from tests/Routing/RoutingUrlGeneratorTest.php rename to tests/Routing/UrlGeneratorTest.php index 8290ec0ad00d..9105a9919a34 100644 --- a/tests/Routing/RoutingUrlGeneratorTest.php +++ b/tests/Routing/UrlGeneratorTest.php @@ -5,7 +5,7 @@ use Illuminate\Routing\Router; use Illuminate\Routing\UrlGenerator; -class RoutingUrlGeneratorTest extends PHPUnit_Framework_TestCase { +class UrlGeneratorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/SessionCacheDrivenStoreTest.php b/tests/Session/CacheDrivenStoreTest.php similarity index 94% rename from tests/Session/SessionCacheDrivenStoreTest.php rename to tests/Session/CacheDrivenStoreTest.php index 218bf093e11a..85bb90ba8841 100644 --- a/tests/Session/SessionCacheDrivenStoreTest.php +++ b/tests/Session/CacheDrivenStoreTest.php @@ -2,7 +2,7 @@ use Symfony\Component\HttpFoundation\Response; -class SessionCacheDrivenStoreTest extends PHPUnit_Framework_TestCase { +class CacheDrivenStoreTest extends PHPUnit_Framework_TestCase { public function testRetrieveCallsCache() { diff --git a/tests/Session/SessionCookieStoreTest.php b/tests/Session/CookieStoreTest.php similarity index 97% rename from tests/Session/SessionCookieStoreTest.php rename to tests/Session/CookieStoreTest.php index 520414283174..a8b2f4ec5357 100644 --- a/tests/Session/SessionCookieStoreTest.php +++ b/tests/Session/CookieStoreTest.php @@ -5,7 +5,7 @@ use Illuminate\Session\CookieStore; use Symfony\Component\HttpFoundation\Request; -class SessionCookieStoreTest extends PHPUnit_Framework_TestCase { +class CookieStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/SessionDatabaseStoreTest.php b/tests/Session/DatabaseStoreTest.php similarity index 97% rename from tests/Session/SessionDatabaseStoreTest.php rename to tests/Session/DatabaseStoreTest.php index eb0371c90192..d0b5800c7c7a 100644 --- a/tests/Session/SessionDatabaseStoreTest.php +++ b/tests/Session/DatabaseStoreTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Session\DatabaseStore; -class SessionDatabaseStoreTest extends PHPUnit_Framework_TestCase { +class DatabaseStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/SessionFileStoreTest.php b/tests/Session/FileStoreTest.php similarity index 97% rename from tests/Session/SessionFileStoreTest.php rename to tests/Session/FileStoreTest.php index 1e91bea78fa6..6188cf996727 100644 --- a/tests/Session/SessionFileStoreTest.php +++ b/tests/Session/FileStoreTest.php @@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -class SessionFileStoreTest extends PHPUnit_Framework_TestCase { +class FileStoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Session/SessionStoreTest.php b/tests/Session/StoreTest.php similarity index 99% rename from tests/Session/SessionStoreTest.php rename to tests/Session/StoreTest.php index 6c5a5aab0ee8..c941690a2864 100644 --- a/tests/Session/SessionStoreTest.php +++ b/tests/Session/StoreTest.php @@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -class SessionStoreTest extends PHPUnit_Framework_TestCase { +class StoreTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Support/SupportFacadeTest.php b/tests/Support/FacadeTest.php similarity index 88% rename from tests/Support/SupportFacadeTest.php rename to tests/Support/FacadeTest.php index 88cbf5b21bf7..3cb2a2b6940b 100644 --- a/tests/Support/SupportFacadeTest.php +++ b/tests/Support/FacadeTest.php @@ -1,6 +1,6 @@ add('foo', 'bar'); - $container->add('foo', 'bar'); - $messages = $container->getMessages(); - $this->assertEquals(array('bar'), $messages['foo']); - } - - - public function testMessagesAreAdded() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $container->add('boom', 'bust'); - $messages = $container->getMessages(); - $this->assertEquals(array('bar', 'baz'), $messages['foo']); - $this->assertEquals(array('bust'), $messages['boom']); - } - - - public function testGetReturnsArrayOfMessagesByKey() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $this->assertEquals(array('bar', 'baz'), $container->get('foo')); - } - - - public function testFirstReturnsSingleMessage() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('foo', 'baz'); - $messages = $container->getMessages(); - $this->assertEquals('bar', $container->first('foo')); - } - - - public function testHasIndicatesExistence() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $this->assertTrue($container->has('foo')); - $this->assertFalse($container->has('bar')); - } - - - public function testAllReturnsAllMessages() - { - $container = new MessageBag; - $container->setFormat(':message'); - $container->add('foo', 'bar'); - $container->add('boom', 'baz'); - $this->assertEquals(array('bar', 'baz'), $container->all()); - } - - - public function testFormatIsRespected() - { - $container = new MessageBag; - $container->setFormat('

:message

'); - $container->add('foo', 'bar'); - $container->add('boom', 'baz'); - $this->assertEquals('

bar

', $container->first('foo')); - $this->assertEquals(array('

bar

'), $container->get('foo')); - $this->assertEquals(array('

bar

', '

baz

'), $container->all()); - $this->assertEquals('bar', $container->first('foo', ':message')); - $this->assertEquals(array('bar'), $container->get('foo', ':message')); - $this->assertEquals(array('bar', 'baz'), $container->all(':message')); - } - +add('foo', 'bar'); + $container->add('foo', 'bar'); + $messages = $container->getMessages(); + $this->assertEquals(array('bar'), $messages['foo']); + } + + + public function testMessagesAreAdded() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $container->add('boom', 'bust'); + $messages = $container->getMessages(); + $this->assertEquals(array('bar', 'baz'), $messages['foo']); + $this->assertEquals(array('bust'), $messages['boom']); + } + + + public function testGetReturnsArrayOfMessagesByKey() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $this->assertEquals(array('bar', 'baz'), $container->get('foo')); + } + + + public function testFirstReturnsSingleMessage() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('foo', 'baz'); + $messages = $container->getMessages(); + $this->assertEquals('bar', $container->first('foo')); + } + + + public function testHasIndicatesExistence() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $this->assertTrue($container->has('foo')); + $this->assertFalse($container->has('bar')); + } + + + public function testAllReturnsAllMessages() + { + $container = new MessageBag; + $container->setFormat(':message'); + $container->add('foo', 'bar'); + $container->add('boom', 'baz'); + $this->assertEquals(array('bar', 'baz'), $container->all()); + } + + + public function testFormatIsRespected() + { + $container = new MessageBag; + $container->setFormat('

:message

'); + $container->add('foo', 'bar'); + $container->add('boom', 'baz'); + $this->assertEquals('

bar

', $container->first('foo')); + $this->assertEquals(array('

bar

'), $container->get('foo')); + $this->assertEquals(array('

bar

', '

baz

'), $container->all()); + $this->assertEquals('bar', $container->first('foo', ':message')); + $this->assertEquals(array('bar'), $container->get('foo', ':message')); + $this->assertEquals(array('bar', 'baz'), $container->all(':message')); + } + } \ No newline at end of file diff --git a/tests/Support/SupportNamespacedItemResolverTest.php b/tests/Support/NamespacedItemResolverTest.php similarity index 91% rename from tests/Support/SupportNamespacedItemResolverTest.php rename to tests/Support/NamespacedItemResolverTest.php index 219af6348f2e..738c3dadb5d6 100644 --- a/tests/Support/SupportNamespacedItemResolverTest.php +++ b/tests/Support/NamespacedItemResolverTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\NamespacedItemResolver; -class SupportNamespacedItemResolverTest extends PHPUnit_Framework_TestCase { +class NamespacedItemResolverTest extends PHPUnit_Framework_TestCase { public function testResolution() { diff --git a/tests/Support/SupportServiceProviderTest.php b/tests/Support/ServiceProviderTest.php similarity index 87% rename from tests/Support/SupportServiceProviderTest.php rename to tests/Support/ServiceProviderTest.php index 350dbbc6b6b0..a3a25623f6ac 100644 --- a/tests/Support/SupportServiceProviderTest.php +++ b/tests/Support/ServiceProviderTest.php @@ -1,6 +1,6 @@ assertEquals('children', str_plural('child')); - $this->assertEquals('tests', str_plural('test')); - $this->assertEquals('deer', str_plural('deer')); - $this->assertEquals('child', str_singular('children')); - $this->assertEquals('test', str_singular('tests')); - $this->assertEquals('deer', str_singular('deer')); - } - -} \ No newline at end of file diff --git a/tests/Translation/TranslationTranslatorTest.php b/tests/Translation/TranslatorTest.php similarity index 98% rename from tests/Translation/TranslationTranslatorTest.php rename to tests/Translation/TranslatorTest.php index 9a491f9452d1..856fe56a1c1a 100644 --- a/tests/Translation/TranslationTranslatorTest.php +++ b/tests/Translation/TranslatorTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\Translation\Translator; -class TranslationTranslatorTest extends PHPUnit_Framework_TestCase { +class TranslatorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidatorTest.php similarity index 99% rename from tests/Validation/ValidationValidatorTest.php rename to tests/Validation/ValidatorTest.php index acaab5c297d2..4e89d7af9dcb 100644 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidatorTest.php @@ -5,7 +5,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\File\File; -class ValidationValidatorTest extends PHPUnit_Framework_TestCase { +class ValidatorTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/View/ViewBladeCompilerTest.php b/tests/View/BladeCompilerTest.php similarity index 99% rename from tests/View/ViewBladeCompilerTest.php rename to tests/View/BladeCompilerTest.php index 3e5d00ad6659..f871de685b6b 100644 --- a/tests/View/ViewBladeCompilerTest.php +++ b/tests/View/BladeCompilerTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\View\Compilers\BladeCompiler; -class ViewBladeCompilerTest extends PHPUnit_Framework_TestCase { +class BladeCompilerTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/View/ViewCompilerEngineTest.php b/tests/View/CompilerEngineTest.php similarity index 95% rename from tests/View/ViewCompilerEngineTest.php rename to tests/View/CompilerEngineTest.php index 3f4986c6ee01..48aa04847ca5 100644 --- a/tests/View/ViewCompilerEngineTest.php +++ b/tests/View/CompilerEngineTest.php @@ -3,7 +3,7 @@ use Mockery as m; use Illuminate\View\Engines\CompilerEngine; -class ViewCompilerEngineTest extends PHPUnit_Framework_TestCase { +class CompilerEngineTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/View/ViewEngineResolverTest.php b/tests/View/EngineResolverTest.php similarity index 82% rename from tests/View/ViewEngineResolverTest.php rename to tests/View/EngineResolverTest.php index 0d8e31c48081..27dfa2d3ae20 100644 --- a/tests/View/ViewEngineResolverTest.php +++ b/tests/View/EngineResolverTest.php @@ -1,6 +1,6 @@