Files
nextcloud-server-mirror/lib/public/AppFramework/Http/InvalidStringParameterException.php
Carl Schwan feb731a69a feat(dispatcher): Extend the amount of checks executed
Support for various psalm scalar types: non-empty-string, positive-int,
...

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2026-08-17 22:59:00 +02:00

42 lines
751 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\AppFramework\Http;
/**
* @since 35.0.0
*/
class InvalidStringParameterException extends \InvalidArgumentException {
/**
* @since 35.0.0
*/
public function __construct(
protected string $parameterName,
protected string $constraint,
) {
parent::__construct(
sprintf('Parameter %s must be a %s', $this->parameterName, $this->constraint)
);
}
/**
* @since 35.0.0
*/
public function getParameterName(): string {
return $this->parameterName;
}
/**
* @since 35.0.0
*/
public function getConstraint(): string {
return $this->constraint;
}
}