mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
d440b9a63f
commit
e659a03140
9 changed files with 9 additions and 9 deletions
|
@ -63,7 +63,7 @@ $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]);
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]);
|
||||||
|
|
||||||
DI::init($dice);
|
DI::init($dice);
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
|
@ -58,7 +58,7 @@ $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::WORKER]]);
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]);
|
||||||
|
|
||||||
DI::init($dice);
|
DI::init($dice);
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Throwable;
|
||||||
*/
|
*/
|
||||||
class AddonInvalidConfigFileException extends \RuntimeException
|
class AddonInvalidConfigFileException extends \RuntimeException
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Throwable $previous = null)
|
public function __construct($message = '', $code = 0, Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Core\Hooks\Exceptions;
|
||||||
|
|
||||||
class HookConfigException extends \RuntimeException
|
class HookConfigException extends \RuntimeException
|
||||||
{
|
{
|
||||||
public function __construct($message = "", \Throwable $previous = null)
|
public function __construct($message = '', \Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Throwable;
|
||||||
*/
|
*/
|
||||||
class LogLevelException extends \InvalidArgumentException
|
class LogLevelException extends \InvalidArgumentException
|
||||||
{
|
{
|
||||||
public function __construct($message = "", Throwable $previous = null)
|
public function __construct($message = '', Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Throwable;
|
||||||
*/
|
*/
|
||||||
class LoggerArgumentException extends \InvalidArgumentException
|
class LoggerArgumentException extends \InvalidArgumentException
|
||||||
{
|
{
|
||||||
public function __construct($message = "", Throwable $previous = null)
|
public function __construct($message = '', Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Throwable;
|
||||||
*/
|
*/
|
||||||
class LoggerException extends \Exception
|
class LoggerException extends \Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", Throwable $previous = null)
|
public function __construct($message = '', Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Throwable;
|
||||||
*/
|
*/
|
||||||
class LoggerUnusableException extends \RuntimeException
|
class LoggerUnusableException extends \RuntimeException
|
||||||
{
|
{
|
||||||
public function __construct($message = "", Throwable $previous = null)
|
public function __construct($message = '', Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, 500, $previous);
|
parent::__construct($message, 500, $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ abstract class AbstractLoggerTypeFactory
|
||||||
return LogLevel::INFO;
|
return LogLevel::INFO;
|
||||||
// legacy DATA
|
// legacy DATA
|
||||||
case "4":
|
case "4":
|
||||||
// legacy ALL
|
// legacy ALL
|
||||||
case "5":
|
case "5":
|
||||||
return LogLevel::DEBUG;
|
return LogLevel::DEBUG;
|
||||||
// default if nothing set
|
// default if nothing set
|
||||||
|
|
Loading…
Reference in a new issue