This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
862 additions
and
1,082 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Alltube\Factory; | ||
|
||
use DebugBar\DataCollector\ConfigCollector; | ||
use DebugBar\DataCollector\MemoryCollector; | ||
use DebugBar\DataCollector\MessagesCollector; | ||
use DebugBar\DataCollector\PhpInfoCollector; | ||
use DebugBar\DataCollector\RequestDataCollector; | ||
use DebugBar\DebugBar; | ||
use DebugBar\DebugBarException; | ||
use Kitchenu\Debugbar\DataCollector\SlimRouteCollector; | ||
use Slim\Container; | ||
|
||
/** | ||
* Class DebugBarFactory | ||
* @package Alltube\Factory | ||
*/ | ||
class DebugBarFactory | ||
{ | ||
|
||
/** | ||
* @param Container $container | ||
* @return DebugBar | ||
* @throws DebugBarException | ||
*/ | ||
public static function create(Container $container): DebugBar | ||
{ | ||
$debugBar = new DebugBar(); | ||
|
||
$requestCollector = new RequestDataCollector(); | ||
$configCollector = new ConfigCollector(get_object_vars($container->get('config'))); | ||
|
||
$debugBar->addCollector(new PhpInfoCollector()) | ||
->addCollector(new MessagesCollector()) | ||
->addCollector($requestCollector) | ||
->addCollector(new MemoryCollector()) | ||
->addCollector($configCollector) | ||
->addCollector(new SlimRouteCollector($container->get('router'), $container->get('request'))); | ||
|
||
$container->get('logger')->add('debugbar', $debugBar->getCollector('messages')); | ||
|
||
$requestCollector->useHtmlVarDumper(); | ||
$configCollector->useHtmlVarDumper(); | ||
|
||
return $debugBar; | ||
} | ||
} |
Oops, something went wrong.