Skip to content

Commit

Permalink
removed implicitly null types
Browse files Browse the repository at this point in the history
  • Loading branch information
agrzegorzewski committed Dec 5, 2024
1 parent 659210c commit 97a72aa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
22 changes: 11 additions & 11 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
$resolver = null,
$guzzle = null,
$shutdownStrategy = null
) {
$guzzle = $guzzle ?: self::makeGuzzle();

Expand Down Expand Up @@ -271,10 +271,10 @@ public function registerCallback(callable $callback)
public function registerDefaultCallbacks()
{
$this->registerCallback(new GlobalMetaData($this->config))
->registerCallback(new RequestMetaData($this->resolver))
->registerCallback(new RequestSession($this->resolver))
->registerCallback(new RequestUser($this->resolver))
->registerCallback(new RequestContext($this->resolver));
->registerCallback(new RequestMetaData($this->resolver))
->registerCallback(new RequestSession($this->resolver))
->registerCallback(new RequestUser($this->resolver))
->registerCallback(new RequestContext($this->resolver));

return $this;
}
Expand Down Expand Up @@ -327,7 +327,7 @@ public function clearBreadcrumbs()
*
* @return void
*/
public function notifyException($throwable, callable $callback = null)
public function notifyException($throwable, $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, $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, $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($notifyReleaseStages = null)
{
$this->config->setNotifyReleaseStages($notifyReleaseStages);

Expand Down
12 changes: 6 additions & 6 deletions 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($notifyReleaseStages = null)
{
$this->notifyReleaseStages = $notifyReleaseStages;

Expand Down Expand Up @@ -313,7 +313,7 @@ public function getFilters()
*/
public function setProjectRoot($projectRoot)
{
$projectRootRegex = $projectRoot ? '/^'.preg_quote($projectRoot, '/').'[\\/]?/i' : null;
$projectRootRegex = $projectRoot ? '/^' . preg_quote($projectRoot, '/') . '[\\/]?/i' : null;
$this->setProjectRootRegex($projectRootRegex);
}

Expand All @@ -327,7 +327,7 @@ public function setProjectRoot($projectRoot)
public function setProjectRootRegex($projectRootRegex)
{
if ($projectRootRegex && @preg_match($projectRootRegex, '') === false) {
throw new InvalidArgumentException('Invalid project root regex: '.$projectRootRegex);
throw new InvalidArgumentException('Invalid project root regex: ' . $projectRootRegex);
}

$this->projectRootRegex = $projectRootRegex;
Expand Down Expand Up @@ -355,7 +355,7 @@ public function isInProject($file)
*/
public function setStripPath($stripPath)
{
$stripPathRegex = $stripPath ? '/^'.preg_quote($stripPath, '/').'[\\/]?/i' : null;
$stripPathRegex = $stripPath ? '/^' . preg_quote($stripPath, '/') . '[\\/]?/i' : null;
$this->setStripPathRegex($stripPathRegex);
}

Expand All @@ -369,7 +369,7 @@ public function setStripPath($stripPath)
public function setStripPathRegex($stripPathRegex)
{
if ($stripPathRegex && @preg_match($stripPathRegex, '') === false) {
throw new InvalidArgumentException('Invalid strip path regex: '.$stripPathRegex);
throw new InvalidArgumentException('Invalid strip path regex: ' . $stripPathRegex);
}

$this->stripPathRegex = $stripPathRegex;
Expand Down Expand Up @@ -670,7 +670,7 @@ public function setErrorReportingLevel($errorReportingLevel)
if (!$this->isSubsetOfErrorReporting($errorReportingLevel)) {
$missingLevels = implode(', ', $this->getMissingErrorLevelNames($errorReportingLevel));
$message =
'Bugsnag Warning: errorReportingLevel cannot contain values that are not in error_reporting. '.
'Bugsnag Warning: errorReportingLevel cannot contain values that are not in error_reporting. ' .
"Any errors of these levels will be ignored: {$missingLevels}.";

error_log($message);
Expand Down
4 changes: 3 additions & 1 deletion src/DateTime/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
final class Date
{
/**
* @param ClockInterface|null $clock
*
* @return string
*/
public static function now(ClockInterface $clock = null)
public static function now($clock = null)
{
if ($clock === null) {
$clock = new Clock();
Expand Down
6 changes: 3 additions & 3 deletions 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, $input = null)
{
$this->server = $server;
$this->session = $session;
Expand Down Expand Up @@ -127,7 +127,7 @@ public function getMetaData()
public function getContext()
{
if (isset($this->server['REQUEST_METHOD']) && isset($this->server['REQUEST_URI'])) {
return $this->server['REQUEST_METHOD'].' '.strtok($this->server['REQUEST_URI'], '?');
return $this->server['REQUEST_METHOD'] . ' ' . strtok($this->server['REQUEST_URI'], '?');
}

return null;
Expand All @@ -154,7 +154,7 @@ protected function getCurrentUrl()

$host = isset($this->server['HTTP_HOST']) ? $this->server['HTTP_HOST'] : 'localhost';

return $schema.$host.$this->server['REQUEST_URI'];
return $schema . $host . $this->server['REQUEST_URI'];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions 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, $http = null)
{
$this->config = $config;
$this->http = $http === null
Expand Down Expand Up @@ -403,7 +403,7 @@ protected function deliverSessions()
try {
$this->http->sendSessions($payload);
} catch (Exception $e) {
error_log('Bugsnag Warning: Couldn\'t notify. '.$e->getMessage());
error_log('Bugsnag Warning: Couldn\'t notify. ' . $e->getMessage());

if (is_callable($this->retryFunction)) {
call_user_func($this->retryFunction, $sessions);
Expand Down

0 comments on commit 97a72aa

Please sign in to comment.