chore: Run cs:fix

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
pull/45094/head
Marcel Klehr 1 month ago
parent 86317bbf4d
commit 29cbb3cf71

@ -27,7 +27,6 @@ declare(strict_types=1);
namespace OC\Core\Controller;
use OCA\Core\ResponseDefinitions;
use OCA\User_LDAP\Handler\ExtStorageConfigHandler;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\Attribute\ApiRoute;
@ -50,8 +49,6 @@ use OCP\TaskProcessing\Exception\Exception;
use OCP\TaskProcessing\Exception\ValidationException;
use OCP\TaskProcessing\ShapeDescriptor;
use OCP\TaskProcessing\Task;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
/**
* @psalm-import-type CoreTaskProcessingTask from ResponseDefinitions

@ -55,13 +55,13 @@ enum EShapeType: int {
if ($this === EShapeType::Text && !is_string($value)) {
throw new ValidationException('Non-text item provided for Text slot');
}
if ($this === EShapeType::ListOfTexts && (!is_array($value) || count(array_filter($value, fn($item) => !is_string($item))) > 0)) {
if ($this === EShapeType::ListOfTexts && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item))) > 0)) {
throw new ValidationException('Non-text list item provided for ListOfTexts slot');
}
if ($this === EShapeType::Number && !is_numeric($value)) {
throw new ValidationException('Non-numeric item provided for Number slot');
}
if ($this === EShapeType::ListOfNumbers && (!is_array($value) || count(array_filter($value, fn($item) => !is_numeric($item))) > 0)) {
if ($this === EShapeType::ListOfNumbers && (!is_array($value) || count(array_filter($value, fn ($item) => !is_numeric($item))) > 0)) {
throw new ValidationException('Non-numeric list item provided for ListOfNumbers slot');
}
}
@ -70,6 +70,7 @@ enum EShapeType: int {
* @param mixed $value
* @return void
* @throws Exception\ValidationException
* @since 30.0.0
*/
public function validateInput(mixed $value): void {
$this->validateNonFileType($value);
@ -101,6 +102,7 @@ enum EShapeType: int {
/**
* @throws ValidationException
* @since 30.0.0
*/
public function validateOutput(mixed $value) {
$this->validateNonFileType($value);
@ -130,6 +132,11 @@ enum EShapeType: int {
}
}
/**
* @param EShapeType $type
* @return EShapeType
* @since 30.0.0
*/
public static function getScalarType(EShapeType $type): EShapeType {
return EShapeType::from($type->value % 10);
}

Loading…
Cancel
Save