Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
1ba15a17
Commit
1ba15a17
authored
Nov 04, 2013
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved the provider interfaces under Silex\Api
parent
eb5079be
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
43 additions
and
32 deletions
+43
-32
doc/providers.rst
doc/providers.rst
+4
-4
src/Silex/Api/ControllerProviderInterface.php
src/Silex/Api/ControllerProviderInterface.php
+3
-1
src/Silex/Api/EventListenerProviderInterface.php
src/Silex/Api/EventListenerProviderInterface.php
+2
-1
src/Silex/Api/ServiceProviderInterface.php
src/Silex/Api/ServiceProviderInterface.php
+3
-1
src/Silex/Application.php
src/Silex/Application.php
+3
-0
src/Silex/Provider/DoctrineServiceProvider.php
src/Silex/Provider/DoctrineServiceProvider.php
+1
-1
src/Silex/Provider/FormServiceProvider.php
src/Silex/Provider/FormServiceProvider.php
+1
-1
src/Silex/Provider/HttpCacheServiceProvider.php
src/Silex/Provider/HttpCacheServiceProvider.php
+2
-2
src/Silex/Provider/HttpFragmentServiceProvider.php
src/Silex/Provider/HttpFragmentServiceProvider.php
+2
-2
src/Silex/Provider/LocaleServiceProvider.php
src/Silex/Provider/LocaleServiceProvider.php
+2
-2
src/Silex/Provider/MonologServiceProvider.php
src/Silex/Provider/MonologServiceProvider.php
+4
-1
src/Silex/Provider/RememberMeServiceProvider.php
src/Silex/Provider/RememberMeServiceProvider.php
+2
-2
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+3
-3
src/Silex/Provider/SerializerServiceProvider.php
src/Silex/Provider/SerializerServiceProvider.php
+1
-1
src/Silex/Provider/ServiceControllerServiceProvider.php
src/Silex/Provider/ServiceControllerServiceProvider.php
+1
-1
src/Silex/Provider/SessionServiceProvider.php
src/Silex/Provider/SessionServiceProvider.php
+2
-2
src/Silex/Provider/SwiftmailerServiceProvider.php
src/Silex/Provider/SwiftmailerServiceProvider.php
+2
-2
src/Silex/Provider/TranslationServiceProvider.php
src/Silex/Provider/TranslationServiceProvider.php
+1
-1
src/Silex/Provider/TwigServiceProvider.php
src/Silex/Provider/TwigServiceProvider.php
+1
-1
src/Silex/Provider/UrlGeneratorServiceProvider.php
src/Silex/Provider/UrlGeneratorServiceProvider.php
+1
-1
src/Silex/Provider/ValidatorServiceProvider.php
src/Silex/Provider/ValidatorServiceProvider.php
+1
-1
tests/Silex/Tests/ApplicationTest.php
tests/Silex/Tests/ApplicationTest.php
+1
-1
No files found.
doc/providers.rst
View file @
1ba15a17
...
@@ -80,7 +80,7 @@ You are encouraged to share yours.
...
@@ -80,7 +80,7 @@ You are encouraged to share yours.
Creating a provider
Creating a provider
~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~
Providers must implement the ``Silex\ServiceProviderInterface``::
Providers must implement the ``Silex\
Api\
ServiceProviderInterface``::
interface ServiceProviderInterface
interface ServiceProviderInterface
{
{
...
@@ -100,7 +100,7 @@ Here is an example of such a provider::
...
@@ -100,7 +100,7 @@ Here is an example of such a provider::
namespace Acme;
namespace Acme;
use Silex\Application;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Silex\
Api\
ServiceProviderInterface;
class HelloServiceProvider implements ServiceProviderInterface
class HelloServiceProvider implements ServiceProviderInterface
{
{
...
@@ -161,7 +161,7 @@ All controllers defined by the provider will now be available under the
...
@@ -161,7 +161,7 @@ All controllers defined by the provider will now be available under the
Creating a provider
Creating a provider
~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~
Providers must implement the ``Silex\ControllerProviderInterface``::
Providers must implement the ``Silex\
Api\
ControllerProviderInterface``::
interface ControllerProviderInterface
interface ControllerProviderInterface
{
{
...
@@ -173,7 +173,7 @@ Here is an example of such a provider::
...
@@ -173,7 +173,7 @@ Here is an example of such a provider::
namespace Acme;
namespace Acme;
use Silex\Application;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\
Api\
ControllerProviderInterface;
class HelloControllerProvider implements ControllerProviderInterface
class HelloControllerProvider implements ControllerProviderInterface
{
{
...
...
src/Silex/ControllerProviderInterface.php
→
src/Silex/
Api/
ControllerProviderInterface.php
View file @
1ba15a17
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
* file that was distributed with this source code.
* file that was distributed with this source code.
*/
*/
namespace
Silex
;
namespace
Silex\Api
;
use
Silex\Application
;
/**
/**
* Interface for controller providers.
* Interface for controller providers.
...
...
src/Silex/EventListenerProviderInterface.php
→
src/Silex/
Api/
EventListenerProviderInterface.php
View file @
1ba15a17
...
@@ -9,9 +9,10 @@
...
@@ -9,9 +9,10 @@
* file that was distributed with this source code.
* file that was distributed with this source code.
*/
*/
namespace
Silex
;
namespace
Silex
\Api
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Silex\Application
;
/**
/**
* Interface for event listener providers.
* Interface for event listener providers.
...
...
src/Silex/ServiceProviderInterface.php
→
src/Silex/
Api/
ServiceProviderInterface.php
View file @
1ba15a17
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
* file that was distributed with this source code.
* file that was distributed with this source code.
*/
*/
namespace
Silex
;
namespace
Silex\Api
;
use
Silex\Application
;
/**
/**
* Interface that all Silex service providers must implement.
* Interface that all Silex service providers must implement.
...
...
src/Silex/Application.php
View file @
1ba15a17
...
@@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
...
@@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RequestContext
;
use
Symfony\Component\Routing\RequestContext
;
use
Silex\Api\EventListenerProviderInterface
;
use
Silex\Api\ControllerProviderInterface
;
use
Silex\Api\ServiceProviderInterface
;
use
Silex\EventListener\MiddlewareListener
;
use
Silex\EventListener\MiddlewareListener
;
use
Silex\EventListener\ConverterListener
;
use
Silex\EventListener\ConverterListener
;
use
Silex\EventListener\StringToResponseListener
;
use
Silex\EventListener\StringToResponseListener
;
...
...
src/Silex/Provider/DoctrineServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\Configuration
;
use
Doctrine\DBAL\Configuration
;
use
Doctrine\Common\EventManager
;
use
Doctrine\Common\EventManager
;
...
...
src/Silex/Provider/FormServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Symfony\Component\Form\Extension\Csrf\CsrfExtension
;
use
Symfony\Component\Form\Extension\Csrf\CsrfExtension
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider
;
...
...
src/Silex/Provider/HttpCacheServiceProvider.php
View file @
1ba15a17
...
@@ -13,8 +13,8 @@ namespace Silex\Provider;
...
@@ -13,8 +13,8 @@ namespace Silex\Provider;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\HttpCache
;
use
Silex\HttpCache
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\HttpKernel\HttpCache\Esi
;
use
Symfony\Component\HttpKernel\HttpCache\Esi
;
use
Symfony\Component\HttpKernel\HttpCache\Store
;
use
Symfony\Component\HttpKernel\HttpCache\Store
;
...
...
src/Silex/Provider/HttpFragmentServiceProvider.php
View file @
1ba15a17
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\HttpKernel\Fragment\FragmentHandler
;
use
Symfony\Component\HttpKernel\Fragment\FragmentHandler
;
use
Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer
;
use
Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer
;
...
...
src/Silex/Provider/LocaleServiceProvider.php
View file @
1ba15a17
...
@@ -13,8 +13,8 @@ namespace Silex\Provider;
...
@@ -13,8 +13,8 @@ namespace Silex\Provider;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\LazyUrlMatcher
;
use
Silex\LazyUrlMatcher
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Silex\EventListener\LocaleListener
;
use
Silex\EventListener\LocaleListener
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
...
...
src/Silex/Provider/MonologServiceProvider.php
View file @
1ba15a17
...
@@ -14,7 +14,10 @@ namespace Silex\Provider;
...
@@ -14,7 +14,10 @@ namespace Silex\Provider;
use
Monolog\Logger
;
use
Monolog\Logger
;
use
Monolog\Handler\StreamHandler
;
use
Monolog\Handler\StreamHandler
;
use
Silex\Application
;
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
Symfony\Bridge\Monolog\Handler\DebugHandler
;
use
Silex\EventListener\LogListener
;
use
Silex\EventListener\LogListener
;
...
...
src/Silex/Provider/RememberMeServiceProvider.php
View file @
1ba15a17
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider
;
use
Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider
;
use
Symfony\Component\Security\Http\Firewall\RememberMeListener
;
use
Symfony\Component\Security\Http\Firewall\RememberMeListener
;
...
...
src/Silex/Provider/SecurityServiceProvider.php
View file @
1ba15a17
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ControllerProviderInterface
;
use
Silex\
Api\
ControllerProviderInterface
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\HttpFoundation\RequestMatcher
;
use
Symfony\Component\HttpFoundation\RequestMatcher
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
...
...
src/Silex/Provider/SerializerServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Symfony\Component\Serializer\Serializer
;
use
Symfony\Component\Serializer\Serializer
;
use
Symfony\Component\Serializer\Encoder\JsonEncoder
;
use
Symfony\Component\Serializer\Encoder\JsonEncoder
;
use
Symfony\Component\Serializer\Encoder\XmlEncoder
;
use
Symfony\Component\Serializer\Encoder\XmlEncoder
;
...
...
src/Silex/Provider/ServiceControllerServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\ServiceControllerResolver
;
use
Silex\ServiceControllerResolver
;
class
ServiceControllerServiceProvider
implements
ServiceProviderInterface
class
ServiceControllerServiceProvider
implements
ServiceProviderInterface
...
...
src/Silex/Provider/SessionServiceProvider.php
View file @
1ba15a17
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Silex\EventListener\SessionListener
;
use
Silex\EventListener\SessionListener
;
use
Silex\EventListener\TestSessionListener
;
use
Silex\EventListener\TestSessionListener
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
...
...
src/Silex/Provider/SwiftmailerServiceProvider.php
View file @
1ba15a17
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\EventListenerProviderInterface
;
use
Silex\
Api\
EventListenerProviderInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\Event\PostResponseEvent
;
use
Symfony\Component\HttpKernel\Event\PostResponseEvent
;
...
...
src/Silex/Provider/TranslationServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\Translator
;
use
Silex\Translator
;
use
Symfony\Component\Translation\MessageSelector
;
use
Symfony\Component\Translation\MessageSelector
;
use
Symfony\Component\Translation\Loader\ArrayLoader
;
use
Symfony\Component\Translation\Loader\ArrayLoader
;
...
...
src/Silex/Provider/TwigServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Symfony\Bridge\Twig\Extension\RoutingExtension
;
use
Symfony\Bridge\Twig\Extension\RoutingExtension
;
use
Symfony\Bridge\Twig\Extension\TranslationExtension
;
use
Symfony\Bridge\Twig\Extension\TranslationExtension
;
use
Symfony\Bridge\Twig\Extension\FormExtension
;
use
Symfony\Bridge\Twig\Extension\FormExtension
;
...
...
src/Silex/Provider/UrlGeneratorServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Symfony\Component\Routing\Generator\UrlGenerator
;
use
Symfony\Component\Routing\Generator\UrlGenerator
;
/**
/**
...
...
src/Silex/Provider/ValidatorServiceProvider.php
View file @
1ba15a17
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Silex\Provider
;
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
use
Silex\
Api\
ServiceProviderInterface
;
use
Silex\ConstraintValidatorFactory
;
use
Silex\ConstraintValidatorFactory
;
use
Symfony\Component\Validator\Validator
;
use
Symfony\Component\Validator\Validator
;
use
Symfony\Component\Validator\DefaultTranslator
;
use
Symfony\Component\Validator\DefaultTranslator
;
...
...
tests/Silex/Tests/ApplicationTest.php
View file @
1ba15a17
...
@@ -477,7 +477,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
...
@@ -477,7 +477,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public
function
testRegisterShouldReturnSelf
()
public
function
testRegisterShouldReturnSelf
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$provider
=
$this
->
getMock
(
'Silex\ServiceProviderInterface'
);
$provider
=
$this
->
getMock
(
'Silex\
Api\
ServiceProviderInterface'
);
$this
->
assertSame
(
$app
,
$app
->
register
(
$provider
));
$this
->
assertSame
(
$app
,
$app
->
register
(
$provider
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment