Skip to content

Commit

Permalink
chore: improve typing for SharedStorage::$storage
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Mar 11, 2024
1 parent 79a951e commit 37023f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto

private string $sourcePath = '';

/**
* @var ?\OC\Files\Storage\Storage $storage
*/
protected $storage;

Check notice

Code scanning / Psalm

NonInvariantDocblockPropertyType Note

Property OCA\Files_Sharing\SharedStorage::$storage has type OC\Files\Storage\Storage|null, not invariant with OC\Files\Storage\Wrapper\Wrapper::$storage of type OC\Files\Storage\Storage

public function __construct($arguments) {
$this->ownerView = $arguments['ownerView'];
$this->logger = \OC::$server->get(LoggerInterface::class);
Expand Down Expand Up @@ -132,6 +137,9 @@ private function getSourceRootInfo() {
return $this->sourceRootInfo;
}

/**
* @psalm-assert \OC\Files\Storage\Storage $this->storage
*/
private function init() {
if ($this->initialized) {
if (!$this->storage) {
Expand Down

0 comments on commit 37023f1

Please sign in to comment.