Skip to content
Merged
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 src/CodeHelper/Methods/JsonSerializeMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
final class JsonSerializeMethod extends PhpMethod
{
public static function fromClass(PhpClass $class, TypeCallResolverInterface $resolver = null): self
public static function fromClass(PhpClass $class, ?TypeCallResolverInterface $resolver = null): self
{
$resolver = $resolver ?? new JsonSerializeTypeCallResolver();

Expand Down
2 changes: 1 addition & 1 deletion src/PhpFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function addFunction(PhpFunction $function): self
/**
* Add use statement after namespace declaration
*/
public function addUse(Identifier|string $identifier, string $alias = null): self
public function addUse(Identifier|string $identifier, ?string $alias = null): self
{
$identifier = Identifier::fromUnknown($identifier);
if ($alias) {
Expand Down
6 changes: 3 additions & 3 deletions src/PhpMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static function getter(PhpVariable $var, array $source = []): self
* @param PhpParam[] $params
* @param array<array-key, string|string[]> $source
*/
public static function public(string $identifier, array $params, array $source, Type $type = null): self
public static function public(string $identifier, array $params, array $source, ?Type $type = null): self
{
return new self(self::PUBLIC_ACCESS, $identifier, $params, $source, $type ?? Type::empty());
}
Expand All @@ -122,7 +122,7 @@ public static function public(string $identifier, array $params, array $source,
* @param PhpParam[] $params
* @param array<array-key, string|string[]> $source
*/
public static function private(string $identifier, array $params, array $source, Type $type = null): self
public static function private(string $identifier, array $params, array $source, ?Type $type = null): self
{
return new self(self::PRIVATE_ACCESS, $identifier, $params, $source, $type ?? Type::empty());
}
Expand All @@ -131,7 +131,7 @@ public static function private(string $identifier, array $params, array $source,
* @param PhpParam[] $params
* @param array<array-key, string|string[]> $source
*/
public static function protected(string $identifier, array $params, array $source, Type $type = null): self
public static function protected(string $identifier, array $params, array $source, ?Type $type = null): self
{
return new self(self::PROTECTED_ACCESS, $identifier, $params, $source, $type ?? Type::empty());
}
Expand Down
2 changes: 1 addition & 1 deletion src/PhpTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getComment(): PhpDocComment
return $this->comment;
}

public function addUse(Identifier|string $class, string $alias = null): static
public function addUse(Identifier|string $class, ?string $alias = null): static
{
$class = Identifier::fromUnknown($class);
if (!$alias && $this->identifier->equal($class)) {
Expand Down