Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4112,31 +4112,12 @@
</InvalidOperand>
</file>
<file src="lib/private/Lockdown/Filesystem/NullCache.php">
<InvalidNullableReturnType>
<code><![CDATA[get]]></code>
</InvalidNullableReturnType>
<InvalidReturnStatement>
<code><![CDATA[[]]]></code>
</InvalidReturnStatement>
<InvalidReturnType>
<code><![CDATA[getIncomplete]]></code>
</InvalidReturnType>
<NullableReturnStatement>
<code><![CDATA[$file !== '' ? null :
new CacheEntry([
'fileid' => -1,
'parent' => -1,
'name' => '',
'path' => '',
'size' => '0',
'mtime' => time(),
'storage_mtime' => time(),
'etag' => '',
'mimetype' => FileInfo::MIMETYPE_FOLDER,
'mimepart' => 'httpd',
'permissions' => Constants::PERMISSION_READ
])]]></code>
</NullableReturnStatement>
</file>
<file src="lib/private/Lockdown/Filesystem/NullStorage.php">
<TooManyArguments>
Expand Down
31 changes: 17 additions & 14 deletions lib/private/Lockdown/Filesystem/NullCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ public function getNumericStorageId() {
}

public function get($file) {
return $file !== '' ? null :
new CacheEntry([
'fileid' => -1,
'parent' => -1,
'name' => '',
'path' => '',
'size' => '0',
'mtime' => time(),
'storage_mtime' => time(),
'etag' => '',
'mimetype' => FileInfo::MIMETYPE_FOLDER,
'mimepart' => 'httpd',
'permissions' => Constants::PERMISSION_READ
]);
if ($file !== '') {
return false;
}

return new CacheEntry([
'fileid' => -1,
'parent' => -1,
'name' => '',
'path' => '',
'size' => '0',
'mtime' => time(),
'storage_mtime' => time(),
'etag' => '',
'mimetype' => FileInfo::MIMETYPE_FOLDER,
'mimepart' => 'httpd',
'permissions' => Constants::PERMISSION_READ
]);
}

public function getFolderContents($folder) {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Lockdown/Filesystem/NullCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testGetNumericStorageId(): void {
}

public function testGetEmpty(): void {
$this->assertNull($this->cache->get('foo'));
$this->assertFalse($this->cache->get('foo'));
}

public function testGet(): void {
Expand Down
Loading