RUN PHP-CS PSR-2
This commit is contained in:
parent
102c7acd60
commit
4219e706d4
|
@ -278,7 +278,7 @@ abstract class AbstractCommand extends ContainerAwareCommand
|
|||
$logicalName = $this->transformToLogicalName($schema, $bundle);
|
||||
$finalSchema = new \SplFileInfo($this->getFileLocator()->locate($logicalName));
|
||||
|
||||
$finalSchemas[(string)$finalSchema] = array($bundle, $finalSchema);
|
||||
$finalSchemas[(string) $finalSchema] = array($bundle, $finalSchema);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* This file is part of the PropelBundle package.
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Propel\PropelBundle\Command;
|
|||
*/
|
||||
class Phing extends \Phing
|
||||
{
|
||||
static public function getPhingVersion()
|
||||
public static function getPhingVersion()
|
||||
{
|
||||
return 'Phing/Symfony';
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
namespace Propel\PropelBundle\DataFixtures\Loader;
|
||||
|
||||
|
||||
use \BasePeer;
|
||||
use \BaseObject;
|
||||
use \Propel;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class XmlDataLoader extends AbstractDataLoader
|
|||
// First make a valid key which is the Ns (Namespace) attribute
|
||||
// + the element name (the class name)
|
||||
foreach ($value->attributes() as $subkey => $subvalue) {
|
||||
if ('Namespace' === (string)$subkey) {
|
||||
if ('Namespace' === (string) $subkey) {
|
||||
$key = $subvalue . '\\' . $key;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -61,7 +61,7 @@ class FixturesLoadCommandTest extends TestCase
|
|||
{
|
||||
$tmp_dir = $this->fixtures_dir;
|
||||
|
||||
return array_map(function($file) use($tmp_dir) {
|
||||
return array_map(function($file) use ($tmp_dir) {
|
||||
return str_replace($tmp_dir . DIRECTORY_SEPARATOR, '', $file);
|
||||
}, array_keys(iterator_to_array($file_iterator)));
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Propel\PropelBundle\Tests\Fixtures\Model\map;
|
|||
use \RelationMap;
|
||||
use \TableMap;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'book' table.
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -33,7 +33,7 @@ class UniqueObjectValidator extends ConstraintValidator
|
|||
throw new UnexpectedTypeException($constraint->fields, 'array');
|
||||
}
|
||||
|
||||
$fields = (array)$constraint->fields;
|
||||
$fields = (array) $constraint->fields;
|
||||
|
||||
if (0 === count($fields)) {
|
||||
throw new ConstraintDefinitionException("At least one field must be specified.");
|
||||
|
|
Loading…
Reference in a new issue