Skip to content

Commit

Permalink
fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hkp22 committed Mar 7, 2024
1 parent 3ca6760 commit b7a9dfb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
errorLevel="4"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
14 changes: 7 additions & 7 deletions src/Presets/Traits/HandleFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ protected function ensureDirectoryExists(string $path, int $mode = 0755, bool $r
}
}

protected function replaceInFile(string $search, string $replace, string $path): int|bool
protected function replaceInFile(string $search, string $replace, string $path): bool
{
return file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));
return (bool) file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));
}

public function createFile(string $path, string $content = ''): int|bool
public function createFile(string $path, string $content = ''): bool
{
return file_put_contents($path, $content);
return (bool) file_put_contents($path, $content);
}

public function append(string $path, string $data): int|bool
public function append(string $path, string $data): bool
{
return file_put_contents($path, $data, FILE_APPEND);
return (bool) file_put_contents($path, $data, FILE_APPEND);
}

public function copyDirectory(string $directory, string $destination, int | null $options = null): bool
public function copyDirectory(string $directory, string $destination, $options = null): bool
{
return (new Filesystem())->copyDirectory($directory, $destination, $options);
}
Expand Down

0 comments on commit b7a9dfb

Please sign in to comment.