Skip to content

Commit

Permalink
Merge branch 'fix-application-contract-violations' of https://github.…
Browse files Browse the repository at this point in the history
…com/X-Coder264/framework into X-Coder264-fix-application-contract-violations
  • Loading branch information
taylorotwell committed Nov 13, 2018
2 parents f737c23 + d52298a commit 97b3f1b
Show file tree
Hide file tree
Showing 20 changed files with 219 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AuthManager implements FactoryContract
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand Down Expand Up @@ -43,7 +43,7 @@ class AuthManager implements FactoryContract
/**
* Create a new Auth manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/Passwords/PasswordBrokerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PasswordBrokerManager implements FactoryContract
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand All @@ -28,7 +28,7 @@ class PasswordBrokerManager implements FactoryContract
/**
* Create a new PasswordBroker manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Broadcasting/BroadcastManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BroadcastManager implements FactoryContract
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand All @@ -42,7 +42,7 @@ class BroadcastManager implements FactoryContract
/**
* Create a new manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CacheManager implements FactoryContract
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand All @@ -37,7 +37,7 @@ class CacheManager implements FactoryContract
/**
* Create a new Cache manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand Down
7 changes: 7 additions & 0 deletions src/Illuminate/Contracts/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ public function when($concrete);
*/
public function factory($abstract);

/**
* Flush the container of all bindings and resolved instances.
*
* @return void
*/
public function flush();

/**
* Resolve the given type from the container.
*
Expand Down
181 changes: 181 additions & 0 deletions src/Illuminate/Contracts/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Contracts\Foundation;

use Closure;
use Illuminate\Contracts\Container\Container;

interface Application extends Container
Expand All @@ -20,6 +21,52 @@ public function version();
*/
public function basePath();

/**
* Get the path to the bootstrap directory.
*
* @param string $path Optionally, a path to append to the bootstrap path
* @return string
*/
public function bootstrapPath($path = '');

/**
* Get the path to the application configuration files.
*
* @param string $path Optionally, a path to append to the config path
* @return string
*/
public function configPath($path = '');

/**
* Get the path to the database directory.
*
* @param string $path Optionally, a path to append to the database path
* @return string
*/
public function databasePath($path = '');

/**
* Get the path to the environment file directory.
*
* @return string
*/
public function environmentPath();

/**
* Get the path to the resources directory.
*
* @param string $path
* @return string
*/
public function resourcePath($path = '');

/**
* Get the path to the storage directory.
*
* @return string
*/
public function storagePath();

/**
* Get or check the current application environment.
*
Expand Down Expand Up @@ -74,6 +121,14 @@ public function register($provider, $force = false);
*/
public function registerDeferredProvider($provider, $service = null);

/**
* Resolve a service provider instance from the class name.
*
* @param string $provider
* @return \Illuminate\Support\ServiceProvider
*/
public function resolveProvider($provider);

/**
* Boot the application's service providers.
*
Expand All @@ -97,6 +152,50 @@ public function booting($callback);
*/
public function booted($callback);

/**
* Run the given array of bootstrap classes.
*
* @param array $bootstrappers
* @return void
*/
public function bootstrapWith(array $bootstrappers);

/**
* Determine if the application configuration is cached.
*
* @return bool
*/
public function configurationIsCached();

/**
* Detect the application's current environment.
*
* @param \Closure $callback
* @return string
*/
public function detectEnvironment(Closure $callback);

/**
* Get the environment file the application is using.
*
* @return string
*/
public function environmentFile();

/**
* Get the fully qualified path to the environment file.
*
* @return string
*/
public function environmentFilePath();

/**
* Get the path to the configuration cache file.
*
* @return string
*/
public function getCachedConfigPath();

/**
* Get the path to the cached services.php file.
*
Expand All @@ -110,4 +209,86 @@ public function getCachedServicesPath();
* @return string
*/
public function getCachedPackagesPath();

/**
* Get the path to the routes cache file.
*
* @return string
*/
public function getCachedRoutesPath();

/**
* Get the current application locale.
*
* @return string
*/
public function getLocale();

/**
* Get the application namespace.
*
* @return string
*
* @throws \RuntimeException
*/
public function getNamespace();

/**
* Get the registered service provider instances if any exist.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @return array
*/
public function getProviders($provider);

/**
* Determine if the application has been bootstrapped before.
*
* @return bool
*/
public function hasBeenBootstrapped();

/**
* Load and boot all of the remaining deferred providers.
*
* @return void
*/
public function loadDeferredProviders();

/**
* Set the environment file to be loaded during bootstrapping.
*
* @param string $file
* @return $this
*/
public function loadEnvironmentFrom($file);

/**
* Determine if the application routes are cached.
*
* @return bool
*/
public function routesAreCached();

/**
* Set the current application locale.
*
* @param string $locale
* @return void
*/
public function setLocale($locale);

/**
* Determine if middleware has been disabled for the application.
*
* @return bool
*/
public function shouldSkipMiddleware();

/**
* Terminate the application.
*
* @return void
*/
public function terminate();
}
4 changes: 2 additions & 2 deletions src/Illuminate/Database/DatabaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand Down Expand Up @@ -44,7 +44,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* Create a new database manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Database\Connectors\ConnectionFactory $factory
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/RouteCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function getFreshApplicationRoutes()
/**
* Get a fresh application instance.
*
* @return \Illuminate\Foundation\Application
* @return \Illuminate\Contracts\Foundation\Application
*/
protected function getFreshApplication()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Illuminate\Foundation\Http\Middleware;

use Closure;
use Illuminate\Foundation\Application;
use Illuminate\Support\InteractsWithTime;
use Symfony\Component\HttpFoundation\Cookie;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Cookie\Middleware\EncryptCookies;

class VerifyCsrfToken
Expand All @@ -17,7 +17,7 @@ class VerifyCsrfToken
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand Down Expand Up @@ -45,7 +45,7 @@ class VerifyCsrfToken
/**
* Create a new middleware instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
* @return void
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Testing/PendingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PendingCommand
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand Down Expand Up @@ -58,7 +58,7 @@ class PendingCommand
* Create a new pending console command run.
*
* @param \PHPUnit\Framework\TestCase $test
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @param string $command
* @param array $parameters
* @return void
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class TestCase extends BaseTestCase
/**
* The Illuminate application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function action($name, $parameters = [], $absolute = true)
*
* @param string $abstract
* @param array $parameters
* @return mixed|\Illuminate\Foundation\Application
* @return mixed|\Illuminate\Contracts\Foundation\Application
*/
function app($abstract = null, array $parameters = [])
{
Expand Down
Loading

0 comments on commit 97b3f1b

Please sign in to comment.