chore: apply cs fixer

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2024-07-11 01:11:24 -03:00
parent c9c413f755
commit 1d78eb5851
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318
13 changed files with 23 additions and 22 deletions

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
require_once './vendor/autoload.php';
require_once './vendor-bin/coding-standard/vendor/autoload.php';
use Nextcloud\CodingStandard\Config;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

View file

@ -388,7 +388,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur
];
foreach ($updatable as $property => $data) {
$property = $userAccount->getProperty($property);
if (null !== $data['value']) {
if ($data['value'] !== null) {
$property->setValue($data['value']);
}
}

View file

@ -70,7 +70,7 @@ class FileElementController extends AEnvironmentAwareController {
#[NoAdminRequired]
#[NoCSRFRequired]
#[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/file-element/{uuid}', requirements: ['apiVersion' => '(v1)'])]
public function post(string $uuid, int $signRequestId, int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
public function post(string $uuid, int $signRequestId, ?int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
$visibleElement = [
'elementId' => $elementId,
'type' => $type,
@ -120,7 +120,7 @@ class FileElementController extends AEnvironmentAwareController {
#[NoAdminRequired]
#[NoCSRFRequired]
#[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/file-element/{uuid}/{elementId}', requirements: ['apiVersion' => '(v1)'])]
public function patch(string $uuid, int $signRequestId, int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
public function patch(string $uuid, int $signRequestId, ?int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
return $this->post($uuid, $signRequestId, $elementId, $type, $metadata, $coordinates);
}

View file

@ -85,7 +85,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu
#[PublicPage]
#[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/file_id/{fileId}', requirements: ['apiVersion' => '(v1)'])]
public function signUsingFileId(int $fileId, string $method, array $elements = [], string $identifyValue = '', string $token = ''): DataResponse {
return $this->sign($fileId, null, $method, $elements, $identifyValue, $token);
return $this->sign($method, $elements, $identifyValue, $token, $fileId, null);
}
/**
@ -108,13 +108,13 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu
#[PublicPage]
#[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/uuid/{uuid}', requirements: ['apiVersion' => '(v1)'])]
public function signUsingUuid(string $uuid, string $method, array $elements = [], string $identifyValue = '', string $token = ''): DataResponse {
return $this->sign(null, $uuid, $method, $elements, $identifyValue, $token);
return $this->sign($method, $elements, $identifyValue, $token, null, $uuid);
}
/**
* @return DataResponse<Http::STATUS_OK, array{action: integer, message: string, file: array{uuid: string}}, array{}>|DataResponse<Http::STATUS_UNPROCESSABLE_ENTITY, array{action: integer, errors: string[], redirect?: string}, array{}>
*/
public function sign(int $fileId = null, string $signRequestUuid = null, string $method, array $elements = [], string $identifyValue = '', string $token = ''): DataResponse {
public function sign(string $method, array $elements = [], string $identifyValue = '', string $token = '', ?int $fileId = null, ?string $signRequestUuid = null): DataResponse {
try {
$user = $this->userSession->getUser();
$this->validateHelper->canSignWithIdentificationDocumentStatus(

View file

@ -91,7 +91,7 @@ class AccountFileMapper extends QBMapper {
return $this->findEntity($qb);
}
public function accountFileList(array $filter, int $page = null, int $length = null): array {
public function accountFileList(array $filter, ?int $page = null, ?int $length = null): array {
$filter['length'] = $length;
$filter['page'] = $page;
$pagination = $this->getUserAccountFile($filter);

View file

@ -24,7 +24,7 @@ class PagerFantaQueryAdapter implements AdapterInterface {
public function __construct(
private IQueryBuilder $queryBuilder,
) {
if (QueryBuilder::SELECT !== $queryBuilder->getType()) {
if ($queryBuilder->getType() !== QueryBuilder::SELECT) {
// @codeCoverageIgnoreStart
throw new InvalidArgumentException('Only SELECT queries can be paginated.');
// @codeCoverageIgnoreEnd

View file

@ -359,9 +359,9 @@ class SignRequestMapper extends QBMapper {
public function getFilesAssociatedFilesWithMeFormatted(
IUser $user,
int $page = null,
int $length = null,
array $filter,
?int $page = null,
?int $length = null,
): array {
$filter['email'] = $user->getEMailAddress();
$filter['length'] = $length;

View file

@ -454,9 +454,9 @@ class FileService {
$return = $this->signRequestMapper->getFilesAssociatedFilesWithMeFormatted(
$this->me,
$filter,
$page,
$length,
$filter,
);
$signers = $this->signRequestMapper->getByMultipleFileId(array_column($return['data'], 'id'));

View file

@ -82,7 +82,7 @@ class FolderService {
/**
* @throws NotFoundException
*/
public function getFileById(int $nodeId = null): File {
public function getFileById(?int $nodeId = null): File {
if ($this->getUserId()) {
$folder = $this->root->getUserFolder($this->getUserId());
$file = $folder->getById($nodeId);

View file

@ -129,7 +129,7 @@ class SignerElementsService {
$return = [];
$fileList = $this->getElementsFromSession();
foreach ($fileList as $fileElement) {
list($type, $timestamp) = explode('_', pathinfo($fileElement->getName(), PATHINFO_FILENAME));
[$type, $timestamp] = explode('_', pathinfo($fileElement->getName(), PATHINFO_FILENAME));
$return[] = [
'type' => $type,
'file' => [

View file

@ -103,7 +103,7 @@ class ApiTestCase extends TestCase {
* @throws StatusCodeNotMatchedException
* @throws MessageException
*/
public function assertRequest(AbstractRequester $request = null) {
public function assertRequest(?AbstractRequester $request = null) {
if (!$request) {
$request = $this->request;
}

View file

@ -117,7 +117,7 @@ class FeatureContext extends NextcloudApiContext implements OpenedEmailStorageAw
}
protected function beforeRequest(string $fullUrl, array $options): array {
list($fullUrl, $options) = parent::beforeRequest($fullUrl, $options);
[$fullUrl, $options] = parent::beforeRequest($fullUrl, $options);
$options = $this->parseFormParams($options);
$fullUrl = $this->parseText($fullUrl);
return [$fullUrl, $options];
@ -192,7 +192,7 @@ class FeatureContext extends NextcloudApiContext implements OpenedEmailStorageAw
* @param string $user
* @param TableNode|null $body
*/
public function userNotifications(string $user, TableNode $body = null): void {
public function userNotifications(string $user, ?TableNode $body = null): void {
$this->setCurrentUser($user);
$this->sendOCSRequest(
'GET', '/apps/notifications/api/v2/notifications'

View file

@ -83,12 +83,12 @@
"source": {
"type": "git",
"url": "https://github.com/vitormattos/openapi-extractor.git",
"reference": "c507024e24ccf21144f25682ce210b408919e7c2"
"reference": "a5d2b685133c42ba02f43ed6be9b4a2d57d1be25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vitormattos/openapi-extractor/zipball/c507024e24ccf21144f25682ce210b408919e7c2",
"reference": "c507024e24ccf21144f25682ce210b408919e7c2",
"url": "https://api.github.com/repos/vitormattos/openapi-extractor/zipball/a5d2b685133c42ba02f43ed6be9b4a2d57d1be25",
"reference": "a5d2b685133c42ba02f43ed6be9b4a2d57d1be25",
"shasum": ""
},
"require": {
@ -99,7 +99,8 @@
"phpstan/phpdoc-parser": "^1.28"
},
"require-dev": {
"nextcloud/coding-standard": "^1.2"
"nextcloud/coding-standard": "^1.2",
"nextcloud/ocp": "dev-master"
},
"bin": [
"generate-spec",
@ -128,7 +129,7 @@
"support": {
"source": "https://github.com/vitormattos/openapi-extractor/tree/develop"
},
"time": "2024-06-06T14:21:56+00:00"
"time": "2024-07-11T03:52:32+00:00"
},
{
"name": "nikic/php-parser",