Skip to content

Commit

Permalink
Bump icewind/streams from 0.7.1 to 0.7.2
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Dec 28, 2020
1 parent 86e6f07 commit 6a0d175
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 187 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public function getContentType() {
}

/**
* @return array|false
* @return array|bool
*/
public function getDirectDownload() {
if (\OCP\App::isEnabled('encryption')) {
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function hasUpdated($path, $time) {
/**
* @param string $path
* @param string $mode
* @return resource|false
* @return resource|bool
*/
public function fopen($path, $mode) {
$fullPath = $this->buildPath($path);
Expand Down
3 changes: 1 addition & 2 deletions apps/workflowengine/lib/Check/FileMimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ protected function getActualValue() {
return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, 'httpd/unix-directory');
}

if ($this->storage->file_exists($this->path)) {
$path = $this->storage->getLocalFile($this->path);
if ($this->storage->file_exists($this->path) && is_string($path = $this->storage->getLocalFile($this->path))) {
$mimeType = $this->mimeTypeDetector->detectContent($path);
return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, $mimeType);
}
Expand Down
107 changes: 16 additions & 91 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1724,12 +1724,8 @@
</InvalidReturnType>
</file>
<file src="apps/files_sharing/lib/SharedStorage.php">
<FalsableReturnStatement occurrences="5">
<code>$this-&gt;nonMaskedStorage-&gt;fopen($this-&gt;getUnjailedPath($path), $mode)</code>
<FalsableReturnStatement occurrences="1">
<code>$this-&gt;sourceRootInfo</code>
<code>false</code>
<code>false</code>
<code>false</code>
</FalsableReturnStatement>
<InvalidNullableReturnType occurrences="1">
<code>ICacheEntry</code>
Expand Down Expand Up @@ -2792,7 +2788,7 @@
<file src="core/routes.php">
<InvalidScope occurrences="2">
<code>$this</code>
<code>$this</code>
<code>$this-&gt;create('core_ajax_update', '/core/ajax/update.php')</code>
</InvalidScope>
</file>
<file src="core/templates/layout.public.php">
Expand Down Expand Up @@ -3068,10 +3064,11 @@
<FalsableReturnStatement occurrences="1">
<code>false</code>
</FalsableReturnStatement>
<InvalidReturnStatement occurrences="1">
<InvalidReturnStatement occurrences="2">
<code>$this-&gt;tar-&gt;extractInString($path)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<InvalidReturnType occurrences="2">
<code>resource</code>
<code>string</code>
</InvalidReturnType>
<UndefinedDocblockClass occurrences="1">
Expand All @@ -3083,6 +3080,10 @@
<code>boolean|null</code>
<code>boolean|null</code>
</ImplementedReturnTypeMismatch>
<InvalidReturnStatement occurrences="1"/>
<InvalidReturnType occurrences="1">
<code>resource</code>
</InvalidReturnType>
</file>
<file src="lib/private/Authentication/LoginCredentials/Store.php">
<RedundantCondition occurrences="1">
Expand Down Expand Up @@ -4213,29 +4214,6 @@
</InvalidReturnType>
</file>
<file src="lib/private/Files/Storage/Wrapper/Encoding.php">
<FalsableReturnStatement occurrences="12">
<code>$result</code>
<code>$this-&gt;storage-&gt;file_get_contents($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;filemtime($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;filesize($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;free_space($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;getETag($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;getLocalFile($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;getMimeType($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;hash($type, $this-&gt;findPathToUse($path), $raw)</code>
<code>$this-&gt;storage-&gt;opendir($this-&gt;findPathToUse($path))</code>
<code>$this-&gt;storage-&gt;search($query)</code>
<code>$this-&gt;storage-&gt;stat($this-&gt;findPathToUse($path))</code>
</FalsableReturnStatement>
<ImplementedReturnTypeMismatch occurrences="1">
<code>bool</code>
</ImplementedReturnTypeMismatch>
<InvalidReturnStatement occurrences="1">
<code>$this-&gt;storage-&gt;filetype($this-&gt;findPathToUse($path))</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>bool</code>
</InvalidReturnType>
<UndefinedInterfaceMethod occurrences="13">
<code>$this-&gt;namesCache</code>
<code>$this-&gt;namesCache</code>
Expand All @@ -4253,16 +4231,6 @@
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/Files/Storage/Wrapper/Encryption.php">
<FalsableReturnStatement occurrences="5">
<code>$stat</code>
<code>$this-&gt;storage-&gt;file_get_contents($path)</code>
<code>$this-&gt;storage-&gt;filesize($path)</code>
<code>$this-&gt;storage-&gt;getLocalFile($path)</code>
<code>false</code>
</FalsableReturnStatement>
<ImplementedReturnTypeMismatch occurrences="1">
<code>resource|bool</code>
</ImplementedReturnTypeMismatch>
<InvalidArgument occurrences="2">
<code>$source</code>
<code>$target</code>
Expand Down Expand Up @@ -4290,40 +4258,14 @@
</NullableReturnStatement>
</file>
<file src="lib/private/Files/Storage/Wrapper/Jail.php">
<FalsableReturnStatement occurrences="12">
<code>$this-&gt;getWrapperStorage()-&gt;file_get_contents($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;filemtime($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;filesize($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;fopen($this-&gt;getUnjailedPath($path), $mode)</code>
<code>$this-&gt;getWrapperStorage()-&gt;free_space($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;getETag($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;getLocalFile($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;getMimeType($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;hash($type, $this-&gt;getUnjailedPath($path), $raw)</code>
<code>$this-&gt;getWrapperStorage()-&gt;opendir($this-&gt;getUnjailedPath($path))</code>
<code>$this-&gt;getWrapperStorage()-&gt;search($query)</code>
<code>$this-&gt;getWrapperStorage()-&gt;stat($this-&gt;getUnjailedPath($path))</code>
</FalsableReturnStatement>
<ImplementedReturnTypeMismatch occurrences="1">
<code>bool</code>
</ImplementedReturnTypeMismatch>
<InvalidReturnStatement occurrences="1">
<code>$this-&gt;getWrapperStorage()-&gt;filetype($this-&gt;getUnjailedPath($path))</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>bool</code>
</InvalidReturnType>
</file>
<file src="lib/private/Files/Storage/Wrapper/PermissionsMask.php">
<FalsableReturnStatement occurrences="1">
<code>$this-&gt;checkMask($permissions) ? parent::fopen($path, $mode) : false</code>
</FalsableReturnStatement>
</file>
<file src="lib/private/Files/Storage/Wrapper/Quota.php">
<FalsableReturnStatement occurrences="2">
<code>$source</code>
<code>$this-&gt;storage-&gt;free_space($path)</code>
</FalsableReturnStatement>
<InvalidReturnStatement occurrences="1">
<code>$extension === 'part'</code>
</InvalidReturnStatement>
Expand All @@ -4339,30 +4281,10 @@
</ParamNameMismatch>
</file>
<file src="lib/private/Files/Storage/Wrapper/Wrapper.php">
<FalsableReturnStatement occurrences="13">
<code>$this-&gt;getWrapperStorage()-&gt;file_get_contents($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;filemtime($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;filesize($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;fopen($path, $mode)</code>
<code>$this-&gt;getWrapperStorage()-&gt;free_space($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;getDirectDownload($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;getETag($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;getLocalFile($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;getMimeType($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;hash($type, $path, $raw)</code>
<code>$this-&gt;getWrapperStorage()-&gt;opendir($path)</code>
<code>$this-&gt;getWrapperStorage()-&gt;search($query)</code>
<code>$this-&gt;getWrapperStorage()-&gt;stat($path)</code>
</FalsableReturnStatement>
<ImplementedReturnTypeMismatch occurrences="1">
<code>bool</code>
</ImplementedReturnTypeMismatch>
<InvalidReturnStatement occurrences="2">
<code>$this-&gt;getWrapperStorage()-&gt;filetype($path)</code>
<InvalidReturnStatement occurrences="1">
<code>$this-&gt;getWrapperStorage()-&gt;test()</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="2">
<code>bool</code>
<InvalidReturnType occurrences="1">
<code>true</code>
</InvalidReturnType>
</file>
Expand Down Expand Up @@ -4774,9 +4696,12 @@
</InvalidReturnType>
</file>
<file src="lib/private/Preview/ProviderV2.php">
<FalsableReturnStatement occurrences="1">
<InvalidReturnStatement occurrences="1">
<code>$file-&gt;getStorage()-&gt;getLocalFile($file-&gt;getInternalPath())</code>
</FalsableReturnStatement>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>string</code>
</InvalidReturnType>
</file>
<file src="lib/private/Preview/SVG.php">
<ImplicitToStringCast occurrences="1">
Expand Down
6 changes: 5 additions & 1 deletion lib/composer/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[]
{
"packages": [],
"dev": false,
"dev-package-names": []
}
7 changes: 4 additions & 3 deletions lib/private/Files/ObjectStore/StorageObjectStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

use OCP\Files\ObjectStore\IObjectStore;
use OCP\Files\Storage\IStorage;
use function is_resource;

/**
* Object store that wraps a storage backend, mostly for testing purposes
Expand Down Expand Up @@ -57,11 +58,11 @@ public function getStorageId() {
*/
public function readObject($urn) {
$handle = $this->storage->fopen($urn, 'r');
if ($handle) {
if (is_resource($handle)) {
return $handle;
} else {
throw new \Exception();
}

throw new \Exception();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/SimpleFS/NewSimpleFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function read() {
/**
* Open the file as stream for writing, resulting resource can be operated as stream like the result from php's own fopen
*
* @return resource
* @return resource|bool
* @throws \OCP\Files\NotPermittedException
* @since 14.0.0
*/
Expand Down
5 changes: 3 additions & 2 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,9 @@ public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
}
}

if ($result and $preserveMtime) {
$this->touch($targetInternalPath, $sourceStorage->filemtime($sourceInternalPath));
if ($result && $preserveMtime) {
$mtime = $sourceStorage->filemtime($sourceInternalPath);
$this->touch($targetInternalPath, is_int($mtime) ? $mtime : null);
}

if (!$result) {
Expand Down
26 changes: 13 additions & 13 deletions lib/private/Files/Storage/Wrapper/Encoding.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function rmdir($path) {
* see https://www.php.net/manual/en/function.opendir.php
*
* @param string $path
* @return resource
* @return resource|bool
*/
public function opendir($path) {
return $this->storage->opendir($this->findPathToUse($path));
Expand Down Expand Up @@ -187,7 +187,7 @@ public function is_file($path) {
* only the following keys are required in the result: size and mtime
*
* @param string $path
* @return array
* @return array|bool
*/
public function stat($path) {
return $this->storage->stat($this->findPathToUse($path));
Expand All @@ -197,7 +197,7 @@ public function stat($path) {
* see https://www.php.net/manual/en/function.filetype.php
*
* @param string $path
* @return bool
* @return string|bool
*/
public function filetype($path) {
return $this->storage->filetype($this->findPathToUse($path));
Expand All @@ -208,7 +208,7 @@ public function filetype($path) {
* The result for filesize when called on a folder is required to be 0
*
* @param string $path
* @return int
* @return int|bool
*/
public function filesize($path) {
return $this->storage->filesize($this->findPathToUse($path));
Expand Down Expand Up @@ -289,7 +289,7 @@ public function file_exists($path) {
* see https://www.php.net/manual/en/function.filemtime.php
*
* @param string $path
* @return int
* @return int|bool
*/
public function filemtime($path) {
return $this->storage->filemtime($this->findPathToUse($path));
Expand All @@ -299,7 +299,7 @@ public function filemtime($path) {
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
* @return string
* @return string|bool
*/
public function file_get_contents($path) {
return $this->storage->file_get_contents($this->findPathToUse($path));
Expand Down Expand Up @@ -358,7 +358,7 @@ public function copy($path1, $path2) {
*
* @param string $path
* @param string $mode
* @return resource
* @return resource|bool
*/
public function fopen($path, $mode) {
$result = $this->storage->fopen($this->findPathToUse($path), $mode);
Expand All @@ -373,7 +373,7 @@ public function fopen($path, $mode) {
* The mimetype for a folder is required to be "httpd/unix-directory"
*
* @param string $path
* @return string
* @return string|bool
*/
public function getMimeType($path) {
return $this->storage->getMimeType($this->findPathToUse($path));
Expand All @@ -385,7 +385,7 @@ public function getMimeType($path) {
* @param string $type
* @param string $path
* @param bool $raw
* @return string
* @return string|bool
*/
public function hash($type, $path, $raw = false) {
return $this->storage->hash($type, $this->findPathToUse($path), $raw);
Expand All @@ -395,7 +395,7 @@ public function hash($type, $path, $raw = false) {
* see https://www.php.net/manual/en/function.free_space.php
*
* @param string $path
* @return int
* @return int|bool
*/
public function free_space($path) {
return $this->storage->free_space($this->findPathToUse($path));
Expand All @@ -405,7 +405,7 @@ public function free_space($path) {
* search for occurrences of $query in file names
*
* @param string $query
* @return array
* @return array|bool
*/
public function search($query) {
return $this->storage->search($query);
Expand All @@ -428,7 +428,7 @@ public function touch($path, $mtime = null) {
* The local version of the file can be temporary and doesn't have to be persistent across requests
*
* @param string $path
* @return string
* @return string|bool
*/
public function getLocalFile($path) {
return $this->storage->getLocalFile($this->findPathToUse($path));
Expand Down Expand Up @@ -480,7 +480,7 @@ public function getScanner($path = '', $storage = null) {
* get the ETag for a file or folder
*
* @param string $path
* @return string
* @return string|bool
*/
public function getETag($path) {
return $this->storage->getETag($this->findPathToUse($path));
Expand Down
Loading

0 comments on commit 6a0d175

Please sign in to comment.