Commit b1cd6501 authored by Fabien Potencier's avatar Fabien Potencier

fixed CS

parent 1c954619
...@@ -90,7 +90,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte ...@@ -90,7 +90,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
$this['dispatcher_class'] = 'Symfony\\Component\\EventDispatcher\\EventDispatcher'; $this['dispatcher_class'] = 'Symfony\\Component\\EventDispatcher\\EventDispatcher';
$this['dispatcher'] = $this->share(function () use ($app) { $this['dispatcher'] = $this->share(function () use ($app) {
/** /**
* @var EventDispatcherInterface $dispatcher * @var EventDispatcherInterface
*/ */
$dispatcher = new $app['dispatcher_class'](); $dispatcher = new $app['dispatcher_class']();
......
...@@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilder; ...@@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilder;
trait FormTrait 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 mixed $data The initial data for the form
* @param array $options Options for the form * @param array $options Options for the form
......
...@@ -39,7 +39,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface ...@@ -39,7 +39,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
protected $validators; protected $validators;
/** /**
* Constructor * Constructor.
* *
* @param \Pimple $container DI container * @param \Pimple $container DI container
* @param array $serviceNames Validator service names * @param array $serviceNames Validator service names
...@@ -54,7 +54,8 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface ...@@ -54,7 +54,8 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
/** /**
* Returns the validator for the supplied constraint. * Returns the validator for the supplied constraint.
* *
* @param Constraint $constraint A constraint * @param Constraint $constraint A constraint
*
* @return ConstraintValidator A validator for the supplied constraint * @return ConstraintValidator A validator for the supplied constraint
*/ */
public function getInstance(Constraint $constraint) public function getInstance(Constraint $constraint)
...@@ -71,9 +72,10 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface ...@@ -71,9 +72,10 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
} }
/** /**
* Returns the validator instance * Returns the validator instance.
*
* @param string $name
* *
* @param string $name
* @return ConstraintValidator * @return ConstraintValidator
*/ */
private function createValidator($name) private function createValidator($name)
......
...@@ -27,6 +27,7 @@ use Silex\Exception\ControllerFrozenException; ...@@ -27,6 +27,7 @@ use Silex\Exception\ControllerFrozenException;
* @method Controller requireHttps() * @method Controller requireHttps()
* @method Controller before(mixed $callback) * @method Controller before(mixed $callback)
* @method Controller after(mixed $callback) * @method Controller after(mixed $callback)
*
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class Controller class Controller
......
...@@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response; ...@@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
/** /**
* Log request, response and exceptions * Log request, response and exceptions.
*/ */
class LogListener implements EventSubscriberInterface class LogListener implements EventSubscriberInterface
{ {
...@@ -36,7 +36,7 @@ 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 * @param GetResponseEvent $event
*/ */
...@@ -50,7 +50,7 @@ class LogListener implements EventSubscriberInterface ...@@ -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 * @param FilterResponseEvent $event
*/ */
...@@ -64,7 +64,7 @@ class LogListener implements EventSubscriberInterface ...@@ -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 * @param GetResponseForExceptionEvent $event
*/ */
...@@ -74,7 +74,7 @@ class LogListener implements EventSubscriberInterface ...@@ -74,7 +74,7 @@ class LogListener implements EventSubscriberInterface
} }
/** /**
* Logs a request * Logs a request.
* *
* @param Request $request * @param Request $request
*/ */
...@@ -84,7 +84,7 @@ class LogListener implements EventSubscriberInterface ...@@ -84,7 +84,7 @@ class LogListener implements EventSubscriberInterface
} }
/** /**
* Logs a response * Logs a response.
* *
* @param Response $response * @param Response $response
*/ */
...@@ -98,7 +98,7 @@ class LogListener implements EventSubscriberInterface ...@@ -98,7 +98,7 @@ class LogListener implements EventSubscriberInterface
} }
/** /**
* Logs an exception * Logs an exception.
* *
* @param Exception $e * @param Exception $e
*/ */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace Silex\Exception; 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> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
......
...@@ -37,7 +37,7 @@ class LazyUrlMatcher implements UrlMatcherInterface ...@@ -37,7 +37,7 @@ class LazyUrlMatcher implements UrlMatcherInterface
{ {
$urlMatcher = call_user_func($this->factory); $urlMatcher = call_user_func($this->factory);
if (!$urlMatcher instanceof UrlMatcherInterface) { 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; return $urlMatcher;
......
...@@ -19,7 +19,7 @@ use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices; ...@@ -19,7 +19,7 @@ use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices;
use Symfony\Component\Security\Http\RememberMe\ResponseListener; 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> * @author Jérôme Tamarelle <jerome@tamarelle.net>
*/ */
......
...@@ -23,7 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; ...@@ -23,7 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
/** /**
* LogListener * LogListener.
* *
* @author Jérôme Tamarelle <jerome@tamarelle.net> * @author Jérôme Tamarelle <jerome@tamarelle.net>
*/ */
......
...@@ -284,7 +284,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -284,7 +284,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
}); });
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
return new Response("Exception thrown", 500); return new Response('Exception thrown', 500);
}); });
$request = Request::create('/foo'); $request = Request::create('/foo');
...@@ -308,10 +308,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -308,10 +308,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the second error handler should fire // the second error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException"; return 'Caught LogicException';
}); });
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
return "Caught Exception"; return 'Caught Exception';
}); });
$request = Request::create('/foo'); $request = Request::create('/foo');
...@@ -334,10 +334,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -334,10 +334,10 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the first error handler should fire // the first error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException"; return 'Caught LogicException';
}); });
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
return "Caught Exception"; return 'Caught Exception';
}); });
$request = Request::create('/foo'); $request = Request::create('/foo');
...@@ -361,11 +361,11 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -361,11 +361,11 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// the \Exception error handler is registered first and also // the \Exception error handler is registered first and also
// captures all exceptions that extend it // captures all exceptions that extend it
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
return "Caught Exception"; return 'Caught Exception';
}); });
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException"; return 'Caught LogicException';
}); });
$request = Request::create('/foo'); $request = Request::create('/foo');
......
...@@ -44,7 +44,7 @@ class LazyDispatcherTest extends \PHPUnit_Framework_TestCase ...@@ -44,7 +44,7 @@ class LazyDispatcherTest extends \PHPUnit_Framework_TestCase
$app = new Application(); $app = new Application();
$fired = false; $fired = false;
$app->get("/", function () use ($app, &$fired) { $app->get('/', function () use ($app, &$fired) {
$app->finish(function () use (&$fired) { $app->finish(function () use (&$fired) {
$fired = true; $fired = true;
}); });
......
...@@ -69,7 +69,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -69,7 +69,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
return 'error handled'; return 'error handled';
}); });
/** /*
* Simulate 404, logged to error level * Simulate 404, logged to error level
*/ */
$this->assertFalse($app['monolog.handler']->hasErrorRecords()); $this->assertFalse($app['monolog.handler']->hasErrorRecords());
...@@ -81,7 +81,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -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+#"; $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']); $this->assertMatchingRecord($pattern, Logger::ERROR, $app['monolog.handler']);
/** /*
* Simulate unhandled exception, logged to critical * Simulate unhandled exception, logged to critical
*/ */
$app->get('/error', function () { $app->get('/error', function () {
...@@ -102,7 +102,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -102,7 +102,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
$app = $this->getApplication(); $app = $this->getApplication();
$app->get('/foo', function () use ($app) { $app->get('/foo', function () use ($app) {
return new RedirectResponse("/bar", 302); return new RedirectResponse('/bar', 302);
}); });
$this->assertFalse($app['monolog.handler']->hasInfoRecords()); $this->assertFalse($app['monolog.handler']->hasInfoRecords());
...@@ -128,14 +128,14 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -128,14 +128,14 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
), ),
)); ));
$app->get("/admin", function () { $app->get('/admin', function () {
return "SECURE!"; return 'SECURE!';
}); });
$request = Request::create("/admin"); $request = Request::create('/admin');
$app->run($request); $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() public function testStringErrorLevel()
...@@ -165,7 +165,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -165,7 +165,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
$app->handle(Request::create('/404')); $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) protected function assertMatchingRecord($pattern, $level, $handler)
......
...@@ -19,7 +19,7 @@ use Silex\Provider\SessionServiceProvider; ...@@ -19,7 +19,7 @@ use Silex\Provider\SessionServiceProvider;
use Symfony\Component\HttpKernel\Client; use Symfony\Component\HttpKernel\Client;
/** /**
* SecurityServiceProvider * SecurityServiceProvider.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
......
...@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Client; ...@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* SecurityServiceProvider * SecurityServiceProvider.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
......
...@@ -26,7 +26,7 @@ class SessionServiceProviderTest extends WebTestCase ...@@ -26,7 +26,7 @@ class SessionServiceProviderTest extends WebTestCase
{ {
public function testRegister() public function testRegister()
{ {
/** /*
* Smoke test * Smoke test
*/ */
$defaultStorage = $this->app['session.storage.native']; $defaultStorage = $this->app['session.storage.native'];
......
...@@ -37,7 +37,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -37,7 +37,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
$app['swiftmailer.use_spool'] = false; $app['swiftmailer.use_spool'] = false;
$app['swiftmailer.spooltransport'] = function () { $app['swiftmailer.spooltransport'] = function () {
throw new \Exception("Should not be instantiated"); throw new \Exception('Should not be instantiated');
}; };
$this->assertInstanceOf('Swift_Mailer', $app['mailer']); $this->assertInstanceOf('Swift_Mailer', $app['mailer']);
......
...@@ -21,7 +21,7 @@ use Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\Custom; ...@@ -21,7 +21,7 @@ use Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\Custom;
use Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\CustomValidator; use Silex\Tests\Provider\ValidatorServiceProviderTest\Constraint\CustomValidator;
/** /**
* ValidatorServiceProvider * ValidatorServiceProvider.
* *
* Javier Lopez <f12loalf@gmail.com> * Javier Lopez <f12loalf@gmail.com>
*/ */
......
...@@ -16,7 +16,7 @@ use Silex\Provider\ServiceControllerServiceProvider; ...@@ -16,7 +16,7 @@ use Silex\Provider\ServiceControllerServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* Router test cases, using the ServiceControllerResolver * Router test cases, using the ServiceControllerResolver.
*/ */
class ServiceControllerResolverRouterTest extends RouterTest class ServiceControllerResolverRouterTest extends RouterTest
{ {
......
...@@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
/** /**
* Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some * Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some
* integration tests * integration tests.
*/ */
class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase
{ {
......
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