Commit 1ba15a17 authored by Fabien Potencier's avatar Fabien Potencier

moved the provider interfaces under Silex\Api

parent eb5079be
......@@ -80,7 +80,7 @@ You are encouraged to share yours.
Creating a provider
~~~~~~~~~~~~~~~~~~~
Providers must implement the ``Silex\ServiceProviderInterface``::
Providers must implement the ``Silex\Api\ServiceProviderInterface``::
interface ServiceProviderInterface
{
......@@ -100,7 +100,7 @@ Here is an example of such a provider::
namespace Acme;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
class HelloServiceProvider implements ServiceProviderInterface
{
......@@ -161,7 +161,7 @@ All controllers defined by the provider will now be available under the
Creating a provider
~~~~~~~~~~~~~~~~~~~
Providers must implement the ``Silex\ControllerProviderInterface``::
Providers must implement the ``Silex\Api\ControllerProviderInterface``::
interface ControllerProviderInterface
{
......@@ -173,7 +173,7 @@ Here is an example of such a provider::
namespace Acme;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\Api\ControllerProviderInterface;
class HelloControllerProvider implements ControllerProviderInterface
{
......
......@@ -9,7 +9,9 @@
* file that was distributed with this source code.
*/
namespace Silex;
namespace Silex\Api;
use Silex\Application;
/**
* Interface for controller providers.
......
......@@ -9,9 +9,10 @@
* file that was distributed with this source code.
*/
namespace Silex;
namespace Silex\Api;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Silex\Application;
/**
* Interface for event listener providers.
......
......@@ -9,7 +9,9 @@
* file that was distributed with this source code.
*/
namespace Silex;
namespace Silex\Api;
use Silex\Application;
/**
* Interface that all Silex service providers must implement.
......
......@@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
use Silex\Api\EventListenerProviderInterface;
use Silex\Api\ControllerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\EventListener\MiddlewareListener;
use Silex\EventListener\ConverterListener;
use Silex\EventListener\StringToResponseListener;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Configuration;
use Doctrine\Common\EventManager;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider;
......
......@@ -13,8 +13,8 @@ namespace Silex\Provider;
use Silex\Application;
use Silex\HttpCache;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpCache\Store;
......
......@@ -12,8 +12,8 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
use Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer;
......
......@@ -13,8 +13,8 @@ namespace Silex\Provider;
use Silex\Application;
use Silex\LazyUrlMatcher;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Silex\EventListener\LocaleListener;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......
......@@ -14,7 +14,10 @@ namespace Silex\Provider;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bridge\Monolog\Handler\DebugHandler;
use Silex\EventListener\LogListener;
......
......@@ -12,8 +12,8 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider;
use Symfony\Component\Security\Http\Firewall\RememberMeListener;
......
......@@ -12,9 +12,9 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ControllerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RequestMatcher;
use Symfony\Component\HttpFoundation\Request;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\ServiceControllerResolver;
class ServiceControllerServiceProvider implements ServiceProviderInterface
......
......@@ -12,8 +12,8 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Silex\EventListener\SessionListener;
use Silex\EventListener\TestSessionListener;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......
......@@ -12,8 +12,8 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\EventListenerProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\Translator;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Loader\ArrayLoader;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Symfony\Bridge\Twig\Extension\RoutingExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Extension\FormExtension;
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Symfony\Component\Routing\Generator\UrlGenerator;
/**
......
......@@ -12,7 +12,7 @@
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\Api\ServiceProviderInterface;
use Silex\ConstraintValidatorFactory;
use Symfony\Component\Validator\Validator;
use Symfony\Component\Validator\DefaultTranslator;
......
......@@ -477,7 +477,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testRegisterShouldReturnSelf()
{
$app = new Application();
$provider = $this->getMock('Silex\ServiceProviderInterface');
$provider = $this->getMock('Silex\Api\ServiceProviderInterface');
$this->assertSame($app, $app->register($provider));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment