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
b1cd6501
Commit
b1cd6501
authored
Apr 11, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
1c954619
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
43 additions
and
40 deletions
+43
-40
src/Silex/Application.php
src/Silex/Application.php
+1
-1
src/Silex/Application/FormTrait.php
src/Silex/Application/FormTrait.php
+1
-1
src/Silex/ConstraintValidatorFactory.php
src/Silex/ConstraintValidatorFactory.php
+6
-4
src/Silex/Controller.php
src/Silex/Controller.php
+1
-0
src/Silex/EventListener/LogListener.php
src/Silex/EventListener/LogListener.php
+7
-7
src/Silex/Exception/ControllerFrozenException.php
src/Silex/Exception/ControllerFrozenException.php
+1
-1
src/Silex/LazyUrlMatcher.php
src/Silex/LazyUrlMatcher.php
+1
-1
src/Silex/Provider/RememberMeServiceProvider.php
src/Silex/Provider/RememberMeServiceProvider.php
+1
-1
tests/Silex/Tests/EventListener/LogListenerTest.php
tests/Silex/Tests/EventListener/LogListenerTest.php
+1
-1
tests/Silex/Tests/ExceptionHandlerTest.php
tests/Silex/Tests/ExceptionHandlerTest.php
+7
-7
tests/Silex/Tests/LazyDispatcherTest.php
tests/Silex/Tests/LazyDispatcherTest.php
+1
-1
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
+8
-8
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
...s/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
+1
-1
tests/Silex/Tests/ServiceControllerResolverRouterTest.php
tests/Silex/Tests/ServiceControllerResolverRouterTest.php
+1
-1
tests/Silex/Tests/ServiceControllerResolverTest.php
tests/Silex/Tests/ServiceControllerResolverTest.php
+1
-1
No files found.
src/Silex/Application.php
View file @
b1cd6501
...
...
@@ -90,7 +90,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
$this
[
'dispatcher_class'
]
=
'Symfony\\Component\\EventDispatcher\\EventDispatcher'
;
$this
[
'dispatcher'
]
=
$this
->
share
(
function
()
use
(
$app
)
{
/**
* @var EventDispatcherInterface
$dispatcher
* @var EventDispatcherInterface
*/
$dispatcher
=
new
$app
[
'dispatcher_class'
]();
...
...
src/Silex/Application/FormTrait.php
View file @
b1cd6501
...
...
@@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilder;
trait
FormTrait
{
/**
* Creates and returns a form builder instance
* Creates and returns a form builder instance
.
*
* @param mixed $data The initial data for the form
* @param array $options Options for the form
...
...
src/Silex/ConstraintValidatorFactory.php
View file @
b1cd6501
...
...
@@ -39,7 +39,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
protected
$validators
;
/**
* Constructor
* Constructor
.
*
* @param \Pimple $container DI container
* @param array $serviceNames Validator service names
...
...
@@ -55,6 +55,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
* Returns the validator for the supplied constraint.
*
* @param Constraint $constraint A constraint
*
* @return ConstraintValidator A validator for the supplied constraint
*/
public
function
getInstance
(
Constraint
$constraint
)
...
...
@@ -71,9 +72,10 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
}
/**
* Returns the validator instance
* Returns the validator instance
.
*
* @param string $name
*
* @return ConstraintValidator
*/
private
function
createValidator
(
$name
)
...
...
src/Silex/Controller.php
View file @
b1cd6501
...
...
@@ -27,6 +27,7 @@ use Silex\Exception\ControllerFrozenException;
* @method Controller requireHttps()
* @method Controller before(mixed $callback)
* @method Controller after(mixed $callback)
*
* @author Igor Wiedler <igor@wiedler.ch>
*/
class
Controller
...
...
src/Silex/EventListener/LogListener.php
View file @
b1cd6501
...
...
@@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
/**
* Log request, response and exceptions
* Log request, response and exceptions
.
*/
class
LogListener
implements
EventSubscriberInterface
{
...
...
@@ -36,7 +36,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs master requests on event KernelEvents::REQUEST
* Logs master requests on event KernelEvents::REQUEST
.
*
* @param GetResponseEvent $event
*/
...
...
@@ -50,7 +50,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs master response on event KernelEvents::RESPONSE
* Logs master response on event KernelEvents::RESPONSE
.
*
* @param FilterResponseEvent $event
*/
...
...
@@ -64,7 +64,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs uncaught exceptions on event KernelEvents::EXCEPTION
* Logs uncaught exceptions on event KernelEvents::EXCEPTION
.
*
* @param GetResponseForExceptionEvent $event
*/
...
...
@@ -74,7 +74,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs a request
* Logs a request
.
*
* @param Request $request
*/
...
...
@@ -84,7 +84,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs a response
* Logs a response
.
*
* @param Response $response
*/
...
...
@@ -98,7 +98,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs an exception
* Logs an exception
.
*
* @param Exception $e
*/
...
...
src/Silex/Exception/ControllerFrozenException.php
View file @
b1cd6501
...
...
@@ -12,7 +12,7 @@
namespace
Silex\Exception
;
/**
* Exception, is thrown when a frozen controller is modified
* Exception, is thrown when a frozen controller is modified
.
*
* @author Igor Wiedler <igor@wiedler.ch>
*/
...
...
src/Silex/LazyUrlMatcher.php
View file @
b1cd6501
...
...
@@ -37,7 +37,7 @@ class LazyUrlMatcher implements UrlMatcherInterface
{
$urlMatcher
=
call_user_func
(
$this
->
factory
);
if
(
!
$urlMatcher
instanceof
UrlMatcherInterface
)
{
throw
new
\LogicException
(
"Factory supplied to LazyUrlMatcher must return implementation of UrlMatcherInterface."
);
throw
new
\LogicException
(
'Factory supplied to LazyUrlMatcher must return implementation of UrlMatcherInterface.'
);
}
return
$urlMatcher
;
...
...
src/Silex/Provider/RememberMeServiceProvider.php
View file @
b1cd6501
...
...
@@ -19,7 +19,7 @@ use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices;
use
Symfony\Component\Security\Http\RememberMe\ResponseListener
;
/**
* Remember-me authentication for the SecurityServiceProvider
* Remember-me authentication for the SecurityServiceProvider
.
*
* @author Jérôme Tamarelle <jerome@tamarelle.net>
*/
...
...
tests/Silex/Tests/EventListener/LogListenerTest.php
View file @
b1cd6501
...
...
@@ -23,7 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
/**
* LogListener
* LogListener
.
*
* @author Jérôme Tamarelle <jerome@tamarelle.net>
*/
...
...
tests/Silex/Tests/ExceptionHandlerTest.php
View file @
b1cd6501
...
...
@@ -284,7 +284,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
});
$app
->
error
(
function
(
\Exception
$e
)
{
return
new
Response
(
"Exception thrown"
,
500
);
return
new
Response
(
'Exception thrown'
,
500
);
});
$request
=
Request
::
create
(
'/foo'
);
...
...
@@ -308,10 +308,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the second error handler should fire
$app
->
error
(
function
(
\LogicException
$e
)
{
// Extends \Exception
return
"Caught LogicException"
;
return
'Caught LogicException'
;
});
$app
->
error
(
function
(
\Exception
$e
)
{
return
"Caught Exception"
;
return
'Caught Exception'
;
});
$request
=
Request
::
create
(
'/foo'
);
...
...
@@ -334,10 +334,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the first error handler should fire
$app
->
error
(
function
(
\LogicException
$e
)
{
// Extends \Exception
return
"Caught LogicException"
;
return
'Caught LogicException'
;
});
$app
->
error
(
function
(
\Exception
$e
)
{
return
"Caught Exception"
;
return
'Caught Exception'
;
});
$request
=
Request
::
create
(
'/foo'
);
...
...
@@ -361,11 +361,11 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the \Exception error handler is registered first and also
// captures all exceptions that extend it
$app
->
error
(
function
(
\Exception
$e
)
{
return
"Caught Exception"
;
return
'Caught Exception'
;
});
$app
->
error
(
function
(
\LogicException
$e
)
{
// Extends \Exception
return
"Caught LogicException"
;
return
'Caught LogicException'
;
});
$request
=
Request
::
create
(
'/foo'
);
...
...
tests/Silex/Tests/LazyDispatcherTest.php
View file @
b1cd6501
...
...
@@ -44,7 +44,7 @@ class LazyDispatcherTest extends \PHPUnit_Framework_TestCase
$app
=
new
Application
();
$fired
=
false
;
$app
->
get
(
"/"
,
function
()
use
(
$app
,
&
$fired
)
{
$app
->
get
(
'/'
,
function
()
use
(
$app
,
&
$fired
)
{
$app
->
finish
(
function
()
use
(
&
$fired
)
{
$fired
=
true
;
});
...
...
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -69,7 +69,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
return
'error handled'
;
});
/*
*
/*
* Simulate 404, logged to error level
*/
$this
->
assertFalse
(
$app
[
'monolog.handler'
]
->
hasErrorRecords
());
...
...
@@ -81,7 +81,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
$pattern
=
"#Symfony
\\\\
Component
\\\\
HttpKernel
\\\\
Exception
\\\\
NotFoundHttpException: No route found for
\"
GET /error
\"
\(uncaught exception\) at .* line \d+#"
;
$this
->
assertMatchingRecord
(
$pattern
,
Logger
::
ERROR
,
$app
[
'monolog.handler'
]);
/*
*
/*
* Simulate unhandled exception, logged to critical
*/
$app
->
get
(
'/error'
,
function
()
{
...
...
@@ -102,7 +102,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
=
$this
->
getApplication
();
$app
->
get
(
'/foo'
,
function
()
use
(
$app
)
{
return
new
RedirectResponse
(
"/bar"
,
302
);
return
new
RedirectResponse
(
'/bar'
,
302
);
});
$this
->
assertFalse
(
$app
[
'monolog.handler'
]
->
hasInfoRecords
());
...
...
@@ -128,14 +128,14 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
),
));
$app
->
get
(
"/admin"
,
function
()
{
return
"SECURE!"
;
$app
->
get
(
'/admin'
,
function
()
{
return
'SECURE!'
;
});
$request
=
Request
::
create
(
"/admin"
);
$request
=
Request
::
create
(
'/admin'
);
$app
->
run
(
$request
);
$this
->
assertEmpty
(
$app
[
'monolog.handler'
]
->
getRecords
(),
"Expected no logging to occur"
);
$this
->
assertEmpty
(
$app
[
'monolog.handler'
]
->
getRecords
(),
'Expected no logging to occur'
);
}
public
function
testStringErrorLevel
()
...
...
@@ -165,7 +165,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
handle
(
Request
::
create
(
'/404'
));
$this
->
assertEmpty
(
$app
[
'monolog.handler'
]
->
getRecords
(),
"Expected no logging to occur"
);
$this
->
assertEmpty
(
$app
[
'monolog.handler'
]
->
getRecords
(),
'Expected no logging to occur'
);
}
protected
function
assertMatchingRecord
(
$pattern
,
$level
,
$handler
)
...
...
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -19,7 +19,7 @@ use Silex\Provider\SessionServiceProvider;
use
Symfony\Component\HttpKernel\Client
;
/**
* SecurityServiceProvider
* SecurityServiceProvider
.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
...
...
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Client;
use
Symfony\Component\HttpFoundation\Request
;
/**
* SecurityServiceProvider
* SecurityServiceProvider
.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
...
...
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -26,7 +26,7 @@ class SessionServiceProviderTest extends WebTestCase
{
public
function
testRegister
()
{
/*
*
/*
* Smoke test
*/
$defaultStorage
=
$this
->
app
[
'session.storage.native'
];
...
...
tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -37,7 +37,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
[
'swiftmailer.use_spool'
]
=
false
;
$app
[
'swiftmailer.spooltransport'
]
=
function
()
{
throw
new
\Exception
(
"Should not be instantiated"
);
throw
new
\Exception
(
'Should not be instantiated'
);
};
$this
->
assertInstanceOf
(
'Swift_Mailer'
,
$app
[
'mailer'
]);
...
...
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View file @
b1cd6501
...
...
@@ -21,7 +21,7 @@ use Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\Custom;
use
Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\CustomValidator
;
/**
* ValidatorServiceProvider
* ValidatorServiceProvider
.
*
* Javier Lopez <f12loalf@gmail.com>
*/
...
...
tests/Silex/Tests/ServiceControllerResolverRouterTest.php
View file @
b1cd6501
...
...
@@ -16,7 +16,7 @@ use Silex\Provider\ServiceControllerServiceProvider;
use
Symfony\Component\HttpFoundation\Request
;
/**
* Router test cases, using the ServiceControllerResolver
* Router test cases, using the ServiceControllerResolver
.
*/
class
ServiceControllerResolverRouterTest
extends
RouterTest
{
...
...
tests/Silex/Tests/ServiceControllerResolverTest.php
View file @
b1cd6501
...
...
@@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
/**
* Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some
* integration tests
* integration tests
.
*/
class
ServiceControllerResolverTest
extends
\PHPUnit_Framework_Testcase
{
...
...
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