Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #245 from BenMorel/master

Documentation fixes
  • Loading branch information...
commit c4255b9fbd63ee1fe52697839318af5937fced9b 2 parents d658ec7 + ccf2c58
@beberlei beberlei authored
Showing with 1,485 additions and 712 deletions.
  1. +1 −1  bin/travis-setup.php
  2. +1 −1  build.xml
  3. +30 −8 lib/Doctrine/Common/ClassLoader.php
  4. +4 −3 lib/Doctrine/Common/CommonException.php
  5. +5 −8 lib/Doctrine/Common/Comparable.php
  6. +11 −11 lib/Doctrine/Common/EventArgs.php
  7. +24 −17 lib/Doctrine/Common/EventManager.php
  8. +5 −8 lib/Doctrine/Common/EventSubscriber.php
  9. +4 −4 lib/Doctrine/Common/Lexer.php
  10. +7 −9 lib/Doctrine/Common/NotifyPropertyChanged.php
  11. +18 −18 lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
  12. +10 −11 lib/Doctrine/Common/Persistence/ConnectionRegistry.php
  13. +7 −6 lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
  14. +2 −3 lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
  15. +8 −8 lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
  16. +15 −13 lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
  17. +19 −14 lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
  18. +15 −16 lib/Doctrine/Common/Persistence/ManagerRegistry.php
  19. +48 −36 lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
  20. +19 −10 lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
  21. +10 −8 lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
  22. +20 −17 lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
  23. +14 −11 lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
  24. +26 −29 lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
  25. +10 −8 lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
  26. +7 −5 lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
  27. +18 −26 lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
  28. +10 −12 lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
  29. +10 −9 lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
  30. +13 −10 lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
  31. +5 −3 lib/Doctrine/Common/Persistence/Mapping/MappingException.php
  32. +10 −6 lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
  33. +1 −2  lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
  34. +7 −31 lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
  35. +28 −11 lib/Doctrine/Common/Persistence/ObjectManager.php
  36. +2 −0  lib/Doctrine/Common/Persistence/ObjectManagerAware.php
  37. +17 −14 lib/Doctrine/Common/Persistence/ObjectRepository.php
  38. +35 −25 lib/Doctrine/Common/Persistence/PersistentObject.php
  39. +4 −5 lib/Doctrine/Common/Persistence/Proxy.php
  40. +10 −13 lib/Doctrine/Common/PropertyChangedListener.php
  41. +8 −9 lib/Doctrine/Common/Proxy/Autoloader.php
  42. +8 −8 lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php
  43. +4 −4 lib/Doctrine/Common/Proxy/Exception/ProxyException.php
  44. +8 −7 lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php
  45. +16 −9 lib/Doctrine/Common/Proxy/Proxy.php
  46. +54 −45 lib/Doctrine/Common/Proxy/ProxyGenerator.php
  47. +1 −2  lib/Doctrine/Common/Reflection/ClassFinderInterface.php
  48. +6 −10 lib/Doctrine/Common/Reflection/Psr0FindFile.php
  49. +10 −7 lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
  50. +1 −1  lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php
  51. +364 −43 lib/Doctrine/Common/Reflection/StaticReflectionClass.php
  52. +292 −33 lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
  53. +37 −25 lib/Doctrine/Common/Reflection/StaticReflectionParser.php
  54. +113 −12 lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
  55. +17 −11 lib/Doctrine/Common/Util/ClassUtils.php
  56. +21 −18 lib/Doctrine/Common/Util/Debug.php
  57. +2 −3 lib/Doctrine/Common/Util/Inflector.php
  58. +10 −12 lib/Doctrine/Common/Version.php
  59. +1 −1  tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php
  60. +1 −1  tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php
  61. +1 −1  tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php
View
2  bin/travis-setup.php
@@ -13,7 +13,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
+ * and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
View
2  build.xml
@@ -46,7 +46,7 @@
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
<lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
<lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
- <license>LGPL</license>
+ <license>MIT</license>
<version release="${pear.version}" api="${pear.version}" />
<stability release="${pear.stability}" api="${pear.stability}" />
<notes>-</notes>
View
38 lib/Doctrine/Common/ClassLoader.php
@@ -34,22 +34,30 @@
class ClassLoader
{
/**
- * @var string PHP file extension
+ * PHP file extension.
+ *
+ * @var string
*/
protected $fileExtension = '.php';
/**
- * @var string Current namespace
+ * Current namespace.
+ *
+ * @var string|null
*/
protected $namespace;
/**
- * @var string Current include path
+ * Current include path.
+ *
+ * @var string|null
*/
protected $includePath;
/**
- * @var string PHP namespace separator
+ * PHP namespace separator.
+ *
+ * @var string
*/
protected $namespaceSeparator = '\\';
@@ -61,8 +69,8 @@ class ClassLoader
* If neither a namespace nor an include path is given, the ClassLoader will
* be responsible for loading all classes, thereby relying on the PHP include_path.
*
- * @param string $ns The namespace of the classes to load.
- * @param string $includePath The base include path to use.
+ * @param string|null $ns The namespace of the classes to load.
+ * @param string|null $includePath The base include path to use.
*/
public function __construct($ns = null, $includePath = null)
{
@@ -74,6 +82,8 @@ public function __construct($ns = null, $includePath = null)
* Sets the namespace separator used by classes in the namespace of this ClassLoader.
*
* @param string $sep The separator to use.
+ *
+ * @return void
*/
public function setNamespaceSeparator($sep)
{
@@ -93,7 +103,9 @@ public function getNamespaceSeparator()
/**
* Sets the base include path for all class files in the namespace of this ClassLoader.
*
- * @param string $includePath
+ * @param string|null $includePath
+ *
+ * @return void
*/
public function setIncludePath($includePath)
{
@@ -103,7 +115,7 @@ public function setIncludePath($includePath)
/**
* Gets the base include path for all class files in the namespace of this ClassLoader.
*
- * @return string
+ * @return string|null
*/
public function getIncludePath()
{
@@ -114,6 +126,8 @@ public function getIncludePath()
* Sets the file extension of class files in the namespace of this ClassLoader.
*
* @param string $fileExtension
+ *
+ * @return void
*/
public function setFileExtension($fileExtension)
{
@@ -132,6 +146,8 @@ public function getFileExtension()
/**
* Registers this ClassLoader on the SPL autoload stack.
+ *
+ * @return void
*/
public function register()
{
@@ -140,6 +156,8 @@ public function register()
/**
* Removes this ClassLoader from the SPL autoload stack.
+ *
+ * @return void
*/
public function unregister()
{
@@ -150,6 +168,7 @@ public function unregister()
* Loads the given class or interface.
*
* @param string $className The name of the class to load.
+ *
* @return boolean TRUE if the class has been successfully loaded, FALSE otherwise.
*/
public function loadClass($className)
@@ -170,6 +189,7 @@ public function loadClass($className)
* the given name.
*
* @param string $className The fully-qualified name of the class.
+ *
* @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise.
*/
public function canLoadClass($className)
@@ -206,6 +226,7 @@ public function canLoadClass($className)
* these responsibilities.
*
* @param string $className The fully-qualified name of the class.
+ *
* @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise.
*/
public static function classExists($className)
@@ -248,6 +269,7 @@ public static function classExists($className)
* for (and is able to load) the class with the given name.
*
* @param string $className The name of the class.
+ *
* @return ClassLoader The <tt>ClassLoader</tt> for the class or NULL if no such <tt>ClassLoader</tt> exists.
*/
public static function getClassLoader($className)
View
7 lib/Doctrine/Common/CommonException.php
@@ -20,9 +20,10 @@
namespace Doctrine\Common;
/**
- * Base exception class for package Doctrine\Common
- * @author heinrich
+ * Base exception class for package Doctrine\Common.
*
+ * @author heinrich
*/
-class CommonException extends \Exception {
+class CommonException extends \Exception
+{
}
View
13 lib/Doctrine/Common/Comparable.php
@@ -17,22 +17,20 @@
* <http://www.doctrine-project.org>.
*/
-
namespace Doctrine\Common;
/**
* Comparable interface that allows to compare two value objects to each other for similarity.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.com
- * @since 2.2
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
*/
interface Comparable
{
/**
- * Compare the current object to the passed $other.
+ * Compares the current object to the passed $other.
*
* Returns 0 if they are semantically equal, 1 if the other object
* is less than the current one, or -1 if its more than the current one.
@@ -46,4 +44,3 @@
*/
public function compareTo($other);
}
-
View
22 lib/Doctrine/Common/EventArgs.php
@@ -1,7 +1,5 @@
<?php
/*
- * $Id$
- *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -28,18 +26,18 @@
* information to an event handler when an event is raised. The single empty EventArgs
* instance can be obtained through {@link getEmptyInstance}.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
class EventArgs
{
/**
- * @var EventArgs Single instance of EventArgs
+ * Single instance of EventArgs.
+ *
+ * @var EventArgs
*/
private static $_emptyEventArgsInstance;
@@ -50,10 +48,12 @@ class EventArgs
* like this: EventManager::dispatchEvent('eventname');
*
* The benefit from this is that only one empty instance is instantiated and shared
- * (otherwise there would be instances for every dispatched in the abovementioned form)
+ * (otherwise there would be instances for every dispatched in the abovementioned form).
*
* @see EventManager::dispatchEvent
+ *
* @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx
+ *
* @return EventArgs
*/
public static function getEmptyInstance()
View
41 lib/Doctrine/Common/EventManager.php
@@ -1,7 +1,5 @@
<?php
/*
- * $Id$
- *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -26,13 +24,11 @@
* Listeners are registered on the manager and events are dispatched through the
* manager.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
class EventManager
{
@@ -47,10 +43,11 @@ class EventManager
/**
* Dispatches an event to all registered listeners.
*
- * @param string $eventName The name of the event to dispatch. The name of the event is
- * the name of the method that is invoked on listeners.
- * @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners.
- * If not supplied, the single empty EventArgs instance is used.
+ * @param string $eventName The name of the event to dispatch. The name of the event is
+ * the name of the method that is invoked on listeners.
+ * @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners.
+ * If not supplied, the single empty EventArgs instance is used.
+ *
* @return boolean
*/
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
@@ -67,7 +64,8 @@ public function dispatchEvent($eventName, EventArgs $eventArgs = null)
/**
* Gets the listeners of a specific event or all listeners.
*
- * @param string $event The name of the event.
+ * @param string|null $event The name of the event.
+ *
* @return array The event listeners for the specified event, or all event listeners.
*/
public function getListeners($event = null)
@@ -79,6 +77,7 @@ public function getListeners($event = null)
* Checks whether an event has any registered listeners.
*
* @param string $event
+ *
* @return boolean TRUE if the specified event has any listeners, FALSE otherwise.
*/
public function hasListeners($event)
@@ -89,8 +88,10 @@ public function hasListeners($event)
/**
* Adds an event listener that listens on the specified events.
*
- * @param string|array $events The event(s) to listen on.
- * @param object $listener The listener object.
+ * @param string|array $events The event(s) to listen on.
+ * @param object $listener The listener object.
+ *
+ * @return void
*/
public function addEventListener($events, $listener)
{
@@ -108,7 +109,9 @@ public function addEventListener($events, $listener)
* Removes an event listener from the specified events.
*
* @param string|array $events
- * @param object $listener
+ * @param object $listener
+ *
+ * @return void
*/
public function removeEventListener($events, $listener)
{
@@ -128,6 +131,8 @@ public function removeEventListener($events, $listener)
* interested in and added as a listener for these events.
*
* @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
+ *
+ * @return void
*/
public function addEventSubscriber(EventSubscriber $subscriber)
{
@@ -139,6 +144,8 @@ public function addEventSubscriber(EventSubscriber $subscriber)
* interested in and removed as a listener for these events.
*
* @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
+ *
+ * @return void
*/
public function removeEventSubscriber(EventSubscriber $subscriber)
{
View
13 lib/Doctrine/Common/EventSubscriber.php
@@ -1,7 +1,5 @@
<?php
/*
- * $Id: EventListener.php 4653 2008-07-10 17:17:58Z romanb $
- *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -27,12 +25,11 @@
* {@link getSubscribedEvents} and registers the subscriber as a listener for all
* returned events.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
interface EventSubscriber
{
View
8 lib/Doctrine/Common/Lexer.php
@@ -27,10 +27,10 @@
* Lexer moved into its own Component Doctrine\Common\Lexer. This class
* only stays for being BC.
*
- * @since 2.0
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @since 2.0
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
abstract class Lexer extends AbstractLexer
{
View
16 lib/Doctrine/Common/NotifyPropertyChanged.php
@@ -1,7 +1,5 @@
<?php
/*
- * $Id$
- *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -25,13 +23,11 @@
* Contract for classes that provide the service of notifying listeners of
* changes to their properties.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
interface NotifyPropertyChanged
{
@@ -39,6 +35,8 @@
* Adds a listener that wants to be notified about property changes.
*
* @param PropertyChangedListener $listener
+ *
+ * @return void
*/
public function addPropertyChangedListener(PropertyChangedListener $listener);
}
View
36 lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
@@ -1,5 +1,4 @@
<?php
-
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -25,12 +24,11 @@
/**
* Abstract implementation of the ManagerRegistry contract.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.2
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Lukas Kahwe Smith <smith@pooteeweet.org>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
abstract class AbstractManagerRegistry implements ManagerRegistry
{
@@ -65,11 +63,11 @@
private $proxyInterfaceName;
/**
- * Constructor
+ * Constructor.
*
* @param string $name
- * @param array $connections
- * @param array $managers
+ * @param array $connections
+ * @param array $managers
* @param string $defaultConnection
* @param string $defaultManager
* @param string $proxyInterfaceName
@@ -85,27 +83,29 @@ public function __construct($name, array $connections, array $managers, $default
}
/**
- * Fetches/creates the given services
+ * Fetches/creates the given services.
+ *
+ * A service in this context is connection or a manager instance.
*
- * A service in this context is connection or a manager instance
+ * @param string $name The name of the service.
*
- * @param string $name name of the service
- * @return object instance of the given service
+ * @return object The instance of the given service.
*/
abstract protected function getService($name);
/**
- * Resets the given services
+ * Resets the given services.
+ *
+ * A service in this context is connection or a manager instance.
*
- * A service in this context is connection or a manager instance
+ * @param string $name The name of the service.
*
- * @param string $name name of the service
* @return void
*/
abstract protected function resetService($name);
/**
- * Get the name of the registry
+ * Gets the name of the registry.
*
* @return string
*/
View
21 lib/Doctrine/Common/Persistence/ConnectionRegistry.php
@@ -22,42 +22,41 @@
/**
* Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.2
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Lukas Kahwe Smith <smith@pooteeweet.org>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
interface ConnectionRegistry
{
/**
* Gets the default connection name.
*
- * @return string The default connection name
+ * @return string The default connection name.
*/
public function getDefaultConnectionName();
/**
* Gets the named connection.
*
- * @param string $name The connection name (null for the default one)
+ * @param string $name The connection name (null for the default one).
*
* @return object
*/
public function getConnection($name = null);
/**
- * Gets an array of all registered connections
+ * Gets an array of all registered connections.
*
- * @return array An array of Connection instances
+ * @return array An array of Connection instances.
*/
public function getConnections();
/**
* Gets all connection names.
*
- * @return array An array of connection names
+ * @return array An array of connection names.
*/
public function getConnectionNames();
}
View
13 lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
@@ -15,7 +15,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
-*/
+ */
namespace Doctrine\Common\Persistence\Event;
@@ -44,9 +44,9 @@ class LifecycleEventArgs extends EventArgs
private $object;
/**
- * Constructor
+ * Constructor.
*
- * @param object $object
+ * @param object $object
* @param ObjectManager $objectManager
*/
public function __construct($object, ObjectManager $objectManager)
@@ -56,7 +56,8 @@ public function __construct($object, ObjectManager $objectManager)
}
/**
- * Retrieve associated entity.
+ * Retrieves the associated entity.
+ *
* @deprecated
*
* @return object
@@ -67,7 +68,7 @@ public function getEntity()
}
/**
- * Retrieve associated object.
+ * Retrieves the associated object.
*
* @return object
*/
@@ -77,7 +78,7 @@ public function getObject()
}
/**
- * Retrieve associated ObjectManager.
+ * Retrieves the associated ObjectManager.
*
* @return ObjectManager
*/
View
5 lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
@@ -54,7 +54,7 @@ public function __construct(ClassMetadata $classMetadata, ObjectManager $objectM
}
/**
- * Retrieve associated ClassMetadata.
+ * Retrieves the associated ClassMetadata.
*
* @return ClassMetadata
*/
@@ -64,7 +64,7 @@ public function getClassMetadata()
}
/**
- * Retrieve associated ObjectManager.
+ * Retrieves the associated ObjectManager.
*
* @return ObjectManager
*/
@@ -73,4 +73,3 @@ public function getObjectManager()
return $this->objectManager;
}
}
-
View
16 lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
@@ -15,22 +15,22 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
-*/
+ */
namespace Doctrine\Common\Persistence\Event;
+use Doctrine\Common\EventArgs;
use Doctrine\Common\Persistence\ObjectManager;
/**
* Provides event arguments for the preFlush event.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.2
- * @author Roman Borschel <roman@code-factory.de>
- * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Roman Borschel <roman@code-factory.de>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
*/
-class ManagerEventArgs extends \Doctrine\Common\EventArgs
+class ManagerEventArgs extends EventArgs
{
/**
* @var ObjectManager
@@ -48,7 +48,7 @@ public function __construct(ObjectManager $objectManager)
}
/**
- * Retrieve associated ObjectManager.
+ * Retrieves the associated ObjectManager.
*
* @return ObjectManager
*/
View
28 lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
@@ -19,16 +19,18 @@
namespace Doctrine\Common\Persistence\Event;
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\ObjectManager;
+
/**
* Provides event arguments for the onClear event.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.2
- * @author Roman Borschel <roman@code-factory.de>
- * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Roman Borschel <roman@code-factory.de>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
*/
-class OnClearEventArgs extends \Doctrine\Common\EventArgs
+class OnClearEventArgs extends EventArgs
{
/**
* @var \Doctrine\Common\Persistence\ObjectManager
@@ -36,15 +38,15 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
private $objectManager;
/**
- * @var string
+ * @var string|null
*/
private $entityClass;
/**
* Constructor.
*
- * @param \Doctrine\Common\Persistence\ObjectManager $objectManager
- * @param string $entityClass Optional entity class
+ * @param ObjectManager $objectManager The object manager.
+ * @param string|null $entityClass The optional entity class.
*/
public function __construct($objectManager, $entityClass = null)
{
@@ -53,7 +55,7 @@ public function __construct($objectManager, $entityClass = null)
}
/**
- * Retrieve associated ObjectManager.
+ * Retrieves the associated ObjectManager.
*
* @return \Doctrine\Common\Persistence\ObjectManager
*/
@@ -63,9 +65,9 @@ public function getObjectManager()
}
/**
- * Name of the entity class that is cleared, or empty if all are cleared.
+ * Returns the name of the entity class that is cleared, or null if all are cleared.
*
- * @return string
+ * @return string|null
*/
public function getEntityClass()
{
@@ -73,7 +75,7 @@ public function getEntityClass()
}
/**
- * Check if event clears all entities.
+ * Returns whether this event clears all entities.
*
* @return bool
*/
View
33 lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
@@ -19,8 +19,8 @@
namespace Doctrine\Common\Persistence\Event;
-use Doctrine\Common\EventArgs,
- Doctrine\Common\Persistence\ObjectManager;
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\ObjectManager;
/**
* Class that holds event arguments for a preUpdate event.
@@ -40,9 +40,9 @@ class PreUpdateEventArgs extends LifecycleEventArgs
/**
* Constructor.
*
- * @param object $entity
+ * @param object $entity
* @param ObjectManager $objectManager
- * @param array $changeSet
+ * @param array $changeSet
*/
public function __construct($entity, ObjectManager $objectManager, array &$changeSet)
{
@@ -52,7 +52,7 @@ public function __construct($entity, ObjectManager $objectManager, array &$chang
}
/**
- * Retrieve entity changeset.
+ * Retrieves the entity changeset.
*
* @return array
*/
@@ -62,7 +62,7 @@ public function getEntityChangeSet()
}
/**
- * Check if field has a changeset.
+ * Checks if field has a changeset.
*
* @param string $field
*
@@ -74,9 +74,10 @@ public function hasChangedField($field)
}
/**
- * Get the old value of the changeset of the changed field.
+ * Gets the old value of the changeset of the changed field.
+ *
+ * @param string $field
*
- * @param string $field
* @return mixed
*/
public function getOldValue($field)
@@ -87,9 +88,10 @@ public function getOldValue($field)
}
/**
- * Get the new value of the changeset of the changed field.
+ * Gets the new value of the changeset of the changed field.
+ *
+ * @param string $field
*
- * @param string $field
* @return mixed
*/
public function getNewValue($field)
@@ -100,10 +102,12 @@ public function getNewValue($field)
}
/**
- * Set the new value of this field.
+ * Sets the new value of this field.
*
* @param string $field
- * @param mixed $value
+ * @param mixed $value
+ *
+ * @return void
*/
public function setNewValue($field, $value)
{
@@ -113,10 +117,12 @@ public function setNewValue($field, $value)
}
/**
- * Assert the field exists in changeset.
+ * Asserts the field exists in changeset.
*
* @param string $field
*
+ * @return void
+ *
* @throws \InvalidArgumentException
*/
private function assertValidField($field)
@@ -130,4 +136,3 @@ private function assertValidField($field)
}
}
}
-
View
31 lib/Doctrine/Common/Persistence/ManagerRegistry.php
@@ -22,33 +22,32 @@
/**
* Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.2
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Lukas Kahwe Smith <smith@pooteeweet.org>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
interface ManagerRegistry extends ConnectionRegistry
{
/**
* Gets the default object manager name.
*
- * @return string The default object manager name
+ * @return string The default object manager name.
*/
public function getDefaultManagerName();
/**
* Gets a named object manager.
*
- * @param string $name The object manager name (null for the default one)
+ * @param string $name The object manager name (null for the default one).
*
* @return \Doctrine\Common\Persistence\ObjectManager
*/
public function getManager($name = null);
/**
- * Gets an array of all registered object managers
+ * Gets an array of all registered object managers.
*
* @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances
*/
@@ -67,7 +66,7 @@ public function getManagers();
* hold an obsolete reference. You can inject the registry instead
* to avoid this problem.
*
- * @param string $name The object manager name (null for the default one)
+ * @param string|null $name The object manager name (null for the default one).
*
* @return \Doctrine\Common\Persistence\ObjectManager
*/
@@ -78,24 +77,24 @@ public function resetManager($name = null);
*
* This method looks for the alias in all registered object managers.
*
- * @param string $alias The alias
+ * @param string $alias The alias.
*
- * @return string The full namespace
+ * @return string The full namespace.
*/
public function getAliasNamespace($alias);
/**
* Gets all connection names.
*
- * @return array An array of connection names
+ * @return array An array of connection names.
*/
public function getManagerNames();
/**
* Gets the ObjectRepository for an persistent object.
*
- * @param string $persistentObject The name of the persistent object.
- * @param string $persistentManagerName The object manager name (null for the default one)
+ * @param string $persistentObject The name of the persistent object.
+ * @param string $persistentManagerName The object manager name (null for the default one).
*
* @return \Doctrine\Common\Persistence\ObjectRepository
*/
@@ -104,7 +103,7 @@ public function getRepository($persistentObject, $persistentManagerName = null);
/**
* Gets the object manager associated with a given class.
*
- * @param string $class A persistent object class name
+ * @param string $class A persistent object class name.
*
* @return \Doctrine\Common\Persistence\ObjectManager|null
*/
View
84 lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
@@ -19,21 +19,21 @@
namespace Doctrine\Common\Persistence\Mapping;
-use Doctrine\Common\Cache\Cache,
- Doctrine\Common\Util\ClassUtils;
+use Doctrine\Common\Cache\Cache;
+use Doctrine\Common\Util\ClassUtils;
/**
* The ClassMetadataFactory is used to create ClassMetadata objects that contain all the
* metadata mapping informations of a class which describes how a class should be mapped
* to a relational database.
*
- * This class was abstracted from the ORM ClassMetadataFactory
+ * This class was abstracted from the ORM ClassMetadataFactory.
*
- * @since 2.2
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @since 2.2
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
abstract class AbstractClassMetadataFactory implements ClassMetadataFactory
{
@@ -42,10 +42,10 @@
*
* @var string
*/
- protected $cacheSalt = "\$CLASSMETADATA";
+ protected $cacheSalt = '$CLASSMETADATA';
/**
- * @var \Doctrine\Common\Cache\Cache
+ * @var \Doctrine\Common\Cache\Cache|null
*/
private $cacheDriver;
@@ -60,14 +60,16 @@
protected $initialized = false;
/**
- * @var ReflectionService
+ * @var ReflectionService|null
*/
- private $reflectionService;
+ private $reflectionService = null;
/**
* Sets the cache driver used by the factory to cache ClassMetadata instances.
*
- * @param Doctrine\Common\Cache\Cache $cacheDriver
+ * @param \Doctrine\Common\Cache\Cache $cacheDriver
+ *
+ * @return void
*/
public function setCacheDriver(Cache $cacheDriver = null)
{
@@ -77,7 +79,7 @@ public function setCacheDriver(Cache $cacheDriver = null)
/**
* Gets the cache driver used by the factory to cache ClassMetadata instances.
*
- * @return Doctrine\Common\Cache\Cache
+ * @return \Doctrine\Common\Cache\Cache|null
*/
public function getCacheDriver()
{
@@ -85,7 +87,7 @@ public function getCacheDriver()
}
/**
- * Return an array of all the loaded metadata currently in memory.
+ * Returns an array of all the loaded metadata currently in memory.
*
* @return array
*/
@@ -124,35 +126,38 @@ public function getAllMetadata()
abstract protected function initialize();
/**
- * Get the fully qualified class-name from the namespace alias.
+ * Gets the fully qualified class-name from the namespace alias.
*
* @param string $namespaceAlias
* @param string $simpleClassName
+ *
* @return string
*/
abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName);
/**
- * Return the mapping driver implementation.
+ * Returns the mapping driver implementation.
*
* @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
*/
abstract protected function getDriver();
/**
- * Wakeup reflection after ClassMetadata gets unserialized from cache.
+ * Wakes up reflection after ClassMetadata gets unserialized from cache.
*
- * @param ClassMetadata $class
+ * @param ClassMetadata $class
* @param ReflectionService $reflService
+ *
* @return void
*/
abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService);
/**
- * Initialize Reflection after ClassMetadata was constructed.
+ * Initializes Reflection after ClassMetadata was constructed.
*
- * @param ClassMetadata $class
+ * @param ClassMetadata $class
* @param ReflectionService $reflService
+ *
* @return void
*/
abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService);
@@ -160,10 +165,10 @@ public function getAllMetadata()
/**
* Checks whether the class metadata is an entity.
*
- * This method should false for mapped superclasses or
- * embedded classes.
+ * This method should return false for mapped superclasses or embedded classes.
*
* @param ClassMetadata $class
+ *
* @return boolean
*/
abstract protected function isEntity(ClassMetadata $class);
@@ -172,6 +177,7 @@ public function getAllMetadata()
* Gets the class metadata descriptor for a class.
*
* @param string $className The name of the class.
+ *
* @return \Doctrine\Common\Persistence\Mapping\ClassMetadata
*/
public function getMetadataFor($className)
@@ -224,6 +230,7 @@ public function getMetadataFor($className)
* Checks whether the factory has the metadata for a class loaded already.
*
* @param string $className
+ *
* @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
*/
public function hasMetadataFor($className)
@@ -236,8 +243,10 @@ public function hasMetadataFor($className)
*
* NOTE: This is only useful in very special cases, like when generating proxy classes.
*
- * @param string $className
+ * @param string $className
* @param ClassMetadata $class
+ *
+ * @return void
*/
public function setMetadataFor($className, $class)
{
@@ -245,10 +254,11 @@ public function setMetadataFor($className, $class)
}
/**
- * Get array of parent classes for the given entity class
+ * Gets an array of parent classes for the given entity class.
*
* @param string $name
- * @return array $parentClasses
+ *
+ * @return array
*/
protected function getParentClasses($name)
{
@@ -325,12 +335,14 @@ protected function loadMetadata($name)
}
/**
- * Actually load the metadata from the underlying metadata
+ * Actually loads the metadata from the underlying metadata.
*
- * @param ClassMetadata $class
+ * @param ClassMetadata $class
* @param ClassMetadata|null $parent
- * @param bool $rootEntityFound
- * @param array $nonSuperclassParents classnames all parent classes that are not marked as mapped superclasses
+ * @param bool $rootEntityFound
+ * @param array $nonSuperclassParents All parent class names
+ * that are not marked as mapped superclasses.
+ *
* @return void
*/
abstract protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents);
@@ -339,15 +351,13 @@ protected function loadMetadata($name)
* Creates a new ClassMetadata instance for the given class name.
*
* @param string $className
+ *
* @return ClassMetadata
*/
abstract protected function newClassMetadataInstance($className);
/**
- * Check if this class is mapped by this Object Manager + ClassMetadata configuration
- *
- * @param $class
- * @return bool
+ * {@inheritDoc}
*/
public function isTransient($class)
{
@@ -365,9 +375,11 @@ public function isTransient($class)
}
/**
- * Set reflectionService.
+ * Sets the reflectionService.
*
* @param ReflectionService $reflectionService
+ *
+ * @return void
*/
public function setReflectionService(ReflectionService $reflectionService)
{
@@ -375,7 +387,7 @@ public function setReflectionService(ReflectionService $reflectionService)
}
/**
- * Get the reflection service associated with this metadata factory.
+ * Gets the reflection service associated with this metadata factory.
*
* @return ReflectionService
*/
View
29 lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
@@ -22,16 +22,15 @@
/**
* Contract for a Doctrine persistence layer ClassMetadata class to implement.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.1
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Jonathan Wage <jonwage@gmail.com>
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Jonathan Wage <jonwage@gmail.com>
*/
interface ClassMetadata
{
/**
- * Get fully-qualified class name of this persistent class.
+ * Gets the fully-qualified class name of this persistent class.
*
* @return string
*/
@@ -57,6 +56,7 @@ public function getReflectionClass();
* Checks if the given field name is a mapped identifier for this class.
*
* @param string $fieldName
+ *
* @return boolean
*/
public function isIdentifier($fieldName);
@@ -65,6 +65,7 @@ public function isIdentifier($fieldName);
* Checks if the given field is a mapped property for this class.
*
* @param string $fieldName
+ *
* @return boolean
*/
public function hasField($fieldName);
@@ -73,6 +74,7 @@ public function hasField($fieldName);
* Checks if the given field is a mapped association for this class.
*
* @param string $fieldName
+ *
* @return boolean
*/
public function hasAssociation($fieldName);
@@ -81,6 +83,7 @@ public function hasAssociation($fieldName);
* Checks if the given field is a mapped single valued association for this class.
*
* @param string $fieldName
+ *
* @return boolean
*/
public function isSingleValuedAssociation($fieldName);
@@ -89,6 +92,7 @@ public function isSingleValuedAssociation($fieldName);
* Checks if the given field is a mapped collection valued association for this class.
*
* @param string $fieldName
+ *
* @return boolean
*/
public function isCollectionValuedAssociation($fieldName);
@@ -110,7 +114,7 @@ public function getFieldNames();
public function getIdentifierFieldNames();
/**
- * A numerically indexed list of association names of this persistent class.
+ * Returns a numerically indexed list of association names of this persistent class.
*
* This array includes identifier associations if present on this class.
*
@@ -125,6 +129,7 @@ public function getAssociationNames();
* integer, string, boolean, float/double, datetime.
*
* @param string $fieldName
+ *
* @return string
*/
public function getTypeOfField($fieldName);
@@ -133,32 +138,36 @@ public function getTypeOfField($fieldName);
* Returns the target class name of the given association.
*
* @param string $assocName
+ *
* @return string
*/
public function getAssociationTargetClass($assocName);
/**
- * Checks if the association is the inverse side of a bidirectional association
+ * Checks if the association is the inverse side of a bidirectional association.
*
* @param string $assocName
+ *
* @return boolean
*/
public function isAssociationInverseSide($assocName);
/**
- * Returns the target field of the owning side of the association
+ * Returns the target field of the owning side of the association.
*
* @param string $assocName
+ *
* @return string
*/
public function getAssociationMappedByTargetField($assocName);
/**
- * Return the identifier of this object as an array with field name as key.
+ * Returns the identifier of this object as an array with field name as key.
*
* Has to return an empty array if no identifier isset.
*
* @param object $object
+ *
* @return array
*/
public function getIdentifierValues($object);
View
18 lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
@@ -22,11 +22,10 @@
/**
* Contract for a Doctrine persistence layer ClassMetadata class to implement.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.1
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Jonathan Wage <jonwage@gmail.com>
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Jonathan Wage <jonwage@gmail.com>
*/
interface ClassMetadataFactory
{
@@ -42,6 +41,7 @@ public function getAllMetadata();
* Gets the class metadata descriptor for a class.
*
* @param string $className The name of the class.
+ *
* @return ClassMetadata
*/
public function getMetadataFor($className);
@@ -50,6 +50,7 @@ public function getMetadataFor($className);
* Checks whether the factory has the metadata for a class loaded already.
*
* @param string $className
+ *
* @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
*/
public function hasMetadataFor($className);
@@ -58,16 +59,17 @@ public function hasMetadataFor($className);
* Sets the metadata descriptor for a specific class.
*
* @param string $className
+ *
* @param ClassMetadata $class
*/
public function setMetadataFor($className, $class);
/**
- * Whether the class with the specified name should have its metadata loaded.
- * This is only the case if it is either mapped directly or as a
- * MappedSuperclass.
+ * Returns whether the class with the specified name should have its metadata loaded.
+ * This is only the case if it is either mapped directly or as a MappedSuperclass.
*
* @param string $className
+ *
* @return boolean
*/
public function isTransient($className);
View
37 lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
@@ -19,15 +19,14 @@
namespace Doctrine\Common\Persistence\Mapping\Driver;
-use Doctrine\Common\Cache\ArrayCache,
- Doctrine\Common\Annotations\AnnotationReader,
- Doctrine\Common\Annotations\AnnotationRegistry,
- Doctrine\Common\Persistence\Mapping\MappingException;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Annotations\AnnotationRegistry;
+use Doctrine\Common\Persistence\Mapping\MappingException;
/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
*
- * @since 2.2
+ * @since 2.2
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan H. Wage <jonwage@gmail.com>
@@ -57,14 +56,14 @@
protected $fileExtension = '.php';
/**
- * Cache for AnnotationDriver#getAllClassNames()
+ * Cache for AnnotationDriver#getAllClassNames().
*
- * @var array
+ * @var array|null
*/
protected $classNames;
/**
- * Name of the entity annotations as keys
+ * Name of the entity annotations as keys.
*
* @var array
*/
@@ -74,8 +73,8 @@
* Initializes a new AnnotationDriver that uses the given AnnotationReader for reading
* docblock annotations.
*
- * @param AnnotationReader $reader The AnnotationReader to use, duck-typed.
- * @param string|array $paths One or multiple paths where mapping classes can be found.
+ * @param AnnotationReader $reader The AnnotationReader to use, duck-typed.
+ * @param string|array|null $paths One or multiple paths where mapping classes can be found.
*/
public function __construct($reader, $paths = null)
{
@@ -86,9 +85,11 @@ public function __construct($reader, $paths = null)
}
/**
- * Append lookup paths to metadata driver.
+ * Appends lookup paths to metadata driver.
*
* @param array $paths
+ *
+ * @return void
*/
public function addPaths(array $paths)
{
@@ -96,7 +97,7 @@ public function addPaths(array $paths)
}
/**
- * Retrieve the defined metadata lookup paths.
+ * Retrieves the defined metadata lookup paths.
*
* @return array
*/
@@ -106,7 +107,7 @@ public function getPaths()
}
/**
- * Retrieve the current annotation reader
+ * Retrieves the current annotation reader.
*
* @return AnnotationReader
*/
@@ -116,7 +117,7 @@ public function getReader()
}
/**
- * Get the file extension used to look for mapping files under
+ * Gets the file extension used to look for mapping files under.
*
* @return string
*/
@@ -126,9 +127,10 @@ public function getFileExtension()
}
/**
- * Set the file extension used to look for mapping files under
+ * Sets the file extension used to look for mapping files under.
+ *
+ * @param string $fileExtension The file extension to set.
*
- * @param string $fileExtension The file extension to set
* @return void
*/
public function setFileExtension($fileExtension)
@@ -137,13 +139,14 @@ public function setFileExtension($fileExtension)
}
/**
- * Whether the class with the specified name is transient. Only non-transient
+ * Returns whether the class with the specified name is transient. Only non-transient
* classes, that is entities and mapped superclasses, should have their metadata loaded.
*
* A class is non-transient if it is annotated with an annotation
* from the {@see AnnotationDriver::entityAnnotationClasses}.
*
* @param string $className
+ *
* @return boolean
*/
public function isTransient($className)
View
25 lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
@@ -15,14 +15,14 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
-*/
+ */
namespace Doctrine\Common\Persistence\Mapping\Driver;
use Doctrine\Common\Persistence\Mapping\MappingException;
/**
- * Locate the file that contains the metadata information for a given class name.
+ * Locates the file that contains the metadata information for a given class name.
*
* This behavior is independent of the actual content of the file. It just detects
* the file which is responsible for the given class name.
@@ -42,7 +42,7 @@ class DefaultFileLocator implements FileLocator
/**
* The file extension of mapping documents.
*
- * @var string
+ * @var string|null
*/
protected $fileExtension;
@@ -50,8 +50,8 @@ class DefaultFileLocator implements FileLocator
* Initializes a new FileDriver that looks in the given path(s) for mapping
* documents and operates in the specified operating mode.
*
- * @param string|array $paths One or multiple paths where mapping documents can be found.
- * @param string|null $fileExtension
+ * @param string|array $paths One or multiple paths where mapping documents can be found.
+ * @param string|null $fileExtension The file extension of mapping documents.
*/
public function __construct($paths, $fileExtension = null)
{
@@ -60,9 +60,11 @@ public function __construct($paths, $fileExtension = null)
}
/**
- * Append lookup paths to metadata driver.
+ * Appends lookup paths to metadata driver.
*
* @param array $paths
+ *
+ * @return void
*/
public function addPaths(array $paths)
{
@@ -70,7 +72,7 @@ public function addPaths(array $paths)
}
/**
- * Retrieve the defined metadata lookup paths.
+ * Retrieves the defined metadata lookup paths.
*
* @return array
*/
@@ -80,9 +82,9 @@ public function getPaths()
}
/**
- * Get the file extension used to look for mapping files under
+ * Gets the file extension used to look for mapping files under.
*
- * @return string
+ * @return string|null
*/
public function getFileExtension()
{
@@ -90,9 +92,10 @@ public function getFileExtension()
}
/**
- * Set the file extension used to look for mapping files under
+ * Sets the file extension used to look for mapping files under.
+ *
+ * @param string|null $fileExtension The file extension to set.
*
- * @param string $fileExtension The file extension to set
* @return void
*/
public function setFileExtension($fileExtension)
View
55 lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
@@ -29,13 +29,12 @@
* file per class and the file names of the mapping files must correspond to the full
* class name, including namespace, with the namespace delimiters '\', replaced by dots '.'.
*
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.com
- * @since 2.2
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan H. Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
*/
abstract class FileDriver implements MappingDriver
{
@@ -45,12 +44,12 @@
protected $locator;
/**
- * @var array
+ * @var array|null
*/
protected $classCache;
/**
- * @var string
+ * @var string|null
*/
protected $globalBasename;
@@ -58,8 +57,9 @@
* Initializes a new FileDriver that looks in the given path(s) for mapping
* documents and operates in the specified operating mode.
*
- * @param string|array|FileLocator $locator A FileLocator or one/multiple paths where mapping documents can be found.
- * @param string $fileExtension
+ * @param string|array|FileLocator $locator A FileLocator or one/multiple paths
+ * where mapping documents can be found.
+ * @param string|null $fileExtension
*/
public function __construct($locator, $fileExtension = null)
{
@@ -71,9 +71,11 @@ public function __construct($locator, $fileExtension = null)
}
/**
- * Set global basename
+ * Sets the global basename.
*
* @param string $file
+ *
+ * @return void
*/
public function setGlobalBasename($file)
{
@@ -81,9 +83,9 @@ public function setGlobalBasename($file)
}
/**
- * Retrieve global basename
+ * Retrieves the global basename.
*
- * @return string
+ * @return string|null
*/
public function getGlobalBasename()
{
@@ -91,13 +93,14 @@ public function getGlobalBasename()
}
/**
- * Get the element of schema meta data for the class from the mapping file.
- * This will lazily load the mapping file if it is not loaded yet
+ * Gets the element of schema meta data for the class from the mapping file.
+ * This will lazily load the mapping file if it is not loaded yet.
*
* @param string $className
*
+ * @return array The element of schema meta data.
+ *
* @throws MappingException
- * @return array The element of schema meta data
*/
public function getElement($className)
{
@@ -118,12 +121,7 @@ public function getElement($className)
}
/**
- * Whether the class with the specified name should have its metadata loaded.
- * This is only the case if it is either mapped as an Entity or a
- * MappedSuperclass.
- *
- * @param string $className
- * @return boolean
+ * {@inheritDoc}
*/
public function isTransient($className)
{
@@ -139,9 +137,7 @@ public function isTransient($className)
}
/**
- * Gets the names of all mapped classes known to this driver.
- *
- * @return array The names of all mapped classes known to this driver.
+ * {@inheritDoc}
*/
public function getAllClassNames()
{
@@ -161,12 +157,13 @@ public function getAllClassNames()
* from class/entity names to their corresponding file driver elements.
*
* @param string $file The mapping file to load.
+ *
* @return array
*/
abstract protected function loadMappingFile($file);
/**
- * Initialize the class cache from all the global files.
+ * Initializes the class cache from all the global files.
*
* Using this feature adds a substantial performance hit to file drivers as
* more metadata has to be loaded into memory than might actually be
@@ -193,7 +190,7 @@ protected function initialize()
}
/**
- * Retrieve the locator used to discover mapping files by className
+ * Retrieves the locator used to discover mapping files by className.
*
* @return FileLocator
*/
@@ -203,7 +200,7 @@ public function getLocator()
}
/**
- * Set the locator used to discover mapping files by className
+ * Sets the locator used to discover mapping files by className.
*
* @param FileLocator $locator
*/
View
18 lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
@@ -15,12 +15,12 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
-*/
+ */
namespace Doctrine\Common\Persistence\Mapping\Driver;
/**
- * Locate the file that contains the metadata information for a given class name.
+ * Locates the file that contains the metadata information for a given class name.
*
* This behavior is independent of the actual content of the file. It just detects
* the file which is responsible for the given class name.
@@ -31,23 +31,25 @@
interface FileLocator
{
/**
- * Locate mapping file for the given class name.
+ * Locates mapping file for the given class name.
*
* @param string $className
+ *
* @return string
*/
public function findMappingFile($className);
/**
- * Get all class names that are found with this file locator.
+ * Gets all class names that are found with this file locator.
+ *
+ * @param string $globalBasename Passed to allow excluding the basename.
*
- * @param string $globalBasename Passed to allow excluding the basename
* @return array
*/
public function getAllClassNames($globalBasename);
/**
- * Check if a file can be found for this class name.
+ * Checks if a file can be found for this class name.
*
* @param string $className
*
@@ -56,14 +58,14 @@ public function getAllClassNames($globalBasename);
public function fileExists($className);
/**
- * Get all the paths that this file locator looks for mapping files.
+ * Gets all the paths that this file locator looks for mapping files.
*
* @return array
*/
public function getPaths();
/**
- * Get the file extension that mapping files are suffixed with.
+ * Gets the file extension that mapping files are suffixed with.
*
* @return string
*/
View
12 lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
@@ -24,7 +24,7 @@
/**
* Contract for metadata drivers.
*
- * @since 2.2
+ * @since 2.2
* @author Jonathan H. Wage <jonwage@gmail.com>
*/
interface MappingDriver
@@ -32,8 +32,10 @@
/**
* Loads the metadata for the specified class into the provided container.
*
- * @param string $className
+ * @param string $className
* @param ClassMetadata $metadata
+ *
+ * @return void
*/
public function loadMetadataForClass($className, ClassMetadata $metadata);
@@ -45,11 +47,11 @@ public function loadMetadataForClass($className, ClassMetadata $metadata);
public function getAllClassNames();
/**
- * Whether the class with the specified name should have its metadata loaded.
- * This is only the case if it is either mapped as an Entity or a
- * MappedSuperclass.
+ * Returns whether the class with the specified name should have its metadata loaded.
+ * This is only the case if it is either mapped as an Entity or a MappedSuperclass.
*
* @param string $className
+ *
* @return boolean
*/
public function isTransient($className);
View
44 lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
@@ -19,13 +19,13 @@
namespace Doctrine\Common\Persistence\Mapping\Driver;
-use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver,
- Doctrine\Common\Persistence\Mapping\ClassMetadata,
- Doctrine\Common\Persistence\Mapping\MappingException;
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\MappingException;
/**
* The DriverChain allows you to add multiple other mapping drivers for
- * certain namespaces
+ * certain namespaces.
*
* @since 2.2
* @author Benjamin Eberlei <kontakt@beberlei.de>