Skip to content

Commit

Permalink
Merge pull request #245 from symfony-cmf/cs-fixes
Browse files Browse the repository at this point in the history
cs cleanup and stop using deprecated Testing component document
  • Loading branch information
lsmith77 committed Apr 28, 2014
2 parents a3afe2f + b91d92f commit 04556bd
Show file tree
Hide file tree
Showing 51 changed files with 102 additions and 108 deletions.
1 change: 0 additions & 1 deletion Admin/Extension/RouteReferrersExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Admin\Extension;

use Sonata\AdminBundle\Admin\AdminExtension;
Expand Down
1 change: 0 additions & 1 deletion Admin/RouteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Admin;

use Sonata\AdminBundle\Datagrid\DatagridMapper;
Expand Down
3 changes: 1 addition & 2 deletions CmfRoutingBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle;

use Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass;
Expand Down Expand Up @@ -107,7 +106,7 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
* Otherwise use the standalone one from CmfCoreBundle.
*
* @return boolean|string the compiler pass to use or false if no suitable
* one was found
* one was found
*/
private function findDoctrineOrmCompiler()
{
Expand Down
1 change: 0 additions & 1 deletion Controller/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Controller;

use Symfony\Component\Routing\RouterInterface;
Expand Down
2 changes: 0 additions & 2 deletions DependencyInjection/CmfRoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection;

use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Expand All @@ -18,7 +17,6 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\Loader\LoaderInterface;

/**
Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/Compiler/SetRouterPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection;

use Symfony\Component\Config\Definition\ConfigurationInterface;
Expand Down
3 changes: 1 addition & 2 deletions Doctrine/DoctrineProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine;

use Doctrine\Common\Persistence\ManagerRegistry;
Expand Down Expand Up @@ -53,7 +52,7 @@ abstract class DoctrineProvider

/**
* @param ManagerRegistry $managerRegistry
* @param string $className
* @param string $className
*/
public function __construct(ManagerRegistry $managerRegistry, $className = null)
{
Expand Down
12 changes: 7 additions & 5 deletions Doctrine/Orm/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm;

use Symfony\Cmf\Component\Routing\ContentRepositoryInterface;
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\DoctrineProvider;

/**
* Abstract content repository for ORM
* Abstract content repository for ORM.
*
* This repository follows the pattern of FQN:id. That is, the full model class
* name, then a colon, then the id. For example "Acme\Content:12".
*
* This will only work with single column ids.
*
* @author teito
*/
Expand All @@ -37,9 +41,7 @@ protected function getModelAndId($identifier)
/**
* {@inheritDoc}
*
* @param string $id The ID contains both model name and id, seperated by a colon.
* The model name must not contain a colon. For instance, "Acme\Content:12"
* tries to find the Acme\Content object where id = 12
* @param string $id The ID contains both model name and id, separated by a colon.
*/
public function findById($id)
{
Expand Down
1 change: 0 additions & 1 deletion Doctrine/Orm/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm;

use Symfony\Cmf\Bundle\RoutingBundle\Model\Route as RouteModel;
Expand Down
1 change: 0 additions & 1 deletion Doctrine/Orm/RouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm;

use Doctrine\Common\Persistence\ManagerRegistry;
Expand Down
1 change: 0 additions & 1 deletion Doctrine/Phpcr/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use Symfony\Cmf\Component\Routing\ContentRepositoryInterface;
Expand Down
1 change: 0 additions & 1 deletion Doctrine/Phpcr/IdPrefixListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
Expand Down
18 changes: 8 additions & 10 deletions Doctrine/Phpcr/LocaleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ODM\PHPCR\DocumentManager;
use Doctrine\ODM\PHPCR\Event\MoveEventArgs;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
Expand Down Expand Up @@ -166,14 +164,14 @@ protected function getPrefixes()
* Update the locale of a route if $id starts with the prefix and has a
* valid locale right after.
*
* @param Route $doc The route object
* @param string $id The id (in move case, this is not the current
* id of $route).
* @param DocumentManager $dm The document manager to get locales from if
* the setAvailableTranslations option is
* enabled.
* @param boolean $force Whether to update the locale even if the
* route already has a locale.
* @param Route $doc The route object
* @param string $id The id (in move case, this is not the current
* id of $route).
* @param DocumentManager $dm The document manager to get locales from if
* the setAvailableTranslations option is
* enabled.
* @param boolean $force Whether to update the locale even if the
* route already has a locale.
*/
protected function updateLocale(Route $doc, $id, DocumentManager $dm, $force = false)
{
Expand Down
3 changes: 1 addition & 2 deletions Doctrine/Phpcr/PrefixInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

/**
Expand All @@ -27,7 +26,7 @@ public function getId();

/**
* @param string $prefix The path in the repository to the routing root
* document.
* document.
*/
public function setPrefix($prefix);
}
1 change: 0 additions & 1 deletion Doctrine/Phpcr/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use Doctrine\Common\Collections\Collection;
Expand Down
1 change: 0 additions & 1 deletion Doctrine/Phpcr/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use Doctrine\Common\Collections\ArrayCollection;
Expand Down
2 changes: 0 additions & 2 deletions Doctrine/Phpcr/RouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;

use PHPCR\Query\QueryInterface;
use PHPCR\Query\RowInterface;
use PHPCR\RepositoryException;
use PHPCR\Util\UUIDHelper;
use Doctrine\Common\Persistence\ManagerRegistry;
Expand Down
1 change: 0 additions & 1 deletion Form/Type/RouteTypeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
Expand Down
3 changes: 1 addition & 2 deletions Model/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Model;

use LogicException;
Expand Down Expand Up @@ -129,7 +128,7 @@ public function isPermanent()
* and target route document.
*
* @param array $parameters a hashmap of key to value mapping for route
* parameters
* parameters
*/
public function setParameters(array $parameters)
{
Expand Down
3 changes: 1 addition & 2 deletions Model/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Model;

use Symfony\Component\Routing\Route as SymfonyRoute;
Expand Down Expand Up @@ -141,7 +140,7 @@ public function setStaticPrefix($prefix)
* Set the object this url points to
*
* @param mixed $object A content object that can be persisted by the
* storage layer.
* storage layer.
*/
public function setContent($object)
{
Expand Down
1 change: 0 additions & 1 deletion Routing/DynamicRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Routing;

use Symfony\Component\HttpFoundation\Request;
Expand Down
1 change: 0 additions & 1 deletion Tests/Functional/Admin/RouteAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Admin;

use Symfony\Cmf\Bundle\RoutingBundle\Admin\RouteAdmin;
Expand Down
9 changes: 4 additions & 5 deletions Tests/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional;

use Doctrine\ODM\PHPCR\DocumentManager;
use PHPCR\Util\PathHelper;
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase as ComponentBaseTestCase;
use Symfony\Cmf\Component\Testing\Document\Content;
use Symfony\Cmf\Bundle\RoutingBundle\Tests\Resources\Document\Content;

class BaseTestCase extends ComponentBaseTestCase
{
Expand Down Expand Up @@ -53,10 +52,10 @@ protected function createRoute($path)
*
* @return Content
*/
protected function createContent($path)
protected function createContent($path = '/test/content')
{
$content = new Content;
$content->setId('/test/content');
$content = new Content();
$content->setId($path);
$content->setTitle('Foo Content');
$this->getDm()->persist($content);
$this->getDm()->flush();
Expand Down
5 changes: 1 addition & 4 deletions Tests/Functional/Controller/RedirectControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Controller;

use Symfony\Component\HttpFoundation\RedirectResponse;

use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute;
use Symfony\Cmf\Bundle\RoutingBundle\Controller\RedirectController;
Expand Down Expand Up @@ -63,7 +60,7 @@ public function testRedirectUri()

public function testRedirectContent()
{
$content = $this->createContent('/test/content');
$content = $this->createContent();

$root = $this->getDm()->find(null, self::ROUTE_ROOT);

Expand Down
2 changes: 0 additions & 2 deletions Tests/Functional/Doctrine/Orm/OrmTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Doctrine\Orm;

use Symfony\Cmf\Component\Testing\Functional\BaseTestCase as ComponentBaseTestCase;
use Symfony\Cmf\Component\Testing\Document\Content;

use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\Route;

Expand Down
1 change: 0 additions & 1 deletion Tests/Functional/Doctrine/Orm/RouteProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Doctrine\Orm;

use Symfony\Component\HttpFoundation\Request;
Expand Down
3 changes: 1 addition & 2 deletions Tests/Functional/Doctrine/Phpcr/RedirectRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Doctrine\Phpcr;

use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
Expand All @@ -29,7 +28,7 @@ public function setUp()

public function testRedirectDoctrine()
{
$content = $this->createContent('/test/content');
$content = $this->createContent();
$root = $this->getDm()->find(null, self::ROUTE_ROOT);

$route = new Route;
Expand Down
1 change: 0 additions & 1 deletion Tests/Functional/Doctrine/Phpcr/RouteProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Doctrine\Phpcr;

use Doctrine\ODM\PHPCR\Document\Generic;
Expand Down
1 change: 0 additions & 1 deletion Tests/Functional/Doctrine/Phpcr/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Doctrine\Phpcr;

use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
Expand Down
Loading

0 comments on commit 04556bd

Please sign in to comment.