1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Add scalar types to processor/formatters and top level classes

This commit is contained in:
Jordi Boggiano
2016-09-25 21:23:35 +02:00
parent 760dc44ebd
commit 6e6586257d
29 changed files with 130 additions and 196 deletions

View File

@@ -65,11 +65,7 @@ class WebProcessor
}
}
/**
* @param array $record
* @return array
*/
public function __invoke(array $record)
public function __invoke(array $record): array
{
// skip processing if for some reason request data
// is not present (CLI or wonky SAPIs)
@@ -82,23 +78,14 @@ class WebProcessor
return $record;
}
/**
* @param string $extraName
* @param string $serverName
* @return $this
*/
public function addExtraField($extraName, $serverName)
public function addExtraField(string $extraName, string $serverName): self
{
$this->extraFields[$extraName] = $serverName;
return $this;
}
/**
* @param array $extra
* @return array
*/
private function appendExtraFields(array $extra)
private function appendExtraFields(array $extra): array
{
foreach ($this->extraFields as $extraName => $serverName) {
$extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;