Commit 234a9205 authored by Fabien Potencier's avatar Fabien Potencier

Merge branch '1.3'

* 1.3:
  fixed CS

Conflicts:
	src/Silex/Application.php
	src/Silex/EventListener/LogListener.php
	src/Silex/LazyUrlMatcher.php
parents fb1e41e5 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
......
......@@ -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
......
......@@ -48,7 +48,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs master requests on event KernelEvents::REQUEST
* Logs master requests on event KernelEvents::REQUEST.
*
* @param GetResponseEvent $event
*/
......@@ -62,7 +62,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs master response on event KernelEvents::RESPONSE
* Logs master response on event KernelEvents::RESPONSE.
*
* @param FilterResponseEvent $event
*/
......@@ -76,7 +76,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs uncaught exceptions on event KernelEvents::EXCEPTION
* Logs uncaught exceptions on event KernelEvents::EXCEPTION.
*
* @param GetResponseForExceptionEvent $event
*/
......@@ -86,7 +86,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs a request
* Logs a request.
*
* @param Request $request
*/
......@@ -96,7 +96,7 @@ class LogListener implements EventSubscriberInterface
}
/**
* Logs a response
* Logs a response.
*
* @param Response $response
*/
......
......@@ -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>
*/
......
......@@ -21,7 +21,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>
*/
......
......@@ -40,7 +40,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
protected $validators;
/**
* Constructor
* Constructor.
*
* @param Container $container DI container
* @param array $serviceNames Validator service names
......@@ -55,7 +55,8 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
/**
* 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
*/
public function getInstance(Constraint $constraint)
......@@ -72,9 +73,10 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
}
/**
* Returns the validator instance
* Returns the validator instance.
*
* @param string $name
*
* @param string $name
* @return ConstraintValidator
*/
private function createValidator($name)
......
......@@ -24,7 +24,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* LogListener
* LogListener.
*
* @author Jérôme Tamarelle <jerome@tamarelle.net>
*/
......
......@@ -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');
......
......@@ -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;
});
......
......@@ -81,7 +81,7 @@ class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase
return 'error handled';
});
/**
/*
* Simulate 404, logged to error level
*/
$this->assertFalse($app['monolog.handler']->hasErrorRecords());
......@@ -93,7 +93,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 () {
......@@ -114,7 +114,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());
......@@ -140,14 +140,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()
......@@ -177,7 +177,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)
......
......@@ -19,7 +19,7 @@ use Silex\Provider\SessionServiceProvider;
use Symfony\Component\HttpKernel\Client;
/**
* SecurityServiceProvider
* SecurityServiceProvider.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
......
......@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpFoundation\Request;
/**
* SecurityServiceProvider
* SecurityServiceProvider.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
......
......@@ -26,7 +26,7 @@ class SessionServiceProviderTest extends WebTestCase
{
public function testRegister()
{
/**
/*
* Smoke test
*/
$defaultStorage = $this->app['session.storage.native'];
......
......@@ -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']);
......
......@@ -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>
*/
......
......@@ -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
{
......
......@@ -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
{
......
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