From 774bb3fec4f8a2d5bf4cc6e449c1c6d9aeecb0ce Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Fri, 14 Dec 2012 20:12:56 +0000 Subject: [PATCH] Fixed missed documentation issues in Doctrine\ORM --- lib/Doctrine/ORM/EntityNotFoundException.php | 3 +++ lib/Doctrine/ORM/Id/SequenceGenerator.php | 25 ++++++++++++++++--- lib/Doctrine/ORM/Id/TableGenerator.php | 7 ++++++ .../ORM/Internal/Hydration/ObjectHydrator.php | 2 ++ lib/Doctrine/ORM/NoResultException.php | 3 +++ lib/Doctrine/ORM/PersistentCollection.php | 23 +++++++++-------- lib/Doctrine/ORM/Tools/EntityGenerator.php | 5 ++++ 7 files changed, 54 insertions(+), 14 deletions(-) diff --git a/lib/Doctrine/ORM/EntityNotFoundException.php b/lib/Doctrine/ORM/EntityNotFoundException.php index 087c65d91..710853deb 100644 --- a/lib/Doctrine/ORM/EntityNotFoundException.php +++ b/lib/Doctrine/ORM/EntityNotFoundException.php @@ -27,6 +27,9 @@ namespace Doctrine\ORM; */ class EntityNotFoundException extends ORMException { + /** + * Constructor. + */ public function __construct() { parent::__construct('Entity was not found.'); diff --git a/lib/Doctrine/ORM/Id/SequenceGenerator.php b/lib/Doctrine/ORM/Id/SequenceGenerator.php index 5d7e305da..545152254 100644 --- a/lib/Doctrine/ORM/Id/SequenceGenerator.php +++ b/lib/Doctrine/ORM/Id/SequenceGenerator.php @@ -30,9 +30,28 @@ use Doctrine\ORM\EntityManager; */ class SequenceGenerator extends AbstractIdGenerator implements Serializable { + /** + * The allocation size of the sequence. + * + * @var int + */ private $_allocationSize; + + /** + * The name of the sequence. + * + * @var string + */ private $_sequenceName; + + /** + * @var int + */ private $_nextValue = 0; + + /** + * @var int|null + */ private $_maxValue = null; /** @@ -53,7 +72,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable * @param EntityManager $em * @param object $entity * - * @return integer|float The generated value. + * @return integer The generated value. * * @override */ @@ -74,7 +93,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable /** * Gets the maximum value of the currently allocated bag of values. * - * @return integer|float + * @return integer|null */ public function getCurrentMaxValue() { @@ -84,7 +103,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable /** * Gets the next value that will be returned by generate(). * - * @return integer|float + * @return integer */ public function getNextValue() { diff --git a/lib/Doctrine/ORM/Id/TableGenerator.php b/lib/Doctrine/ORM/Id/TableGenerator.php index 33aa3b8c0..34606fb22 100644 --- a/lib/Doctrine/ORM/Id/TableGenerator.php +++ b/lib/Doctrine/ORM/Id/TableGenerator.php @@ -47,7 +47,14 @@ class TableGenerator extends AbstractIdGenerator */ private $_allocationSize; + /** + * @var int|null + */ private $_nextValue; + + /** + * @var int|null + */ private $_maxValue; /** diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index 4824bbc83..bc28aa072 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -610,6 +610,8 @@ class ObjectHydrator extends AbstractHydrator * When executed in a hydrate() loop we may have to clear internal state to * decrease memory consumption. * + * @param mixed $eventArgs + * * @return void */ public function onClear($eventArgs) diff --git a/lib/Doctrine/ORM/NoResultException.php b/lib/Doctrine/ORM/NoResultException.php index 682cb3a64..2cbac8e9d 100644 --- a/lib/Doctrine/ORM/NoResultException.php +++ b/lib/Doctrine/ORM/NoResultException.php @@ -27,6 +27,9 @@ namespace Doctrine\ORM; */ class NoResultException extends UnexpectedResultException { + /** + * Constructor. + */ public function __construct() { parent::__construct('No result was found for query although at least one row was expected.'); diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 5580f361b..a7d4abb3f 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -705,7 +705,7 @@ final class PersistentCollection implements Collection, Selectable /* ArrayAccess implementation */ /** - * @see containsKey() + * {@inheritdoc} */ public function offsetExists($offset) { @@ -713,7 +713,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * @see get() + * {@inheritdoc} */ public function offsetGet($offset) { @@ -721,8 +721,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * @see add() - * @see set() + * {@inheritdoc} */ public function offsetSet($offset, $value) { @@ -734,20 +733,23 @@ final class PersistentCollection implements Collection, Selectable } /** - * @see remove() + * {@inheritdoc} */ public function offsetUnset($offset) { return $this->remove($offset); } + /** + * {@inheritdoc} + */ public function key() { return $this->coll->key(); } /** - * Gets the element of the collection at the current iterator position. + * {@inheritdoc} */ public function current() { @@ -755,7 +757,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * Moves the internal iterator position to the next element. + * {@inheritdoc} */ public function next() { @@ -773,7 +775,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * Extract a slice of $length elements starting at position $offset from the Collection. + * Extracts a slice of $length elements starting at position $offset from the Collection. * * If $length is null it returns all elements from $offset to the end of the Collection. * Keys have to be preserved by this method. Calling this method will only return the @@ -798,7 +800,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * Cleanup internal state of cloned persistent collection. + * Cleans up internal state of cloned persistent collection. * * The following problems have to be prevented: * 1. Added entities are added to old PC @@ -825,7 +827,7 @@ final class PersistentCollection implements Collection, Selectable } /** - * Select all elements from a selectable that match the expression and + * Selects all elements from a selectable that match the expression and * return a new collection containing these elements. * * @param \Doctrine\Common\Collections\Criteria $criteria @@ -866,4 +868,3 @@ final class PersistentCollection implements Collection, Selectable return new ArrayCollection(array_merge($persister->loadCriteria($criteria), $newObjects)); } } - diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index eb3daaf8a..2c6b8977f 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -299,6 +299,9 @@ public function __construct() } '; + /** + * Constructor. + */ public function __construct() { if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { @@ -439,6 +442,8 @@ public function __construct() /** * Sets the name of the class the generated classes should extend from. * + * @param string $classToExtend + * * @return void */ public function setClassToExtend($classToExtend)