@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $param = Parameter::fromElement($this->element->addParameter($name)); |
| 59 | 59 | |
| 60 | - if (\func_num_args() > 1) { |
|
| 60 | + if (\func_num_args() > 1){ |
|
| 61 | 61 | $param->setDefaultValue($defaultValue); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | $type = $this->element->getReturnType(false); |
| 99 | 99 | |
| 100 | - return $type === null ? null : (string) $type; |
|
| 100 | + return $type === null ? null : (string)$type; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public function setReturnReference(bool $state = true): static |
@@ -57,7 +57,8 @@ |
||
| 57 | 57 | { |
| 58 | 58 | $param = Parameter::fromElement($this->element->addParameter($name)); |
| 59 | 59 | |
| 60 | - if (\func_num_args() > 1) { |
|
| 60 | + if (\func_num_args() > 1) |
|
| 61 | + { |
|
| 61 | 62 | $param->setDefaultValue($defaultValue); |
| 62 | 63 | } |
| 63 | 64 | |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | trait CommentAware |
| 11 | 11 | { |
| 12 | - public function setComment(array|string|null $comment): static |
|
| 12 | + public function setComment(array | string | null $comment): static |
|
| 13 | 13 | { |
| 14 | - if (\is_array($comment)) { |
|
| 15 | - foreach ($comment as $value) { |
|
| 14 | + if (\is_array($comment)){ |
|
| 15 | + foreach ($comment as $value){ |
|
| 16 | 16 | $this->element->addComment($value); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -11,8 +11,10 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function setComment(array|string|null $comment): static |
| 13 | 13 | { |
| 14 | - if (\is_array($comment)) { |
|
| 15 | - foreach ($comment as $value) { |
|
| 14 | + if (\is_array($comment)) |
|
| 15 | + { |
|
| 16 | + foreach ($comment as $value) |
|
| 17 | + { |
|
| 16 | 18 | $this->element->addComment($value); |
| 17 | 19 | } |
| 18 | 20 | |
@@ -25,37 +25,37 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function setPublic(): static |
| 27 | 27 | { |
| 28 | - $this->setVisibility(Visibility::PUBLIC); |
|
| 28 | + $this->setVisibility(Visibility::public); |
|
| 29 | 29 | |
| 30 | 30 | return $this; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function isPublic(): bool |
| 34 | 34 | { |
| 35 | - return $this->getVisibility() === Visibility::PUBLIC; |
|
| 35 | + return $this->getVisibility() === Visibility::public; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function setProtected(): static |
| 39 | 39 | { |
| 40 | - $this->setVisibility(Visibility::PROTECTED); |
|
| 40 | + $this->setVisibility(Visibility::protected); |
|
| 41 | 41 | |
| 42 | 42 | return $this; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function isProtected(): bool |
| 46 | 46 | { |
| 47 | - return $this->getVisibility() === Visibility::PROTECTED; |
|
| 47 | + return $this->getVisibility() === Visibility::protected; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function setPrivate(): static |
| 51 | 51 | { |
| 52 | - $this->setVisibility(Visibility::PRIVATE); |
|
| 52 | + $this->setVisibility(Visibility::private); |
|
| 53 | 53 | |
| 54 | 54 | return $this; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function isPrivate(): bool |
| 58 | 58 | { |
| 59 | - return $this->getVisibility() === Visibility::PRIVATE; |
|
| 59 | + return $this->getVisibility() === Visibility::private; |
|
| 60 | 60 | } |
| 61 | 61 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function getVisibility(): ?Visibility |
| 22 | 22 | { |
| 23 | - return Visibility::tryFrom((string) $this->element->getVisibility()); |
|
| 23 | + return Visibility::tryFrom((string)$this->element->getVisibility()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function setPublic(): static |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function setName(?string $name): self |
| 28 | 28 | { |
| 29 | - if ($name !== null) { |
|
| 29 | + if ($name !== null){ |
|
| 30 | 30 | $name = (new InflectorFactory())->build()->classify($name); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function setName(?string $name): self |
| 28 | 28 | { |
| 29 | - if ($name !== null) { |
|
| 29 | + if ($name !== null) |
|
| 30 | + { |
|
| 30 | 31 | $name = (new InflectorFactory())->build()->classify($name); |
| 31 | 32 | } |
| 32 | 33 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | )); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function addCase(string $name, string|int|null $value = null): EnumCase |
|
| 87 | + public function addCase(string $name, string | int | null $value = null): EnumCase |
|
| 88 | 88 | { |
| 89 | 89 | return EnumCase::fromElement($this->element->addCase($name, $value)); |
| 90 | 90 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | return $this; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - public function addMember(Method|Constant|EnumCase|TraitUse $member): static |
|
| 104 | + public function addMember(Method | Constant | EnumCase | TraitUse $member): static |
|
| 105 | 105 | { |
| 106 | 106 | $this->element->addMember($member->getElement()); |
| 107 | 107 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | return $this; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - public function addMember(Method|Property|Constant|TraitUse $member): static |
|
| 92 | + public function addMember(Method | Property | Constant | TraitUse $member): static |
|
| 93 | 93 | { |
| 94 | 94 | $this->element->addMember($member->getElement()); |
| 95 | 95 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | enum Visibility: string |
| 8 | 8 | { |
| 9 | - case PUBLIC = 'public'; |
|
| 10 | - case PROTECTED = 'protected'; |
|
| 11 | - case PRIVATE = 'private'; |
|
| 9 | + case public = 'public'; |
|
| 10 | + case protected = 'protected'; |
|
| 11 | + case private = 'private'; |
|
| 12 | 12 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | { |
| 59 | 59 | $type = $this->element->getType(); |
| 60 | 60 | |
| 61 | - return $type === null ? null : (string) $type; |
|
| 61 | + return $type === null ? null : (string)$type; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function setNullable(bool $state = true): self |
@@ -63,7 +63,8 @@ |
||
| 63 | 63 | |
| 64 | 64 | public function addNamespace(string|PhpNamespace $namespace): PhpNamespace |
| 65 | 65 | { |
| 66 | - if ($namespace instanceof PhpNamespace) { |
|
| 66 | + if ($namespace instanceof PhpNamespace) |
|
| 67 | + { |
|
| 67 | 68 | $this->element->addNamespace($namespace->getElement()); |
| 68 | 69 | |
| 69 | 70 | return $namespace; |
@@ -59,9 +59,9 @@ |
||
| 59 | 59 | return $file; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function addNamespace(string|PhpNamespace $namespace): PhpNamespace |
|
| 62 | + public function addNamespace(string | PhpNamespace $namespace): PhpNamespace |
|
| 63 | 63 | { |
| 64 | - if ($namespace instanceof PhpNamespace) { |
|
| 64 | + if ($namespace instanceof PhpNamespace){ |
|
| 65 | 65 | $this->element->addNamespace($namespace->getElement()); |
| 66 | 66 | |
| 67 | 67 | return $namespace; |