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
a4a5ad03
Commit
a4a5ad03
authored
May 19, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
24244da6
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
21 additions
and
33 deletions
+21
-33
src/Silex/Application.php
src/Silex/Application.php
+8
-13
src/Silex/Controller.php
src/Silex/Controller.php
+1
-1
src/Silex/ControllerCollection.php
src/Silex/ControllerCollection.php
+5
-5
src/Silex/ExceptionHandler.php
src/Silex/ExceptionHandler.php
+0
-2
src/Silex/GetResponseForErrorEvent.php
src/Silex/GetResponseForErrorEvent.php
+0
-2
src/Silex/LazyUrlMatcher.php
src/Silex/LazyUrlMatcher.php
+1
-0
src/Silex/Provider/MonologServiceProvider.php
src/Silex/Provider/MonologServiceProvider.php
+0
-1
src/Silex/WebTestCase.php
src/Silex/WebTestCase.php
+2
-3
tests/Silex/Tests/ApplicationTest.php
tests/Silex/Tests/ApplicationTest.php
+1
-0
tests/Silex/Tests/BeforeAfterFilterTest.php
tests/Silex/Tests/BeforeAfterFilterTest.php
+1
-1
tests/Silex/Tests/ControllerCollectionTest.php
tests/Silex/Tests/ControllerCollectionTest.php
+0
-3
tests/Silex/Tests/ErrorHandlerTest.php
tests/Silex/Tests/ErrorHandlerTest.php
+1
-0
tests/Silex/Tests/JsonTest.php
tests/Silex/Tests/JsonTest.php
+0
-2
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
+1
-0
No files found.
src/Silex/Application.php
View file @
a4a5ad03
...
...
@@ -23,8 +23,6 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use
Symfony\Component\HttpKernel\Event\PostResponseEvent
;
use
Symfony\Component\HttpKernel\EventListener\ResponseListener
;
use
Symfony\Component\HttpKernel\EventListener\RouterListener
;
use
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
use
Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
use
Symfony\Component\HttpKernel\KernelEvents
;
...
...
@@ -36,12 +34,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use
Symfony\Component\EventDispatcher\Event
;
use
Symfony\Component\EventDispatcher\EventDispatcher
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
use
Symfony\Component\Routing\Route
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RequestContext
;
use
Symfony\Component\Routing\Exception\ExceptionInterface
as
RoutingException
;
use
Symfony\Component\Routing\Exception\MethodNotAllowedException
;
use
Symfony\Component\Routing\Exception\ResourceNotFoundException
;
use
Symfony\Component\ClassLoader\UniversalClassLoader
;
use
Silex\RedirectableUrlMatcher
;
use
Silex\ControllerResolver
;
...
...
@@ -119,6 +113,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$ret
=
call_user_func
(
$callback
,
$event
->
getRequest
());
if
(
$ret
instanceof
Response
)
{
$event
->
setResponse
(
$ret
);
return
;
}
elseif
(
null
!==
$ret
)
{
throw
new
\RuntimeException
(
'Middleware for route "'
.
$event
->
getRequest
()
->
attributes
->
get
(
'_route'
)
.
'" returned an invalid response value. Must return null or an instance of Response.'
);
...
...
src/Silex/Controller.php
View file @
a4a5ad03
src/Silex/ControllerCollection.php
View file @
a4a5ad03
src/Silex/ExceptionHandler.php
View file @
a4a5ad03
...
...
@@ -11,8 +11,6 @@
namespace
Silex
;
use
Silex\Application
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpKernel\Debug\ExceptionHandler
as
DebugExceptionHandler
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
...
...
src/Silex/GetResponseForErrorEvent.php
View file @
a4a5ad03
...
...
@@ -11,9 +11,7 @@
namespace
Silex
;
use
Symfony\Component\HttpKernel\HttpKernelInterface
;
use
Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
;
use
Symfony\Component\HttpFoundation\Request
;
/**
* GetResponseForExceptionEvent with additional setStringResponse method
...
...
src/Silex/LazyUrlMatcher.php
View file @
a4a5ad03
...
...
@@ -40,6 +40,7 @@ class LazyUrlMatcher implements UrlMatcherInterface
if
(
!
$urlMatcher
instanceof
UrlMatcherInterface
)
{
throw
new
\LogicException
(
"Factory supplied to LazyUrlMatcher must return implementation of UrlMatcherInterface."
);
}
return
$urlMatcher
;
}
...
...
src/Silex/Provider/MonologServiceProvider.php
View file @
a4a5ad03
...
...
@@ -19,7 +19,6 @@ use Silex\ServiceProviderInterface;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
/**
* Monolog Provider.
...
...
src/Silex/WebTestCase.php
View file @
a4a5ad03
...
...
@@ -12,7 +12,6 @@
namespace
Silex
;
use
Symfony\Component\HttpKernel\Client
;
use
Symfony\Component\HttpKernel\Test\WebTestCase
as
BaseWebTestCase
;
/**
* WebTestCase is the base class for functional tests.
...
...
tests/Silex/Tests/ApplicationTest.php
View file @
a4a5ad03
...
...
@@ -191,6 +191,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$app
->
get
(
'/reached'
,
function
()
use
(
&
$middlewareTarget
)
{
$middlewareTarget
[]
=
'route_triggered'
;
return
'hello'
;
})
->
middleware
(
$middleware1
)
...
...
tests/Silex/Tests/BeforeAfterFilterTest.php
View file @
a4a5ad03
...
...
@@ -15,7 +15,6 @@ use Silex\Application;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
/**
* Error handler test cases.
...
...
@@ -60,6 +59,7 @@ class BeforeAfterFilterTest extends \PHPUnit_Framework_TestCase
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
)
{
$i
++
;
return
new
Response
(
'foo'
);
});
...
...
tests/Silex/Tests/ControllerCollectionTest.php
View file @
a4a5ad03
...
...
@@ -11,14 +11,11 @@
namespace
Silex\Tests
;
use
Silex\Application
;
use
Silex\Controller
;
use
Silex\ControllerCollection
;
use
Silex\Exception\ControllerFrozenException
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Routing\Route
;
use
Symfony\Component\Routing\RouteCollection
;
/**
* ControllerCollection test cases.
...
...
tests/Silex/Tests/ErrorHandlerTest.php
View file @
a4a5ad03
...
...
@@ -139,6 +139,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$errors
++
;
return
new
Response
(
'foo exception handler'
);
});
...
...
tests/Silex/Tests/JsonTest.php
View file @
a4a5ad03
...
...
@@ -13,8 +13,6 @@ namespace Silex\Tests;
use
Silex\Application
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
/**
* JSON test cases.
...
...
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
View file @
a4a5ad03
...
...
@@ -36,6 +36,7 @@ class SessionServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
get
(
'/login'
,
function
()
use
(
$app
)
{
$app
[
'session'
]
->
set
(
'logged_in'
,
true
);
return
'Logged in successfully.'
;
});
...
...
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