Commit 2038b91c authored by Fabien Potencier's avatar Fabien Potencier

minor #1155 PHPDocs cleans ups (SpacePossum)

This PR was merged into the 1.2 branch.

Discussion
----------

PHPDocs cleans ups

And some tabs versus spaces.

Commits
-------

bd9f72eb Phpdocs
parents 67e4a0f6 bd9f72eb
...@@ -43,9 +43,6 @@ class ControllerCollection ...@@ -43,9 +43,6 @@ class ControllerCollection
protected $defaultController; protected $defaultController;
protected $prefix; protected $prefix;
/**
* Constructor.
*/
public function __construct(Route $defaultRoute) public function __construct(Route $defaultRoute)
{ {
$this->defaultRoute = $defaultRoute; $this->defaultRoute = $defaultRoute;
......
...@@ -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,9 +98,9 @@ class LogListener implements EventSubscriberInterface ...@@ -98,9 +98,9 @@ class LogListener implements EventSubscriberInterface
} }
/** /**
* Logs an exception * Logs an exception.
* *
* @param Exception $e * @param \Exception $e
*/ */
protected function logException(\Exception $e) protected function logException(\Exception $e)
{ {
......
...@@ -30,7 +30,8 @@ class ExceptionListenerWrapper ...@@ -30,7 +30,8 @@ class ExceptionListenerWrapper
/** /**
* Constructor. * Constructor.
* *
* @param Application $app An Application instance * @param Application $app An Application instance
* @param callable $callback
*/ */
public function __construct(Application $app, $callback) public function __construct(Application $app, $callback)
{ {
......
...@@ -28,12 +28,12 @@ use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; ...@@ -28,12 +28,12 @@ use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
class SerializerServiceProvider implements ServiceProviderInterface class SerializerServiceProvider implements ServiceProviderInterface
{ {
/** /**
* {@inheritDoc} * {@inheritdoc}
* *
* This method registers a serializer service. {@link http://api.symfony.com/master/Symfony/Component/Serializer/Serializer.html * This method registers a serializer service. {@link http://api.symfony.com/master/Symfony/Component/Serializer/Serializer.html
* The service is provided by the Symfony Serializer component}. * The service is provided by the Symfony Serializer component}.
* *
* @param Silex\Application $app * @param Application $app
*/ */
public function register(Application $app) public function register(Application $app)
{ {
...@@ -51,11 +51,11 @@ class SerializerServiceProvider implements ServiceProviderInterface ...@@ -51,11 +51,11 @@ class SerializerServiceProvider implements ServiceProviderInterface
} }
/** /**
* {@inheritDoc} * {@inheritdoc}
* *
* This provider does not execute any code when booting. * This provider does not execute any code when booting.
* *
* @param Silex\Application $app * @param Application $app
*/ */
public function boot(Application $app) public function boot(Application $app)
{ {
......
...@@ -22,7 +22,7 @@ use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher as BaseRedirectable ...@@ -22,7 +22,7 @@ use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher as BaseRedirectable
class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher
{ {
/** /**
* @see RedirectableUrlMatcherInterface::match() * {@inheritdoc}
*/ */
public function redirect($path, $route, $scheme = null) public function redirect($path, $route, $scheme = null)
{ {
......
...@@ -39,7 +39,7 @@ class CallbackResolverTest extends \PHPUnit_Framework_Testcase ...@@ -39,7 +39,7 @@ class CallbackResolverTest extends \PHPUnit_Framework_Testcase
} }
/** /**
* @expectedException InvalidArgumentException * @expectedException \InvalidArgumentException
* @expectedExceptionMessage Service "some_service" does not exist. * @expectedExceptionMessage Service "some_service" does not exist.
*/ */
public function testShouldThrowAnExceptionIfServiceIsMissing() public function testShouldThrowAnExceptionIfServiceIsMissing()
......
...@@ -64,7 +64,7 @@ class CallbackServicesTest extends \PHPUnit_Framework_TestCase ...@@ -64,7 +64,7 @@ class CallbackServicesTest extends \PHPUnit_Framework_TestCase
public function controller(Application $app) public function controller(Application $app)
{ {
return $app->abort(404); $app->abort(404);
} }
public function before() public function before()
......
...@@ -31,7 +31,7 @@ class ControllerTest extends \PHPUnit_Framework_TestCase ...@@ -31,7 +31,7 @@ class ControllerTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException Silex\Exception\ControllerFrozenException * @expectedException \Silex\Exception\ControllerFrozenException
*/ */
public function testBindOnFrozenControllerShouldThrowException() public function testBindOnFrozenControllerShouldThrowException()
{ {
......
...@@ -40,7 +40,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase ...@@ -40,7 +40,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException LogicException * @expectedException \LogicException
* @expectedExceptionMessage Factory supplied to LazyUrlMatcher must return implementation of UrlMatcherInterface. * @expectedExceptionMessage Factory supplied to LazyUrlMatcher must return implementation of UrlMatcherInterface.
*/ */
public function testThatCanInjectUrlMatcherOnly() public function testThatCanInjectUrlMatcherOnly()
......
...@@ -67,7 +67,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -67,7 +67,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());
...@@ -79,7 +79,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -79,7 +79,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 () {
...@@ -100,7 +100,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -100,7 +100,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());
...@@ -126,14 +126,14 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -126,14 +126,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()
...@@ -145,7 +145,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -145,7 +145,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException InvalidArgumentException * @expectedException \InvalidArgumentException
* @expectedExceptionMessage Provided logging level 'foo' does not exist. Must be a valid monolog logging level. * @expectedExceptionMessage Provided logging level 'foo' does not exist. Must be a valid monolog logging level.
*/ */
public function testNonExistentStringErrorLevel() public function testNonExistentStringErrorLevel()
...@@ -163,7 +163,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -163,7 +163,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)
......
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