Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed May 19, 2012
1 parent ab31304 commit e00b525
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Configuration/ConfigurationAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function __construct(array $values)
$this->$name($v);
}
}
}
}
4 changes: 1 addition & 3 deletions DependencyInjection/SensioFrameworkExtraExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\Definition\Processor;

/*
Expand All @@ -35,7 +33,7 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();

$config = $processor->process($configuration->getConfigTree(), $configs);

$loader->load('services.xml');

$annotationsToLoad = array();
Expand Down
1 change: 0 additions & 1 deletion EventListener/TemplateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

Expand Down
2 changes: 1 addition & 1 deletion Request/ParamConverter/ParamConverterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/**
*
*
*
* @author Fabien Potencier <fabien@symfony.com>
*/
Expand Down
8 changes: 4 additions & 4 deletions Request/ParamConverter/ParamConverterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

/**
* Managers converters.
* Managers converters.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Henrik Bjornskov <henrik@bjrnskov.dk>
Expand All @@ -27,10 +27,10 @@ class ParamConverterManager
protected $converters = array();

/**
* Applies all converters to the passed configurations and stops when a
* Applies all converters to the passed configurations and stops when a
* converter is applied it will move on to the next configuration and so on.
*
* @param Request $request
* @param Request $request
* @param array|object $configurations
*/
public function apply(Request $request, $configurations)
Expand All @@ -41,7 +41,7 @@ public function apply(Request $request, $configurations)

foreach ($configurations as $configuration) {
// If the value is already an instance of the class we are trying to convert it into
// we should continue as no convertion is required
// we should continue as no convertion is required
$value = $request->attributes->get($configuration->getName());
$className = $configuration->getClass();
if (is_object($value) && $value instanceof $className) {
Expand Down
9 changes: 4 additions & 5 deletions Routing/AnnotatedRouteControllerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Symfony\Component\Routing\Loader\AnnotationClassLoader;
use Symfony\Component\Routing\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\AnnotationReader as ConfigurationAnnotationReader;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

/*
Expand All @@ -30,8 +29,8 @@ class AnnotatedRouteControllerLoader extends AnnotationClassLoader
* Configures the _controller default parameter and eventually the _method
* requirement of a given Route instance.
*
* @param Route $route A Route instance
* @param ReflectionClass $class A ReflectionClass instance
* @param Route $route A Route instance
* @param ReflectionClass $class A ReflectionClass instance
* @param ReflectionMethod $method A ReflectionClass method
*/
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
Expand All @@ -55,8 +54,8 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec
/**
* Makes the default route name more sane by removing common keywords.
*
* @param ReflectionClass $class A ReflectionClass instance
* @param ReflectionMethod $method A ReflectionMethod instance
* @param ReflectionClass $class A ReflectionClass instance
* @param ReflectionMethod $method A ReflectionMethod instance
* @return string
*/
protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
Expand Down
10 changes: 5 additions & 5 deletions Templating/TemplateGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public function __construct(KernelInterface $kernel)
{
$this->kernel = $kernel;
}

/**
* Guesses and returns the template name to render based on the controller
* and action names.
*
* @param array $controller An array storing the controller object and action method
* @param Request $request A Request instance
* @param string $engine
* @param array $controller An array storing the controller object and action method
* @param Request $request A Request instance
* @param string $engine
* @return TemplateReference template reference
* @throws \InvalidArgumentException
*/
Expand Down Expand Up @@ -74,7 +74,7 @@ public function guessTemplateName($controller, Request $request, $engine = 'twig
/**
* Returns the Bundle instance in which the given class name is located.
*
* @param string $class A fully qualified controller class name
* @param string $class A fully qualified controller class name
* @param Bundle $bundle A Bundle instance
* @throws \InvalidArgumentException
*/
Expand Down
4 changes: 2 additions & 2 deletions Tests/EventListener/ControllerListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

Expand Down Expand Up @@ -75,11 +74,12 @@ protected function createRequest(Cache $cache = null)
protected function getFilterControllerEvent($controller, Request $request)
{
$mockKernel = $this->getMockForAbstractClass('Symfony\Component\HttpKernel\Kernel', array('', ''));

return new FilterControllerEvent($mockKernel, $controller, $request, HttpKernelInterface::MASTER_REQUEST);
}

protected function getReadedCache()
{
return $this->request->attributes->get('_cache');
}
}
}
2 changes: 1 addition & 1 deletion Tests/EventListener/Fixture/FooControllerCacheAtClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class FooControllerCacheAtClass
public function barAction()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function barAction()
public function bar2Action()
{
}
}
}
2 changes: 1 addition & 1 deletion Tests/EventListener/Fixture/FooControllerCacheAtMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class FooControllerCacheAtMethod
public function barAction()
{
}
}
}
23 changes: 12 additions & 11 deletions Tests/Request/ParamConverter/DoctrineParamConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class DoctrineParamConverterTest extends \PHPUnit_Framework_TestCase
* @var Doctrine\Common\Persistence\ManagerRegistry
*/
private $manager;

/**
* @var DoctrineParamConverter
*/
private $converter;

public function setUp()
{
if (!interface_exists('Doctrine\Common\Persistence\ManagerRegistry')) {
Expand All @@ -26,7 +26,7 @@ public function setUp()
$this->manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
$this->converter = new DoctrineParamConverter($this->manager);
}

public function createConfiguration($class = null, array $options = null)
{
$config = $this->getMock(
Expand All @@ -43,24 +43,25 @@ public function createConfiguration($class = null, array $options = null)
->method('getClass')
->will($this->returnValue($class));
}

return $config;
}

public function testApplyWithNoIdAndData()
{
$request = new Request();
$config = $this->createConfiguration(null, array());
$objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager');

$this->manager->expects($this->never())->method('find');
$this->manager->expects($this->once())
->method('getManager')
->will($this->returnValue($objectManager));

$this->setExpectedException('LogicException');
$this->converter->apply($request, $config);
}

public function testSupports()
{
$config = $this->createConfiguration('stdClass', array());
Expand All @@ -69,18 +70,18 @@ public function testSupports()
->method('isTransient')
->with($this->equalTo('stdClass'))
->will($this->returnValue( false ));

$objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
$objectManager->expects($this->once())
->method('getMetadataFactory')
->will($this->returnValue($metadataFactory));

$this->manager->expects($this->once())
->method('getManager')
->will($this->returnValue($objectManager));

$ret = $this->converter->supports($config);

$this->assertTrue($ret, "Should be supported");
}
}
1 change: 1 addition & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
return false;
}
require_once $path;

return true;
}
});
Expand Down

0 comments on commit e00b525

Please sign in to comment.