Skip to content

Conversation

@backportbot-nextcloud
Copy link

@backportbot-nextcloud backportbot-nextcloud bot commented Oct 12, 2022

  • ⚠️ This backport had conflicts and is incomplete

backport of #34559

$pathHash = sha1($path);

$entity = new OpenLocalEditor();
$entity->setUserId($this->userId);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of setUserId cannot be null, possibly null value provided
$pathHash = sha1($path);

try {
$entity = $this->mapper->verifyToken($this->userId, $pathHash, $token);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of OCA\Files\Db\OpenLocalEditorMapper::verifyToken cannot be null, possibly null value provided
*/
class OpenLocalEditor extends Entity {
/** @var string */
protected $userId;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\Files\Db\OpenLocalEditor::$userId is not defined in constructor of OCA\Files\Db\OpenLocalEditor or in any methods called in the constructor
protected $userId;

/** @var string */
protected $pathHash;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\Files\Db\OpenLocalEditor::$pathHash is not defined in constructor of OCA\Files\Db\OpenLocalEditor or in any methods called in the constructor
protected $pathHash;

/** @var int */
protected $expirationTime;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\Files\Db\OpenLocalEditor::$expirationTime is not defined in constructor of OCA\Files\Db\OpenLocalEditor or in any methods called in the constructor
protected $expirationTime;

/** @var string */
protected $token;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\Files\Db\OpenLocalEditor::$token is not defined in constructor of OCA\Files\Db\OpenLocalEditor or in any methods called in the constructor
* @throws MultipleObjectsReturnedException
* @throws Exception
*/
public function verifyToken(string $userId, string $pathHash, string $token): OpenLocalEditor {

Check notice

Code scanning / Psalm

MoreSpecificReturnType

The declared return type 'OCA\Files\Db\OpenLocalEditor' for OCA\Files\Db\OpenLocalEditorMapper::verifyToken is more specific than the inferred return type 'OCP\AppFramework\Db\Entity'
->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter($pathHash)))
->andWhere($qb->expr()->eq('token', $qb->createNamedParameter($token)));

return $this->findEntity($qb);

Check notice

Code scanning / Psalm

LessSpecificReturnStatement

The type 'OCP\AppFramework\Db\Entity' is more general than the declared return type 'OCA\Files\Db\OpenLocalEditor' for OCA\Files\Db\OpenLocalEditorMapper::verifyToken
@blizzz blizzz mentioned this pull request Oct 12, 2022
2 tasks
@blizzz
Copy link
Member

blizzz commented Oct 12, 2022

@nickvergessen backport incomplete

@blizzz blizzz added the 2. developing Work in progress label Oct 12, 2022
Signed-off-by: Joas Schilling <[email protected]>
@nickvergessen
Copy link
Member

Version in info.xml was the issue, so bumped it manually.

@nickvergessen nickvergessen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 13, 2022
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@blizzz blizzz merged commit 2a42dd4 into stable25 Oct 13, 2022
@blizzz blizzz deleted the backport/34559/stable25 branch October 13, 2022 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants