1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 01:26:11 +02:00

Update return types

This commit is contained in:
Jordi Boggiano
2018-11-19 14:40:44 +01:00
parent 6bb347c040
commit 1c5b0b8ff4
13 changed files with 63 additions and 82 deletions

View File

@@ -35,7 +35,7 @@ class CubeHandler extends AbstractProcessingHandler
* A valid url must consist of three parts : protocol://host:port
* Only valid protocols used by Cube are http and udp
*/
public function __construct($url, $level = Logger::DEBUG, bool $bubble = true)
public function __construct(string $url, $level = Logger::DEBUG, bool $bubble = true)
{
$urlInfo = parse_url($url);
@@ -63,7 +63,7 @@ class CubeHandler extends AbstractProcessingHandler
* @throws \LogicException when unable to connect to the socket
* @throws MissingExtensionException when there is no socket extension
*/
protected function connectUdp()
protected function connectUdp(): void
{
if (!extension_loaded('sockets')) {
throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler');
@@ -83,7 +83,7 @@ class CubeHandler extends AbstractProcessingHandler
* Establish a connection to a http server
* @throws \LogicException when no curl extension
*/
protected function connectHttp()
protected function connectHttp(): void
{
if (!extension_loaded('curl')) {
throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler');
@@ -126,7 +126,7 @@ class CubeHandler extends AbstractProcessingHandler
}
}
private function writeUdp($data)
private function writeUdp(string $data): void
{
if (!$this->udpConnection) {
$this->connectUdp();
@@ -135,7 +135,7 @@ class CubeHandler extends AbstractProcessingHandler
socket_send($this->udpConnection, $data, strlen($data), 0);
}
private function writeHttp($data)
private function writeHttp(string $data): void
{
if (!$this->httpConnection) {
$this->connectHttp();