Skip to content

Commit

Permalink
fix: remove implicit nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 3, 2024
1 parent 9d48ad6 commit b087431
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/TestUtils/CloudFunctionDeploymentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function getBaseUri()
* @param int $retries the number of times to retry entry lookup
* @param int sleep the number of seconds sleep before executing the log lookup
*/
private function processFunctionLogs(string $startTime, callable $process, int $retries = null, int $sleep = null)
private function processFunctionLogs(string $startTime, callable $process, ?int $retries = null, ?int $sleep = null)
{
if (empty(self::$loggingClient)) {
self::$loggingClient = new LoggingClient([
Expand Down
2 changes: 1 addition & 1 deletion src/TestUtils/ExponentialBackoffTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function useDeadlineExceededBackoff($retries = null)
});
}

private function useBackoff($retries = null, callable $retryFunction = null)
private function useBackoff($retries = null, ?callable $retryFunction = null)
{
$backoff = new ExponentialBackoff(
$retries ?: $this->expontentialBackoffRetryCount,
Expand Down
4 changes: 2 additions & 2 deletions src/TestUtils/FileUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public static function randomName($length)
return join('', $array);
}

public static function cloneDirectoryIntoTmp($projectDir = '.', ProgressBar $progress = null)
public static function cloneDirectoryIntoTmp($projectDir = '.', ?ProgressBar $progress = null)
{
$tmpDir = sys_get_temp_dir() . '/test-' . self::randomName(8);
self::copyDir($projectDir, $tmpDir, $progress);
return $tmpDir;
}

public static function copyDir($src, $dst, ProgressBar $progress = null)
public static function copyDir($src, $dst, ?ProgressBar $progress = null)
{
@mkdir($dst);
$dir = opendir($src);
Expand Down
10 changes: 5 additions & 5 deletions src/TestUtils/GcloudWrapper/CloudFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(
string $entryPoint,
string $functionSignatureType,
string $region,
string $dir = null
?string $dir = null
) {
$this->projectId = $projectId;
$this->entryPoint = $entryPoint;
Expand Down Expand Up @@ -137,7 +137,7 @@ public function getFunctionName()
*
* @return bool true if deployment suceeds, false upon failure
*/
public function deploy(array $flags = [], string $trigger = self::DEFAULT_TRIGGER, int $retries = 3, string $channel = null)
public function deploy(array $flags = [], string $trigger = self::DEFAULT_TRIGGER, int $retries = 3, ?string $channel = null)
{
if ($this->deployed) {
$this->errorLog('The function has already been deployed.');
Expand Down Expand Up @@ -237,7 +237,7 @@ public function getBaseUrl($force = false, $retries = 3)
* @param array $args
* @return \Symfony\Component\Process\Process
*/
private function gcloudCommand(array $args, string $channel = null)
private function gcloudCommand(array $args, ?string $channel = null)
{
if (!in_array($channel, [null, 'alpha', 'beta'])) {
$this->errorLog('gcloud channel must use product (null), "alpha" or "beta". Defaulting to production.');
Expand Down Expand Up @@ -271,7 +271,7 @@ private function gcloudCommand(array $args, string $channel = null)
* @return \Symfony\Component\Process\Process returns the php server process
* @throws \Symfony\Component\Process\Exception\ProcessFailedException
*/
public function run(array $env = [], string $port = self::DEFAULT_PORT, string $phpBin = null)
public function run(array $env = [], string $port = self::DEFAULT_PORT, ?string $phpBin = null)
{
$this->localUri = 'localhost:' . $port;

Expand Down Expand Up @@ -306,7 +306,7 @@ public function run(array $env = [], string $port = self::DEFAULT_PORT, string $
* @return \Symfony\Component\Process\Process returns the php server process
* @throws \Symfony\Component\Process\Exception\ProcessFailedException
*/
public function runCloudEventFunction(string $port = self::DEFAULT_PORT, string $phpBin = null)
public function runCloudEventFunction(string $port = self::DEFAULT_PORT, ?string $phpBin = null)
{
return $this->run(true, $port, $phpBin);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/ExponentialBackoff.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ExponentialBackoff
* @param int $retries [optional] Number of retries for a failed request.
* @param callable $retryFunction [optional] returns bool for whether or not to retry
*/
public function __construct($retries = null, callable $retryFunction = null)
public function __construct($retries = null, ?callable $retryFunction = null)
{
$this->retries = $retries !== null ? (int) $retries : 3;
$this->retryFunction = $retryFunction;
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Flex/FlexExecCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FlexExecCommand extends Command
/* @var Gcloud */
private $gcloud;

public function __construct(Gcloud $gcloud = null)
public function __construct(?Gcloud $gcloud = null)
{
parent::__construct();
$this->gcloud = ($gcloud == null) ? new Gcloud() : $gcloud;
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/WordPress/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Project extends BaseProject
private $filesystem;
private $wordPressDir;

public function __construct(InputInterface $input, OutputInterface $output, QuestionHelper $helper = null)
public function __construct(InputInterface $input, OutputInterface $output, ?QuestionHelper $helper = null)
{
$this->input = $input;
$this->output = $output;
Expand Down

0 comments on commit b087431

Please sign in to comment.