diff --git a/composer.json b/composer.json index d570a3c4..5765ee0f 100644 --- a/composer.json +++ b/composer.json @@ -1,43 +1,44 @@ { - "name": "nextcloud/tables", - "description": "This app is for managing data in tables.", - "type": "project", - "license": "AGPL", - "authors": [ - { - "name": "Florian Steffens", - "email": "florian@nextcloud.com" - } - ], - "require-dev": { - "nextcloud/coding-standard": "^v1.0.0", - "vimeo/psalm": "^5.6.0", - "nextcloud/ocp": "dev-master", - "phan/phan": "5.x", - "staabm/annotate-pull-request-from-checkstyle": "^1.8", - "phpunit/phpunit": "^9" - }, - "config": { - "optimize-autoloader": true, - "classmap-authoritative": true, - "platform": { - "php": "7.4" - } - }, - "scripts": { - "test": [ - "@test:unit" - ], - "test:unit": "./vendor/bin/phpunit -c tests/unit/phpunit.xml", - "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l", - "cs:check": "php-cs-fixer fix --dry-run --diff", - "cs:fix": "php-cs-fixer fix", - "psalm": "./vendor/bin/psalm --show-info=true --no-cache", - "psalm:update-baseline": "./vendor/bin/psalm --update-baseline", - "psalm:fix": "./vendor/bin/psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType", - "psalm:fix:dry": "./vendor/bin/psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType --dry-run" - }, - "require": { - "phpoffice/phpspreadsheet": "^1.28" - } + "name": "nextcloud/tables", + "description": "This app is for managing data in tables.", + "type": "project", + "license": "AGPL", + "authors": [ + { + "name": "Florian Steffens", + "email": "florian@nextcloud.com" + } + ], + "require-dev": { + "nextcloud/coding-standard": "^v1.0.0", + "vimeo/psalm": "^5.6.0", + "nextcloud/ocp": "dev-master", + "phan/phan": "5.x", + "staabm/annotate-pull-request-from-checkstyle": "^1.8", + "phpunit/phpunit": "^9" + }, + "config": { + "optimize-autoloader": true, + "classmap-authoritative": true, + "platform": { + "php": "7.4" + } + }, + "scripts": { + "test": [ + "@test:unit" + ], + "test:unit": "./vendor/bin/phpunit -c tests/unit/phpunit.xml", + "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l", + "cs:check": "php-cs-fixer fix --dry-run --diff", + "cs:fix": "php-cs-fixer fix", + "psalm": "./vendor/bin/psalm --show-info=true --no-cache", + "psalm:update-baseline": "./vendor/bin/psalm --update-baseline", + "psalm:fix": "./vendor/bin/psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType", + "psalm:fix:dry": "./vendor/bin/psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType --dry-run" + }, + "require": { + "phpoffice/phpspreadsheet": "^1.28", + "ext-json": "*" + } } diff --git a/lib/Service/ColumnTypes/SelectionCheckBusiness.php b/lib/Service/ColumnTypes/SelectionCheckBusiness.php index ca99cd5a..1a2812c4 100644 --- a/lib/Service/ColumnTypes/SelectionCheckBusiness.php +++ b/lib/Service/ColumnTypes/SelectionCheckBusiness.php @@ -10,7 +10,6 @@ class SelectionCheckBusiness extends SuperBusiness implements IColumnTypeBusines public function parseValue(string $value, ?Column $column = null): string { $found = in_array($value, self::PATTERN_POSITIVE, true); - /** @noinspection PhpComposerExtensionStubsInspection */ return json_encode($found ? 'true' : 'false'); } diff --git a/lib/Service/ColumnTypes/TextLinkBusiness.php b/lib/Service/ColumnTypes/TextLinkBusiness.php index 8148df13..eac32e92 100644 --- a/lib/Service/ColumnTypes/TextLinkBusiness.php +++ b/lib/Service/ColumnTypes/TextLinkBusiness.php @@ -17,12 +17,10 @@ public function parseValue(string $value, ?Column $column = null): string { } // if is json - /** @noinspection PhpComposerExtensionStubsInspection */ $data = json_decode($value, true); if($data !== null) { // at least title and resUrl have to be set if(isset($data['title']) && isset($data['value'])) { - /** @noinspection PhpComposerExtensionStubsInspection */ return json_encode($value); } else { $this->logger->warning("Link cell value has incomplete json string."); @@ -35,7 +33,6 @@ public function parseValue(string $value, ?Column $column = null): string { if (empty($matches)) { return ''; } - /** @noinspection PhpComposerExtensionStubsInspection */ return json_encode(json_encode([ 'title' => $matches[0], 'resourceUrl' => $matches[0] @@ -49,7 +46,6 @@ public function canBeParsed(string $value, ?Column $column = null): bool { } // if is json - /** @noinspection PhpComposerExtensionStubsInspection */ $data = json_decode($value); if($data != null) { return true; diff --git a/lib/Service/ImportService.php b/lib/Service/ImportService.php index 5eb64fc6..9cbe2a5c 100644 --- a/lib/Service/ImportService.php +++ b/lib/Service/ImportService.php @@ -208,7 +208,6 @@ private function createRow(Row $row): void { continue; } - /** @noinspection PhpComposerExtensionStubsInspection */ $data[] = [ 'columnId' => (int) $this->columns[$i]->getId(), 'value' => json_decode($this->parseValueByColumnType($cell->getValue(), $this->columns[$i])), diff --git a/lib/Service/RowService.php b/lib/Service/RowService.php index 41158caf..0c7995af 100644 --- a/lib/Service/RowService.php +++ b/lib/Service/RowService.php @@ -219,7 +219,6 @@ private function parseValueByColumnType(string $value, Column $column) { $this->logger->warning('Value '.$value.' could not be parsed for column '.$column->getTitle()); return $value; } - /** @noinspection PhpComposerExtensionStubsInspection */ return json_decode($columnBusiness->parseValue($value, $column)); } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this->logger->debug('Column type business class not found', ['exception' => $e]);