Skip to content

Commit

Permalink
Bump PSL
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Sep 6, 2024
1 parent 29b6c02 commit 1801c62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$tab = ' ';

// Clear file first!
write($target, '', WriteMode::TRUNCATE);
write($target, '', WriteMode::Truncate);

$files = Finder::create()
->in(dirname(__DIR__).'/src')
Expand Down Expand Up @@ -67,7 +67,7 @@ static function (SplFileInfo $file) use ($tab): string {
static fn (iterable $codeLines): string => join($codeLines, PHP_EOL)
);

write($target, $build($files), WriteMode::TRUNCATE);
write($target, $build($files), WriteMode::Truncate);

echo 'Created bootstrap file!'.PHP_EOL;
})();
2 changes: 1 addition & 1 deletion src/Xml/Writer/Opener/xml_file_opener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function xml_file_opener(string $file): Closure
// Try to create the file first.
// If the file exists, it will truncated. (Default behaviour of XMLWriter as well)
// If it cannot be created, it will throw exceptions.
write($file, '', WriteMode::TRUNCATE);
write($file, '', WriteMode::Truncate);

Check failure on line 23 in src/Xml/Writer/Opener/xml_file_opener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 @ ubuntu-latest

UndefinedConstant

src/Xml/Writer/Opener/xml_file_opener.php:23:26: UndefinedConstant: Constant Psl\File\WriteMode::Truncate is not defined (see https://psalm.dev/020)

Check failure on line 23 in src/Xml/Writer/Opener/xml_file_opener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 @ ubuntu-latest

MixedArgument

src/Xml/Writer/Opener/xml_file_opener.php:23:26: MixedArgument: Argument 3 of Psl\File\write cannot be mixed, expecting Psl\File\WriteMode (see https://psalm.dev/030)

return $writer->openUri($file);
};
Expand Down
2 changes: 1 addition & 1 deletion tests/Xml/Writer/Opener/XmlFileOpenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class XmlFileOpenerTest extends TestCase
public function test_it_can_open_a_file(): void
{
$this->createTmpFile(static function (string $path): void {
File\write($path, 'will be truncated', File\WriteMode::TRUNCATE);
File\write($path, 'will be truncated', File\WriteMode::Truncate);

$writer = Writer::forFile($path);
$writer->write(element('root'));
Expand Down

0 comments on commit 1801c62

Please sign in to comment.