Skip to content

Commit 8a9c407

Browse files
committed
cs
1 parent 4e0c6b4 commit 8a9c407

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/PhpGenerator/Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function dumpString(string $s): string
7575
$escaped = preg_replace_callback(
7676
$utf8 ? '#[\p{C}\\\\]#u' : '#[\x00-\x1F\x7F-\xFF\\\\]#',
7777
fn($m) => $special[$m[0]] ?? (strlen($m[0]) === 1
78-
? '\x' . str_pad(strtoupper(dechex(ord($m[0]))), 2, '0', STR_PAD_LEFT) . ''
78+
? '\x' . str_pad(strtoupper(dechex(ord($m[0]))), 2, '0', STR_PAD_LEFT)
7979
: '\u{' . strtoupper(ltrim(dechex(self::utf8Ord($m[0])), '0')) . '}'),
8080
$s,
8181
);

src/PhpGenerator/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function fromConstantReflection(\ReflectionClassConstant $from): Constant
230230
$const = new Constant($from->name);
231231
$const->setValue($from->getValue());
232232
$const->setVisibility($this->getVisibility($from));
233-
$const->setFinal(PHP_VERSION_ID >= 80100 ? $from->isFinal() : false);
233+
$const->setFinal(PHP_VERSION_ID >= 80100 && $from->isFinal());
234234
$const->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
235235
$const->setAttributes($this->getAttributes($from));
236236
return $const;

src/PhpGenerator/PhpFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ public function addUse(string $name, ?string $alias = null, string $of = PhpName
134134
/**
135135
* Adds declare(strict_types=1) to output.
136136
*/
137-
public function setStrictTypes(bool $on = true): static
137+
public function setStrictTypes(bool $state = true): static
138138
{
139-
$this->strictTypes = $on;
139+
$this->strictTypes = $state;
140140
return $this;
141141
}
142142

src/PhpGenerator/Traits/ConstantsAware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function setConstants(array $consts): static
2727
{
2828
(function (Constant ...$consts) {})(...$consts);
2929
$this->consts = [];
30-
foreach ($consts as $k => $const) {
30+
foreach ($consts as $const) {
3131
$this->consts[$const->getName()] = $const;
3232
}
3333

0 commit comments

Comments
 (0)