diff --git a/UPGRADE.md b/UPGRADE.md index dacc3ffd6..e80aa55ad 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -126,7 +126,7 @@ from 2.0 have to configure the annotation driver if they don't use `Configuratio $config->setMetadataDriverImpl($driver); -## Scalar mappings can now be ommitted from DQL result +## Scalar mappings can now be omitted from DQL result You are now allowed to mark scalar SELECT expressions as HIDDEN an they are not hydrated anymore. Example: @@ -307,7 +307,7 @@ them for batch updates like SchemaTool and other commands. However the annotations driver being a default driver does not really help that much anyways. -Therefore we decided to break backwards compability in this issue and drop +Therefore we decided to break backwards compatibility in this issue and drop the support for Annotations as Default Driver and require our users to specify the driver explicitly (which allows us to ask for the path to all entities). @@ -366,7 +366,7 @@ apologize for the inconvenience. ## Default Property for Field Mappings The "default" option for database column defaults has been removed. If desired, database column defaults can -be implemented by using the columnDefinition attribute of the @Column annotation (or the approriate XML and YAML equivalents). +be implemented by using the columnDefinition attribute of the @Column annotation (or the appropriate XML and YAML equivalents). Prefer PHP default values, if possible. ## Selecting Partial Objects @@ -451,7 +451,7 @@ With new required method AbstractTask::buildDocumentation, its implementation de * "doctrine schema-tool --drop" now always drops the complete database instead of only those tables defined by the current database model. The previous method had - problems when foreign keys of orphaned tables pointed to tables that were schedulded + problems when foreign keys of orphaned tables pointed to tables that were scheduled for deletion. * Use "doctrine schema-tool --update" to get a save incremental update for your database schema without deleting any unused tables, sequences or foreign keys. diff --git a/docs/en/cookbook/entities-in-session.rst b/docs/en/cookbook/entities-in-session.rst index 2fd771e5d..664cff53f 100644 --- a/docs/en/cookbook/entities-in-session.rst +++ b/docs/en/cookbook/entities-in-session.rst @@ -64,5 +64,5 @@ object or implement the __sleep() magic method on your entity. When you called detach on your objects they get "unmanaged" with that entity manager. This means you cannot use them as part of write operations - during ``EntityManagr#flush()`` anymore in this request. + during ``EntityManager#flush()`` anymore in this request. diff --git a/docs/en/reference/faq.rst b/docs/en/reference/faq.rst index 5d57c24f7..800b168bd 100644 --- a/docs/en/reference/faq.rst +++ b/docs/en/reference/faq.rst @@ -162,7 +162,7 @@ is supposed to kick-start you, but not towards 100%. Why does the EntityGenerator not generate inheritance correctly? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Just from the details of the discriminator map the EntityGenerator cannot guess the inheritance hierachy. +Just from the details of the discriminator map the EntityGenerator cannot guess the inheritance hierarchy. This is why the generation of inherited entities does not fully work. You have to adjust some additional code to get this one working correctly. diff --git a/docs/en/reference/working-with-associations.rst b/docs/en/reference/working-with-associations.rst index 253edad7e..7f46eba6a 100644 --- a/docs/en/reference/working-with-associations.rst +++ b/docs/en/reference/working-with-associations.rst @@ -689,7 +689,7 @@ interchangeably, independent of in-memory or sql-backed collections. */ public function setMaxResults($maxResults); public function getOrderings(); - public function getWhereExpresion(); + public function getWhereExpression(); public function getFirstResult(); public function getMaxResults(); } diff --git a/docs/en/tutorials/composite-primary-keys.rst b/docs/en/tutorials/composite-primary-keys.rst index 82a5210cb..dd4e49e04 100644 --- a/docs/en/tutorials/composite-primary-keys.rst +++ b/docs/en/tutorials/composite-primary-keys.rst @@ -19,7 +19,7 @@ the ID fields have to have their values set before you call ``EntityManager#pers Primitive Types only ~~~~~~~~~~~~~~~~~~~~ -Even in version 2.0 you can have composite keys as long as they only consist of the primative types +Even in version 2.0 you can have composite keys as long as they only consist of the primitive types ``integer`` and ``string``. Suppose you want to create a database of cars and use the model-name and year of production as primary keys: @@ -129,7 +129,7 @@ of one or many parent entities. - Dynamic Attributes of an Entity (for example Article). Each Article has many attributes with primary key "article_id" and "attribute_name". -- Address object of a Person, the primary key of the adress is "user_id". This is not a case of a composite primary +- Address object of a Person, the primary key of the address is "user_id". This is not a case of a composite primary key, but the identity is derived through a foreign entity and a foreign key. - Join Tables with metadata can be modelled as Entity, for example connections between two articles with a little description and a score. diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index be1a0a1fb..52f6ef507 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -386,7 +386,7 @@ abstract class AbstractQuery } /** - * Defines a cache driver to be used for caching result sets and implictly enables caching. + * Defines a cache driver to be used for caching result sets and implicitly enables caching. * * @param \Doctrine\Common\Cache\Cache|null $resultCacheDriver Cache driver * diff --git a/lib/Doctrine/ORM/Events.php b/lib/Doctrine/ORM/Events.php index 28fdcd9a9..8c13fa2d5 100644 --- a/lib/Doctrine/ORM/Events.php +++ b/lib/Doctrine/ORM/Events.php @@ -122,7 +122,7 @@ final class Events /** * The preFlush event occurs when the EntityManager#flush() operation is invoked, - * but before any changes to managed entites have been calculated. This event is + * but before any changes to managed entities have been calculated. This event is * always raised right after EntityManager#flush() call. */ const preFlush = 'preFlush'; diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 1254bacb4..afd4b41a1 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -168,7 +168,7 @@ abstract class AbstractHydrator } /** - * Excutes one-time preparation tasks, once each time hydration is started + * Executes one-time preparation tasks, once each time hydration is started * through {@link hydrateAll} or {@link iterate()}. * * @return void @@ -178,7 +178,7 @@ abstract class AbstractHydrator } /** - * Excutes one-time cleanup tasks at the end of a hydration that was initiated + * Executes one-time cleanup tasks at the end of a hydration that was initiated * through {@link hydrateAll} or {@link iterate()}. * * @return void @@ -223,7 +223,7 @@ abstract class AbstractHydrator * Puts the elements of a result row into a new array, grouped by the dql alias * they belong to. The column names in the result set are mapped to their * field names during this procedure as well as any necessary conversions on - * the values applied. Scalar values are kept in a specfic key 'scalars'. + * the values applied. Scalar values are kept in a specific key 'scalars'. * * @param array $data SQL Result Row. * @param array &$cache Cache for column to field result information. @@ -321,7 +321,7 @@ abstract class AbstractHydrator } // in an inheritance hierarchy the same field could be defined several times. - // We overwrite this value so long we dont have a non-null value, that value we keep. + // We overwrite this value so long we don't have a non-null value, that value we keep. // Per definition it cannot be that a field is defined several times and has several values. if (isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) && $value === null) { continue; diff --git a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php index 496942e94..c1c13c1f7 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php +++ b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php @@ -49,7 +49,7 @@ class HydrationException extends \Doctrine\ORM\ORMException public static function emptyDiscriminatorValue($dqlAlias) { return new self("The DQL alias '" . $dqlAlias . "' contains an entity ". - "of an inheritance hierachy with an empty discriminator value. This means " . + "of an inheritance hierarchy with an empty discriminator value. This means " . "that the database contains inconsistent data with an empty " . "discriminator value in a table row." ); diff --git a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php index 93179a406..942a662e4 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php @@ -200,7 +200,7 @@ class AssociationBuilder } else if ($this->type == ClassMetadata::ONE_TO_ONE) { $cm->mapOneToOne($mapping); } else { - throw new \InvalidArgumentException("Type should be a ToOne Assocation here"); + throw new \InvalidArgumentException("Type should be a ToOne Association here"); } return $this->builder; } diff --git a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php index a634f1678..774c9e06e 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php @@ -163,7 +163,7 @@ class ClassMetadataBuilder } /** - * Sets class as root of a joined table inheritance hierachy. + * Sets class as root of a joined table inheritance hierarchy. * * @return ClassMetadataBuilder */ @@ -175,7 +175,7 @@ class ClassMetadataBuilder } /** - * Sets class as root of a single table inheritance hierachy. + * Sets class as root of a single table inheritance hierarchy. * * @return ClassMetadataBuilder */ @@ -207,7 +207,7 @@ class ClassMetadataBuilder } /** - * Adds a subclass to this inheritance hierachy. + * Adds a subclass to this inheritance hierarchy. * * @param string $name * @param string $class @@ -319,7 +319,7 @@ class ClassMetadataBuilder } /** - * Creates a ManyToOne Assocation Builder. + * Creates a ManyToOne Association Builder. * * Note: This method does not add the association, you have to call build() on the AssociationBuilder. * @@ -361,7 +361,7 @@ class ClassMetadataBuilder } /** - * Adds simple inverse one-to-one assocation. + * Adds simple inverse one-to-one association. * * @param string $name * @param string $targetEntity @@ -378,7 +378,7 @@ class ClassMetadataBuilder } /** - * Adds simple owning one-to-one assocation. + * Adds simple owning one-to-one association. * * @param string $name * @param string $targetEntity @@ -398,7 +398,7 @@ class ClassMetadataBuilder } /** - * Creates a ManyToMany Assocation Builder. + * Creates a ManyToMany Association Builder. * * @param string $name * @param string $targetEntity @@ -418,7 +418,7 @@ class ClassMetadataBuilder } /** - * Adds a simple owning many to many assocation. + * Adds a simple owning many to many association. * * @param string $name * @param string $targetEntity @@ -438,7 +438,7 @@ class ClassMetadataBuilder } /** - * Adds a simple inverse many to many assocation. + * Adds a simple inverse many to many association. * * @param string $name * @param string $targetEntity @@ -455,7 +455,7 @@ class ClassMetadataBuilder } /** - * Creates a one to many assocation builder. + * Creates a one to many association builder. * * @param string $name * @param string $targetEntity @@ -475,7 +475,7 @@ class ClassMetadataBuilder } /** - * Adds simple OneToMany assocation. + * Adds simple OneToMany association. * * @param string $name * @param string $targetEntity diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 4ea082d31..242a9099f 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -193,7 +193,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory } $class->validateIdentifier(); - $class->validateAssocations(); + $class->validateAssociations(); $class->validateLifecycleCallbacks($this->getReflectionService()); // verify inheritance @@ -319,7 +319,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory foreach ($parentClass->associationMappings as $field => $mapping) { if ($parentClass->isMappedSuperclass) { if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { - throw MappingException::illegalToManyAssocationOnMappedSuperclass($parentClass->name, $field); + throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field); } $mapping['sourceEntity'] = $subClass->name; } diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index fc808d3e5..1396d2a11 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -509,7 +509,7 @@ class ClassMetadataInfo implements ClassMetadata public $isIdentifierComposite = false; /** - * READ-ONLY: Flag indicating wheather the identifier/primary key contains at least one foreign key association. + * READ-ONLY: Flag indicating whether the identifier/primary key contains at least one foreign key association. * * This flag is necessary because some code blocks require special treatment of this cases. * @@ -631,7 +631,7 @@ class ClassMetadataInfo implements ClassMetadata } /** - * Gets the ReflectionPropertys of the mapped class. + * Gets the ReflectionProperties of the mapped class. * * @return array An array of ReflectionProperty instances. */ @@ -938,7 +938,7 @@ class ClassMetadataInfo implements ClassMetadata * * @throws MappingException */ - public function validateAssocations() + public function validateAssociations() { foreach ($this->associationMappings as $mapping) { if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { @@ -1437,7 +1437,7 @@ class ClassMetadataInfo implements ClassMetadata )); } - $uniqueContraintColumns = array(); + $uniqueConstraintColumns = array(); foreach ($mapping['joinColumns'] as &$joinColumn) { if ($mapping['type'] === self::ONE_TO_ONE && ! $this->isInheritanceTypeSingleTable()) { if (count($mapping['joinColumns']) == 1) { @@ -1445,7 +1445,7 @@ class ClassMetadataInfo implements ClassMetadata $joinColumn['unique'] = true; } } else { - $uniqueContraintColumns[] = $joinColumn['name']; + $uniqueConstraintColumns[] = $joinColumn['name']; } } @@ -1472,12 +1472,12 @@ class ClassMetadataInfo implements ClassMetadata ? $joinColumn['fieldName'] : $joinColumn['name']; } - if ($uniqueContraintColumns) { + if ($uniqueConstraintColumns) { if ( ! $this->table) { throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); } $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array( - 'columns' => $uniqueContraintColumns + 'columns' => $uniqueConstraintColumns ); } @@ -1488,7 +1488,7 @@ class ClassMetadataInfo implements ClassMetadata $mapping['isCascadeRemove'] = $mapping['orphanRemoval'] ? true : $mapping['isCascadeRemove']; if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { - throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']); + throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); } return $mapping; @@ -2051,7 +2051,7 @@ class ClassMetadataInfo implements ClassMetadata } /** - * Checks if this entity is the root in any entity-inheritance-hierachy. + * Checks if this entity is the root in any entity-inheritance-hierarchy. * * @return bool */ @@ -2427,7 +2427,7 @@ class ClassMetadataInfo implements ClassMetadata * @deprecated Deprecated since version 2.4 in favor of \Doctrine\ORM\Event\ListenersInvoker * * @param string $lifecycleEvent The lifecycle event. - * @param object $entity The Entity on which the event occured. + * @param object $entity The Entity on which the event occurred. * * @return void */ diff --git a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php index 78c93791b..75658547e 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php +++ b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php @@ -21,7 +21,7 @@ namespace Doctrine\ORM\Mapping; /** - * The default DefaultEntityListene + * The default DefaultEntityListener * * @since 2.4 * @author Fabio B. Silva diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index a4bea98ea..9e1c734cc 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -247,7 +247,7 @@ class AnnotationDriver extends AbstractAnnotationDriver $mapping = array(); $mapping['fieldName'] = $property->getName(); - // Check for JoinColummn/JoinColumns annotations + // Check for JoinColumn/JoinColumns annotations $joinColumns = array(); if ($joinColumnAnnot = $this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinColumn')) { @@ -375,7 +375,7 @@ class AnnotationDriver extends AbstractAnnotationDriver $override = array(); $fieldName = $associationOverride->name; - // Check for JoinColummn/JoinColumns annotations + // Check for JoinColumn/JoinColumns annotations if ($associationOverride->joinColumns) { $joinColumns = array(); foreach ($associationOverride->joinColumns as $joinColumn) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index e1f75da6d..15a4e0d2c 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -84,7 +84,7 @@ class DatabaseDriver implements MappingDriver } /** - * Sets tables manually instead of relying on the reverse engeneering capabilities of SchemaManager. + * Sets tables manually instead of relying on the reverse engineering capabilities of SchemaManager. * * @param array $entityTables * @param array $manyToManyTables @@ -252,7 +252,7 @@ class DatabaseDriver implements MappingDriver if (!$otherFk) { // the definition of this many to many table does not contain - // enough foreign key information to continue reverse engeneering. + // enough foreign key information to continue reverse engineering. continue; } @@ -319,7 +319,7 @@ class DatabaseDriver implements MappingDriver ); } - //Here we need to check if $cols are the same as $primaryKeyColums + //Here we need to check if $cols are the same as $primaryKeyColumns if (!array_diff($cols,$primaryKeyColumns)) { $metadata->mapOneToOne($associationMapping); } else { diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 26d1becd0..461038932 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -224,7 +224,7 @@ class XmlDriver extends FileDriver $metadata->table['options'] = $this->_parseOptions($xmlRoot->options->children()); } - // The mapping assignement is done in 2 times as a bug might occurs on some php/xml lib versions + // The mapping assignment is done in 2 times as a bug might occurs on some php/xml lib versions // The internal SimpleXmlIterator get resetted, to this generate a duplicate field exception $mappings = array(); // Evaluate mappings diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index 61ecb4d11..a8345bbd6 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -529,7 +529,7 @@ class MappingException extends \Doctrine\ORM\ORMException */ public static function cannotVersionIdField($className, $fieldName) { - return new self("Setting Id field '$fieldName' as versionale in entity class '$className' is not supported."); + return new self("Setting Id field '$fieldName' as versionable in entity class '$className' is not supported."); } /** @@ -561,7 +561,7 @@ class MappingException extends \Doctrine\ORM\ORMException * * @return MappingException */ - public static function illegalToManyAssocationOnMappedSuperclass($className, $field) + public static function illegalToManyAssociationOnMappedSuperclass($className, $field) { return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className."#".$field."'."); } @@ -632,7 +632,7 @@ class MappingException extends \Doctrine\ORM\ORMException * * @return MappingException */ - public static function illegalInverseIdentifierAssocation($className, $field) + public static function illegalInverseIdentifierAssociation($className, $field) { return new self("An inverse association is not allowed to be identifier in '$className#$field'."); } @@ -643,7 +643,7 @@ class MappingException extends \Doctrine\ORM\ORMException * * @return MappingException */ - public static function illegalToManyIdentifierAssoaction($className, $field) + public static function illegalToManyIdentifierAssociation($className, $field) { return new self("Many-to-many or one-to-many associations are not allowed to be identifier in '$className#$field'."); } @@ -668,8 +668,8 @@ class MappingException extends \Doctrine\ORM\ORMException { return new self( "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . - "to be properly mapped in the inheritance hierachy. Alternatively you can make '".$className."' an abstract class " . - "to avoid this exception from occuring." + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class " . + "to avoid this exception from occurring." ); } diff --git a/lib/Doctrine/ORM/ORMInvalidArgumentException.php b/lib/Doctrine/ORM/ORMInvalidArgumentException.php index 1773df291..cb5037679 100644 --- a/lib/Doctrine/ORM/ORMInvalidArgumentException.php +++ b/lib/Doctrine/ORM/ORMInvalidArgumentException.php @@ -176,7 +176,7 @@ class ORMInvalidArgumentException extends \InvalidArgumentException public static function invalidCompositeIdentifier() { return new self("Binding an entity with a composite primary key to a query is not supported. " . - "You should split the parameter into the explicit fields and bind them seperately."); + "You should split the parameter into the explicit fields and bind them separately."); } /** diff --git a/lib/Doctrine/ORM/OptimisticLockException.php b/lib/Doctrine/ORM/OptimisticLockException.php index 6f1a57631..57ea66bde 100644 --- a/lib/Doctrine/ORM/OptimisticLockException.php +++ b/lib/Doctrine/ORM/OptimisticLockException.php @@ -71,7 +71,7 @@ class OptimisticLockException extends ORMException * * @return OptimisticLockException */ - public static function lockFailedVersionMissmatch($entity, $expectedLockVersion, $actualLockVersion) + public static function lockFailedVersionMismatch($entity, $expectedLockVersion, $actualLockVersion) { return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); } diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index dbfac3716..33040d993 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -843,7 +843,7 @@ final class PersistentCollection implements Collection, Selectable } if ($this->association['type'] !== ClassMetadata::ONE_TO_MANY) { - throw new \RuntimeException("Matching Criteria on PersistentCollection only works on OneToMany assocations at the moment."); + throw new \RuntimeException("Matching Criteria on PersistentCollection only works on OneToMany associations at the moment."); } // If there are NEW objects we have to check if any of them matches the criteria diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index d5543dad4..c6bd8e847 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -37,7 +37,7 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Expr\Comparison; /** - * A BasicEntityPersiter maps an entity to a single table in a relational database. + * A BasicEntityPersister maps an entity to a single table in a relational database. * * A persister is always responsible for a single entity type. * @@ -177,8 +177,8 @@ class BasicEntityPersister protected $selectColumnListSql; /** - * The JOIN SQL fragement used to eagerly load all many-to-one and one-to-one - * associations configured as FETCH_EAGER, aswell as all inverse one-to-one associations. + * The JOIN SQL fragment used to eagerly load all many-to-one and one-to-one + * associations configured as FETCH_EAGER, as well as all inverse one-to-one associations. * * @var string */ @@ -499,7 +499,7 @@ class BasicEntityPersister } // @Todo this only covers scenarios with no inheritance or of the same level. Is there something - // like self-referential relationship between different levels of an inheritance hierachy? I hope not! + // like self-referential relationship between different levels of an inheritance hierarchy? I hope not! $selfReferential = ($mapping['targetEntity'] == $mapping['sourceEntity']); $class = $this->class; $association = $mapping; diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 4989c7919..7a2f16a1a 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -302,31 +302,31 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister // INNER JOIN parent tables foreach ($this->class->parentClasses as $parentClassName) { - $contitions = array(); + $conditions = array(); $parentClass = $this->em->getClassMetadata($parentClassName); $tableAlias = $this->getSQLTableAlias($parentClassName); $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; foreach ($identifierColumn as $idColumn) { - $contitions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; + $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; } - $joinSql .= implode(' AND ', $contitions); + $joinSql .= implode(' AND ', $conditions); } // OUTER JOIN sub tables foreach ($this->class->subClasses as $subClassName) { - $contitions = array(); + $conditions = array(); $subClass = $this->em->getClassMetadata($subClassName); $tableAlias = $this->getSQLTableAlias($subClassName); $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; foreach ($identifierColumn as $idColumn) { - $contitions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; + $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; } - $joinSql .= implode(' AND ', $contitions); + $joinSql .= implode(' AND ', $conditions); } if ($assoc != null && $assoc['type'] == ClassMetadata::MANY_TO_MANY) { diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php index 0d7abc8d9..e157a90a2 100644 --- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php @@ -178,7 +178,7 @@ class SingleTablePersister extends AbstractEntityInheritancePersister { // Ensure that the filters are applied to the root entity of the inheritance tree $targetEntity = $this->em->getClassMetadata($targetEntity->rootEntityName); - // we dont care about the $targetTableAlias, in a STI there is only one table. + // we don't care about the $targetTableAlias, in a STI there is only one table. return parent::generateFilterConditionSQL($targetEntity, $targetTableAlias); } diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 8b8d40111..107055ed3 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -327,7 +327,7 @@ final class Query extends AbstractQuery } if (count($sqlParams) != count($types)) { - throw QueryException::parameterTypeMissmatch(); + throw QueryException::parameterTypeMismatch(); } if ($sqlParams) { diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 90c706137..48fb790b6 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -350,8 +350,8 @@ class Expr * When converted to string, it will generated a * . Example: * * [php] - * // u.salary * u.percentAnualSalaryIncrease - * $q->expr()->prod('u.salary', 'u.percentAnualSalaryIncrease') + * // u.salary * u.percentAnnualSalaryIncrease + * $q->expr()->prod('u.salary', 'u.percentAnnualSalaryIncrease') * * @param mixed $x Left expression. * @param mixed $y Right expression. diff --git a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php index 602dde6d8..462f971ba 100644 --- a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php +++ b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php @@ -23,7 +23,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Types\Type; /** - * Provides an enclosed support for parameter infering. + * Provides an enclosed support for parameter inferring. * * @link www.doctrine-project.org * @since 2.0 diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 460ebea46..e7a0e3ed2 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -305,7 +305,7 @@ class Parser * * @return void * - * @throws QueryException If the tokens dont match. + * @throws QueryException If the tokens don't match. */ public function match($token) { @@ -644,7 +644,7 @@ class Parser } if ($class->getConstructor() === null) { - $this->semanticalError(sprintf('Class "%s" has not a valid contructor.', $className), $token); + $this->semanticalError(sprintf('Class "%s" has not a valid constructor.', $className), $token); } if ($class->getConstructor()->getNumberOfRequiredParameters() > count($args)) { @@ -2373,7 +2373,7 @@ class Parser return $condPrimary; } - // Peek beyond the matching closing paranthesis ')' + // Peek beyond the matching closing parenthesis ')' $peek = $this->peekBeyondClosingParenthesis(); if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || @@ -2445,7 +2445,7 @@ class Parser $token = $this->lexer->peek(); } - // We need to go even further in case of IS (differenciate between NULL and EMPTY) + // We need to go even further in case of IS (differentiate between NULL and EMPTY) $lookahead = $this->lexer->peek(); } @@ -2495,19 +2495,19 @@ class Parser */ public function EmptyCollectionComparisonExpression() { - $emptyColletionCompExpr = new AST\EmptyCollectionComparisonExpression( + $emptyCollectionCompExpr = new AST\EmptyCollectionComparisonExpression( $this->CollectionValuedPathExpression() ); $this->match(Lexer::T_IS); if ($this->lexer->isNextToken(Lexer::T_NOT)) { $this->match(Lexer::T_NOT); - $emptyColletionCompExpr->not = true; + $emptyCollectionCompExpr->not = true; } $this->match(Lexer::T_EMPTY); - return $emptyColletionCompExpr; + return $emptyCollectionCompExpr; } /** @@ -2800,7 +2800,7 @@ class Parser } if ($peek['value'] == '(') { - // do NOT directly go to FunctionsReturningString() because it doesnt check for custom functions. + // do NOT directly go to FunctionsReturningString() because it doesn't check for custom functions. return $this->FunctionDeclaration(); } diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index 06a622644..da0d2d50c 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -123,9 +123,9 @@ class QueryException extends \Doctrine\ORM\ORMException /** * @return QueryException */ - public static function parameterTypeMissmatch() + public static function parameterTypeMismatch() { - return new self("DQL Query parameter and type numbers missmatch, but have to be exactly equal."); + return new self("DQL Query parameter and type numbers mismatch, but have to be exactly equal."); } /** @@ -159,7 +159,7 @@ class QueryException extends \Doctrine\ORM\ORMException { return new self( "Invalid query operation: Not allowed to iterate over fetch join collections ". - "in class ".$assoc['sourceEntity']." assocation ".$assoc['fieldName'] + "in class ".$assoc['sourceEntity']." association ".$assoc['fieldName'] ); } @@ -184,7 +184,7 @@ class QueryException extends \Doctrine\ORM\ORMException { return new self( "Unsupported query operation: It is not yet possible to overwrite the join ". - "conditions in class ".$assoc['sourceEntityName']." assocation ".$assoc['fieldName'].". ". + "conditions in class ".$assoc['sourceEntityName']." association ".$assoc['fieldName'].". ". "Use WITH to append additional join conditions to the association." ); } @@ -234,7 +234,7 @@ class QueryException extends \Doctrine\ORM\ORMException public static function instanceOfUnrelatedClass($className, $rootClass) { return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . - "inheritance hierachy exists between these two classes."); + "inheritance hierarchy exists between these two classes."); } /** diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 81660fd83..30a39924e 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -1042,7 +1042,7 @@ class SqlWalker implements TreeWalker // Handle WITH clause if (($condExpr = $join->conditionalExpression) !== null) { - // Phase 2 AST optimization: Skip processment of ConditionalExpression + // Phase 2 AST optimization: Skip processing of ConditionalExpression // if only one ConditionalTerm is defined $sql .= ' AND (' . $this->walkConditionalExpression($condExpr) . ')'; } @@ -1691,7 +1691,7 @@ class SqlWalker implements TreeWalker */ public function walkConditionalExpression($condExpr) { - // Phase 2 AST optimization: Skip processment of ConditionalExpression + // Phase 2 AST optimization: Skip processing of ConditionalExpression // if only one ConditionalTerm is defined if ( ! ($condExpr instanceof AST\ConditionalExpression)) { return $this->walkConditionalTerm($condExpr); @@ -1705,7 +1705,7 @@ class SqlWalker implements TreeWalker */ public function walkConditionalTerm($condTerm) { - // Phase 2 AST optimization: Skip processment of ConditionalTerm + // Phase 2 AST optimization: Skip processing of ConditionalTerm // if only one ConditionalFactor is defined if ( ! ($condTerm instanceof AST\ConditionalTerm)) { return $this->walkConditionalFactor($condTerm); @@ -1719,7 +1719,7 @@ class SqlWalker implements TreeWalker */ public function walkConditionalFactor($factor) { - // Phase 2 AST optimization: Skip processment of ConditionalFactor + // Phase 2 AST optimization: Skip processing of ConditionalFactor // if only one ConditionalPrimary is defined return ( ! ($factor instanceof AST\ConditionalFactor)) ? $this->walkConditionalPrimary($factor) @@ -2114,7 +2114,7 @@ class SqlWalker implements TreeWalker : $term; } - // Phase 2 AST optimization: Skip processment of ArithmeticTerm + // Phase 2 AST optimization: Skip processing of ArithmeticTerm // if only one ArithmeticFactor is defined if ( ! ($term instanceof AST\ArithmeticTerm)) { return $this->walkArithmeticFactor($term); @@ -2132,7 +2132,7 @@ class SqlWalker implements TreeWalker return $factor; } - // Phase 2 AST optimization: Skip processment of ArithmeticFactor + // Phase 2 AST optimization: Skip processing of ArithmeticFactor // if only one ArithmeticPrimary is defined if ( ! ($factor instanceof AST\ArithmeticFactor)) { return $this->walkArithmeticPrimary($factor); diff --git a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php index c285739d8..e95155c13 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php @@ -90,7 +90,7 @@ abstract class TreeWalkerAdapter implements TreeWalker } /** - * Retrieves the Query Instance reponsible for the current walkers execution. + * Retrieves the Query Instance responsible for the current walkers execution. * * @return \Doctrine\ORM\AbstractQuery */ diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php index df561d583..cec5d26a3 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php @@ -86,10 +86,10 @@ class ConvertMappingCommand extends Command Convert mapping information between supported formats. This is an execute one-time command. It should not be necessary for -you to call this method multiple times, escpecially when using the --from-database +you to call this method multiple times, especially when using the --from-database flag. -Converting an existing databsae schema into mapping files only solves about 70-80% +Converting an existing database schema into mapping files only solves about 70-80% of the necessary mapping information. Additionally the detection from an existing database cannot detect inverse associations, inheritance types, entities with foreign keys as primary keys and many of the diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 377841f1e..764e89500 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -91,7 +91,7 @@ to error and we suggest you use code repositories such as GIT or SVN to make backups of your code. It makes sense to generate the entity code if you are using entities as Data -Access Objects only and dont put much additional logic on them. If you are +Access Objects only and don't put much additional logic on them. If you are however putting much more logic on the entities you should refrain from using the entity-generator and code your entities manually. diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 02ef1e7c7..f66a49d15 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -500,7 +500,7 @@ class SchemaTool * Gets the class metadata that is responsible for the definition of the referenced column name. * * Previously this was a simple task, but with DDC-117 this problem is actually recursive. If its - * not a simple field, go through all identifier field names that are associations recursivly and + * not a simple field, go through all identifier field names that are associations recursively and * find that referenced column name. * * TODO: Is there any way to make this code more pleasing? @@ -643,7 +643,7 @@ class SchemaTool /** * Drops the database schema for the given classes. * - * In any way when an exception is thrown it is supressed since drop was + * In any way when an exception is thrown it is suppressed since drop was * issued for all classes of the schema and some probably just don't exist. * * @param array $classes diff --git a/lib/Doctrine/ORM/Tools/ToolEvents.php b/lib/Doctrine/ORM/Tools/ToolEvents.php index 7aa98d9a6..aebb5d8f3 100644 --- a/lib/Doctrine/ORM/Tools/ToolEvents.php +++ b/lib/Doctrine/ORM/Tools/ToolEvents.php @@ -23,7 +23,7 @@ class ToolEvents { /** * The postGenerateSchemaTable event occurs in SchemaTool#getSchemaFromMetadata() - * whenever an entity class is transformed into its table representation. It recieves + * whenever an entity class is transformed into its table representation. It receives * the current non-complete Schema instance, the Entity Metadata Class instance and * the Schema Table instance of this entity. * diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 3a3f14e59..4c3f3720c 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1822,7 +1822,7 @@ class UnitOfWork implements PropertyChangedListener // Throw exception if versions dont match. if ($managedCopyVersion != $entityVersion) { - throw OptimisticLockException::lockFailedVersionMissmatch($entity, $entityVersion, $managedCopyVersion); + throw OptimisticLockException::lockFailedVersionMismatch($entity, $entityVersion, $managedCopyVersion); } } @@ -2281,7 +2281,7 @@ class UnitOfWork implements PropertyChangedListener $entityVersion = $class->reflFields[$class->versionField]->getValue($entity); if ($entityVersion != $lockVersion) { - throw OptimisticLockException::lockFailedVersionMissmatch($entity, $lockVersion, $entityVersion); + throw OptimisticLockException::lockFailedVersionMismatch($entity, $lockVersion, $entityVersion); } break; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3ab5edbae..e6fc54315 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,7 +2,7 @@