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

@ -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);
}
}
}
@ -287,7 +287,7 @@ abstract class AbstractCommand extends ContainerAwareCommand
}
/**
* @param \SplFileInfo $file
* @param \SplFileInfo $file
* @return string
*/
protected function getRelativeFileName(\SplFileInfo $file)
@ -369,8 +369,8 @@ EOT;
/**
* Returns an array of properties as key/value pairs from an input file.
*
* @param string $file A file properties.
* @return array An array of properties as key/value pairs.
* @param string $file A file properties.
* @return array An array of properties as key/value pairs.
*/
protected function getProperties($file)
{
@ -405,7 +405,7 @@ EOT;
/**
* Return the current Propel cache directory.
* @return string The current Propel cache directory.
* @return string The current Propel cache directory.
*/
protected function getCacheDir()
{
@ -459,8 +459,8 @@ EOT;
/**
* Extract the database name from a given DSN
*
* @param string $dsn A DSN
* @return string The database name extracted from the given DSN
* @param string $dsn A DSN
* @return string The database name extracted from the given DSN
*/
protected function parseDbName($dsn)
{
@ -574,8 +574,8 @@ EOT;
}
/**
* @param \SplFileInfo $schema
* @param BundleInterface $bundle
* @param \SplFileInfo $schema
* @param BundleInterface $bundle
* @return string
*/
protected function transformToLogicalName(\SplFileInfo $schema, BundleInterface $bundle)

View file

@ -73,8 +73,8 @@ class DatabaseCreateCommand extends AbstractCommand
*
* @see https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Connection.php#L1491
*
* @param string $name A connection name.
* @param array $config A Propel connection configuration.
* @param string $name A connection name.
* @param array $config A Propel connection configuration.
* @return array
*/
private function getTemporaryConfiguration($name, $config)

View file

@ -160,8 +160,8 @@ EOT
/**
* Load fixtures
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
protected function loadFixtures(InputInterface $input, OutputInterface $output, $type = null)
@ -205,8 +205,8 @@ EOT
/**
* Load SQL fixtures
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
protected function loadSqlFixtures(InputInterface $input, OutputInterface $output)

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

@ -55,7 +55,7 @@ abstract class AbstractDataDumper extends AbstractDataHandler implements DataDum
* Dumps data to fixture from a given connection and
* returns an array.
*
* @param string $connectionName The connection name
* @param string $connectionName The connection name
* @return array
*/
protected function getDataAsArray()
@ -175,7 +175,7 @@ abstract class AbstractDataDumper extends AbstractDataHandler implements DataDum
* Fixes the ordering of foreign key data, by outputting data
* a foreign key depends on before the table with the foreign key.
*
* @param array $classes The array with the class names
* @param array $classes The array with the class names
* @return array
*/
protected function fixOrderingOfForeignKeyData($classes)

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;
@ -38,7 +37,7 @@ abstract class AbstractDataLoader extends AbstractDataHandler implements DataLoa
/**
* Transforms a file containing data in an array.
*
* @param string $file A filename.
* @param string $file A filename.
* @return array
*/
abstract protected function transformDataToArray($file);

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

@ -28,7 +28,7 @@ class XmlDataLoader extends AbstractDataLoader
}
/**
* @param SimpleXMLElement $xml
* @param SimpleXMLElement $xml
* @return array
*/
protected function simpleXmlToArray($xml)
@ -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;
}

View file

@ -37,7 +37,7 @@ class Properties
/**
* Get properties.
*
* @return array An array of properties.
* @return array An array of properties.
*/
public function getProperties()
{

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

@ -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)));
}

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.
*
@ -29,8 +28,8 @@ class BookTableMap extends TableMap
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
* @return void
* @throws PropelException
*/
public function initialize()
{

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;
@ -71,7 +70,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Get the [id] column value.
*
* @return int
* @return int
*/
public function getId()
{
@ -81,7 +80,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Get the [name] column value.
*
* @return string
* @return string
*/
public function getName()
{
@ -91,7 +90,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Get the [slug] column value.
*
* @return string
* @return string
*/
public function getSlug()
{
@ -101,8 +100,8 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Set the value of [id] column.
*
* @param int $v new value
* @return Book The current object (for fluent API support)
* @param int $v new value
* @return Book The current object (for fluent API support)
*/
public function setId($v)
{
@ -121,8 +120,8 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Set the value of [name] column.
*
* @param string $v new value
* @return Book The current object (for fluent API support)
* @param string $v new value
* @return Book The current object (for fluent API support)
*/
public function setName($v)
{
@ -141,8 +140,8 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Set the value of [slug] column.
*
* @param string $v new value
* @return Book The current object (for fluent API support)
* @param string $v new value
* @return Book The current object (for fluent API support)
*/
public function setSlug($v)
{
@ -164,7 +163,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* This method can be used in conjunction with isModified() to indicate whether an object is both
* modified _and_ has some values set which are non-default.
*
* @return boolean Whether the columns in this object are only been set with default values.
* @return boolean Whether the columns in this object are only been set with default values.
*/
public function hasOnlyDefaultValues()
{
@ -180,11 +179,11 @@ abstract class BaseBook extends BaseObject implements Persistent
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
@ -219,7 +218,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* the base method from the overridden method (i.e. parent::ensureConsistency()),
* in case your model changes.
*
* @throws PropelException
* @throws PropelException
*/
public function ensureConsistency()
{
@ -231,10 +230,10 @@ abstract class BaseBook extends BaseObject implements Persistent
*
* This will only work if the object has been saved and has a valid primary key set.
*
* @param boolean $deep (optional) Whether to also de-associated any related objects.
* @param PropelPDO $con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
* @param boolean $deep (optional) Whether to also de-associated any related objects.
* @param PropelPDO $con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
*/
public function reload($deep = false, PropelPDO $con = null)
{
@ -269,9 +268,9 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
@ -312,9 +311,9 @@ abstract class BaseBook extends BaseObject implements Persistent
* method. This method wraps all precipitate database operations in a
* single transaction.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see doSave()
*/
public function save(PropelPDO $con = null)
@ -363,9 +362,9 @@ abstract class BaseBook extends BaseObject implements Persistent
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
@ -414,7 +413,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* Gets any ValidationFailed objects that resulted from last call to validate().
*
*
* @return array ValidationFailed[]
* @return array ValidationFailed[]
* @see validate()
*/
public function getValidationFailures()
@ -428,8 +427,8 @@ abstract class BaseBook extends BaseObject implements Persistent
* If $columns is either a column name or an array of column names
* only those columns are validated.
*
* @param mixed $columns Column name or an array of column names.
* @return boolean Whether all columns pass validation.
* @param mixed $columns Column name or an array of column names.
* @return boolean Whether all columns pass validation.
* @see doValidate()
* @see getValidationFailures()
*/
@ -454,8 +453,8 @@ abstract class BaseBook extends BaseObject implements Persistent
* also be validated. If all pass then <code>true</code> is returned; otherwise
* an aggreagated array of ValidationFailed objects will be returned.
*
* @param array $columns Array of column names to validate.
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
* @param array $columns Array of column names to validate.
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
*/
protected function doValidate($columns = null)
{
@ -485,7 +484,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* @param string $type The type of fieldname the $name is of:
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return mixed Value of field.
* @return mixed Value of field.
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
@ -499,8 +498,8 @@ abstract class BaseBook extends BaseObject implements Persistent
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
@ -532,7 +531,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
*
* @return array an associative array containing the field names (as keys) and field values
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
{
@ -558,7 +557,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* @param string $type The type of fieldname the $name is of:
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return void
* @return void
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
@ -571,9 +570,9 @@ abstract class BaseBook extends BaseObject implements Persistent
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
@ -603,9 +602,9 @@ abstract class BaseBook extends BaseObject implements Persistent
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* The default key type is the column's phpname (e.g. 'AuthorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
@ -619,7 +618,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Build a Criteria object containing the values of all modified columns in this object.
*
* @return Criteria The Criteria object containing all modified values.
* @return Criteria The Criteria object containing all modified values.
*/
public function buildCriteria()
{
@ -638,7 +637,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
*
* @return Criteria The Criteria object containing value(s) for primary key(s).
* @return Criteria The Criteria object containing value(s) for primary key(s).
*/
public function buildPkeyCriteria()
{
@ -650,7 +649,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Returns the primary key for this object (row).
* @return int
* @return int
*/
public function getPrimaryKey()
{
@ -660,8 +659,8 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Generic method to set the primary key (id column).
*
* @param int $key Primary key.
* @return void
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
@ -670,7 +669,7 @@ abstract class BaseBook extends BaseObject implements Persistent
/**
* Returns true if the primary key for this object is null.
* @return boolean
* @return boolean
*/
public function isPrimaryKeyNull()
{
@ -683,10 +682,10 @@ abstract class BaseBook extends BaseObject implements Persistent
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of Book (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
* @param object $copyObj An object of Book (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
@ -706,9 +705,9 @@ abstract class BaseBook extends BaseObject implements Persistent
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return Book Clone of current object.
* @throws PropelException
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return Book Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
{
@ -727,7 +726,7 @@ abstract class BaseBook extends BaseObject implements Persistent
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return BookPeer
* @return BookPeer
*/
public function getPeer()
{

View file

@ -61,11 +61,10 @@ abstract class BaseBookPeer
* An identiy map to hold any loaded instances of Book objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array Book[]
* @var array Book[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
@ -102,11 +101,11 @@ abstract class BaseBookPeer
* @param string $name field name
* @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
* @param string $toType One of the class type constants
* @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;
@ -123,10 +122,10 @@ abstract class BaseBookPeer
* @param string $type The type of fieldnames to return:
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return array A list of field names
* @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.');
@ -140,12 +139,12 @@ abstract class BaseBookPeer
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. BookPeer::COLUMN_NAME).
* @return string
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. BookPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
@ -159,10 +158,10 @@ abstract class BaseBookPeer
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
@ -180,10 +179,10 @@ abstract class BaseBookPeer
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @return int Number of matching rows.
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
{
@ -224,11 +223,11 @@ abstract class BaseBookPeer
/**
* Selects one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param PropelPDO $con
* @return Book
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param Criteria $criteria object used to create the SELECT statement.
* @param PropelPDO $con
* @return Book
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
{
@ -244,11 +243,11 @@ abstract class BaseBookPeer
/**
* Selects several row from the DB.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
@ -260,11 +259,11 @@ abstract class BaseBookPeer
* Use this method directly if you want to work with an executed statement durirectly (for example
* to perform your own object hydration).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con The connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return PDOStatement The executed PDOStatement object.
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con The connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return PDOStatement The executed PDOStatement object.
* @see BasePeer::doSelect()
*/
public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
@ -339,8 +338,8 @@ abstract class BaseBookPeer
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
* @return Book Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
* @return Book Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
* @see getPrimaryKeyHash()
*/
public static function getInstanceFromPool($key)
@ -357,7 +356,7 @@ abstract class BaseBookPeer
/**
* Clear the instance pool.
*
* @return void
* @return void
*/
public static function clearInstancePool()
{
@ -378,9 +377,9 @@ abstract class BaseBookPeer
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
@ -397,9 +396,9 @@ abstract class BaseBookPeer
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
@ -410,8 +409,8 @@ abstract class BaseBookPeer
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
@ -441,11 +440,11 @@ abstract class BaseBookPeer
/**
* Populates an object of the default type or an object that inherit from the default.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Book object, last column rank)
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Book object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
@ -468,9 +467,9 @@ abstract class BaseBookPeer
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
@ -496,8 +495,8 @@ abstract class BaseBookPeer
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @param boolean $withPrefix Whether or not to return the path with the class name
* @return string path.to.ClassName
* @param boolean $withPrefix Whether or not to return the path with the class name
* @return string path.to.ClassName
*/
public static function getOMClass($withPrefix = true)
{
@ -507,11 +506,11 @@ abstract class BaseBookPeer
/**
* Performs an INSERT on the database, given a Book or Criteria object.
*
* @param mixed $values Criteria or Book object containing data that is used to create the INSERT statement.
* @param PropelPDO $con the PropelPDO connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param mixed $values Criteria or Book object containing data that is used to create the INSERT statement.
* @param PropelPDO $con the PropelPDO connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, PropelPDO $con = null)
{
@ -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);
@ -550,11 +548,11 @@ abstract class BaseBookPeer
/**
* Performs an UPDATE on the database, given a Book or Criteria object.
*
* @param mixed $values Criteria or Book object containing data that is used to create the UPDATE statement.
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param mixed $values Criteria or Book object containing data that is used to create the UPDATE statement.
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, PropelPDO $con = null)
{
@ -589,8 +587,8 @@ abstract class BaseBookPeer
/**
* Deletes all rows from the book table.
*
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(PropelPDO $con = null)
{
@ -622,11 +620,11 @@ abstract class BaseBookPeer
*
* @param mixed $values Criteria or Book object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, PropelPDO $con = null)
{
@ -686,7 +684,7 @@ abstract class BaseBookPeer
* @param Book $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate($obj, $cols = null)
{
@ -716,9 +714,9 @@ abstract class BaseBookPeer
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return Book
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return Book
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
@ -742,10 +740,10 @@ abstract class BaseBookPeer
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
@ -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;
@ -59,7 +58,7 @@ abstract class BaseBookQuery extends ModelCriteria
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return BookQuery
* @return BookQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
@ -86,7 +85,7 @@ abstract class BaseBookQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con an optional connection object
*
* @return Book|array|mixed the result, formatted by the current formatter
* @return Book|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
@ -112,7 +111,7 @@ abstract class BaseBookQuery extends ModelCriteria
* @param array $keys Primary keys to use for the query
* @param PropelPDO $con an optional connection object
*
* @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
* @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
@ -128,7 +127,7 @@ abstract class BaseBookQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
@ -140,7 +139,7 @@ abstract class BaseBookQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
@ -163,7 +162,7 @@ abstract class BaseBookQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
@ -187,7 +186,7 @@ abstract class BaseBookQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
@ -216,7 +215,7 @@ abstract class BaseBookQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function filterBySlug($slug = null, $comparison = null)
{
@ -237,7 +236,7 @@ abstract class BaseBookQuery extends ModelCriteria
*
* @param Book $book Object to remove from the list of results
*
* @return BookQuery The current query, for fluid interface
* @return BookQuery The current query, for fluid interface
*/
public function prune($book = null)
{

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();
@ -179,7 +177,7 @@ class PropelParamConverterTest extends TestCase
}
public function testParamConverterFindSlugWithMapping()
{
{
$paramConverter = new PropelParamConverter();
$request = new Request(array(), array(), array('slugParam_special' => 'my-book', 'book' => null));
$configuration = new ParamConverter(array('class' => 'Propel\PropelBundle\Tests\Fixtures\Model\Book',

View file

@ -21,7 +21,7 @@ class PropelInflector
* Camelize a word.
* Inspirated by https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/Inflector.php
*
* @param string $word The word to camelize.
* @param string $word The word to camelize.
* @return string
*/
public static function camelize($word)

View file

@ -23,8 +23,8 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException;
class UniqueObjectValidator extends ConstraintValidator
{
/**
* @param object $object
* @param \Symfony\Component\Validator\Constraint $constraint
* @param object $object
* @param \Symfony\Component\Validator\Constraint $constraint
* @return Boolean
*/
public function isValid($object, Constraint $constraint)
@ -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.");