Skip to content

Commit

Permalink
Composer: update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Ondráček <ondracek.roman@centrum.cz>
  • Loading branch information
Roman3349 committed Oct 27, 2022
1 parent ee7622e commit 1295cb0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
20 changes: 12 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
],
"require": {
"php": ">=7.2",
"contributte/di": "^0.5.1",
"contributte/di": "^0.5.3",
"monolog/monolog": "^2.0.0",
"nette/utils": "^3.0.0"
},
"require-dev": {
"ninjify/qa": "^0.12",
"ninjify/qa": "^v0.13.0",
"ninjify/nunjuck": "^0.4",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-nette": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"tracy/tracy": "^2.6.2"
"phpstan/phpstan": "^1.8.11",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
"phpstan/phpstan-nette": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.4.4",
"tracy/tracy": "^v2.9.4"
},
"autoload": {
"psr-4": {
Expand All @@ -43,7 +43,11 @@
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/package-versions-deprecated": true
}
},
"extra": {
"branch-alias": {
Expand Down
18 changes: 9 additions & 9 deletions src/LoggerHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ class LoggerHolder

public static function setLogger(string $loggerServiceName, Container $container): void
{
static::$loggerServiceName = $loggerServiceName;
static::$container = $container;
self::$loggerServiceName = $loggerServiceName;
self::$container = $container;
}

/**
* @return static
*/
public static function getInstance(): self
{
if (static::$instSelf === null) {
if (static::$loggerServiceName === null || static::$container === null) {
throw new InvalidStateException(sprintf('Call %s::setLogger to use %s::getInstance', static::class, static::class));
if (self::$instSelf === null) {
if (self::$loggerServiceName === null || self::$container === null) {
throw new InvalidStateException(sprintf('Call %s::setLogger to use %s::getInstance', self::class, self::class));
}

/** @var Logger $logger */
$logger = static::$container->getService(static::$loggerServiceName);
static::$instSelf = new static($logger);
$logger = self::$container->getService(self::$loggerServiceName);
self::$instSelf = new static($logger);
}

return static::$instSelf;
return self::$instSelf;
}

final public function __construct(Logger $logger)
Expand All @@ -55,7 +55,7 @@ public function getLogger(): LoggerInterface
{
$backtrace = debug_backtrace();
// Get class which called this or file if class does not exist
$calledBy = $backtrace[1]['class'] ?? $backtrace[0]['file'];
$calledBy = $backtrace[1]['class'] ?? $backtrace[0]['file'] ?? $backtrace[0]['function'];

$logger = clone $this->instLogger;

Expand Down
3 changes: 2 additions & 1 deletion src/Tracy/LazyTracyLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public function __construct(string $loggerServiceName, Container $container)
}

/**
* @inheritdoc
* @param mixed $value
* @param mixed $priority
*/
public function log($value, $priority = self::INFO): void
{
Expand Down

0 comments on commit 1295cb0

Please sign in to comment.