Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Monolog/Handler/AmqpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AmqpHandler extends AbstractProcessingHandler
protected AMQPExchange|AMQPChannel $exchange;

/** @var array<string, mixed> */
private array $extraAttributes = [];
protected array $extraAttributes = [];

protected string $exchangeName;

Expand Down Expand Up @@ -147,7 +147,7 @@ protected function getRoutingKey(LogRecord $record): string
return strtolower($routingKey);
}

private function createAmqpMessage(string $data): AMQPMessage
protected function createAmqpMessage(string $data): AMQPMessage
{
$attributes = [
'delivery_mode' => 2,
Expand Down
16 changes: 8 additions & 8 deletions src/Monolog/Handler/BrowserConsoleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected static function getResponseFormatFromContentType(string $contentType):
return self::FORMAT_UNKNOWN;
}

private static function generateScript(): string
protected static function generateScript(): string
{
$script = [];
foreach (static::$records as $record) {
Expand All @@ -188,7 +188,7 @@ private static function generateScript(): string
return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);";
}

private static function getConsoleMethodForLevel(Level $level): string
protected static function getConsoleMethodForLevel(Level $level): string
{
return match ($level) {
Level::Debug => 'debug',
Expand All @@ -201,7 +201,7 @@ private static function getConsoleMethodForLevel(Level $level): string
/**
* @return string[]
*/
private static function handleStyles(string $formatted): array
protected static function handleStyles(string $formatted): array
{
$args = [];
$format = '%c' . $formatted;
Expand All @@ -221,7 +221,7 @@ private static function handleStyles(string $formatted): array
return array_reverse($args);
}

private static function handleCustomStyles(string $style, string $string): string
protected static function handleCustomStyles(string $style, string $string): string
{
static $colors = ['blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'];
static $labels = [];
Expand Down Expand Up @@ -253,7 +253,7 @@ private static function handleCustomStyles(string $style, string $string): strin
* @param mixed[] $dict
* @return mixed[]
*/
private static function dump(string $title, array $dict): array
protected static function dump(string $title, array $dict): array
{
$script = [];
$dict = array_filter($dict, fn ($value) => $value !== null);
Expand All @@ -272,15 +272,15 @@ private static function dump(string $title, array $dict): array
return $script;
}

private static function quote(string $arg): string
protected static function quote(string $arg): string
{
return '"' . addcslashes($arg, "\"\n\\") . '"';
}

/**
* @param mixed $args
*/
private static function call(...$args): string
protected static function call(...$args): string
{
$method = array_shift($args);
if (!\is_string($method)) {
Expand All @@ -293,7 +293,7 @@ private static function call(...$args): string
/**
* @param mixed[] $args
*/
private static function call_array(string $method, array $args): string
protected static function call_array(string $method, array $args): string
{
return 'c.' . $method . '(' . implode(', ', $args) . ');';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/CouchDBHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CouchDBHandler extends AbstractProcessingHandler
* @var mixed[]
* @phpstan-var Options
*/
private array $options;
protected array $options;

/**
* @param mixed[] $options
Expand Down
16 changes: 8 additions & 8 deletions src/Monolog/Handler/CubeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
*/
class CubeHandler extends AbstractProcessingHandler
{
private ?\Socket $udpConnection = null;
private ?\CurlHandle $httpConnection = null;
private string $scheme;
private string $host;
private int $port;
protected ?\Socket $udpConnection = null;
protected ?\CurlHandle $httpConnection = null;
protected string $scheme;
protected string $host;
protected int $port;
/** @var string[] */
private array $acceptedSchemes = ['http', 'udp'];
protected array $acceptedSchemes = ['http', 'udp'];

/**
* Create a Cube handler
Expand Down Expand Up @@ -133,7 +133,7 @@ protected function write(LogRecord $record): void
}
}

private function writeUdp(string $data): void
protected function writeUdp(string $data): void
{
if (null === $this->udpConnection) {
$this->connectUdp();
Expand All @@ -146,7 +146,7 @@ private function writeUdp(string $data): void
socket_send($this->udpConnection, $data, \strlen($data), 0);
}

private function writeHttp(string $data): void
protected function writeHttp(string $data): void
{
if (null === $this->httpConnection) {
$this->connectHttp();
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/Curl/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
final class Util
{
/** @var array<int> */
private static array $retriableErrorCodes = [
protected static array $retriableErrorCodes = [
CURLE_COULDNT_RESOLVE_HOST,
CURLE_COULDNT_CONNECT,
CURLE_HTTP_NOT_FOUND,
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/DeduplicationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function buildDeduplicationStoreEntry(LogRecord $record): string
return $record->datetime->getTimestamp() . ':' . $record->level->getName() . ':' . preg_replace('{[\r\n].*}', '', $record->message);
}

private function collectLogs(): void
protected function collectLogs(): void
{
if (!file_exists($this->deduplicationStore)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/DoctrineCouchDBHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
class DoctrineCouchDBHandler extends AbstractProcessingHandler
{
private CouchDBClient $client;
protected CouchDBClient $client;

public function __construct(CouchDBClient $client, int|string|Level $level = Level::Debug, bool $bubble = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/ElasticsearchHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ElasticsearchHandler extends AbstractProcessingHandler
/**
* @var bool
*/
private $needsType;
protected $needsType;

/**
* @param Client|Client8 $client Elasticsearch Client object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
*/
class ChannelLevelActivationStrategy implements ActivationStrategyInterface
{
private Level $defaultActionLevel;
protected Level $defaultActionLevel;

/**
* @var array<string, Level>
*/
private array $channelToActionLevel;
protected array $channelToActionLevel;

/**
* @param int|string|Level|LogLevel::* $defaultActionLevel The default action level to be used if the record's category doesn't match any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class ErrorLevelActivationStrategy implements ActivationStrategyInterface
{
private Level $actionLevel;
protected Level $actionLevel;

/**
* @param int|string|Level $actionLevel Level or name or value
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/FingersCrossedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function clear(): void
/**
* Resets the state of the handler. Stops forwarding records to the wrapped handler.
*/
private function flushBuffer(): void
protected function flushBuffer(): void
{
if (null !== $this->passthruLevel) {
$passthruLevel = $this->passthruLevel;
Expand Down
4 changes: 2 additions & 2 deletions src/Monolog/Handler/FleepHookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function generateDataStream(LogRecord $record): string
/**
* Builds the header of the API Call
*/
private function buildHeader(string $content): string
protected function buildHeader(string $content): string
{
$header = "POST " . static::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
$header .= "Host: " . static::FLEEP_HOST . "\r\n";
Expand All @@ -121,7 +121,7 @@ private function buildHeader(string $content): string
/**
* Builds the body of API call
*/
private function buildContent(LogRecord $record): string
protected function buildContent(LogRecord $record): string
{
$dataArray = [
'message' => $record->formatted,
Expand Down
4 changes: 2 additions & 2 deletions src/Monolog/Handler/FlowdockHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ protected function generateDataStream(LogRecord $record): string
/**
* Builds the body of API call
*/
private function buildContent(LogRecord $record): string
protected function buildContent(LogRecord $record): string
{
return Utils::jsonEncode($record->formatted);
}

/**
* Builds the header of the API Call
*/
private function buildHeader(string $content): string
protected function buildHeader(string $content): string
{
$header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n";
$header .= "Host: api.flowdock.com\r\n";
Expand Down
4 changes: 2 additions & 2 deletions src/Monolog/Handler/IFTTTHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
*/
class IFTTTHandler extends AbstractProcessingHandler
{
private string $eventName;
private string $secretKey;
protected string $eventName;
protected string $secretKey;

/**
* @param string $eventName The name of the IFTTT Maker event that should be triggered
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/LogglyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function getCurlHandler(string $endpoint): CurlHandle
/**
* Starts a fresh curl session for the given endpoint and returns its handler.
*/
private function loadCurlHandle(string $endpoint): CurlHandle
protected function loadCurlHandle(string $endpoint): CurlHandle
{
$url = sprintf("https://%s/%s/%s/", static::HOST, $endpoint, $this->token);

Expand Down
6 changes: 3 additions & 3 deletions src/Monolog/Handler/LogmaticHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
*/
class LogmaticHandler extends SocketHandler
{
private string $logToken;
protected string $logToken;

private string $hostname;
protected string $hostname;

private string $appName;
protected string $appName;

/**
* @param string $token Log token supplied by Logmatic.
Expand Down
6 changes: 3 additions & 3 deletions src/Monolog/Handler/MongoDBHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
*/
class MongoDBHandler extends AbstractProcessingHandler
{
private \MongoDB\Collection $collection;
protected \MongoDB\Collection $collection;

private Client|Manager $manager;
protected Client|Manager $manager;

private string|null $namespace = null;
protected string|null $namespace = null;

/**
* Constructor.
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/NullHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
class NullHandler extends Handler
{
private Level $level;
protected Level $level;

/**
* @param string|int|Level $level The minimum logging level at which this handler will be triggered
Expand Down
6 changes: 3 additions & 3 deletions src/Monolog/Handler/OverflowHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
*/
class OverflowHandler extends AbstractHandler implements FormattableHandlerInterface
{
private HandlerInterface $handler;
protected HandlerInterface $handler;

/** @var array<int, int> */
private array $thresholdMap = [];
protected array $thresholdMap = [];

/**
* Buffer of all messages passed to the handler before the threshold was reached
*
* @var mixed[][]
*/
private array $buffer = [];
protected array $buffer = [];

/**
* @param array<int, int> $thresholdMap Dictionary of log level value => threshold
Expand Down
16 changes: 8 additions & 8 deletions src/Monolog/Handler/PHPConsoleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
/**
* @phpstan-var Options
*/
private array $options = [
protected array $options = [
'enabled' => true, // bool Is PHP Console server enabled
'classesPartialsTraceIgnore' => ['Monolog\\'], // array Hide calls of classes started with...
'debugTagsKeysInContext' => [0, 'tag'], // bool Is PHP Console server enabled
Expand All @@ -114,7 +114,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
'dataStorage' => null, // \PhpConsole\Storage|null Fixes problem with custom $_SESSION handler (see https://github.com/barbushin/php-console#troubleshooting-with-_session-handler-overridden-in-some-frameworks)
];

private Connector $connector;
protected Connector $connector;

/**
* @param array<string, mixed> $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
Expand All @@ -139,7 +139,7 @@ public function __construct(array $options = [], ?Connector $connector = null, i
* @phpstan-param InputOptions $options
* @phpstan-return Options
*/
private function initOptions(array $options): array
protected function initOptions(array $options): array
{
$wrongOptions = array_diff(array_keys($options), array_keys($this->options));
if (\count($wrongOptions) > 0) {
Expand All @@ -149,7 +149,7 @@ private function initOptions(array $options): array
return array_replace($this->options, $options);
}

private function initConnector(?Connector $connector = null): Connector
protected function initConnector(?Connector $connector = null): Connector
{
if (null === $connector) {
if ($this->options['dataStorage'] instanceof Storage) {
Expand Down Expand Up @@ -240,7 +240,7 @@ protected function write(LogRecord $record): void
}
}

private function handleDebugRecord(LogRecord $record): void
protected function handleDebugRecord(LogRecord $record): void
{
[$tags, $filteredContext] = $this->getRecordTags($record);
$message = $record->message;
Expand All @@ -250,12 +250,12 @@ private function handleDebugRecord(LogRecord $record): void
$this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
}

private function handleExceptionRecord(LogRecord $record): void
protected function handleExceptionRecord(LogRecord $record): void
{
$this->connector->getErrorsDispatcher()->dispatchException($record->context['exception']);
}

private function handleErrorRecord(LogRecord $record): void
protected function handleErrorRecord(LogRecord $record): void
{
$context = $record->context;

Expand All @@ -271,7 +271,7 @@ private function handleErrorRecord(LogRecord $record): void
/**
* @return array{string, mixed[]}
*/
private function getRecordTags(LogRecord $record): array
protected function getRecordTags(LogRecord $record): array
{
$tags = null;
$filteredContext = [];
Expand Down
Loading