Skip to content

Commit f1c87f2

Browse files
committed
uses nette/utils 4
1 parent 39fa444 commit f1c87f2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"require": {
1818
"php": "8.1 - 8.5",
19-
"nette/utils": "^3.2.9 || ^4.0"
19+
"nette/utils": "^4.0.6"
2020
},
2121
"require-dev": {
2222
"nette/tester": "^2.4",

src/PhpGenerator/Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private function dumpCustomObject(object $var, array $parents, int $level): stri
208208
private function dumpLiteral(Literal $var, int $level): string
209209
{
210210
$s = $var->formatWith($this);
211-
$s = Nette\Utils\Strings::normalizeNewlines($s);
211+
$s = Nette\Utils\Strings::unixNewLines($s);
212212
$s = Nette\Utils\Strings::indent(trim($s), $level, $this->indentation);
213213
return ltrim($s, $this->indentation);
214214
}

src/PhpGenerator/Extractor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private function parseCode(string $code): void
4848
throw new Nette\InvalidStateException('The input string is not a PHP code.');
4949
}
5050

51-
$this->code = Nette\Utils\Strings::normalizeNewlines($code);
51+
$this->code = Nette\Utils\Strings::unixNewLines($code);
5252
$parser = (new ParserFactory)->createForNewestSupportedVersion();
5353
$stmts = $parser->parse($this->code);
5454

@@ -314,6 +314,8 @@ private function addClassLikeToFile(PhpFile $phpFile, Node\Stmt\ClassLike $node)
314314
foreach ($node->implements as $item) {
315315
$class->addImplement($item->toString());
316316
}
317+
} else {
318+
throw new Nette\ShouldNotHappenException;
317319
}
318320

319321
$this->addCommentAndAttributes($class, $node);

0 commit comments

Comments
 (0)