diff --git a/composer.json b/composer.json index 41c1dabe..58ae3293 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "maximebf/debugbar", + "name": "graef685/debugbar", "description": "Debug bar in the browser for php application", "keywords": ["debug", "debugbar"], - "homepage": "https://github.com/maximebf/php-debugbar", + "homepage": "https://github.com/graef685/php-debugbar", "type": "library", "license": "MIT", "authors": [ @@ -14,12 +14,17 @@ { "name": "Barry vd. Heuvel", "email": "barryvdh@gmail.com" + }, + { + "name": "Patrick Gräf", + "email": "graef685@googlemail.com", + "homepage": "https://github.com/graef685" } ], "require": { "php": "^7.1|^8", - "psr/log": "^1.0", - "symfony/var-dumper": "^2.6|^3|^4|^5" + "graef685/log": "^4.0", + "symfony/var-dumper": "^2.8.52" }, "require-dev": { "phpunit/phpunit": "^7.5.20 || ^9.4.2" diff --git a/src/DebugBar/DataCollector/MessagesCollector.php b/src/DebugBar/DataCollector/MessagesCollector.php index 594ab2a5..d8628b7b 100644 --- a/src/DebugBar/DataCollector/MessagesCollector.php +++ b/src/DebugBar/DataCollector/MessagesCollector.php @@ -183,7 +183,7 @@ public function getMessages() * @param $message * @param array $context */ - public function log($level, $message, array $context = array()) + public function log($level, string $message, array $context = []): void { // For string messages, interpolate the context following PSR-3 if (is_string($message)) { diff --git a/src/DebugBar/StandardDebugBar.php b/src/DebugBar/StandardDebugBar.php index d0f3e17c..e67841ca 100644 --- a/src/DebugBar/StandardDebugBar.php +++ b/src/DebugBar/StandardDebugBar.php @@ -22,6 +22,8 @@ */ class StandardDebugBar extends DebugBar { + protected static $instance; + public function __construct() { $this->addCollector(new PhpInfoCollector()); @@ -31,4 +33,16 @@ public function __construct() $this->addCollector(new MemoryCollector()); $this->addCollector(new ExceptionsCollector()); } + + /** + * class instance + * + * @return StandardDebugBar + */ + public static function get_instance(){ + if(!self::$instance instanceof StandardDebugBar){ + self::$instance = new StandardDebugBar(); + } + return self::$instance; + } }