RUN PHP-CS PSR-2

This commit is contained in:
Adel 2012-07-19 01:44:18 +03:00 committed by Adel ELHAIBA
parent 102c7acd60
commit 4219e706d4
28 changed files with 216 additions and 205 deletions

View file

@ -1,6 +1,5 @@
<?php
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE

View file

@ -15,7 +15,7 @@ namespace Propel\PropelBundle\Command;
*/
class Phing extends \Phing
{
static public function getPhingVersion()
public static function getPhingVersion()
{
return 'Phing/Symfony';
}

View file

@ -23,5 +23,5 @@ interface DataDumperInterface
* @param string $filename The file name to write data.
* @param string $connectionName The Propel connection name.
*/
function dump($filename, $connectionName = null);
public function dump($filename, $connectionName = null);
}

View file

@ -10,7 +10,6 @@
namespace Propel\PropelBundle\DataFixtures\Loader;
use \BasePeer;
use \BaseObject;
use \Propel;

View file

@ -23,5 +23,5 @@ interface DataLoaderInterface
* @param array $files A set of files containing datas to load.
* @param string $connectionName The Propel connection name
*/
function load($files = array(), $connectionName);
public function load($files = array(), $connectionName);
}

View file

@ -26,7 +26,7 @@ class AclClass extends BaseAclClass
*
* @return \Propel\PropelBundle\Model\Acl\AclClass
*/
static public function fromAclObjectIdentity(ObjectIdentityInterface $objectIdentity, \PropelPDO $con = null)
public static function fromAclObjectIdentity(ObjectIdentityInterface $objectIdentity, \PropelPDO $con = null)
{
$obj = AclClassQuery::create()
->filterByType($objectIdentity->getType())

View file

@ -31,7 +31,7 @@ class Entry extends BaseEntry
*
* @return \Propel\PropelBundle\Model\Acl\Entry
*/
static public function fromAclEntry(EntryInterface $aclEntry)
public static function fromAclEntry(EntryInterface $aclEntry)
{
$entry = new self();
@ -69,7 +69,7 @@ class Entry extends BaseEntry
*
* @return \Symfony\Component\Security\Acl\Model\EntryInterface
*/
static public function toAclEntry(Entry $modelEntry, AclInterface $acl)
public static function toAclEntry(Entry $modelEntry, AclInterface $acl)
{
if (null === $modelEntry->getFieldName()) {
return new AclEntry($modelEntry, $acl);

View file

@ -25,7 +25,7 @@ class SecurityIdentity extends BaseSecurityIdentity
*
* @return \Symfony\Component\Security\Acl\Model\SecurityIdentityInterface
*/
static public function toAclIdentity(SecurityIdentity $securityIdentity)
public static function toAclIdentity(SecurityIdentity $securityIdentity)
{
$identifier = $securityIdentity->getIdentifier();
@ -58,7 +58,7 @@ class SecurityIdentity extends BaseSecurityIdentity
*
* @return \Propel\PropelBundle\Model\Acl\SecurityIdentity
*/
static public function fromAclIdentity(SecurityIdentityInterface $aclIdentity, \PropelPDO $con = null)
public static function fromAclIdentity(SecurityIdentityInterface $aclIdentity, \PropelPDO $con = null)
{
if ($aclIdentity instanceof UserSecurityIdentity) {
$identifier = $aclIdentity->getClass().'-'.$aclIdentity->getUsername();

View file

@ -8,7 +8,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInte
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpFoundation\Request;
/**
* PropelParamConverter
*
@ -47,8 +46,21 @@ class PropelParamConverter implements ParamConverterInterface
*/
protected $withs;
/**
* @var bool
*/
protected $hasWith = false;
/**
* @param Request $request
* @param ConfigurationInterface $configuration
*
* @return bool
*
* @throws \LogicException
* @throws NotFoundHttpException
* @throws \Exception
*/
public function apply(Request $request, ConfigurationInterface $configuration)
{
$classQuery = $configuration->getClass() . 'Query';
@ -107,6 +119,11 @@ class PropelParamConverter implements ParamConverterInterface
return true;
}
/**
* @param ConfigurationInterface $configuration
*
* @return bool
*/
public function supports(ConfigurationInterface $configuration)
{
if (null === ($classname = $configuration->getClass())) {
@ -129,6 +146,8 @@ class PropelParamConverter implements ParamConverterInterface
*
* @param string $classQuery the query class
* @param Request $request
*
* @return mixed
*/
protected function findPk($classQuery, Request $request)
{
@ -146,9 +165,10 @@ class PropelParamConverter implements ParamConverterInterface
/**
* Try to find the object with all params from the $request
*
* @param string $classQuery
* @param Request $request the query class
* @param array $exclude an array of param to exclude from the filter
* @param string $classQuery the query class
* @param Request $request
*
* @return mixed
*/
protected function findOneBy($classQuery, Request $request)
{
@ -178,6 +198,9 @@ class PropelParamConverter implements ParamConverterInterface
* Init the query class with optional joinWith
*
* @param string $classQuery
*
* @return \ModelCriteria
*
* @throws \Exception
*/
protected function getQuery($classQuery)
@ -207,6 +230,9 @@ class PropelParamConverter implements ParamConverterInterface
* Return the valid join Criteria base on the with parameter
*
* @param array $with
*
* @return string
*
* @throws \Exception
*/
protected function getValidJoin($with)

View file

@ -10,7 +10,6 @@
namespace Propel\PropelBundle\Security\Acl\Domain;
use Symfony\Component\Security\Acl\Exception\Exception as AclException;
use Symfony\Component\Security\Acl\Model\AclInterface;

View file

@ -24,7 +24,6 @@ use Propel\PropelBundle\Security\Acl\Domain\Entry;
use Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException;
use Symfony\Component\Security\Acl\Exception\Exception as AclException;
use Symfony\Component\Security\Acl\Model\AclInterface;
use Symfony\Component\Security\Acl\Model\EntryInterface;
use Symfony\Component\Security\Acl\Model\FieldEntryInterface;

View file

@ -4,7 +4,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model;
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBook;
/**
* Skeleton subclass for representing a row from the 'book' table.
*

View file

@ -4,7 +4,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model;
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBookPeer;
/**
* Skeleton subclass for performing query and update operations on the 'book' table.
*

View file

@ -4,7 +4,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model;
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBookQuery;
/**
* Skeleton subclass for performing query and update operations on the 'book' table.
*

View file

@ -5,7 +5,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model\map;
use \RelationMap;
use \TableMap;
/**
* This class defines the structure of the 'book' table.
*

View file

@ -9,7 +9,6 @@ use \PDO;
use \Persistent;
use \Propel;
use \PropelException;
use \PropelObjectCollection;
use \PropelPDO;
use Propel\PropelBundle\Tests\Fixtures\Model\BookPeer;
use Propel\PropelBundle\Tests\Fixtures\Model\BookQuery;

View file

@ -65,7 +65,6 @@ abstract class BaseBookPeer
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
@ -106,7 +105,7 @@ abstract class BaseBookPeer
* @return string translated name of the field.
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
*/
static public function translateFieldName($name, $fromType, $toType)
public static function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
@ -126,7 +125,7 @@ abstract class BaseBookPeer
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
@ -529,7 +528,6 @@ abstract class BaseBookPeer
throw new PropelException('Cannot insert a value for auto-increment primary key ('.BookPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
@ -770,4 +768,3 @@ abstract class BaseBookPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseBookPeer::buildTableMap();

View file

@ -4,7 +4,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model\om;
use \Criteria;
use \ModelCriteria;
use \ModelJoin;
use \PropelPDO;
use Propel\PropelBundle\Tests\Fixtures\Model\BookPeer;
use Propel\PropelBundle\Tests\Fixtures\Model\BookQuery;

View file

@ -8,7 +8,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Propel\PropelBundle\Tests\TestCase;
class PropelParamConverterTest extends TestCase
{
@ -152,7 +151,6 @@ class PropelParamConverterTest extends TestCase
$paramConverter->apply($request, $configuration);
}
public function testParamConverterFindWithOptionalParam()
{
$paramConverter = new PropelParamConverter();