Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored and github-actions[bot] committed Jul 21, 2023
1 parent b5103d1 commit c1ef300
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cli/Valet/Brew.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function ($version) use ($resolvedPhpVersion) {
*
* @param string|null $phpVersion For example, "[email protected]"
*/
public function getPhpExecutablePath(?string $phpVersion = null): string
public function getPhpExecutablePath(string $phpVersion = null): string
{
if (! $phpVersion) {
return BREW_PREFIX.'/bin/php';
Expand Down
2 changes: 1 addition & 1 deletion cli/Valet/Expose.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct(public Composer $composer, public CommandLine $cli)
{
}

public function currentTunnelUrl(?string $domain = null): ?string
public function currentTunnelUrl(string $domain = null): ?string
{
$endpoint = 'http://127.0.0.1:4040/api/tunnels';

Expand Down
10 changes: 5 additions & 5 deletions cli/Valet/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function isDir(string $path): bool
/**
* Create a directory.
*/
public function mkdir(string $path, ?string $owner = null, int $mode = 0755): void
public function mkdir(string $path, string $owner = null, int $mode = 0755): void
{
mkdir($path, $mode, true);

Expand All @@ -31,7 +31,7 @@ public function mkdir(string $path, ?string $owner = null, int $mode = 0755): vo
/**
* Ensure that the given directory exists.
*/
public function ensureDirExists(string $path, ?string $owner = null, int $mode = 0755): void
public function ensureDirExists(string $path, string $owner = null, int $mode = 0755): void
{
if (! $this->isDir($path)) {
$this->mkdir($path, $owner, $mode);
Expand All @@ -49,7 +49,7 @@ public function mkdirAsUser(string $path, int $mode = 0755): void
/**
* Touch the given path.
*/
public function touch(string $path, ?string $owner = null): string
public function touch(string $path, string $owner = null): string
{
touch($path);

Expand Down Expand Up @@ -87,7 +87,7 @@ public function get(string $path): string
/**
* Write to the given file.
*/
public function put(string $path, string $contents, ?string $owner = null): void
public function put(string $path, string $contents, string $owner = null): void
{
file_put_contents($path, $contents);

Expand All @@ -107,7 +107,7 @@ public function putAsUser(string $path, ?string $contents): void
/**
* Append the contents to the given file.
*/
public function append(string $path, string $contents, ?string $owner = null): void
public function append(string $path, string $contents, string $owner = null): void
{
file_put_contents($path, $contents, FILE_APPEND);

Expand Down
2 changes: 1 addition & 1 deletion cli/Valet/Ngrok.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(public CommandLine $cli, public Brew $brew)
/**
* Get the current tunnel URL from the Ngrok API.
*/
public function currentTunnelUrl(?string $domain = null): string
public function currentTunnelUrl(string $domain = null): string
{
// wait a second for ngrok to start before attempting to find available tunnels
sleep(1);
Expand Down
8 changes: 4 additions & 4 deletions cli/Valet/PhpFpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function createConfigurationFiles(string $phpVersion): void
/**
* Restart the PHP FPM process (if one specified) or processes (if none specified).
*/
public function restart(?string $phpVersion = null): void
public function restart(string $phpVersion = null): void
{
$this->brew->restartService($phpVersion ?: $this->utilizedPhpVersions());
}
Expand All @@ -121,7 +121,7 @@ public function stop(): void
/**
* Get the path to the FPM configuration file for the current PHP version.
*/
public function fpmConfigPath(?string $phpVersion = null): string
public function fpmConfigPath(string $phpVersion = null): string
{
if (! $phpVersion) {
$phpVersion = $this->brew->linkedPhp();
Expand Down Expand Up @@ -150,7 +150,7 @@ public function stopRunning(): void
/**
* Stop a given PHP version, if that specific version isn't being used globally or by any sites.
*/
public function stopIfUnused(?string $phpVersion = null): void
public function stopIfUnused(string $phpVersion = null): void
{
if (! $phpVersion) {
return;
Expand Down Expand Up @@ -303,7 +303,7 @@ public function validateRequestedVersion(string $version): string
/**
* Get FPM sock file name for a given PHP version.
*/
public static function fpmSockName(?string $phpVersion = null): string
public static function fpmSockName(string $phpVersion = null): string
{
$versionInteger = preg_replace('~[^\d]~', '', $phpVersion);

Expand Down
22 changes: 11 additions & 11 deletions cli/Valet/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function getProxyHostForSite(string $site, string $configContents = null)
/**
* Get the contents of the configuration for the given site.
*/
public function getSiteConfigFileContents(string $site, ?string $suffix = null): ?string
public function getSiteConfigFileContents(string $site, string $suffix = null): ?string
{
$config = $this->config->read();
$suffix = $suffix ?: '.'.$config['tld'];
Expand All @@ -219,7 +219,7 @@ public function getSiteConfigFileContents(string $site, ?string $suffix = null):
/**
* Get all certificates from config folder.
*/
public function getCertificates(?string $path = null): Collection
public function getCertificates(string $path = null): Collection
{
$path = $path ?: $this->certificatesPath();

Expand Down Expand Up @@ -283,7 +283,7 @@ public function getSites(string $path, Collection $certs): Collection
/**
* Unlink the given symbolic link.
*/
public function unlink(?string $name = null): string
public function unlink(string $name = null): string
{
$name = $this->getSiteLinkName($name);

Expand Down Expand Up @@ -452,7 +452,7 @@ public function isSecured(string $site): bool
*
* @see https://github.com/cabforum/servercert/blob/main/docs/BR.md
*/
public function secure(string $url, ?string $siteConf = null, int $certificateExpireInDays = 396, int $caExpireInYears = 20): void
public function secure(string $url, string $siteConf = null, int $certificateExpireInDays = 396, int $caExpireInYears = 20): void
{
// Extract in order to later preserve custom PHP version config when securing
$phpVersion = $this->customPhpVersion($url);
Expand Down Expand Up @@ -628,7 +628,7 @@ public function buildCertificateConf(string $path, string $url): void
/**
* Build the TLS secured Nginx server for the given URL.
*/
public function buildSecureNginxServer(string $url, ?string $siteConf = null): string
public function buildSecureNginxServer(string $url, string $siteConf = null): string
{
if ($siteConf === null) {
$siteConf = $this->replaceOldLoopbackWithNew(
Expand Down Expand Up @@ -937,31 +937,31 @@ public function plistPath(): string
/**
* Get the path to Nginx site configuration files.
*/
public function nginxPath(?string $additionalPath = null): string
public function nginxPath(string $additionalPath = null): string
{
return $this->valetHomePath().'/Nginx'.($additionalPath ? '/'.$additionalPath : '');
}

/**
* Get the path to the linked Valet sites.
*/
public function sitesPath(?string $link = null): string
public function sitesPath(string $link = null): string
{
return $this->valetHomePath().'/Sites'.($link ? '/'.$link : '');
}

/**
* Get the path to the Valet CA certificates.
*/
public function caPath(?string $caFile = null): string
public function caPath(string $caFile = null): string
{
return $this->valetHomePath().'/CA'.($caFile ? '/'.$caFile : '');
}

/**
* Get the path to the Valet TLS certificates.
*/
public function certificatesPath(?string $url = null, ?string $extension = null): string
public function certificatesPath(string $url = null, string $extension = null): string
{
$url = $url ? '/'.$url : '';
$extension = $extension ? '.'.$extension : '';
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public function replaceSockFile(string $siteConf, string $phpVersion): string
/**
* Get configuration items defined in .valetrc for a site.
*/
public function valetRc(string $siteName, ?string $cwd = null): array
public function valetRc(string $siteName, string $cwd = null): array
{
if ($cwd) {
$path = $cwd.'/.valetrc';
Expand All @@ -1071,7 +1071,7 @@ public function valetRc(string $siteName, ?string $cwd = null): array
/**
* Get PHP version from .valetrc or .valetphprc for a site.
*/
public function phpRcVersion(string $siteName, ?string $cwd = null): ?string
public function phpRcVersion(string $siteName, string $cwd = null): ?string
{
if ($cwd) {
$oldPath = $cwd.'/.valetphprc';
Expand Down
2 changes: 1 addition & 1 deletion cli/includes/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Set or get a global console writer.
*/
function writer(?OutputInterface $writer = null): OutputInterface|\NullWriter|null
function writer(OutputInterface $writer = null): OutputInterface|\NullWriter|null
{
$container = Container::getInstance();

Expand Down
2 changes: 1 addition & 1 deletion tests/PhpFpmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public function test_isolate_will_throw_if_site_is_not_parked_or_linked()

class StubForUpdatingFpmConfigFiles extends PhpFpm
{
public function fpmConfigPath(?string $phpVersion = null): string
public function fpmConfigPath(string $phpVersion = null): string
{
return __DIR__.'/output/fpm.conf';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ public function assertCertificateExistsWithCounterValue($urlWithTld, $counter)

class StubForRemovingLinks extends Site
{
public function sitesPath(?string $additionalPath = null): string
public function sitesPath(string $additionalPath = null): string
{
return __DIR__.'/output'.($additionalPath ? '/'.$additionalPath : '');
}
Expand Down

0 comments on commit c1ef300

Please sign in to comment.