From c5828271cc76eaf2657c8dd037c5df40de02ecdb Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Sat, 8 Aug 2009 23:16:13 +0000 Subject: [PATCH] [2.0] More docblocks and changed exception thrown in Annotations parser --- .../Annotations/AnnotationException.php | 47 +++++++++++++++++++ lib/Doctrine/Common/Annotations/Parser.php | 2 +- lib/Doctrine/Common/Cache/ApcCache.php | 15 +++--- lib/Doctrine/Common/Cache/ArrayCache.php | 14 +++--- lib/Doctrine/Common/Cache/Cache.php | 15 +++--- lib/Doctrine/Common/Cache/MemcacheCache.php | 14 +++--- lib/Doctrine/Common/Cache/XcacheCache.php | 14 +++--- lib/Doctrine/Common/ClassLoader.php | 30 ++++++++++-- lib/Doctrine/ORM/Query/QueryException.php | 13 ++--- 9 files changed, 122 insertions(+), 42 deletions(-) create mode 100644 lib/Doctrine/Common/Annotations/AnnotationException.php diff --git a/lib/Doctrine/Common/Annotations/AnnotationException.php b/lib/Doctrine/Common/Annotations/AnnotationException.php new file mode 100644 index 000000000..69faff4da --- /dev/null +++ b/lib/Doctrine/Common/Annotations/AnnotationException.php @@ -0,0 +1,47 @@ +. + */ + +namespace Doctrine\Common\Annotations; + +/** + * Description of AnnotationException + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + */ +class AnnotationException extends \Doctrine\Common\DoctrineException +{ + public static function syntaxError($message) + { + return new self('[Syntax Error] ' . $message); + } + + + public static function semanticalError($message) + { + return new self('[Semantical Error] ' . $message); + } +} \ No newline at end of file diff --git a/lib/Doctrine/Common/Annotations/Parser.php b/lib/Doctrine/Common/Annotations/Parser.php index 475387c9f..fa57fe9d2 100644 --- a/lib/Doctrine/Common/Annotations/Parser.php +++ b/lib/Doctrine/Common/Annotations/Parser.php @@ -168,7 +168,7 @@ class Parser $message .= "'{$token['value']}'"; } - throw \Doctrine\Common\DoctrineException::syntaxError($message); + throw AnnotationException::syntaxError($message); } /** diff --git a/lib/Doctrine/Common/Cache/ApcCache.php b/lib/Doctrine/Common/Cache/ApcCache.php index 1ee31410b..73268aa54 100644 --- a/lib/Doctrine/Common/Cache/ApcCache.php +++ b/lib/Doctrine/Common/Cache/ApcCache.php @@ -1,6 +1,6 @@ - * @author Roman Borschel + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class ApcCache implements Cache { diff --git a/lib/Doctrine/Common/Cache/ArrayCache.php b/lib/Doctrine/Common/Cache/ArrayCache.php index d31caa5ae..c00d71112 100644 --- a/lib/Doctrine/Common/Cache/ArrayCache.php +++ b/lib/Doctrine/Common/Cache/ArrayCache.php @@ -1,6 +1,6 @@ + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class ArrayCache implements Cache { diff --git a/lib/Doctrine/Common/Cache/Cache.php b/lib/Doctrine/Common/Cache/Cache.php index ebf417c3f..15e33202c 100644 --- a/lib/Doctrine/Common/Cache/Cache.php +++ b/lib/Doctrine/Common/Cache/Cache.php @@ -1,6 +1,6 @@ - * @author Roman Borschel + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ interface Cache { diff --git a/lib/Doctrine/Common/Cache/MemcacheCache.php b/lib/Doctrine/Common/Cache/MemcacheCache.php index 8525231f2..f617bf2e6 100644 --- a/lib/Doctrine/Common/Cache/MemcacheCache.php +++ b/lib/Doctrine/Common/Cache/MemcacheCache.php @@ -1,6 +1,6 @@ + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class MemcacheCache implements Cache { diff --git a/lib/Doctrine/Common/Cache/XcacheCache.php b/lib/Doctrine/Common/Cache/XcacheCache.php index c788f0535..0058c6fb7 100644 --- a/lib/Doctrine/Common/Cache/XcacheCache.php +++ b/lib/Doctrine/Common/Cache/XcacheCache.php @@ -1,6 +1,6 @@ + * @author Jonathan Wage + * @author Roman Borschel */ class XcacheCache implements Cache { diff --git a/lib/Doctrine/Common/ClassLoader.php b/lib/Doctrine/Common/ClassLoader.php index 92f3cd6a6..48c02e7a5 100644 --- a/lib/Doctrine/Common/ClassLoader.php +++ b/lib/Doctrine/Common/ClassLoader.php @@ -1,5 +1,24 @@ . + */ + namespace Doctrine\Common; /** @@ -17,8 +36,13 @@ namespace Doctrine\Common; * 3) DO NOT setCheckFileExists(true). Doing so is expensive in terms of performance. * 4) Use an opcode-cache (i.e. APC) (STRONGLY RECOMMENDED). * - * @since 2.0 - * @author Roman S. Borschel + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class ClassLoader { diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index a6423945e..a2bc4dc6f 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -24,12 +24,13 @@ namespace Doctrine\ORM\Query; /** * Description of QueryException * - * @author Guilherme Blanco - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - * @version $Revision$ + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision: 3938 $ + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class QueryException extends \Doctrine\Common\DoctrineException {