Skip to content

Commit

Permalink
Remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Mar 18, 2024
1 parent a6a85a8 commit 4608f21
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
5 changes: 0 additions & 5 deletions _dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@
use GaletteOAuth2\Repositories\ScopeRepository;
use GaletteOAuth2\Repositories\UserRepository;
use GaletteOAuth2\Tools\Config;
use GaletteOAuth2\Tools\Debug as Debug;
use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\Grant\AuthCodeGrant;
use League\OAuth2\Server\Grant\RefreshTokenGrant;
use League\OAuth2\Server\ResourceServer;
use Psr\Container\ContainerInterface;

if (OAUTH2_LOG) {
Debug::init();
}

$container = $app->getContainer();

$container->set(
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteOAuth2/Authorization/UserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static function mergeOptions(Config $config, $client_id, array $oauth_sco
$options = array_merge($o, $options);
}
$options = array_unique($options);
Debug::Log('Options: ' . implode(';', $options));
Debug::log('Options: ' . implode(';', $options));

return $options;
}
Expand Down
16 changes: 0 additions & 16 deletions lib/GaletteOAuth2/Tools/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,6 @@
*/
final class Debug
{
private static $logger;

public static function init(): Logger
{
self::$logger = new Logger('OAuth2');
$stream = new StreamHandler(GALETTE_LOGS_PATH . '/oauth.log', Logger::DEBUG);
$dateFormat = 'Y-m-d H:i:s';
//$output = "[%datetime%] %channel% %level_name%: %message% \n"; // %context% %extra%\n";
$output = "[%datetime%] : %message% \n"; // %context% %extra%\n";
$formatter = new LineFormatter($output, $dateFormat);
$stream->setFormatter($formatter);
self::$logger->pushHandler($stream);

return self::$logger;
}

public static function printVar($expression, bool $return = true)
{
$export = print_r($expression, true);
Expand Down

0 comments on commit 4608f21

Please sign in to comment.