Commit 481b21eb authored by Fabien Potencier's avatar Fabien Potencier

merged branch catchamonkey/coding_standards (PR #351)

Commits
-------

c6b63758 Some CS fixes in line with the Symfony2 standards

Discussion
----------

Fixes a few small CS issues

* public/static ordering
* whitespace
* missing public declarations
parents e448d255 c6b63758
......@@ -605,7 +605,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
/**
* {@inheritdoc}
*/
static public function getSubscribedEvents()
public static function getSubscribedEvents()
{
return array(
KernelEvents::REQUEST => array(
......
......@@ -25,5 +25,5 @@ interface ControllerProviderInterface
*
* @return ControllerCollection A ControllerCollection instance
*/
function connect(Application $app);
public function connect(Application $app);
}
......@@ -32,7 +32,7 @@ class ExceptionHandler implements EventSubscriberInterface
/**
* {@inheritdoc}
*/
static public function getSubscribedEvents()
public static function getSubscribedEvents()
{
return array(SilexEvents::ERROR => array('onSilexError', -255));
}
......
......@@ -26,7 +26,7 @@ interface ServiceProviderInterface
*
* @param Application $app An Application instance
*/
function register(Application $app);
public function register(Application $app);
/**
* Bootstraps the application.
......@@ -35,5 +35,5 @@ interface ServiceProviderInterface
* and should be used for "dynamic" configuration (whenever
* a service must be requested).
*/
function boot(Application $app);
public function boot(Application $app);
}
......@@ -160,7 +160,7 @@ EOF;
*
* @return string The PHP string with the whitespace removed
*/
static public function stripWhitespace($source)
public static function stripWhitespace($source)
{
if (!function_exists('token_get_all')) {
return $source;
......
......@@ -43,7 +43,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
/**
* Creates a Client.
*
* @param array $server An array of server parameters
* @param array $server An array of server parameters
*
* @return Client A Client instance
*/
......
......@@ -273,6 +273,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
// Since we throw a standard Exception above only
// the second error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException";
});
$app->error(function (\Exception $e) {
......@@ -298,6 +299,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
// Since we throw a LogicException above
// the first error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException";
});
$app->error(function (\Exception $e) {
......@@ -328,6 +330,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
return "Caught Exception";
});
$app->error(function (\LogicException $e) { // Extends \Exception
return "Caught LogicException";
});
......
......@@ -13,7 +13,6 @@ namespace Silex\Tests;
use Silex\Application;
/**
* JSON test cases.
*
......
......@@ -146,7 +146,8 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$this->checkRouteResponse($app, '/resource', 'delete resource', 'delete');
}
public function testRequestShouldBeStoredRegardlessOfRouting() {
public function testRequestShouldBeStoredRegardlessOfRouting()
{
$app = new Application();
$app->get('/foo', function () use ($app) {
......@@ -240,7 +241,7 @@ class MyController
return 'foo';
}
static public function getBar()
public static function getBar()
{
return 'bar';
}
......
......@@ -36,6 +36,7 @@ class WebTestCaseTest extends WebTestCase
$app->match('/server', function () use ($app) {
$user = $app['request']->server->get('PHP_AUTH_USER');
$pass = $app['request']->server->get('PHP_AUTH_PW');
return "<h1>$user:$pass</h1>";
});
......
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