system-dashboard
/
vendor
/
phpdocumentor
/
reflection
/
src
/
phpDocumentor
/
Reflection
/
ReflectionAbstract.php
ReflectionAbstract.php in System Dashboard 2.8.3, at vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/ReflectionAbstract.php
| 1 | <?php |
| 2 | /** |
| 3 | * phpDocumentor |
| 4 | * |
| 5 | * PHP Version 5.3 |
| 6 | * |
| 7 | * @author Mike van Riel <mike.vanriel@naenius.com> |
| 8 | * @copyright 2012 Mike van Riel / Naenius (http://www.naenius.com) |
| 9 | * @license http://www.opensource.org/licenses/mit-license.php MIT |
| 10 | * @link http://phpdoc.org |
| 11 | */ |
| 12 | |
| 13 | namespace phpDocumentor\Reflection; |
| 14 | |
| 15 | use phpDocumentor\Event\DebugEvent; |
| 16 | use phpDocumentor\Event\Dispatcher; |
| 17 | use phpDocumentor\Event\LogEvent; |
| 18 | |
| 19 | /** |
| 20 | * Provides basic event logging and dispatching for every reflection class. |
| 21 | * |
| 22 | * @author Mike van Riel <mike.vanriel@naenius.com> |
| 23 | * @license http://www.opensource.org/licenses/mit-license.php MIT |
| 24 | * @link http://phpdoc.org |
| 25 | */ |
| 26 | abstract class ReflectionAbstract |
| 27 | { |
| 28 | /** |
| 29 | * The context (namespace, aliases) for the reflection. |
| 30 | * |
| 31 | * @var \phpDocumentor\Reflection\DocBlock\Context |
| 32 | */ |
| 33 | protected $context = null; |
| 34 | |
| 35 | /** |
| 36 | * Dispatches a logging request. |
| 37 | * |
| 38 | * @param string $message The message to log. |
| 39 | * @param int $priority The logging priority, the lower, |
| 40 | * the more important. Ranges from 1 to 7 |
| 41 | * |
| 42 | * @return void |
| 43 | */ |
| 44 | public function log($message, $priority = 6) |
| 45 | { |
| 46 | if (class_exists('phpDocumentor\Event\Dispatcher')) { |
| 47 | Dispatcher::getInstance()->dispatch( |
| 48 | 'system.log', |
| 49 | LogEvent::createInstance($this) |
| 50 | ->setMessage($message)->setPriority($priority) |
| 51 | ); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Dispatches a logging request to log a debug message. |
| 57 | * |
| 58 | * @param string $message The message to log. |
| 59 | * |
| 60 | * @return void |
| 61 | */ |
| 62 | public function debug($message) |
| 63 | { |
| 64 | if (class_exists('phpDocumentor\Event\Dispatcher')) { |
| 65 | Dispatcher::getInstance()->dispatch( |
| 66 | 'system.debug', |
| 67 | DebugEvent::createInstance($this) |
| 68 | ->setMessage($message) |
| 69 | ); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 |