storage = $storage; $this->path = $path; $this->isDir = $isDir; } /** * @throws NotFoundException */ public function setEntitySubject(IEntity $entity, $subject): void { if ($entity instanceof File) { if (!$subject instanceof Node) { throw new \UnexpectedValueException( 'Expected Node subject for File entity, got {class}', ['app' => Application::APP_ID, 'class' => get_class($subject)] ); } $this->storage = $subject->getStorage(); $this->path = $subject->getPath(); } } }