From 1103714b9f7537064d893d8454ec2412f751a61e Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 16 Feb 2011 19:27:38 +0100 Subject: [PATCH] typos --- dibi/dibi.php | 85 ++++++++++------------------------ dibi/libs/DibiDatabaseInfo.php | 2 +- dibi/libs/DibiException.php | 39 +++++++++++++++- dibi/libs/DibiHashMap.php | 9 +++- dibi/libs/interfaces.php | 34 ++++++-------- 5 files changed, 83 insertions(+), 86 deletions(-) diff --git a/dibi/dibi.php b/dibi/dibi.php index 1a57f759..82344b36 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -33,37 +33,8 @@ if (interface_exists('Nette\\IDebugPanel')) { interface IDebugPanel {} } -if (!defined('NETTE')) { - /**#@+ @package exceptions */ - class NotImplementedException extends LogicException {} - class NotSupportedException extends LogicException {} - class MemberAccessException extends LogicException {} - class InvalidStateException extends RuntimeException {} - class IOException extends RuntimeException {} - class FileNotFoundException extends IOException {} - /**#@-*/ -} -class DibiPcreException extends Exception { - - public function __construct($message = '%msg.') - { - static $messages = array( - PREG_INTERNAL_ERROR => 'Internal error', - PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted', - PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted', - PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data', - 5 => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', // PREG_BAD_UTF8_OFFSET_ERROR - ); - $code = preg_last_error(); - parent::__construct(str_replace('%msg', isset($messages[$code]) ? $messages[$code] : 'Unknown error', $message), $code); - } -} - - - -// dibi libraries require_once dirname(__FILE__) . '/libs/interfaces.php'; require_once dirname(__FILE__) . '/libs/DibiDateTime.php'; require_once dirname(__FILE__) . '/libs/DibiObject.php'; @@ -107,41 +78,35 @@ class DibiVariable extends DibiDateTime */ class dibi { - /**#@+ - * dibi data type - */ - const TEXT = 's'; // as 'string' - const BINARY = 'bin'; - const BOOL = 'b'; - const INTEGER = 'i'; - const FLOAT = 'f'; - const DATE = 'd'; - const DATETIME = 't'; - const TIME = 't'; + /** column type */ + const TEXT = 's', // as 'string' + BINARY = 'bin', + BOOL = 'b', + INTEGER = 'i', + FLOAT = 'f', + DATE = 'd', + DATETIME = 't', + TIME = 't'; + const IDENTIFIER = 'n'; - /**#@-*/ - /**#@+ - * @deprecated column types - */ - const FIELD_TEXT = dibi::TEXT; - const FIELD_BINARY = dibi::BINARY; - const FIELD_BOOL = dibi::BOOL; - const FIELD_INTEGER = dibi::INTEGER; - const FIELD_FLOAT = dibi::FLOAT; - const FIELD_DATE = dibi::DATE; - const FIELD_DATETIME = dibi::DATETIME; - const FIELD_TIME = dibi::TIME; - /**#@-*/ + /** @deprecated */ + const FIELD_TEXT = dibi::TEXT, + FIELD_BINARY = dibi::BINARY, + FIELD_BOOL = dibi::BOOL, + FIELD_INTEGER = dibi::INTEGER, + FIELD_FLOAT = dibi::FLOAT, + FIELD_DATE = dibi::DATE, + FIELD_DATETIME = dibi::DATETIME, + FIELD_TIME = dibi::TIME; - /**#@+ - * dibi version - */ - const VERSION = '1.5-rc1'; - const REVISION = '$WCREV$ released on $WCDATE$'; - /**#@-*/ + /** version */ + const VERSION = '1.5-rc1', + REVISION = '$WCREV$ released on $WCDATE$'; - const ASC = 'ASC', DESC = 'DESC'; + /** sorting order */ + const ASC = 'ASC', + DESC = 'DESC'; /** @var DibiConnection[] Connection registry storage for DibiConnection objects */ private static $registry = array(); diff --git a/dibi/libs/DibiDatabaseInfo.php b/dibi/libs/DibiDatabaseInfo.php index f98d2c12..50f5edd0 100644 --- a/dibi/libs/DibiDatabaseInfo.php +++ b/dibi/libs/DibiDatabaseInfo.php @@ -8,7 +8,7 @@ * For the full copyright and license information, please view * the file license.txt that was distributed with this source code. * - * @package dibi + * @package dibi\reflection */ diff --git a/dibi/libs/DibiException.php b/dibi/libs/DibiException.php index 68381a38..67d57775 100644 --- a/dibi/libs/DibiException.php +++ b/dibi/libs/DibiException.php @@ -8,11 +8,22 @@ * For the full copyright and license information, please view * the file license.txt that was distributed with this source code. * - * @package dibi + * @package dibi\exceptions */ +if (!defined('NETTE')) { + class NotImplementedException extends LogicException {} + class NotSupportedException extends LogicException {} + class MemberAccessException extends LogicException {} + class InvalidStateException extends RuntimeException {} + class IOException extends RuntimeException {} + class FileNotFoundException extends IOException {} +} + + + /** * dibi common exception. * @@ -159,4 +170,28 @@ class DibiDriverException extends DibiException self::$errorMsg = $message; } -} \ No newline at end of file +} + + + + +/** + * PCRE exception. + * + * @author David Grudl + */ +class DibiPcreException extends Exception { + + public function __construct($message = '%msg.') + { + static $messages = array( + PREG_INTERNAL_ERROR => 'Internal error', + PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted', + PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted', + PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data', + 5 => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', // PREG_BAD_UTF8_OFFSET_ERROR + ); + $code = preg_last_error(); + parent::__construct(str_replace('%msg', isset($messages[$code]) ? $messages[$code] : 'Unknown error', $message), $code); + } +} diff --git a/dibi/libs/DibiHashMap.php b/dibi/libs/DibiHashMap.php index fe6c1bff..80be6696 100644 --- a/dibi/libs/DibiHashMap.php +++ b/dibi/libs/DibiHashMap.php @@ -13,7 +13,7 @@ -/**#@+ +/** * Lazy cached storage. * * @author David Grudl @@ -51,6 +51,12 @@ abstract class DibiHashMapBase +/** + * Lazy cached storage. + * + * @author David Grudl + * @internal + */ final class DibiHashMap extends DibiHashMapBase { @@ -75,4 +81,3 @@ final class DibiHashMap extends DibiHashMapBase } } -/**#@-*/ diff --git a/dibi/libs/interfaces.php b/dibi/libs/interfaces.php index 1c0c41b4..0577eeb4 100644 --- a/dibi/libs/interfaces.php +++ b/dibi/libs/interfaces.php @@ -15,7 +15,6 @@ /** * Provides an interface between a dataset and data-aware components. - * @package dibi */ interface IDataSource extends Countable, IteratorAggregate { @@ -27,7 +26,6 @@ interface IDataSource extends Countable, IteratorAggregate /** * Object that is able to generate SQL. - * @package dibi */ interface IDibiVariable { @@ -40,24 +38,22 @@ interface IDibiVariable /** * Defines method that must profiler implement. - * @package dibi */ interface IDibiProfiler { - /**#@+ event type */ - const CONNECT = 1; - const SELECT = 4; - const INSERT = 8; - const DELETE = 16; - const UPDATE = 32; - const QUERY = 60; // SELECT | INSERT | DELETE | UPDATE - const BEGIN = 64; - const COMMIT = 128; - const ROLLBACK = 256; - const TRANSACTION = 448; // BEGIN | COMMIT | ROLLBACK - const EXCEPTION = 512; - const ALL = 1023; - /**#@-*/ + /** event type */ + const CONNECT = 1, + SELECT = 4, + INSERT = 8, + DELETE = 16, + UPDATE = 32, + QUERY = 60, // SELECT | INSERT | DELETE | UPDATE + BEGIN = 64, + COMMIT = 128, + ROLLBACK = 256, + TRANSACTION = 448, // BEGIN | COMMIT | ROLLBACK + EXCEPTION = 512, + ALL = 1023; /** * Before event notification. @@ -91,8 +87,6 @@ interface IDibiProfiler /** * dibi driver interface. - * - * @author David Grudl */ interface IDibiDriver { @@ -202,8 +196,6 @@ interface IDibiDriver /** * dibi result set driver interface. - * - * @author David Grudl */ interface IDibiResultDriver {