Skip to content

Commit 387dfe6

Browse files
committed
Code style fixes
1 parent b695eff commit 387dfe6

20 files changed

+36
-32
lines changed

src/CodeHelper/ArrayCode.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ public function getSourceArray(): array
5151
foreach ($formattedValue as $z) {
5252
$rows[] = $z;
5353
}
54-
$rows[] = $lastValue .',';
54+
$rows[] = $lastValue . ',';
5555
continue;
5656
}
5757

5858
$formattedValue = FormatValue::format($value);
59-
if ($value instanceof CodeInterface &&
59+
if (
60+
$value instanceof CodeInterface &&
6061
is_array($formattedValue) &&
6162
count($formattedValue) === 1 &&
6263
is_string($formattedValue[0])
@@ -85,7 +86,7 @@ public function getSourceArray(): array
8586
}
8687
elseif (is_string($formattedValue)) {
8788
$rows[] = sprintf(
88-
"%s,",
89+
'%s,',
8990
$formattedValue
9091
);
9192
}

src/CodeHelper/CastCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
public function getSourceArray(): array
3333
{
3434
return [
35-
'(' . $this->castType .')' . $this->reference->toString(),
35+
'(' . $this->castType . ')' . $this->reference->toString(),
3636
];
3737
}
3838
}

src/CodeHelper/ClassMethodCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function this(string $method, array $params = []): self
2020
public function __construct(
2121
private VariableReference $class,
2222
private string $method,
23-
private array $params = []
23+
private array $params = [],
2424
) {
2525
$this->identifier = $class->toString();
2626
}

src/CodeHelper/MethodCallInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
interface MethodCallInterface
66
{
7-
87
}

src/CodeHelper/StaticMethodCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class StaticMethodCall implements CodeInterface, MethodCallInterface
1616
public function __construct(
1717
protected Identifier|string $class,
1818
protected string $method,
19-
protected array $params = []
19+
protected array $params = [],
2020
) {
2121
$this->identifier = Identifier::fromUnknown($class)->getName();
2222
$this->callIdentifier = '::';

src/PhpDocElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @author Fredrik Wallgren <fredrik.wallgren@gmail.com>
1111
* @author Andreas Sundqvist <andreas@stefna.is>
12-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
12+
* @license http://www.opensource.org/licenses/mit-license.php MIT License
1313
*/
1414
class PhpDocElement
1515
{
@@ -19,7 +19,7 @@ public function __construct(
1919
private string $type,
2020
string|Type $dataType,
2121
private string $variableName,
22-
private string $description
22+
private string $description,
2323
) {
2424
$this->datatype = is_string($dataType) ? Type::fromString($dataType) : $dataType;
2525
}

src/PhpFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
array $params,
2929
protected array|CodeInterface $body,
3030
protected ?Type $returnTypeHint = null,
31-
protected ?PhpDocComment $comment = null
31+
protected ?PhpDocComment $comment = null,
3232
) {
3333
$this->identifier = Identifier::fromUnknown($identifier);
3434
foreach ($params as $param) {

src/PhpInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function addVariable(PhpVariable $variable, bool $forcePublic = false): s
6565
return parent::addVariable($variable);
6666
}
6767

68-
public static function fromClass(Identifier $identifier, PhpClass $class): self
68+
public static function fromClass(Identifier $identifier, PhpClass $class): self
6969
{
7070
$interface = new self($identifier);
7171
$interface->uses = $class->uses;

src/PhpMethod.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ public function setParent(PhpTrait|PhpInterface|PhpClass $parent): static
219219
if ($this->constructorAutoAssign) {
220220
foreach ($this->params as $param) {
221221
$var = $param->getVariable();
222-
if ($var &&
222+
if (
223+
$var &&
223224
!$parent instanceof PhpInterface &&
224225
!$parent->hasVariable($var->getIdentifier())
225226
) {

src/PhpParam.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function getParent(): PhpFunction|PhpMethod|null
6464
public function setParent(PhpFunction|PhpMethod $parent): void
6565
{
6666
$this->parent = $parent;
67-
if ($this->variable &&
67+
if (
68+
$this->variable &&
6869
$parent instanceof PhpMethod &&
6970
$parent->doConstructorAutoAssign()
7071
) {

0 commit comments

Comments
 (0)