Skip to content

Commit 9bb353b

Browse files
committed
Apply fixes from StyleCI
1 parent fa9b19e commit 9bb353b

File tree

16 files changed

+23
-23
lines changed

16 files changed

+23
-23
lines changed

monorepo/stubs/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @param class-string<T> $abstract
77
* @return T
88
*/
9-
function app(string $abstract = null, array $parameters = [])
9+
function app(?string $abstract = null, array $parameters = [])
1010
{
1111
}
1212

packages/framework/src/Console/Commands/RouteListCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public function handle(): int
3535
};
3636
}
3737

38-
/** @return array<integer, array<string, string>> */
38+
/** @return array<int, array<string, string>> */
3939
protected function generate(): array
4040
{
4141
return Arr::map(array_values(Hyde::routes()->all()), RouteListItem::format(...));
4242
}
4343

44-
/** @param array<integer, array<string, string>> $routes */
44+
/** @param array<int, array<string, string>> $routes */
4545
protected function makeHeader(array $routes): array
4646
{
4747
return Arr::map(array_keys($routes[0]), Hyde::makeTitle(...));

packages/framework/src/Console/Concerns/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function handleException(Exception $exception): int
8282
* Note that not all terminals support this, and it may lead to only
8383
* the label being shown, and the path being lost to the void.
8484
*/
85-
public static function fileLink(string $path, string $label = null): string
85+
public static function fileLink(string $path, ?string $label = null): string
8686
{
8787
$link = 'file://'.str_replace('\\', '/', realpath($path) ?: Hyde::path($path));
8888

packages/framework/src/Facades/Config.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@
1919
*/
2020
class Config extends \Illuminate\Support\Facades\Config
2121
{
22-
public static function getArray(string $key, array $default = null): array
22+
public static function getArray(string $key, ?array $default = null): array
2323
{
2424
return (array) self::validated(static::get($key, $default), 'array', $key);
2525
}
2626

27-
public static function getString(string $key, string $default = null): string
27+
public static function getString(string $key, ?string $default = null): string
2828
{
2929
return (string) self::validated(static::get($key, $default), 'string', $key);
3030
}
3131

32-
public static function getInt(string $key, int $default = null): int
32+
public static function getInt(string $key, ?int $default = null): int
3333
{
3434
return (int) self::validated(static::get($key, $default), 'int', $key);
3535
}
3636

37-
public static function getBool(string $key, bool $default = null): bool
37+
public static function getBool(string $key, ?bool $default = null): bool
3838
{
3939
return (bool) self::validated(static::get($key, $default), 'bool', $key);
4040
}
4141

42-
public static function getFloat(string $key, float $default = null): float
42+
public static function getFloat(string $key, ?float $default = null): float
4343
{
4444
return (float) self::validated(static::get($key, $default), 'float', $key);
4545
}
4646

4747
/** @experimental Could possibly be merged by allowing null returns if default is null? Preferably with generics so the type is matched by IDE support. */
48-
public static function getNullableString(string $key, string $default = null): ?string
48+
public static function getNullableString(string $key, ?string $default = null): ?string
4949
{
5050
/** @var array|string|int|bool|float|null $value */
5151
$value = static::get($key, $default);

packages/framework/src/Facades/Features.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function toArray(): array
150150
}
151151

152152
/** @internal This method is not covered by the backward compatibility promise. */
153-
public static function mock(string $feature, bool $enabled = null): void
153+
public static function mock(string $feature, ?bool $enabled = null): void
154154
{
155155
if ($enabled === true) {
156156
// Add the feature if it doesn't already exist.

packages/framework/src/Framework/Concerns/InteractsWithFrontMatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait InteractsWithFrontMatter
2020
*
2121
* @return \Hyde\Markdown\Models\FrontMatter|mixed
2222
*/
23-
public function data(string $key = null, mixed $default = null): mixed
23+
public function data(?string $key = null, mixed $default = null): mixed
2424
{
2525
return Arr::get(array_filter(array_merge(
2626
$this->matter->toArray(),
@@ -33,7 +33,7 @@ public function data(string $key = null, mixed $default = null): mixed
3333
*
3434
* @return \Hyde\Markdown\Models\FrontMatter|mixed
3535
*/
36-
public function matter(string $key = null, mixed $default = null): mixed
36+
public function matter(?string $key = null, mixed $default = null): mixed
3737
{
3838
if ($key) {
3939
return $this->matter->get($key, $default);

packages/framework/src/Framework/Factories/HydePageDataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function findTitleFromParentIdentifier(): ?string
9393
return null;
9494
}
9595

96-
protected function getMatter(string $key): string|null
96+
protected function getMatter(string $key): ?string
9797
{
9898
/** @var ?string $value */
9999
$value = $this->matter->get($key);

packages/framework/src/Framework/Features/Navigation/NavigationData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class NavigationData extends ArrayObject implements NavigationSchema, Seri
2222
public readonly bool $hidden;
2323
public readonly ?string $group;
2424

25-
public function __construct(string $label, int $priority, bool $hidden, string $group = null)
25+
public function __construct(string $label, int $priority, bool $hidden, ?string $group = null)
2626
{
2727
$this->label = $label;
2828
$this->priority = $priority;

packages/framework/src/Framework/Features/Navigation/NumericalPageOrderingHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function hasNumericalPrefix(string $identifier): bool
3636
/**
3737
* Splits a numbered identifier into its numerical prefix and the rest of the identifier.
3838
*
39-
* @return array{integer, string}
39+
* @return array{int, string}
4040
*/
4141
public static function splitNumericPrefix(string $identifier): array
4242
{

packages/framework/src/Markdown/Contracts/MarkdownDocumentContract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface MarkdownDocumentContract
1313
*
1414
* @return \Hyde\Markdown\Models\FrontMatter|mixed
1515
*/
16-
public function matter(string $key = null, mixed $default = null): mixed;
16+
public function matter(?string $key = null, mixed $default = null): mixed;
1717

1818
/**
1919
* Return the document's Markdown object.

0 commit comments

Comments
 (0)