Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 compatibility #671

Closed
wants to merge 1 commit into from
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"homepage": "https://bugsnag.com"
}],
"require": {
"php": ">=5.5",
"php": ">=8.1",
"composer/ca-bundle": "^1.0",
"guzzlehttp/guzzle": "^5.0|^6.0|^7.0"
},
Expand Down
14 changes: 7 additions & 7 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public static function make(
*/
public function __construct(
Configuration $config,
ResolverInterface $resolver = null,
GuzzleHttp\ClientInterface $guzzle = null,
ShutdownStrategyInterface $shutdownStrategy = null
?ResolverInterface $resolver = null,
?GuzzleHttp\ClientInterface $guzzle = null,
?ShutdownStrategyInterface $shutdownStrategy = null
) {
$guzzle = $guzzle ?: self::makeGuzzle();

Expand Down Expand Up @@ -327,7 +327,7 @@ public function clearBreadcrumbs()
*
* @return void
*/
public function notifyException($throwable, callable $callback = null)
public function notifyException($throwable, ?callable $callback = null)
{
$report = Report::fromPHPThrowable($this->config, $throwable);

Expand All @@ -343,7 +343,7 @@ public function notifyException($throwable, callable $callback = null)
*
* @return void
*/
public function notifyError($name, $message, callable $callback = null)
public function notifyError($name, $message, ?callable $callback = null)
{
$report = Report::fromNamedError($this->config, $name, $message);

Expand All @@ -360,7 +360,7 @@ public function notifyError($name, $message, callable $callback = null)
*
* @return void
*/
public function notify(Report $report, callable $callback = null)
public function notify(Report $report, ?callable $callback = null)
{
$this->pipeline->execute($report, function ($report) use ($callback) {
if ($callback) {
Expand Down Expand Up @@ -511,7 +511,7 @@ public function isBatchSending()
*
* @return $this
*/
public function setNotifyReleaseStages(array $notifyReleaseStages = null)
public function setNotifyReleaseStages(?array $notifyReleaseStages = null)
{
$this->config->setNotifyReleaseStages($notifyReleaseStages);

Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function isBatchSending()
*
* @return $this
*/
public function setNotifyReleaseStages(array $notifyReleaseStages = null)
public function setNotifyReleaseStages(?array $notifyReleaseStages = null)
{
$this->notifyReleaseStages = $notifyReleaseStages;

Expand Down
2 changes: 1 addition & 1 deletion src/DateTime/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class Date
/**
* @return string
*/
public static function now(ClockInterface $clock = null)
public static function now(?ClockInterface $clock = null)
{
if ($clock === null) {
$clock = new Clock();
Expand Down
8 changes: 0 additions & 8 deletions src/ErrorTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ class ErrorTypes
'severity' => 'info',
],

E_STRICT => [
'name' => 'PHP Strict',
'severity' => 'info',
],

E_RECOVERABLE_ERROR => [
'name' => 'PHP Recoverable Error',
'severity' => 'error',
Expand Down Expand Up @@ -205,9 +200,6 @@ public static function codeToString($code)
case E_USER_NOTICE:
return 'E_USER_NOTICE';

case E_STRICT:
return 'E_STRICT';

case E_RECOVERABLE_ERROR:
return 'E_RECOVERABLE_ERROR';

Expand Down
2 changes: 1 addition & 1 deletion src/Request/PhpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PhpRequest implements RequestInterface
*
* @return void
*/
public function __construct(array $server, array $session, array $cookies, array $headers, array $input = null)
public function __construct(array $server, array $session, array $cookies, array $headers, ?array $input = null)
{
$this->server = $server;
$this->session = $session;
Expand Down
2 changes: 1 addition & 1 deletion src/SessionTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class SessionTracker
* is deprecated and $http will be required
* in the next major version.
*/
public function __construct(Configuration $config, HttpClient $http = null)
public function __construct(Configuration $config, ?HttpClient $http = null)
{
$this->config = $config;
$this->http = $http === null
Expand Down