Skip to content

Commit

Permalink
Merge pull request #36 from nuwber/laravel-9
Browse files Browse the repository at this point in the history
Laravel 9 compatibility

Close #35
  • Loading branch information
hedii authored Feb 9, 2022
2 parents be2d079 + 3be19b8 commit ed05363
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.3', '7.4', '8.0', '8.1' ]
php-versions: [ '8.0', '8.1' ]
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"source": "https://github.com/hedii/laravel-gelf-logger"
},
"require": {
"php": "^7.3|^8.0",
"illuminate/log": "^8.12",
"graylog2/gelf-php": "^1.6"
"php": "^8.0",
"illuminate/log": "^9.0",
"graylog2/gelf-php": "^1.7"
},
"require-dev": {
"orchestra/testbench": "^6.0"
"orchestra/testbench": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
13 changes: 5 additions & 8 deletions src/GelfLoggerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,11 @@ protected function getTransport(
?string $path = null,
?SslOptions $sslOptions = null
): AbstractTransport {
switch (strtolower($transport)) {
case 'tcp':
return new TcpTransport($host, $port, $sslOptions);
case 'http':
return new HttpTransport($host, $port, $path ?? HttpTransport::DEFAULT_PATH, $sslOptions);
default:
return new UdpTransport($host, $port);
}
return match(strtolower($transport)) {
'tcp' => new TcpTransport($host, $port, $sslOptions),
'http' => new HttpTransport($host, $port, $path ?? HttpTransport::DEFAULT_PATH, $sslOptions),
default => new UdpTransport($host, $port),
};
}

protected function enableSsl(array $config): bool
Expand Down

0 comments on commit ed05363

Please sign in to comment.