Skip to content

Commit

Permalink
fix(IStorage): Use false instead of bool intersection type to match i…
Browse files Browse the repository at this point in the history
…mplementations

Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Sep 26, 2024
1 parent 11c5e50 commit ad548d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
15 changes: 0 additions & 15 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2066,11 +2066,6 @@
<code><![CDATA[remove]]></code>
</UndefinedMethod>
</file>
<file src="lib/private/Files/ObjectStore/ObjectStoreStorage.php">
<InvalidScalarArgument>
<code><![CDATA[$source]]></code>
</InvalidScalarArgument>
</file>
<file src="lib/private/Files/ObjectStore/S3ConnectionTrait.php">
<InternalClass>
<code><![CDATA[ClientResolver::_default_signature_provider()]]></code>
Expand Down Expand Up @@ -2169,16 +2164,6 @@
<code><![CDATA[$size]]></code>
</InvalidScalarArgument>
</file>
<file src="lib/private/Files/Storage/Wrapper/Jail.php">
<InvalidReturnStatement>
<code><![CDATA[$this->getWrapperStorage()->filetype($this->getUnjailedPath($path))]]></code>
</InvalidReturnStatement>
<InvalidReturnType/>
</file>
<file src="lib/private/Files/Storage/Wrapper/Wrapper.php">
<InvalidReturnStatement/>
<InvalidReturnType/>
</file>
<file src="lib/private/Files/Stream/SeekableHttpStream.php">
<InvalidReturnType>
<code><![CDATA[stream_close]]></code>
Expand Down
20 changes: 10 additions & 10 deletions lib/public/Files/Storage/IStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function is_file($path);
* only the following keys are required in the result: size and mtime
*
* @param string $path
* @return array|bool
* @return array|false
* @since 9.0.0
*/
public function stat($path);
Expand All @@ -96,7 +96,7 @@ public function stat($path);
* see https://www.php.net/manual/en/function.filetype.php
*
* @param string $path
* @return string|bool
* @return string|false
* @since 9.0.0
*/
public function filetype($path);
Expand All @@ -106,7 +106,7 @@ public function filetype($path);
* The result for filesize when called on a folder is required to be 0
*
* @param string $path
* @return false|int|float
* @return int|float|false
* @since 9.0.0
*/
public function filesize($path);
Expand Down Expand Up @@ -179,7 +179,7 @@ public function file_exists($path);
* see https://www.php.net/manual/en/function.filemtime.php
*
* @param string $path
* @return int|bool
* @return int|false
* @since 9.0.0
*/
public function filemtime($path);
Expand Down Expand Up @@ -237,7 +237,7 @@ public function copy($source, $target);
*
* @param string $path
* @param string $mode
* @return resource|bool
* @return resource|false
* @since 9.0.0
*/
public function fopen($path, $mode);
Expand All @@ -247,7 +247,7 @@ public function fopen($path, $mode);
* The mimetype for a folder is required to be "httpd/unix-directory"
*
* @param string $path
* @return string|bool
* @return string|false
* @since 9.0.0
*/
public function getMimeType($path);
Expand All @@ -258,16 +258,16 @@ public function getMimeType($path);
* @param string $type
* @param string $path
* @param bool $raw
* @return string|bool
* @return string|false
* @since 9.0.0
*/
public function hash($type, $path, $raw = false);

/**
* see https://www.php.net/manual/en/function.free_space.php
* see https://www.php.net/manual/en/function.disk-free-space.php
*
* @param string $path
* @return int|float|bool
* @return int|float|false
* @since 9.0.0
*/
public function free_space($path);
Expand Down Expand Up @@ -345,7 +345,7 @@ public function instanceOfStorage($class);
* For now the returned array can hold the parameter url - in future more attributes might follow.
*
* @param string $path
* @return array|bool
* @return array|false
* @since 9.0.0
*/
public function getDirectDownload($path);
Expand Down

0 comments on commit ad548d7

Please sign in to comment.