From 1aabf51292a5c40ba17b6ddba83e50d9aa9e667a Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Tue, 6 Sep 2022 12:32:56 +0545 Subject: [PATCH] Fix all coding standard error --- Makefile | 2 +- .../features/bootstrap/GraphContext.php | 3 ++ .../features/bootstrap/SpacesContext.php | 42 +++++++++++++++---- .../features/bootstrap/SpacesTUSContext.php | 3 +- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 49d9ac895..cf9b6526c 100644 --- a/Makefile +++ b/Makefile @@ -276,7 +276,7 @@ ci-format: $(BUILDIFIER) .PHONY: test-php-style test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor $(PHP_CS_FIXER) fix -v --diff --allow-risky yes --dry-run - $(PHP_CODESNIFFER) --cache --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance + $(PHP_CODESNIFFER) --cache --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance tests/TestHelpers .PHONY: test-php-style-fix test-php-style-fix: vendor-bin/owncloud-codestyle/vendor diff --git a/tests/acceptance/features/bootstrap/GraphContext.php b/tests/acceptance/features/bootstrap/GraphContext.php index a2a3b5c33..caba60a1b 100644 --- a/tests/acceptance/features/bootstrap/GraphContext.php +++ b/tests/acceptance/features/bootstrap/GraphContext.php @@ -509,6 +509,7 @@ class GraphContext implements Context { * @param string $shouldOrNot (not|) * @param TableNode $table * + * @return void * @throws GuzzleException * @throws Exception */ @@ -539,10 +540,12 @@ class GraphContext implements Context { /** * @When /^the user "([^"]*)" changes its own password "([^"]*)" to "([^"]*)" using the Graph API$/ + * * @param string $user * @param string $currentPassword * @param string $newPassword * + * @return void * @throws GuzzleException * @throws Exception */ diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index f0840b64e..784269fc8 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -668,8 +668,8 @@ class SpacesContext implements Context { * * @param string $user * @param string $spaceName - * @return void * + * @return void * @throws GuzzleException */ public function theUserLooksUpTheSingleSpaceUsingTheGraphApiByUsingItsId(string $user, string $spaceName): void { @@ -847,8 +847,8 @@ class SpacesContext implements Context { * @param string $user * @param string $spaceName * @param string $foldersPath - * @return void * + * @return void * @throws GuzzleException */ public function theUserListsTheContentOfAPersonalSpaceRootUsingTheWebDAvApi( @@ -1006,6 +1006,7 @@ class SpacesContext implements Context { /** * @Then /^the json responded should contain a space "([^"]*)" (?:|(?:owned by|granted to) "([^"]*)" )(?:|(?:with description file|with space image) "([^"]*)" )with these key and value pairs:$/ + * * @param string $spaceName * @param string $userName * @param string $fileName @@ -1016,8 +1017,8 @@ class SpacesContext implements Context { */ public function jsonRespondedShouldContain( string $spaceName, - string $userName = '', - string $fileName = '', + string $userName, + string $fileName, TableNode $table ): void { $this->featureContext->verifyTableNodeColumns($table, ['key', 'value']); @@ -1090,8 +1091,8 @@ class SpacesContext implements Context { public function userHasSpaceWith( string $user, string $spaceName, - string $grantedUser = '', - string $fileName = '', + string $grantedUser, + string $fileName, TableNode $table ): void { $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user); @@ -1292,6 +1293,7 @@ class SpacesContext implements Context { * and returns found search results if found else returns false * * @param string|null $entryNameToSearch + * @param string $folderPath * * @return array * string if $entryNameToSearch is given and is found @@ -1545,6 +1547,7 @@ class SpacesContext implements Context { * @param string $user * @param string $spaceName * @param string $newDescription + * * @return void * @throws GuzzleException * @throws JsonException @@ -2496,7 +2499,7 @@ class SpacesContext implements Context { /** * User get all objects in the trash of project space * - * method "getTrashbinContentFromResponseXml" borrowed from core repository + * Method "getTrashbinContentFromResponseXml" borrowed from core repository * and return array like: * [1] => Array * ( @@ -2619,6 +2622,7 @@ class SpacesContext implements Context { * @param string $width * @param string $height * + * @return void * @throws GuzzleException */ public function downloadPreview( @@ -2659,6 +2663,7 @@ class SpacesContext implements Context { * @param string $fileName * @param string $spaceName * + * @return void * @throws GuzzleException */ public function downloadFile( @@ -2689,6 +2694,7 @@ class SpacesContext implements Context { * @param string $path * @param string $spaceName * + * @return void * @throws GuzzleException */ public function userRequestsTheChecksumViaPropfindInSpace( @@ -2726,6 +2732,7 @@ class SpacesContext implements Context { * @param string $path * @param string $spaceName * + * @return void * @throws GuzzleException */ public function userUploadsFileWithChecksumWithContentInSpace( @@ -2758,6 +2765,7 @@ class SpacesContext implements Context { * @param string $index * @param string $spaceName * + * @return void * @throws GuzzleException */ public function downloadVersionOfTheFile( @@ -2903,6 +2911,9 @@ class SpacesContext implements Context { /** * @Then /^these etags should have changed$/ * + * @param TableNode $table + * + * @return void * @throws GuzzleException */ public function theseEtagsShouldHaveChanged(TableNode $table): void { @@ -2930,6 +2941,7 @@ class SpacesContext implements Context { * * @param TableNode $table * + * @return void * @throws GuzzleException */ public function theseEtagsShouldNotHaveChanged(TableNode $table): void { @@ -2955,6 +2967,11 @@ class SpacesContext implements Context { /** * @Given /^user "([^"]*)" has stored etag of element "([^"]*)" inside space "([^"]*)"$/ * + * @param string $user + * @param string $path + * @param string $space + * + * @return void * @throws GuzzleException | Exception */ public function userHasStoredEtagOfElementFromSpace(string $user, string $path, string $space):void { @@ -2972,9 +2989,15 @@ class SpacesContext implements Context { /** * @Given /^user "([^"]*)" has stored etag of element "([^"]*)" on path "([^"]*)" inside space "([^"]*)"$/ * + * @param $user + * @param $path + * @param $storePath + * @param $space + * + * @return void * @throws Exception | GuzzleException */ - public function userHasStoredEtagOfElementOnPathFromSpace($user, $path, $storePath, $space) { + public function userHasStoredEtagOfElementOnPathFromSpace($user, $path, $storePath, $space):void { $user = $this->featureContext->getActualUsername($user); $this->storeEtagOfElementInSpaceForUser( $user, @@ -2995,9 +3018,10 @@ class SpacesContext implements Context { * @param TableNode $properties * @param string $spaceName * + * @return void * @throws Exception | GuzzleException */ - public function userHasLockedResourceOfSpace(string $user, string $resource, TableNode $properties, string $spaceName) { + public function userHasLockedResourceOfSpace(string $user, string $resource, TableNode $properties, string $spaceName): void { $this->setSpaceIDByName($user, $spaceName); $this->webDavLockingContext->lockFileUsingWebDavAPI($user, $resource, $properties); } diff --git a/tests/acceptance/features/bootstrap/SpacesTUSContext.php b/tests/acceptance/features/bootstrap/SpacesTUSContext.php index 45bbc065e..700776977 100644 --- a/tests/acceptance/features/bootstrap/SpacesTUSContext.php +++ b/tests/acceptance/features/bootstrap/SpacesTUSContext.php @@ -85,12 +85,11 @@ class SpacesTUSContext implements Context { * * @param string $user * @param string $source - * @param string $spaceName * @param string $destination + * @param string $spaceName * @param array|null $uploadMetadata * * @return void - * * @throws Exception * @throws GuzzleException */