diff options
Diffstat (limited to 'build')
28 files changed, 1469 insertions, 1244 deletions
diff --git a/build/autoloaderchecker.sh b/build/autoloaderchecker.sh index ffa157f6c80..60bc4c0c395 100755 --- a/build/autoloaderchecker.sh +++ b/build/autoloaderchecker.sh @@ -1,26 +1,18 @@ #!/usr/bin/env bash -COMPOSER_COMMAND=$(which "composer") -if [ "$COMPOSER_COMMAND" = '' ] +COMPOSER_COMMAND="php composer.phar" + +if [ -e "composer.phar" ] then - #No global composer found, try local or download it - if [ -e "composer.phar" ] - then - echo "Composer found: checking for update" - else - echo "Composer not found: fetching" - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php - php -r "unlink('composer-setup.php');" - fi - - COMPOSER_COMMAND="php composer.phar" + echo "Composer found: checking for update" + $COMPOSER_COMMAND self-update else - echo "Global composer found: checking for update" + echo "Composer not found: fetching" + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + php composer-setup.php --2 + php -r "unlink('composer-setup.php');" fi -#Make sure we are on the latest composer -$COMPOSER_COMMAND self-update REPODIR=`git rev-parse --show-toplevel` @@ -50,6 +42,8 @@ do fi done +rm composer.phar + echo if [ $composerfile = true ] then diff --git a/build/integration/composer.json b/build/integration/composer.json index 23c9148f042..ba90c632b1b 100644 --- a/build/integration/composer.json +++ b/build/integration/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "phpunit/phpunit": "~6.5", - "behat/behat": "~3.7.0", + "behat/behat": "~3.8.0", "guzzlehttp/guzzle": "6.5.2", "jarnaiz/behat-junit-formatter": "^1.3", "sabre/dav": "3.2.3", diff --git a/build/integration/data/coloured-pattern.png b/build/integration/data/coloured-pattern.png Binary files differnew file mode 100644 index 00000000000..cf43787f3fd --- /dev/null +++ b/build/integration/data/coloured-pattern.png diff --git a/build/integration/data/green-square-256.png b/build/integration/data/green-square-256.png Binary files differnew file mode 100644 index 00000000000..9f14b707ca3 --- /dev/null +++ b/build/integration/data/green-square-256.png diff --git a/build/integration/features/avatar.feature b/build/integration/features/avatar.feature new file mode 100644 index 00000000000..f7926615c01 --- /dev/null +++ b/build/integration/features/avatar.feature @@ -0,0 +1,183 @@ +Feature: avatar + + Background: + Given user "user0" exists + + Scenario: get default user avatar + When user "user0" gets avatar for user "user0" + Then The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 0 | + And last avatar is a square of size 128 + And last avatar is not a single color + + Scenario: get default user avatar as an anonymous user + When user "anonymous" gets avatar for user "user0" + Then The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 0 | + And last avatar is a square of size 128 + And last avatar is not a single color + + + + Scenario: get temporary user avatar before cropping it + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/green-square-256.png" + When logged in user gets temporary avatar + Then The following headers should be set + | Content-Type | image/png | + # "last avatar" also includes the last temporary avatar + And last avatar is a square of size 256 + And last avatar is a single "#00FF00" color + + Scenario: get user avatar before cropping it + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/green-square-256.png" + # Avatar needs to be cropped to finish setting it even if it is squared + When user "user0" gets avatar for user "user0" + Then The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 0 | + And last avatar is a square of size 128 + And last avatar is not a single color + + + + Scenario: set user avatar from file + Given Logging in using web as "user0" + When logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user crops temporary avatar + | x | 384 | + | y | 256 | + | w | 128 | + | h | 128 | + Then logged in user gets temporary avatar with 404 + And user "user0" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 128 + And last avatar is a single "#FF0000" color + And user "anonymous" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 128 + And last avatar is a single "#FF0000" color + + Scenario: set user avatar from internal path + Given user "user0" uploads file "data/coloured-pattern.png" to "/internal-coloured-pattern.png" + And Logging in using web as "user0" + When logged in user posts temporary avatar from internal path "internal-coloured-pattern.png" + And logged in user crops temporary avatar + | x | 704 | + | y | 320 | + | w | 64 | + | h | 64 | + Then logged in user gets temporary avatar with 404 + And user "user0" gets avatar for user "user0" with size "64" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 64 + And last avatar is a single "#00FF00" color + And user "anonymous" gets avatar for user "user0" with size "64" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 64 + And last avatar is a single "#00FF00" color + + Scenario: cropped user avatar needs to be squared + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/coloured-pattern.png" + When logged in user crops temporary avatar with 400 + | x | 384 | + | y | 256 | + | w | 192 | + | h | 128 | + + + + Scenario: delete user avatar + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user crops temporary avatar + | x | 384 | + | y | 256 | + | w | 128 | + | h | 128 | + And user "user0" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 128 + And last avatar is a single "#FF0000" color + And user "anonymous" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 128 + And last avatar is a single "#FF0000" color + When logged in user deletes the user avatar + Then user "user0" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 0 | + And last avatar is a square of size 128 + And last avatar is not a single color + And user "anonymous" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 0 | + And last avatar is a square of size 128 + And last avatar is not a single color + + + + Scenario: get user avatar with a larger size than the original one + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user crops temporary avatar + | x | 384 | + | y | 256 | + | w | 128 | + | h | 128 | + When user "user0" gets avatar for user "user0" with size "192" + Then The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 192 + And last avatar is a single "#FF0000" color + + Scenario: get user avatar with a smaller size than the original one + Given Logging in using web as "user0" + And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user crops temporary avatar + | x | 384 | + | y | 256 | + | w | 128 | + | h | 128 | + When user "user0" gets avatar for user "user0" with size "96" + Then The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 96 + And last avatar is a single "#FF0000" color + + + + Scenario: get default guest avatar + When user "user0" gets avatar for guest "guest0" + Then The following headers should be set + | Content-Type | image/png | + And last avatar is a square of size 128 + And last avatar is not a single color + + Scenario: get default guest avatar as an anonymous user + When user "anonymous" gets avatar for guest "guest0" + Then The following headers should be set + | Content-Type | image/png | + And last avatar is a square of size 128 + And last avatar is not a single color diff --git a/build/integration/features/bootstrap/AppConfiguration.php b/build/integration/features/bootstrap/AppConfiguration.php index b893637ba6c..772370a85ba 100644 --- a/build/integration/features/bootstrap/AppConfiguration.php +++ b/build/integration/features/bootstrap/AppConfiguration.php @@ -4,6 +4,7 @@ * * @author Arthur Schiwon <blizzz@arthur-schiwon.de> * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Joas Schilling <coding@schilljs.com> * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> * @author Sergio Bertolin <sbertolin@solidgear.es> @@ -72,6 +73,19 @@ trait AppConfiguration { } } + /** + * @param string $app + * @param string $parameter + * @param string $value + */ + protected function deleteServerConfig($app, $parameter) { + $this->sendingTo('DELETE', "/apps/testing/api/v1/app/{$app}/{$parameter}"); + $this->theHTTPStatusCodeShouldBe('200'); + if ($this->apiVersion === 1) { + $this->theOCSStatusCodeShouldBe('100'); + } + } + protected function setStatusTestingApp($enabled) { $this->sendingTo(($enabled ? 'post' : 'delete'), '/cloud/apps/testing'); $this->theHTTPStatusCodeShouldBe('200'); diff --git a/build/integration/features/bootstrap/Avatar.php b/build/integration/features/bootstrap/Avatar.php new file mode 100644 index 00000000000..388715340c6 --- /dev/null +++ b/build/integration/features/bootstrap/Avatar.php @@ -0,0 +1,271 @@ +<?php +/** + * @copyright Copyright (c) 2020, Daniel Calviño Sánchez (danxuliu@gmail.com) + * + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +use Behat\Gherkin\Node\TableNode; +use PHPUnit\Framework\Assert; + +require __DIR__ . '/../../vendor/autoload.php'; + +trait Avatar { + + /** @var string **/ + private $lastAvatar; + + /** @AfterScenario **/ + public function cleanupLastAvatar() { + $this->lastAvatar = null; + } + + private function getLastAvatar() { + $this->lastAvatar = ''; + + $body = $this->response->getBody(); + while (!$body->eof()) { + $this->lastAvatar .= $body->read(8192); + } + $body->close(); + } + + /** + * @When user :user gets avatar for user :userAvatar + * + * @param string $user + * @param string $userAvatar + */ + public function userGetsAvatarForUser(string $user, string $userAvatar) { + $this->userGetsAvatarForUserWithSize($user, $userAvatar, '128'); + } + + /** + * @When user :user gets avatar for user :userAvatar with size :size + * + * @param string $user + * @param string $userAvatar + * @param string $size + */ + public function userGetsAvatarForUserWithSize(string $user, string $userAvatar, string $size) { + $this->asAn($user); + $this->sendingToDirectUrl('GET', '/index.php/avatar/' . $userAvatar . '/' . $size); + $this->theHTTPStatusCodeShouldBe('200'); + + $this->getLastAvatar(); + } + + /** + * @When user :user gets avatar for guest :guestAvatar + * + * @param string $user + * @param string $guestAvatar + */ + public function userGetsAvatarForGuest(string $user, string $guestAvatar) { + $this->asAn($user); + $this->sendingToDirectUrl('GET', '/index.php/avatar/guest/' . $guestAvatar . '/128'); + $this->theHTTPStatusCodeShouldBe('201'); + + $this->getLastAvatar(); + } + + /** + * @When logged in user gets temporary avatar + */ + public function loggedInUserGetsTemporaryAvatar() { + $this->loggedInUserGetsTemporaryAvatarWith('200'); + } + + /** + * @When logged in user gets temporary avatar with :statusCode + * + * @param string $statusCode + */ + public function loggedInUserGetsTemporaryAvatarWith(string $statusCode) { + $this->sendingAToWithRequesttoken('GET', '/index.php/avatar/tmp'); + $this->theHTTPStatusCodeShouldBe($statusCode); + + $this->getLastAvatar(); + } + + /** + * @When logged in user posts temporary avatar from file :source + * + * @param string $source + */ + public function loggedInUserPostsTemporaryAvatarFromFile(string $source) { + $file = \GuzzleHttp\Psr7\stream_for(fopen($source, 'r')); + + $this->sendingAToWithRequesttoken('POST', '/index.php/avatar', + [ + 'multipart' => [ + [ + 'name' => 'files[]', + 'contents' => $file + ] + ] + ]); + $this->theHTTPStatusCodeShouldBe('200'); + } + + /** + * @When logged in user posts temporary avatar from internal path :path + * + * @param string $path + */ + public function loggedInUserPostsTemporaryAvatarFromInternalPath(string $path) { + $this->sendingAToWithRequesttoken('POST', '/index.php/avatar?path=' . $path); + $this->theHTTPStatusCodeShouldBe('200'); + } + + /** + * @When logged in user crops temporary avatar + * + * @param TableNode $crop + */ + public function loggedInUserCropsTemporaryAvatar(TableNode $crop) { + $this->loggedInUserCropsTemporaryAvatarWith('200', $crop); + } + + /** + * @When logged in user crops temporary avatar with :statusCode + * + * @param string $statusCode + * @param TableNode $crop + */ + public function loggedInUserCropsTemporaryAvatarWith(string $statusCode, TableNode $crop) { + $parameters = []; + foreach ($crop->getRowsHash() as $key => $value) { + $parameters[] = 'crop[' . $key . ']=' . $value; + } + + $this->sendingAToWithRequesttoken('POST', '/index.php/avatar/cropped?' . implode('&', $parameters)); + $this->theHTTPStatusCodeShouldBe($statusCode); + } + + /** + * @When logged in user deletes the user avatar + */ + public function loggedInUserDeletesTheUserAvatar() { + $this->sendingAToWithRequesttoken('DELETE', '/index.php/avatar'); + $this->theHTTPStatusCodeShouldBe('200'); + } + + /** + * @Then last avatar is a square of size :size + * + * @param string size + */ + public function lastAvatarIsASquareOfSize(string $size) { + list($width, $height) = getimagesizefromstring($this->lastAvatar); + + Assert::assertEquals($width, $height, 'Avatar is not a square'); + Assert::assertEquals($size, $width); + } + + /** + * @Then last avatar is not a single color + */ + public function lastAvatarIsNotASingleColor() { + Assert::assertEquals(null, $this->getColorFromLastAvatar()); + } + + /** + * @Then last avatar is a single :color color + * + * @param string $color + * @param string $size + */ + public function lastAvatarIsASingleColor(string $color) { + $expectedColor = $this->hexStringToRgbColor($color); + $colorFromLastAvatar = $this->getColorFromLastAvatar(); + + Assert::assertTrue($this->isSameColor($expectedColor, $colorFromLastAvatar), + $this->rgbColorToHexString($colorFromLastAvatar) . ' does not match expected ' . $color); + } + + private function hexStringToRgbColor($hexString) { + // Strip initial "#" + $hexString = substr($hexString, 1); + + $rgbColorInt = hexdec($hexString); + + // RGBA hex strings are not supported; the given string is assumed to be + // an RGB hex string. + return [ + 'red' => ($rgbColorInt >> 16) & 0xFF, + 'green' => ($rgbColorInt >> 8) & 0xFF, + 'blue' => $rgbColorInt & 0xFF, + 'alpha' => 0 + ]; + } + + private function rgbColorToHexString($rgbColor) { + $rgbColorInt = ($rgbColor['red'] << 16) + ($rgbColor['green'] << 8) + ($rgbColor['blue']); + + return '#' . str_pad(strtoupper(dechex($rgbColorInt)), 6, '0', STR_PAD_LEFT); + } + + private function getColorFromLastAvatar() { + $image = imagecreatefromstring($this->lastAvatar); + + $firstPixelColorIndex = imagecolorat($image, 0, 0); + $firstPixelColor = imagecolorsforindex($image, $firstPixelColorIndex); + + for ($i = 0; $i < imagesx($image); $i++) { + for ($j = 0; $j < imagesx($image); $j++) { + $currentPixelColorIndex = imagecolorat($image, $i, $j); + $currentPixelColor = imagecolorsforindex($image, $currentPixelColorIndex); + + // The colors are compared with a small allowed delta, as even + // on solid color images the resizing can cause some small + // artifacts that slightly modify the color of certain pixels. + if (!$this->isSameColor($firstPixelColor, $currentPixelColor)) { + imagedestroy($image); + + return null; + } + } + } + + imagedestroy($image); + + return $firstPixelColor; + } + + private function isSameColor(array $firstColor, array $secondColor, int $allowedDelta = 1) { + if ($this->isSameColorComponent($firstColor['red'], $secondColor['red'], $allowedDelta) && + $this->isSameColorComponent($firstColor['green'], $secondColor['green'], $allowedDelta) && + $this->isSameColorComponent($firstColor['blue'], $secondColor['blue'], $allowedDelta) && + $this->isSameColorComponent($firstColor['alpha'], $secondColor['alpha'], $allowedDelta)) { + return true; + } + + return false; + } + + private function isSameColorComponent(int $firstColorComponent, int $secondColorComponent, int $allowedDelta) { + if ($firstColorComponent >= ($secondColorComponent - $allowedDelta) && + $firstColorComponent <= ($secondColorComponent + $allowedDelta)) { + return true; + } + + return false; + } +} diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index eed0f173ced..c8c40d2a98b 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -14,7 +14,7 @@ * @author Sergio Bertolin <sbertolin@solidgear.es> * @author Sergio BertolÃn <sbertolin@solidgear.es> * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -44,6 +44,7 @@ require __DIR__ . '/../../vendor/autoload.php'; trait BasicStructure { use Auth; + use Avatar; use Download; use Mail; use Trashbin; @@ -178,7 +179,7 @@ trait BasicStructure { $options = []; if ($this->currentUser === 'admin') { $options['auth'] = $this->adminUser; - } else { + } elseif (strpos($this->currentUser, 'anonymous') !== 0) { $options['auth'] = [$this->currentUser, $this->regularUser]; } $options['headers'] = [ @@ -218,7 +219,7 @@ trait BasicStructure { $options = []; if ($this->currentUser === 'admin') { $options['auth'] = $this->adminUser; - } else { + } elseif (strpos($this->currentUser, 'anonymous') !== 0) { $options['auth'] = [$this->currentUser, $this->regularUser]; } if ($body instanceof TableNode) { @@ -307,21 +308,31 @@ trait BasicStructure { * @When Sending a :method to :url with requesttoken * @param string $method * @param string $url + * @param TableNode|array|null $body */ - public function sendingAToWithRequesttoken($method, $url) { + public function sendingAToWithRequesttoken($method, $url, $body = null) { $baseUrl = substr($this->baseUrl, 0, -5); + $options = [ + 'cookies' => $this->cookieJar, + 'headers' => [ + 'requesttoken' => $this->requestToken + ], + ]; + + if ($body instanceof TableNode) { + $fd = $body->getRowsHash(); + $options['form_params'] = $fd; + } elseif ($body) { + $options = array_merge($options, $body); + } + $client = new Client(); try { $this->response = $client->request( $method, $baseUrl . $url, - [ - 'cookies' => $this->cookieJar, - 'headers' => [ - 'requesttoken' => $this->requestToken - ] - ] + $options ); } catch (ClientException $e) { $this->response = $e->getResponse(); diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php index 19da7bc62c1..aa5a040161b 100644 --- a/build/integration/features/bootstrap/CapabilitiesContext.php +++ b/build/integration/features/bootstrap/CapabilitiesContext.php @@ -3,6 +3,7 @@ * * * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Joas Schilling <coding@schilljs.com> * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> * @author Robin Appelman <robin@icewind.nl> @@ -53,7 +54,7 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext { } $answeredValue = (string)$answeredValue; Assert::assertEquals( - $row['value']==="EMPTY" ? '' : $row['value'], + $row['value'] === "EMPTY" ? '' : $row['value'], $answeredValue, "Failed field " . $row['capability'] . " " . $row['path_to_element'] ); @@ -61,16 +62,16 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext { } protected function resetAppConfigs() { - $this->modifyServerConfig('core', 'shareapi_enabled', 'yes'); - $this->modifyServerConfig('core', 'shareapi_allow_links', 'yes'); - $this->modifyServerConfig('core', 'shareapi_allow_public_upload', 'yes'); - $this->modifyServerConfig('core', 'shareapi_allow_resharing', 'yes'); - $this->modifyServerConfig('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); - $this->modifyServerConfig('files_sharing', 'incoming_server2server_share_enabled', 'yes'); - $this->modifyServerConfig('core', 'shareapi_enforce_links_password', 'no'); - $this->modifyServerConfig('core', 'shareapi_allow_public_notification', 'no'); - $this->modifyServerConfig('core', 'shareapi_default_expire_date', 'no'); - $this->modifyServerConfig('core', 'shareapi_enforce_expire_date', 'no'); - $this->modifyServerConfig('core', 'shareapi_allow_group_sharing', 'yes'); + $this->deleteServerConfig('core', 'shareapi_enabled'); + $this->deleteServerConfig('core', 'shareapi_allow_links'); + $this->deleteServerConfig('core', 'shareapi_allow_public_upload'); + $this->deleteServerConfig('core', 'shareapi_allow_resharing'); + $this->deleteServerConfig('files_sharing', 'outgoing_server2server_share_enabled'); + $this->deleteServerConfig('files_sharing', 'incoming_server2server_share_enabled'); + $this->deleteServerConfig('core', 'shareapi_enforce_links_password'); + $this->deleteServerConfig('core', 'shareapi_allow_public_notification'); + $this->deleteServerConfig('core', 'shareapi_default_expire_date'); + $this->deleteServerConfig('core', 'shareapi_enforce_expire_date'); + $this->deleteServerConfig('core', 'shareapi_allow_group_sharing'); } } diff --git a/build/integration/features/bootstrap/CommandLine.php b/build/integration/features/bootstrap/CommandLine.php index 060e2b5be26..fa773ea91cd 100644 --- a/build/integration/features/bootstrap/CommandLine.php +++ b/build/integration/features/bootstrap/CommandLine.php @@ -3,9 +3,10 @@ * @copyright Copyright (c) 2016, ownCloud, Inc. * * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Joas Schilling <coding@schilljs.com> * @author Lukas Reschke <lukas@statuscode.ch> * @author Robin Appelman <robin@icewind.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * @@ -23,6 +24,8 @@ * */ +use PHPUnit\Framework\Assert; + require __DIR__ . '/../../vendor/autoload.php'; trait CommandLine { @@ -96,25 +99,6 @@ trait CommandLine { } /** - * Finds all lines containing the given text - * - * @param string $input stdout or stderr output - * @param string $text text to search for - * @return array array of lines that matched - */ - public function findLines($input, $text) { - $results = []; - // the exception text usually appears after an "[Exception"] row - foreach (explode("\n", $input) as $line) { - if (strpos($line, $text) >= 0) { - $results[] = $line; - } - } - - return $results; - } - - /** * @Then /^the command was successful$/ */ public function theCommandWasSuccessful() { @@ -158,19 +142,13 @@ trait CommandLine { * @Then /^the command output contains the text "([^"]*)"$/ */ public function theCommandOutputContainsTheText($text) { - $lines = $this->findLines($this->lastStdOut, $text); - if (empty($lines)) { - throw new \Exception('The command did not output the expected text on stdout "' . $exceptionText . '"'); - } + Assert::assertContains($text, $this->lastStdOut, 'The command did not output the expected text on stdout'); } /** * @Then /^the command error output contains the text "([^"]*)"$/ */ public function theCommandErrorOutputContainsTheText($text) { - $lines = $this->findLines($this->lastStdErr, $text); - if (empty($lines)) { - throw new \Exception('The command did not output the expected text on stderr "' . $exceptionText . '"'); - } + Assert::assertContains($text, $this->lastStdErr, 'The command did not output the expected text on stderr'); } } diff --git a/build/integration/features/bootstrap/CommandLineContext.php b/build/integration/features/bootstrap/CommandLineContext.php index 3acb59ec404..2c434a1b89f 100644 --- a/build/integration/features/bootstrap/CommandLineContext.php +++ b/build/integration/features/bootstrap/CommandLineContext.php @@ -3,10 +3,11 @@ * @copyright Copyright (c) 2016, ownCloud, Inc. * * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Lukas Reschke <lukas@statuscode.ch> * @author Stefan Weil <sw@weilnetz.de> * @author Sujith H <sharidasan@owncloud.com> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * @@ -27,6 +28,7 @@ require __DIR__ . '/../../vendor/autoload.php'; use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use PHPUnit\Framework\Assert; class CommandLineContext implements \Behat\Behat\Context\Context { use CommandLine; @@ -129,4 +131,11 @@ class CommandLineContext implements \Behat\Behat\Context\Context { $davPath = rtrim($davPath, '/') . $this->lastTransferPath; $this->featureContext->usingDavPath($davPath); } + + /** + * @Then /^transfer folder name contains "([^"]+)"$/ + */ + public function transferFolderNameContains($text) { + Assert::assertContains($text, $this->lastTransferPath); + } } diff --git a/build/integration/features/bootstrap/FakeSMTPHelper.php b/build/integration/features/bootstrap/FakeSMTPHelper.php index d8f6be4dc23..1cc1a5fe7a7 100644 --- a/build/integration/features/bootstrap/FakeSMTPHelper.php +++ b/build/integration/features/bootstrap/FakeSMTPHelper.php @@ -113,7 +113,7 @@ class fakeSMTP { $this->mail['emailBody'] = $splitmail[1]; $headers = preg_replace("/ \s+/", ' ', preg_replace("/\n\s/", ' ', $this->mail['emailHeaders'])); $headerlines = explode("\n", $headers); - for ($i=0; $i<count($headerlines); $i++) { + for ($i = 0; $i < count($headerlines); $i++) { if (preg_match('/^Subject: (.*)/i', $headerlines[$i], $matches)) { $this->mail['emailSubject'] = trim($matches[1]); } @@ -152,13 +152,13 @@ class fakeSMTP { return preg_match('/^[_a-z0-9-+]+(\.[_a-z0-9-+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', strtolower($email)); } - private function generateRandom($length=8) { + private function generateRandom($length = 8) { $password = ''; $possible = '2346789BCDFGHJKLMNPQRTVWXYZ'; $maxlength = strlen($possible); $i = 0; - for ($i=0; $i < $length; $i++) { - $char = substr($possible, mt_rand(0, $maxlength-1), 1); + for ($i = 0; $i < $length; $i++) { + $char = substr($possible, mt_rand(0, $maxlength - 1), 1); if (!strstr($password, $char)) { $password .= $char; } diff --git a/build/integration/features/bootstrap/FederationContext.php b/build/integration/features/bootstrap/FederationContext.php index 13e0de46187..41581110bdf 100644 --- a/build/integration/features/bootstrap/FederationContext.php +++ b/build/integration/features/bootstrap/FederationContext.php @@ -4,6 +4,7 @@ * * @author Bjoern Schiessle <bjoern@schiessle.org> * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Joas Schilling <coding@schilljs.com> * @author Robin Appelman <robin@icewind.nl> * @author Sergio Bertolin <sbertolin@solidgear.es> @@ -97,7 +98,7 @@ class FederationContext implements Context, SnippetAcceptingContext { } protected function resetAppConfigs() { - $this->modifyServerConfig('files_sharing', 'incoming_server2server_group_share_enabled', 'no'); - $this->modifyServerConfig('files_sharing', 'outgoing_server2server_group_share_enabled', 'no'); + $this->deleteServerConfig('files_sharing', 'incoming_server2server_group_share_enabled'); + $this->deleteServerConfig('files_sharing', 'outgoing_server2server_group_share_enabled'); } } diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php index daf5b11569c..0ec19f27c60 100644 --- a/build/integration/features/bootstrap/Provisioning.php +++ b/build/integration/features/bootstrap/Provisioning.php @@ -12,7 +12,7 @@ * @author Sergio Bertolin <sbertolin@solidgear.es> * @author Sergio BertolÃn <sbertolin@solidgear.es> * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -70,7 +70,7 @@ trait Provisioning { } /** - * @Given /^user "([^"]*)" with displayname "([^"]*)" exists$/ + * @Given /^user "([^"]*)" with displayname "((?:[^"]|\\")*)" exists$/ * @param string $user */ public function assureUserWithDisplaynameExists($user, $displayname) { @@ -173,6 +173,37 @@ trait Provisioning { } } + /** + * @Then /^search users by phone for region "([^"]*)" with$/ + * + * @param string $user + * @param \Behat\Gherkin\Node\TableNode|null $settings + */ + public function searchUserByPhone($region, \Behat\Gherkin\Node\TableNode $searchTable) { + $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/search/by-phone"; + $client = new Client(); + $options = []; + $options['auth'] = $this->adminUser; + $options['headers'] = [ + 'OCS-APIREQUEST' => 'true', + ]; + + $search = []; + foreach ($searchTable->getRows() as $row) { + if (!isset($search[$row[0]])) { + $search[$row[0]] = []; + } + $search[$row[0]][] = $row[1]; + } + + $options['form_params'] = [ + 'location' => $region, + 'search' => $search, + ]; + + $this->response = $client->post($fullUrl, $options); + } + public function createUser($user) { $previous_user = $this->currentUser; $this->currentUser = "admin"; @@ -422,7 +453,7 @@ trait Provisioning { 'groupid' => $group, ]; - $this->response =$client->post($fullUrl, $options); + $this->response = $client->post($fullUrl, $options); } @@ -561,6 +592,19 @@ trait Provisioning { } /** + * @Then /^phone matches returned are$/ + * @param \Behat\Gherkin\Node\TableNode|null $usersList + */ + public function thePhoneUsersShouldBe($usersList) { + if ($usersList instanceof \Behat\Gherkin\Node\TableNode) { + $users = $usersList->getRowsHash(); + $listCheckedElements = simplexml_load_string($this->response->getBody())->data; + $respondedArray = json_decode(json_encode($listCheckedElements), true); + Assert::assertEquals($users, $respondedArray); + } + } + + /** * @Then /^detailed users returned are$/ * @param \Behat\Gherkin\Node\TableNode|null $usersList */ diff --git a/build/integration/features/bootstrap/ShareesContext.php b/build/integration/features/bootstrap/ShareesContext.php index 64896a82009..c1db2d57e05 100644 --- a/build/integration/features/bootstrap/ShareesContext.php +++ b/build/integration/features/bootstrap/ShareesContext.php @@ -3,8 +3,8 @@ * * * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Joas Schilling <coding@schilljs.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> * * @license GNU AGPL version 3 or any later version * @@ -36,8 +36,8 @@ class ShareesContext implements Context, SnippetAcceptingContext { use AppConfiguration; protected function resetAppConfigs() { - $this->modifyServerConfig('core', 'shareapi_only_share_with_group_members', 'no'); - $this->modifyServerConfig('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'); - $this->modifyServerConfig('core', 'shareapi_allow_group_sharing', 'yes'); + $this->deleteServerConfig('core', 'shareapi_only_share_with_group_members'); + $this->deleteServerConfig('core', 'shareapi_allow_share_dialog_user_enumeration'); + $this->deleteServerConfig('core', 'shareapi_allow_group_sharing'); } } diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 4ce2e12e29d..c2d16f19e75 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -13,7 +13,7 @@ * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Sergio Bertolin <sbertolin@solidgear.es> * @author Sergio BertolÃn <sbertolin@solidgear.es> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license GNU AGPL version 3 or any later version * diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php index ab480dec4a3..b1a4c1aa48b 100644 --- a/build/integration/features/bootstrap/SharingContext.php +++ b/build/integration/features/bootstrap/SharingContext.php @@ -37,6 +37,13 @@ class SharingContext implements Context, SnippetAcceptingContext { use CommandLine; protected function resetAppConfigs() { - $this->modifyServerConfig('sharebymail', 'enforcePasswordProtection', 'no'); + $this->deleteServerConfig('core', 'shareapi_default_permissions'); + $this->deleteServerConfig('core', 'shareapi_default_internal_expire_date'); + $this->deleteServerConfig('core', 'shareapi_internal_expire_after_n_days'); + $this->deleteServerConfig('core', 'internal_defaultExpDays'); + $this->deleteServerConfig('core', 'shareapi_default_expire_date'); + $this->deleteServerConfig('core', 'shareapi_expire_after_n_days'); + $this->deleteServerConfig('core', 'link_defaultExpDays'); + $this->deleteServerConfig('sharebymail', 'enforcePasswordProtection'); } } diff --git a/build/integration/features/bootstrap/TagsContext.php b/build/integration/features/bootstrap/TagsContext.php index 4cc558dbdad..a490a5e6701 100644 --- a/build/integration/features/bootstrap/TagsContext.php +++ b/build/integration/features/bootstrap/TagsContext.php @@ -9,7 +9,7 @@ * @author Robin Appelman <robin@icewind.nl> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Sergio Bertolin <sbertolin@solidgear.es> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php index b68048e7cc9..3eb6ce812ec 100644 --- a/build/integration/features/bootstrap/Trashbin.php +++ b/build/integration/features/bootstrap/Trashbin.php @@ -4,7 +4,7 @@ * * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> * @author Robin Appelman <robin@icewind.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index e4ca972dbdb..de277b2278d 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -13,7 +13,7 @@ * @author Sergio Bertolin <sbertolin@solidgear.es> * @author Sergio BertolÃn <sbertolin@solidgear.es> * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license GNU AGPL version 3 or any later version * diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature index ecc33c657f4..717aa04e4bd 100644 --- a/build/integration/features/provisioning-v1.feature +++ b/build/integration/features/provisioning-v1.feature @@ -71,12 +71,12 @@ Feature: provisioning And the HTTP status code should be "200" And sending "PUT" to "/cloud/users/brand-new-user" with | key | email | - | value | brand-new-user@gmail.com | + | value | no-reply@nextcloud.com | And the OCS status code should be "100" And the HTTP status code should be "200" And sending "PUT" to "/cloud/users/brand-new-user" with | key | phone | - | value | 0123 456 789 | + | value | +49 711 / 25 24 28-90 | And the OCS status code should be "100" And the HTTP status code should be "200" And sending "PUT" to "/cloud/users/brand-new-user" with @@ -97,12 +97,29 @@ Feature: provisioning Then user "brand-new-user" has | id | brand-new-user | | displayname | Brand New User | - | email | brand-new-user@gmail.com | - | phone | 0123 456 789 | + | email | no-reply@nextcloud.com | + | phone | +4971125242890 | | address | Foo Bar Town | | website | https://nextcloud.com | | twitter | Nextcloud | + Scenario: Search by phone number + Given As an "admin" + And user "phone-user" exists + And sending "PUT" to "/cloud/users/phone-user" with + | key | phone | + | value | +49 711 / 25 24 28-90 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + Then search users by phone for region "DE" with + | random-string1 | 0711 / 123 456 78 | + | random-string1 | 0711 / 252 428-90 | + | random-string2 | 0711 / 90-824 252 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + Then phone matches returned are + | random-string1 | phone-user@localhost:8080 | + Scenario: Create a group Given As an "admin" And group "new-group" does not exist diff --git a/build/integration/features/transfer-ownership.feature b/build/integration/features/transfer-ownership.feature index 76e55af89a7..b18453cf3ec 100644 --- a/build/integration/features/transfer-ownership.feature +++ b/build/integration/features/transfer-ownership.feature @@ -29,6 +29,22 @@ Feature: transfer-ownership And using received transfer folder of "user1" as dav path And as "user1" the folder "/test" exists + Scenario: transferring ownership from user with risky display name + Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + When transferring ownership from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And transfer folder name contains "transferred from user0 -risky- ヂspḷay -na|-|e- on" + And using old dav path + And as "user0" the folder "/test" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + Scenario: transferring ownership of file shares Given user "user0" exists And user "user1" exists @@ -281,15 +297,29 @@ Feature: transfer-ownership Scenario: transferring ownership fails with invalid source user Given user "user0" exists When transferring ownership from "invalid_user" to "user0" - Then the command error output contains the text "Unknown source user" + Then the command output contains the text "Unknown source user" And the command failed with exit code 1 Scenario: transferring ownership fails with invalid target user Given user "user0" exists When transferring ownership from "user0" to "invalid_user" - Then the command error output contains the text "Unknown target user" + Then the command output contains the text "Unknown destination user invalid_user" And the command failed with exit code 1 + Scenario: transferring ownership of a file + Given user "user0" exists + And user "user1" exists + And User "user0" uploads file "data/textfile.txt" to "/somefile.txt" + When transferring ownership of path "somefile.txt" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the file "/somefile.txt" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the file "/somefile.txt" exists + Scenario: transferring ownership of a folder Given user "user0" exists And user "user1" exists @@ -305,6 +335,73 @@ Feature: transfer-ownership And using received transfer folder of "user1" as dav path And as "user1" the folder "/test" exists + Scenario: transferring ownership from user with risky display name + Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And transfer folder name contains "transferred from user0 -risky- ヂspḷay -na|-|e- on" + And using old dav path + And as "user0" the folder "/test" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + + Scenario: transferring ownership of path does not affect other files + Given user "user0" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + And User "user0" created a folder "/test2" + And User "user0" uploads file "data/textfile.txt" to "/test2/somefile.txt" + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the folder "/test" does not exist + And as "user0" the folder "/test2" exists + And as "user0" the file "/test2/somefile.txt" exists + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + And as "user1" the folder "/test2" does not exist + + Scenario: transferring ownership of path does not affect other shares + Given user "user0" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + And User "user0" created a folder "/test2" + And User "user0" uploads file "data/textfile.txt" to "/test2/sharedfile.txt" + And file "/test2/sharedfile.txt" of user "user0" is shared with user "user1" with permissions 19 + And user "user1" accepts last share + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the folder "/test" does not exist + And as "user0" the folder "/test2" exists + And as "user0" the file "/test2/sharedfile.txt" exists + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + And as "user1" the folder "/test2" does not exist + And using old dav path + And as "user1" the file "/sharedfile.txt" exists + And As an "user1" + And Getting info of last share + And the OCS status code should be "100" + And Share fields of last share match with + | uid_owner | user0 | + | uid_file_owner | user0 | + | share_with | user1 | + Scenario: transferring ownership of file shares Given user "user0" exists And user "user1" exists @@ -414,7 +511,7 @@ Feature: transfer-ownership And user "user2" accepts last share When transferring ownership of path "test" from "user0" to "user1" Then the command failed with exit code 1 - And the command error output contains the text "Could not transfer files." + And the command output contains the text "Could not transfer files." Scenario: transferring ownership does not transfer received shares Given user "user0" exists @@ -450,19 +547,19 @@ Feature: transfer-ownership Given user "user0" exists And User "user0" created a folder "/sub" When transferring ownership of path "sub" from "invalid_user" to "user0" - Then the command error output contains the text "Unknown source user" + Then the command output contains the text "Unknown source user" And the command failed with exit code 1 Scenario: transferring ownership fails with invalid target user Given user "user0" exists And User "user0" created a folder "/sub" When transferring ownership of path "sub" from "user0" to "invalid_user" - Then the command error output contains the text "Unknown target user" + Then the command output contains the text "Unknown destination user invalid_user" And the command failed with exit code 1 Scenario: transferring ownership fails with invalid path Given user "user0" exists And user "user1" exists When transferring ownership of path "test" from "user0" to "user1" - Then the command error output contains the text "Unknown target user" + Then the command output contains the text "Unknown path provided: test" And the command failed with exit code 1 diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature index 764cd857a3e..00a754d54d3 100644 --- a/build/integration/sharing_features/sharing-v1.feature +++ b/build/integration/sharing_features/sharing-v1.feature @@ -14,7 +14,7 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" And The following headers should be set - | Content-Security-Policy | default-src 'none';base-uri 'none';manifest-src 'self' | + | Content-Security-Policy | default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none' | Scenario: Creating a share with a group Given user "user0" exists @@ -357,6 +357,146 @@ Feature: sharing | url | AN_URL | | mimetype | httpd/unix-directory | + Scenario: Creating a new share of a file with default permissions + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "7" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | permissions | 3 | + + Scenario: Creating a new share of a folder with default permissions + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "7" + When creating a share with + | path | FOLDER | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | permissions | 7 | + + Scenario: Creating a new internal share with default expiration date + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + + Scenario: Creating a new internal share with relaxed default expiration date + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + And parameter "internal_defaultExpDays" of app "core" is set to "1" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +1 days | + + Scenario: Creating a new internal share with relaxed default expiration date too large + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + And parameter "internal_defaultExpDays" of app "core" is set to "10" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + + Scenario: Creating a new link share with default expiration date + Given user "user0" exists + And As an "user0" + And parameter "shareapi_default_expire_date" of app "core" is set to "yes" + And parameter "shareapi_expire_after_n_days" of app "core" is set to "3" + When creating a share with + | path | welcome.txt | + | shareType | 3 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + + Scenario: Creating a new link share with relaxed default expiration date + Given user "user0" exists + And As an "user0" + And parameter "shareapi_default_expire_date" of app "core" is set to "yes" + And parameter "shareapi_expire_after_n_days" of app "core" is set to "3" + And parameter "link_defaultExpDays" of app "core" is set to "1" + When creating a share with + | path | welcome.txt | + | shareType | 3 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +1 days | + + Scenario: Creating a new link share with relaxed default expiration date too large + Given user "user0" exists + And As an "user0" + And parameter "shareapi_default_expire_date" of app "core" is set to "yes" + And parameter "shareapi_expire_after_n_days" of app "core" is set to "3" + And parameter "link_defaultExpDays" of app "core" is set to "10" + When creating a share with + | path | welcome.txt | + | shareType | 3 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + Scenario: getting all shares of a user using that user Given user "user0" exists And user "user1" exists diff --git a/build/license.php b/build/license.php index 7bd9e1054c0..e736419e2ac 100644 --- a/build/license.php +++ b/build/license.php @@ -287,7 +287,7 @@ With help from many libraries and frameworks including: chdir($buildDir); } $timestampChanges = explode(PHP_EOL, $out); - $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges)-1); + $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges) - 1); foreach ($timestampChanges as $timestamp) { if ((int)$timestamp < $deadlineTimestamp) { return; diff --git a/build/package-lock.json b/build/package-lock.json index 5e9ba07ae73..2ce9cddfba5 100644 --- a/build/package-lock.json +++ b/build/package-lock.json @@ -1964,12 +1964,6 @@ "dev": true, "optional": true }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, @@ -2626,6 +2620,13 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "dev": true, + "optional": true + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -3064,9 +3065,9 @@ "dev": true }, "jsdoc": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.5.tgz", - "integrity": "sha512-SbY+i9ONuxSK35cgVHaI8O9senTE4CDYAmGSDJ5l3+sfe62Ff4gy96osy6OW84t4K4A8iGnMrlRrsSItSNp3RQ==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz", + "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==", "dev": true, "requires": { "@babel/parser": "^7.9.4", diff --git a/build/package.json b/build/package.json index 76f1035752e..a19da6842e0 100644 --- a/build/package.json +++ b/build/package.json @@ -14,7 +14,7 @@ "handlebars": "^4.7.6", "jasmine-core": "~2.5.2", "jasmine-sinon": "^0.4.0", - "jsdoc": "^3.6.5", + "jsdoc": "^3.6.6", "karma": "^3.1.4", "karma-coverage": "2.0.1", "karma-jasmine": "^1.1.2", diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index a8d98ea2c42..fbed4556196 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<files psalm-version="3.15@de6e7f324f44dde540ebe7ebd4eb481b97c86f30"> +<files psalm-version="4.2.1@ea9cb72143b77e7520c52fa37290bd8d8bc88fd9"> <file src="3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>string|null</code> @@ -41,21 +41,12 @@ <code>array</code> </LessSpecificImplementedReturnType> </file> - <file src="apps/accessibility/lib/Controller/AccessibilityController.php"> - <UndefinedThisPropertyAssignment occurrences="1"> - <code>$this->appRoot</code> - </UndefinedThisPropertyAssignment> - <UndefinedThisPropertyFetch occurrences="2"> - <code>$this->appRoot</code> - <code>$this->appRoot</code> - </UndefinedThisPropertyFetch> - </file> <file src="apps/cloud_federation_api/lib/Controller/RequestHandlerController.php"> <InvalidScalarArgument occurrences="1"> <code>$e->getCode()</code> </InvalidScalarArgument> <TypeDoesNotContainType occurrences="1"> - <code>is_array($notification)</code> + <code>!is_array($notification)</code> </TypeDoesNotContainType> </file> <file src="apps/comments/lib/JSSettingsHelper.php"> @@ -73,18 +64,11 @@ <code>\Sabre\Uri\split($this->principalUri)</code> </UndefinedFunction> </file> - <file src="apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php"> + <file src="apps/contactsinteraction/lib/Card.php"> <InvalidReturnType occurrences="1"> - <code>run</code> + <code>?string</code> </InvalidReturnType> </file> - <file src="apps/contactsinteraction/lib/Db/CardSearchDao.php"> - <ImplicitToStringCast occurrences="3"> - <code>$propQuery->createFunction($addressbooksQuery->getSQL())</code> - <code>$cardQuery->createFunction($propQuery->getSQL())</code> - <code>$cardQuery->createFunction($addressbooksQuery->getSQL())</code> - </ImplicitToStringCast> - </file> <file src="apps/dav/appinfo/v1/caldav.php"> <TooManyArguments occurrences="1"> <code>new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud')</code> @@ -103,8 +87,8 @@ </file> <file src="apps/dav/appinfo/v1/publicwebdav.php"> <InternalMethod occurrences="2"> - <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false)</code> <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog)</code> + <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false)</code> </InternalMethod> <UndefinedGlobalVariable occurrences="1"> <code>$baseuri</code> @@ -135,6 +119,9 @@ <InvalidOperand occurrences="1"> <code>$argv[5]</code> </InvalidOperand> + <InvalidScalarArgument occurrences="1"> + <code>$chunkSize</code> + </InvalidScalarArgument> <MissingFile occurrences="1"> <code>require '../../../../3rdparty/autoload.php'</code> </MissingFile> @@ -152,16 +139,6 @@ <code>Uri\split($this->principalInfo['uri'])</code> </UndefinedFunction> </file> - <file src="apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php"> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> - </file> - <file src="apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php"> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> - </file> <file src="apps/dav/lib/BackgroundJob/UploadCleanup.php"> <InvalidArgument occurrences="1"> <code>File</code> @@ -176,10 +153,10 @@ <code>setDateTime</code> </UndefinedMethod> <UndefinedPropertyFetch occurrences="4"> - <code>$newCalendarData->VEVENT->DTSTART</code> <code>$existingBirthday->VEVENT->DTSTART</code> - <code>$newCalendarData->VEVENT->SUMMARY</code> <code>$existingBirthday->VEVENT->SUMMARY</code> + <code>$newCalendarData->VEVENT->DTSTART</code> + <code>$newCalendarData->VEVENT->SUMMARY</code> </UndefinedPropertyFetch> </file> <file src="apps/dav/lib/CalDAV/CachedSubscription.php"> @@ -202,31 +179,21 @@ </NullableReturnStatement> </file> <file src="apps/dav/lib/CalDAV/CalDavBackend.php"> - <ImplicitToStringCast occurrences="8"> - <code>$query->createParameter('principaluri')</code> - <code>$query->createNamedParameter(self::ACCESS_PUBLIC)</code> - <code>$query->createNamedParameter(self::ACCESS_PUBLIC)</code> - <code>$query->createNamedParameter($value)</code> - <code>$query->createParameter('uri')</code> - <code>$outerQuery->createFunction($innerQuery->getSQL())</code> - <code>$calendarObjectIdQuery->createNamedParameter($componentTypes, IQueryBuilder::PARAM_STR_ARRAY)</code> - <code>$query->createNamedParameter($matches, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> <InvalidArgument occurrences="14"> + <code>'\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject'</code> <code>'\OCA\DAV\CalDAV\CalDavBackend::createCalendar'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCalendar'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar'</code> <code>'\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject'</code> <code>'\OCA\DAV\CalDAV\CalDavBackend::createSubscription'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::updateSubscription'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject'</code> <code>'\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription'</code> - <code>'\OCA\DAV\CalDAV\CalDavBackend::updateShares'</code> <code>'\OCA\DAV\CalDAV\CalDavBackend::publishCalendar'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCalendar'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::updateShares'</code> + <code>'\OCA\DAV\CalDAV\CalDavBackend::updateSubscription'</code> </InvalidArgument> <InvalidNullableReturnType occurrences="2"> <code>array</code> @@ -250,35 +217,30 @@ <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> - <code>purgeProperties</code> <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> + <code>purgeProperties</code> </TooManyArguments> <UndefinedFunction occurrences="4"> + <code>Uri\split($principalUri)</code> <code>Uri\split($row['principaluri'])</code> <code>Uri\split($row['principaluri'])</code> <code>Uri\split($row['principaluri'])</code> - <code>Uri\split($principalUri)</code> </UndefinedFunction> </file> - <file src="apps/dav/lib/CalDAV/Calendar.php"> - <NullableReturnStatement occurrences="1"> - <code>parent::getOwner()</code> - </NullableReturnStatement> - </file> <file src="apps/dav/lib/CalDAV/CalendarHome.php"> <InvalidClass occurrences="1"> <code>\Sabre\CalDAv\Notifications\Collection</code> </InvalidClass> <InvalidReturnStatement occurrences="5"> + <code>$calendarPlugin->getCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri)</code> <code>new Inbox($this->caldavBackend, $this->principalInfo['uri'])</code> <code>new Outbox($this->config, $this->principalInfo['uri'])</code> - <code>new \Sabre\CalDAv\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri'])</code> <code>new Subscription($this->caldavBackend, $subscription)</code> - <code>$calendarPlugin->getCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri)</code> + <code>new \Sabre\CalDAv\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri'])</code> </InvalidReturnStatement> <InvalidReturnType occurrences="1"> <code>getChild</code> @@ -310,26 +272,32 @@ <code>$paths</code> </MoreSpecificImplementedParamType> </file> + <file src="apps/dav/lib/CalDAV/Publishing/PublishPlugin.php"> + <InvalidOperand occurrences="2"> + <code>$canPublish</code> + <code>$canShare</code> + </InvalidOperand> + </file> <file src="apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php"> <UndefinedMethod occurrences="3"> - <code>isFloating</code> <code>hasTime</code> <code>isFloating</code> + <code>isFloating</code> </UndefinedMethod> </file> <file src="apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php"> <FalsableReturnStatement occurrences="4"> - <code>$l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> <code>$l10n->l('date', $dt, ['width' => 'medium'])</code> <code>$l10n->l('datetime', $dt, ['width' => 'medium|short'])</code> <code>$l10n->l('time', $dt, ['width' => 'short'])</code> + <code>$l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> </FalsableReturnStatement> <InvalidReturnStatement occurrences="5"> - <code>[$organizerEMail => $name]</code> - <code>$l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> <code>$l10n->l('date', $dt, ['width' => 'medium'])</code> <code>$l10n->l('datetime', $dt, ['width' => 'medium|short'])</code> <code>$l10n->l('time', $dt, ['width' => 'short'])</code> + <code>$l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> + <code>[$organizerEMail => $name]</code> </InvalidReturnStatement> <InvalidReturnType occurrences="5"> <code>array|null</code> @@ -340,22 +308,22 @@ </InvalidReturnType> <UndefinedMethod occurrences="3"> <code>getDateTime</code> - <code>isFloating</code> <code>getDateTime</code> + <code>isFloating</code> </UndefinedMethod> </file> <file src="apps/dav/lib/CalDAV/Reminder/Notifier.php"> <FalsableReturnStatement occurrences="4"> - <code>$this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> <code>$this->l10n->l('date', $dt, ['width' => 'medium'])</code> <code>$this->l10n->l('datetime', $dt, ['width' => 'medium|short'])</code> <code>$this->l10n->l('time', $dt, ['width' => 'short'])</code> + <code>$this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> </FalsableReturnStatement> <InvalidReturnStatement occurrences="4"> - <code>$this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> <code>$this->l10n->l('date', $dt, ['width' => 'medium'])</code> <code>$this->l10n->l('datetime', $dt, ['width' => 'medium|short'])</code> <code>$this->l10n->l('time', $dt, ['width' => 'short'])</code> + <code>$this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated'])</code> </InvalidReturnStatement> <InvalidReturnType occurrences="4"> <code>string</code> @@ -397,33 +365,36 @@ </UndefinedFunction> </file> <file src="apps/dav/lib/CalDAV/Schedule/IMipPlugin.php"> - <ImplicitToStringCast occurrences="2"/> + <ImplicitToStringCast occurrences="2"> + <code>$vevent->LOCATION</code> + <code>$vevent->SUMMARY</code> + </ImplicitToStringCast> <InvalidNullableReturnType occurrences="1"> <code>string</code> </InvalidNullableReturnType> <InvalidScalarArgument occurrences="2"> - <code>[$sender => $senderName]</code> <code>[$recipient => $recipientName]</code> + <code>[$sender => $senderName]</code> </InvalidScalarArgument> <NullableReturnStatement occurrences="1"> <code>$lang->getValue()</code> </NullableReturnStatement> <UndefinedMethod occurrences="15"> - <code>isFloating</code> <code>getDateTime</code> - <code>setDateTime</code> - <code>hasTime</code> - <code>isFloating</code> <code>getDateTime</code> - <code>setDateTime</code> <code>getDateTime</code> <code>getDateTime</code> <code>getDateTime</code> - <code>hasTime</code> <code>getDateTime</code> <code>getDateTime</code> <code>getDateTime</code> + <code>hasTime</code> + <code>hasTime</code> + <code>isFloating</code> <code>isFloating</code> + <code>isFloating</code> + <code>setDateTime</code> + <code>setDateTime</code> </UndefinedMethod> <UndefinedPropertyFetch occurrences="1"> <code>$iTipMessage->message->VEVENT->SUMMARY</code> @@ -438,14 +409,14 @@ <code>split($principalUrl)</code> </UndefinedFunction> <UndefinedInterfaceMethod occurrences="2"> - <code>getChildren</code> <code>get</code> + <code>getChildren</code> </UndefinedInterfaceMethod> <UndefinedMethod occurrences="5"> <code>getDateTime</code> - <code>isFloating</code> <code>hasTime</code> <code>isFloating</code> + <code>isFloating</code> <code>principalSearch</code> </UndefinedMethod> </file> @@ -462,9 +433,9 @@ </file> <file src="apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php"> <TypeDoesNotContainType occurrences="3"> - <code>is_array($newProps['filters']['comps'])</code> - <code>is_array($newProps['filters']['props'])</code> - <code>is_array($newProps['filters']['params'])</code> + <code>!is_array($newProps['filters']['comps'])</code> + <code>!is_array($newProps['filters']['params'])</code> + <code>!is_array($newProps['filters']['props'])</code> </TypeDoesNotContainType> </file> <file src="apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php"> @@ -472,11 +443,6 @@ <code>$webcalData</code> </InvalidArgument> </file> - <file src="apps/dav/lib/CardDAV/AddressBook.php"> - <NullableReturnStatement occurrences="1"> - <code>parent::getOwner()</code> - </NullableReturnStatement> - </file> <file src="apps/dav/lib/CardDAV/AddressBookImpl.php"> <InvalidArgument occurrences="1"> <code>$id</code> @@ -490,15 +456,10 @@ <FalsableReturnStatement occurrences="1"> <code>false</code> </FalsableReturnStatement> - <ImplicitToStringCast occurrences="3"> - <code>$query->createParameter('principaluri')</code> - <code>$query->createParameter('uri')</code> - <code>$query->createNamedParameter($matches, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> <InvalidArgument occurrences="3"> <code>'\OCA\DAV\CardDAV\CardDavBackend::createCard'</code> - <code>'\OCA\DAV\CardDAV\CardDavBackend::updateCard'</code> <code>'\OCA\DAV\CardDAV\CardDavBackend::deleteCard'</code> + <code>'\OCA\DAV\CardDAV\CardDavBackend::updateCard'</code> </InvalidArgument> <InvalidNullableReturnType occurrences="1"> <code>array</code> @@ -518,8 +479,8 @@ <code>$addressBooks[$row['id']][$readOnlyPropertyName] === 0</code> </TypeDoesNotContainType> <UndefinedFunction occurrences="2"> - <code>\Sabre\Uri\split($row['principaluri'])</code> <code>\Sabre\Uri\split($principalUri)</code> + <code>\Sabre\Uri\split($row['principaluri'])</code> </UndefinedFunction> </file> <file src="apps/dav/lib/CardDAV/MultiGetExportPlugin.php"> @@ -552,13 +513,10 @@ <InvalidScalarArgument occurrences="1"> <code>$targetBookId</code> </InvalidScalarArgument> - <NullArgument occurrences="1"> - <code>null</code> - </NullArgument> </file> <file src="apps/dav/lib/CardDAV/SystemAddressbook.php"> <RedundantCondition occurrences="1"> - <code>$shareEnumeration && $restrictShareEnumeration</code> + <code>$shareEnumeration</code> </RedundantCondition> </file> <file src="apps/dav/lib/CardDAV/UserAddressBooks.php"> @@ -599,7 +557,7 @@ </file> <file src="apps/dav/lib/Comments/EntityTypeCollection.php"> <TypeDoesNotContainType occurrences="1"> - <code>is_string($name)</code> + <code>!is_string($name)</code> </TypeDoesNotContainType> </file> <file src="apps/dav/lib/Comments/RootCollection.php"> @@ -647,9 +605,6 @@ <InvalidScalarArgument occurrences="1"> <code>$node->getId()</code> </InvalidScalarArgument> - <UndefinedFunction occurrences="1"> - <code>\Sabre\Uri\split($node->getPath())</code> - </UndefinedFunction> </file> <file src="apps/dav/lib/Connector/Sabre/Directory.php"> <InvalidPropertyAssignmentValue occurrences="1"> @@ -697,9 +652,9 @@ </file> <file src="apps/dav/lib/Connector/Sabre/FilesPlugin.php"> <UndefinedFunction occurrences="3"> - <code>\Sabre\Uri\split($source)</code> <code>\Sabre\Uri\split($destination)</code> <code>\Sabre\Uri\split($filePath)</code> + <code>\Sabre\Uri\split($source)</code> </UndefinedFunction> </file> <file src="apps/dav/lib/Connector/Sabre/FilesReportPlugin.php"> @@ -720,8 +675,8 @@ <code>\OCA\Circles\Api\v1\Circles</code> </UndefinedClass> <UndefinedInterfaceMethod occurrences="2"> - <code>getPath</code> <code>getById</code> + <code>getPath</code> </UndefinedInterfaceMethod> </file> <file src="apps/dav/lib/Connector/Sabre/Node.php"> @@ -737,15 +692,15 @@ <code>$this->info->getId()</code> </NullableReturnStatement> <UndefinedFunction occurrences="2"> - <code>\Sabre\Uri\split($this->path)</code> <code>\Sabre\Uri\split($name)</code> + <code>\Sabre\Uri\split($this->path)</code> </UndefinedFunction> </file> <file src="apps/dav/lib/Connector/Sabre/ObjectTree.php"> <UndefinedFunction occurrences="3"> - <code>\Sabre\Uri\split($path)</code> <code>\Sabre\Uri\split($destinationPath)</code> <code>\Sabre\Uri\split($destinationPath)</code> + <code>\Sabre\Uri\split($path)</code> </UndefinedFunction> </file> <file src="apps/dav/lib/Connector/Sabre/Principal.php"> @@ -758,8 +713,7 @@ <InvalidReturnType occurrences="1"> <code>string[]</code> </InvalidReturnType> - <NullableReturnStatement occurrences="9"> - <code>null</code> + <NullableReturnStatement occurrences="8"> <code>$this->circleToPrincipal($name)</code> <code>null</code> <code>null</code> @@ -817,9 +771,9 @@ <UndefinedInterfaceMethod occurrences="5"> <code>getId</code> <code>getId</code> + <code>getId</code> <code>getPath</code> <code>getPath</code> - <code>getId</code> </UndefinedInterfaceMethod> <UndefinedPropertyAssignment occurrences="1"> <code>$server->xml->namespacesMap</code> @@ -908,8 +862,8 @@ </file> <file src="apps/dav/lib/Files/FileSearchBackend.php"> <InvalidArgument occurrences="2"> - <code>$operator->arguments</code> <code>$argument</code> + <code>$operator->arguments</code> </InvalidArgument> <InvalidReturnStatement occurrences="1"> <code>$value</code> @@ -917,6 +871,9 @@ <InvalidReturnType occurrences="1"> <code>?string</code> </InvalidReturnType> + <UndefinedDocblockClass occurrences="1"> + <code>$operator->arguments[0]->name</code> + </UndefinedDocblockClass> <UndefinedPropertyFetch occurrences="1"> <code>$operator->arguments[0]->name</code> </UndefinedPropertyFetch> @@ -945,11 +902,6 @@ <code>$this->usersToDelete</code> </InvalidPropertyAssignmentValue> </file> - <file src="apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->createParameter('ids')</code> - </ImplicitToStringCast> - </file> <file src="apps/dav/lib/RootCollection.php"> <UndefinedPropertyAssignment occurrences="1"> <code>$publicCalendarRoot->disableListing</code> @@ -969,12 +921,12 @@ <UndefinedMethod occurrences="9"> <code>getDateTime</code> <code>getDateTime</code> - <code>isFloating</code> <code>getDateTime</code> - <code>setDateTime</code> + <code>getDateTime</code> <code>hasTime</code> <code>isFloating</code> - <code>getDateTime</code> + <code>isFloating</code> + <code>setDateTime</code> <code>setDateTime</code> </UndefinedMethod> </file> @@ -987,8 +939,8 @@ </file> <file src="apps/dav/lib/Server.php"> <InvalidArgument occurrences="2"> - <code>'OCA\DAV\Connector\Sabre::authInit'</code> <code>'OCA\DAV\Connector\Sabre::addPlugin'</code> + <code>'OCA\DAV\Connector\Sabre::authInit'</code> </InvalidArgument> <TooManyArguments occurrences="3"> <code>dispatch</code> @@ -1036,15 +988,15 @@ <code>$members</code> </MoreSpecificImplementedParamType> <UndefinedFunction occurrences="9"> + <code>\Sabre\Uri\split($member)</code> <code>\Sabre\Uri\split($principal)</code> <code>\Sabre\Uri\split($principal)</code> <code>\Sabre\Uri\split($principalUri)</code> - <code>\Sabre\Uri\split($member)</code> <code>\Sabre\Uri\split($principalUri)</code> - <code>\Sabre\Uri\split($realPrincipalUri)</code> <code>\Sabre\Uri\split($principalUri)</code> <code>\Sabre\Uri\split($principalUri)</code> <code>\Sabre\Uri\split($principalUri)</code> + <code>\Sabre\Uri\split($realPrincipalUri)</code> </UndefinedFunction> </file> <file src="apps/dav/lib/Upload/AssemblyStream.php"> @@ -1070,31 +1022,37 @@ </UndefinedFunction> </file> <file src="apps/encryption/lib/Command/ScanLegacyFormat.php"> + <InvalidOperand occurrences="1"> + <code>$result</code> + </InvalidOperand> <RedundantCondition occurrences="1"> <code>$result</code> </RedundantCondition> </file> <file src="apps/encryption/lib/Crypto/Crypt.php"> <RedundantCondition occurrences="1"> - <code>$userSession && $userSession->isLoggedIn()</code> + <code>$userSession</code> </RedundantCondition> + <TypeDoesNotContainType occurrences="2"> + <code>get_class($res) === 'OpenSSLAsymmetricKey'</code> + <code>is_object($res)</code> + </TypeDoesNotContainType> </file> <file src="apps/encryption/lib/Crypto/EncryptAll.php"> <InvalidArgument occurrences="1"> <code>[$to => $recipientDisplayName]</code> </InvalidArgument> <UndefinedInterfaceMethod occurrences="3"> - <code>setSubject</code> <code>setHtmlBody</code> <code>setPlainBody</code> + <code>setSubject</code> </UndefinedInterfaceMethod> </file> <file src="apps/encryption/lib/Crypto/Encryption.php"> <FalsableReturnStatement occurrences="1"> <code>$result</code> </FalsableReturnStatement> - <ImplementedParamTypeMismatch occurrences="3"> - <code>$position</code> + <ImplementedParamTypeMismatch occurrences="2"> <code>$position</code> <code>$position</code> </ImplementedParamTypeMismatch> @@ -1112,18 +1070,18 @@ <code>throw $exception;</code> </InvalidThrow> <RedundantCondition occurrences="2"> - <code>$userSession && $userSession->isLoggedIn()</code> - <code>$encryptedFileKey && $shareKey</code> + <code>$encryptedFileKey</code> + <code>$userSession</code> </RedundantCondition> </file> <file src="apps/encryption/lib/Recovery.php"> <InvalidScalarArgument occurrences="3"> - <code>1</code> <code>0</code> <code>0</code> + <code>1</code> </InvalidScalarArgument> <RedundantCondition occurrences="1"> - <code>$userSession && $userSession->isLoggedIn()</code> + <code>$userSession</code> </RedundantCondition> </file> <file src="apps/encryption/lib/Session.php"> @@ -1131,85 +1089,43 @@ <code>new Exceptions\PrivateKeyMissingException('please try to log-out and log-in again', 0)</code> </TooManyArguments> </file> - <file src="apps/encryption/lib/Users/Setup.php"> - <RedundantCondition occurrences="1"> - <code>$userSession && $userSession->isLoggedIn()</code> - </RedundantCondition> - </file> <file src="apps/encryption/lib/Util.php"> <RedundantCondition occurrences="1"> - <code>$userSession && $userSession->isLoggedIn()</code> + <code>$userSession</code> </RedundantCondition> </file> - <file src="apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php"> - <MoreSpecificImplementedParamType occurrences="1"> - <code>$jobList</code> - </MoreSpecificImplementedParamType> - <TooFewArguments occurrences="1"/> - </file> <file src="apps/federatedfilesharing/lib/Controller/RequestHandlerController.php"> <InvalidScalarArgument occurrences="7"> - <code>$remoteId</code> <code>$id</code> <code>$id</code> <code>$id</code> <code>$id</code> <code>$id</code> <code>$id</code> + <code>$remoteId</code> </InvalidScalarArgument> - <RedundantCondition occurrences="1"/> - <TypeDoesNotContainNull occurrences="2"> + <TypeDoesNotContainNull occurrences="3"> <code>$permission === null</code> <code>$remoteId === null</code> </TypeDoesNotContainNull> </file> <file src="apps/federatedfilesharing/lib/FederatedShareProvider.php"> - <ImplicitToStringCast occurrences="17"> - <code>$qb->createNamedParameter($shareType)</code> - <code>$qb->createNamedParameter($itemType)</code> - <code>$qb->createNamedParameter($itemSource)</code> - <code>$qb->createNamedParameter($itemSource)</code> - <code>$qb->createNamedParameter($shareWith)</code> - <code>$qb->createNamedParameter($uidOwner)</code> - <code>$qb->createNamedParameter($sharedBy)</code> - <code>$qb->createNamedParameter($permissions)</code> - <code>$qb->createNamedParameter($token)</code> - <code>$qb->createNamedParameter(time())</code> - <code>$qb->createNamedParameter('')</code> - <code>$qb->createNamedParameter($this->supportedShareType, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($this->supportedShareType, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($this->supportedShareType, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($this->supportedShareType, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($this->supportedShareType, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> - <InvalidArrayAccess occurrences="2"> - <code>$token</code> - <code>$remoteId</code> - </InvalidArrayAccess> - <InvalidArrayOffset occurrences="1"> - <code>list($token, $remoteId)</code> - </InvalidArrayOffset> <InvalidReturnStatement occurrences="1"> <code>$shares</code> </InvalidReturnStatement> <InvalidReturnType occurrences="1"> <code>getSharesInFolder</code> </InvalidReturnType> - <InvalidScalarArgument occurrences="6"> + <InvalidScalarArgument occurrences="5"> <code>$shareId</code> <code>$shareId</code> <code>$shareId</code> <code>$shareId</code> - <code>$share->getId()</code> <code>(int)$data['id']</code> </InvalidScalarArgument> </file> <file src="apps/federatedfilesharing/lib/Notifications.php"> - <InvalidReturnStatement occurrences="2"> - <code>[$ocmResult['token'], $ocmResult['providerId']]</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="4"> + <InvalidReturnType occurrences="3"> <code>bool</code> <code>bool</code> <code>bool</code> @@ -1223,14 +1139,13 @@ <InvalidReturnType occurrences="1"> <code>string</code> </InvalidReturnType> - <InvalidScalarArgument occurrences="7"> - <code>$remoteId</code> + <InvalidScalarArgument occurrences="6"> <code>$id</code> <code>$id</code> <code>$id</code> - <code>(int)$share['id']</code> <code>$id</code> <code>$id</code> + <code>(int)$share['id']</code> </InvalidScalarArgument> </file> <file src="apps/federatedfilesharing/lib/Settings/Personal.php"> @@ -1241,16 +1156,6 @@ <code>null</code> </NullableReturnStatement> </file> - <file src="apps/federation/lib/BackgroundJob/GetSharedSecret.php"> - <MoreSpecificImplementedParamType occurrences="1"> - <code>$jobList</code> - </MoreSpecificImplementedParamType> - </file> - <file src="apps/federation/lib/BackgroundJob/RequestSharedSecret.php"> - <MoreSpecificImplementedParamType occurrences="1"> - <code>$jobList</code> - </MoreSpecificImplementedParamType> - </file> <file src="apps/federation/lib/TrustedServers.php"> <InvalidArgument occurrences="1"> <code>'OCP\Federation\TrustedServerEvent::remove'</code> @@ -1278,11 +1183,6 @@ <code>$this</code> </InvalidScope> </file> - <file src="apps/files/lib/Activity/Filter/Favorites.php"> - <ImplicitToStringCast occurrences="1"> - <code>$query->createNamedParameter($favorites['items'], IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> - </file> <file src="apps/files/lib/Activity/Provider.php"> <FalsableReturnStatement occurrences="1"> <code>$this->fileEncrypted[$fileId]</code> @@ -1305,13 +1205,6 @@ <code>10 * 1024 * 1024</code> </InvalidScalarArgument> </file> - <file src="apps/files/lib/BackgroundJob/ScanFiles.php"> - <InvalidScalarArgument occurrences="3"> - <code>0</code> - <code>$offset</code> - <code>$offset</code> - </InvalidScalarArgument> - </file> <file src="apps/files/lib/Command/Scan.php"> <InvalidReturnStatement occurrences="1"> <code>$connection</code> @@ -1348,8 +1241,8 @@ <code>$templateId</code> </InvalidArgument> <UndefinedInterfaceMethod occurrences="2"> - <code>open</code> <code>getTemplates</code> + <code>open</code> </UndefinedInterfaceMethod> </file> <file src="apps/files/lib/Controller/ViewController.php"> @@ -1414,11 +1307,6 @@ <code>$this</code> </InvalidScope> </file> - <file src="apps/files_external/lib/BackgroundJob/CredentialsCleanup.php"> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> - </file> <file src="apps/files_external/lib/Command/Applicable.php"> <InvalidArgument occurrences="1"> <code>$mountId</code> @@ -1439,9 +1327,6 @@ </NullArgument> </file> <file src="apps/files_external/lib/Command/Notify.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->createNamedParameter($storageIds, IQueryBuilder::PARAM_INT_ARRAY, ':storage_ids')</code> - </ImplicitToStringCast> <InvalidArgument occurrences="2"> <code>$input->getArgument('mount_id')</code> <code>$storage</code> @@ -1462,8 +1347,8 @@ <code>$mountId</code> </InvalidArgument> <InvalidScalarArgument occurrences="2"> - <code>$status</code> <code>$e->getCode()</code> + <code>$status</code> </InvalidScalarArgument> </file> <file src="apps/files_external/lib/Config/ConfigAdapter.php"> @@ -1473,10 +1358,10 @@ </file> <file src="apps/files_external/lib/Controller/StoragesController.php"> <InvalidScalarArgument occurrences="4"> + <code>$e->getCode()</code> + <code>$status</code> <code>$this->service->getVisibilityType()</code> <code>$this->service->getVisibilityType()</code> - <code>$status</code> - <code>$e->getCode()</code> </InvalidScalarArgument> </file> <file src="apps/files_external/lib/Controller/UserGlobalStoragesController.php"> @@ -1503,8 +1388,8 @@ </file> <file src="apps/files_external/lib/Lib/IdentifierTrait.php"> <UndefinedDocblockClass occurrences="2"> - <code>IdentifierTrait</code> <code>$this->deprecateTo</code> + <code>IdentifierTrait</code> </UndefinedDocblockClass> </file> <file src="apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php"> @@ -1622,9 +1507,6 @@ <code>filetype</code> <code>fopen</code> </InvalidNullableReturnType> - <UndefinedInterfaceMethod occurrences="1"> - <code>$content</code> - </UndefinedInterfaceMethod> </file> <file src="apps/files_external/lib/Migration/DummyUserSession.php"> <InvalidReturnType occurrences="1"> @@ -1633,10 +1515,10 @@ </file> <file src="apps/files_external/lib/MountConfig.php"> <InternalMethod occurrences="4"> - <code>setIV</code> + <code>decrypt</code> <code>encrypt</code> <code>setIV</code> - <code>decrypt</code> + <code>setIV</code> </InternalMethod> <InvalidNullableReturnType occurrences="1"> <code>string</code> @@ -1663,18 +1545,6 @@ </TooManyArguments> </file> <file src="apps/files_external/lib/Service/DBConfigService.php"> - <ImplicitToStringCast occurrences="10"> - <code>$builder->createNamedParameter($groupIds, IQueryBuilder::PARAM_STR_ARRAY)</code> - <code>$builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)</code> - <code>$builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)</code> - <code>$builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)</code> - <code>$builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)</code> - <code>$builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)</code> - <code>$builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR)</code> - <code>$builder->createNamedParameter($mountId)</code> - <code>$builder->createNamedParameter($type)</code> - <code>$builder->createNamedParameter($value)</code> - </ImplicitToStringCast> <NullableReturnStatement occurrences="1"> <code>null</code> </NullableReturnStatement> @@ -1718,20 +1588,17 @@ <FalsableReturnStatement occurrences="1"> <code>false</code> </FalsableReturnStatement> + <InvalidReturnStatement occurrences="2"> + <code>$entry</code> + <code>$this->formatCacheEntry(clone $this->sourceRootInfo, '')</code> + </InvalidReturnStatement> + <InvalidReturnType occurrences="2"> + <code>formatCacheEntry</code> + <code>get</code> + </InvalidReturnType> <NullArgument occurrences="1"> <code>null</code> </NullArgument> - <UndefinedInterfaceMethod occurrences="9"> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - </UndefinedInterfaceMethod> </file> <file src="apps/files_sharing/lib/Capabilities.php"> <InvalidScalarArgument occurrences="1"> @@ -1743,23 +1610,11 @@ <code>getUserFolder</code> </UndefinedInterfaceMethod> </file> - <file src="apps/files_sharing/lib/Controller/DeletedShareAPIController.php"> - <UndefinedDocblockClass occurrences="2"> - <code>$this->getRoomShareHelper()</code> - <code>\OCA\Talk\Share\Helper\DeletedShareAPIController</code> - </UndefinedDocblockClass> - </file> - <file src="apps/files_sharing/lib/Controller/ExternalSharesController.php"> - <InvalidArgument occurrences="2"> - <code>'https'</code> - <code>'http'</code> - </InvalidArgument> - </file> <file src="apps/files_sharing/lib/Controller/ShareAPIController.php"> <InvalidScalarArgument occurrences="3"> - <code>Constants::PERMISSION_ALL</code> <code>$code</code> <code>$code</code> + <code>Constants::PERMISSION_ALL</code> </InvalidScalarArgument> <NullArgument occurrences="1"> <code>null</code> @@ -1779,14 +1634,13 @@ </UndefinedDocblockClass> </file> <file src="apps/files_sharing/lib/Controller/ShareController.php"> - <InvalidArgument occurrences="2"> - <code>'Share is read-only'</code> + <InvalidArgument occurrences="1"> <code>$files_list</code> </InvalidArgument> <InvalidScalarArgument occurrences="3"> + <code>$freeSpace</code> <code>$maxUploadFilesize</code> <code>$maxUploadFilesize</code> - <code>$freeSpace</code> </InvalidScalarArgument> <NullArgument occurrences="1"> <code>null</code> @@ -1797,23 +1651,7 @@ <code>$password</code> </NullArgument> </file> - <file src="apps/files_sharing/lib/ExpireSharesJob.php"> - <NullArgument occurrences="1"> - <code>null</code> - </NullArgument> - </file> - <file src="apps/files_sharing/lib/External/Cache.php"> - <UndefinedInterfaceMethod occurrences="4"> - <code>$result</code> - <code>$result</code> - <code>$result</code> - <code>$file</code> - </UndefinedInterfaceMethod> - </file> <file src="apps/files_sharing/lib/External/Manager.php"> - <ImplicitToStringCast occurrences="1"> - <code>$query->createFunction('(' . $select . ')')</code> - </ImplicitToStringCast> <InvalidScalarArgument occurrences="1"> <code>(int) $remoteShare</code> </InvalidScalarArgument> @@ -1825,8 +1663,8 @@ </file> <file src="apps/files_sharing/lib/External/Scanner.php"> <InvalidNullableReturnType occurrences="2"> - <code>scan</code> <code>array</code> + <code>scan</code> </InvalidNullableReturnType> <InvalidScalarArgument occurrences="1"> <code>$recursive</code> @@ -1834,10 +1672,6 @@ <MoreSpecificImplementedParamType occurrences="1"> <code>$cacheData</code> </MoreSpecificImplementedParamType> - <UndefinedInterfaceMethod occurrences="2"> - <code>$existingChild</code> - <code>$existingChild</code> - </UndefinedInterfaceMethod> </file> <file src="apps/files_sharing/lib/External/Storage.php"> <InvalidReturnStatement occurrences="1"> @@ -1863,11 +1697,6 @@ <code>NotFoundResponse</code> </InvalidReturnType> </file> - <file src="apps/files_sharing/lib/Migration/SetAcceptedStatus.php"> - <ImplicitToStringCast occurrences="1"> - <code>$query->createNamedParameter([IShare::TYPE_USER, IShare::TYPE_GROUP, IShare::TYPE_USERGROUP], IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> - </file> <file src="apps/files_sharing/lib/Scanner.php"> <InvalidNullableReturnType occurrences="1"> <code>array</code> @@ -1897,28 +1726,27 @@ </file> <file src="apps/files_sharing/lib/SharedStorage.php"> <FalsableReturnStatement occurrences="5"> + <code>$this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode)</code> <code>$this->sourceRootInfo</code> <code>false</code> <code>false</code> <code>false</code> - <code>$this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode)</code> - <code>false</code> </FalsableReturnStatement> <InvalidNullableReturnType occurrences="1"> <code>ICacheEntry</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="5"> <code>$this->getPermissions($path) & \OCP\Constants::PERMISSION_CREATE</code> - <code>$this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE</code> <code>$this->getPermissions($path) & \OCP\Constants::PERMISSION_DELETE</code> <code>$this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE</code> + <code>$this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE</code> <code>new FailedCache()</code> </InvalidReturnStatement> <InvalidReturnType occurrences="4"> <code>isCreatable</code> - <code>isUpdatable</code> <code>isDeletable</code> <code>isSharable</code> + <code>isUpdatable</code> </InvalidReturnType> <NullableReturnStatement occurrences="1"> <code>$this->sourceRootInfo</code> @@ -1941,9 +1769,6 @@ </InvalidArgument> <TooManyArguments occurrences="1"> <code>dispatch</code> - <code>dispatch</code> - <code>dispatch</code> - <code>dispatch</code> </TooManyArguments> </file> <file src="apps/files_trashbin/lib/Sabre/AbstractTrash.php"> @@ -1955,9 +1780,6 @@ </NullableReturnStatement> </file> <file src="apps/files_trashbin/lib/Sabre/AbstractTrashFolder.php"> - <ImplementedReturnTypeMismatch occurrences="1"> - <code>ITrash</code> - </ImplementedReturnTypeMismatch> <InvalidReturnStatement occurrences="1"> <code>$entry</code> </InvalidReturnStatement> @@ -1984,9 +1806,6 @@ </UndefinedFunction> </file> <file src="apps/files_trashbin/lib/Sabre/TrashRoot.php"> - <ImplementedReturnTypeMismatch occurrences="1"> - <code>ITrash</code> - </ImplementedReturnTypeMismatch> <InvalidReturnStatement occurrences="1"> <code>$entry</code> </InvalidReturnStatement> @@ -2021,15 +1840,6 @@ <FalsableReturnStatement occurrences="1"> <code>false</code> </FalsableReturnStatement> - <InvalidArgument occurrences="1"> - <code>$ma</code> - </InvalidArgument> - <InvalidReturnStatement occurrences="1"> - <code>$query->execute([$uid])</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>bool</code> - </InvalidReturnType> <InvalidScalarArgument occurrences="2"> <code>$timestamp</code> <code>$timestamp</code> @@ -2081,16 +1891,16 @@ </file> <file src="apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php"> <InvalidArrayOffset occurrences="10"> + <code>$publicData[IAccountManager::PROPERTY_ADDRESS]['value']</code> <code>$publicData[IAccountManager::PROPERTY_DISPLAYNAME]['value']</code> <code>$publicData[IAccountManager::PROPERTY_EMAIL]['value']</code> - <code>$publicData[IAccountManager::PROPERTY_ADDRESS]['value']</code> - <code>$publicData[IAccountManager::PROPERTY_WEBSITE]['value']</code> - <code>$publicData[IAccountManager::PROPERTY_TWITTER]['value']</code> <code>$publicData[IAccountManager::PROPERTY_PHONE]['value']</code> <code>$publicData[IAccountManager::PROPERTY_TWITTER]['signature']</code> + <code>$publicData[IAccountManager::PROPERTY_TWITTER]['value']</code> + <code>$publicData[IAccountManager::PROPERTY_TWITTER]['verified']</code> <code>$publicData[IAccountManager::PROPERTY_WEBSITE]['signature']</code> + <code>$publicData[IAccountManager::PROPERTY_WEBSITE]['value']</code> <code>$publicData[IAccountManager::PROPERTY_WEBSITE]['verified']</code> - <code>$publicData[IAccountManager::PROPERTY_TWITTER]['verified']</code> </InvalidArrayOffset> <InvalidScalarArgument occurrences="1"> <code>$this->retries + 1</code> @@ -2103,9 +1913,9 @@ </file> <file src="apps/oauth2/lib/Controller/SettingsController.php"> <UndefinedMagicMethod occurrences="4"> + <code>getClientIdentifier</code> <code>getName</code> <code>getRedirectUri</code> - <code>getClientIdentifier</code> <code>getSecret</code> </UndefinedMagicMethod> </file> @@ -2115,19 +1925,12 @@ <file src="apps/oauth2/lib/Db/ClientMapper.php"> <InvalidCatch occurrences="2"/> </file> - <file src="apps/provisioning_api/lib/AppInfo/Application.php"> - <UndefinedInterfaceMethod occurrences="1"> - <code>getSubAdmin</code> - </UndefinedInterfaceMethod> - </file> <file src="apps/provisioning_api/lib/Controller/UsersController.php"> <InvalidScalarArgument occurrences="1"> <code>$quota</code> </InvalidScalarArgument> - <RedundantCondition occurrences="1"> - <code>$groupid === null || trim($groupid) === ''</code> - </RedundantCondition> - <TypeDoesNotContainNull occurrences="1"> + <TypeDoesNotContainNull occurrences="2"> + <code>$groupid === null</code> <code>$groupid === null</code> </TypeDoesNotContainNull> <UndefinedInterfaceMethod occurrences="1"> @@ -2142,47 +1945,37 @@ <code>getSettingsManager</code> </UndefinedInterfaceMethod> </file> - <file src="apps/settings/lib/BackgroundJobs/VerifyUserData.php"> - <MoreSpecificImplementedParamType occurrences="1"> - <code>$jobList</code> - </MoreSpecificImplementedParamType> - </file> <file src="apps/settings/lib/Controller/AppSettingsController.php"> <UndefinedInterfaceMethod occurrences="1"> <code>ignoreNextcloudRequirementForApp</code> </UndefinedInterfaceMethod> </file> <file src="apps/settings/lib/Controller/CheckSetupController.php"> - <InvalidArgument occurrences="2"> - <code>IDBConnection::CHECK_MISSING_INDEXES_EVENT</code> + <InvalidArgument occurrences="3"> <code>IDBConnection::CHECK_MISSING_COLUMNS_EVENT</code> + <code>IDBConnection::CHECK_MISSING_INDEXES_EVENT</code> + <code>IDBConnection::CHECK_MISSING_PRIMARY_KEYS_EVENT</code> </InvalidArgument> <InvalidOperand occurrences="1"> <code>$lastCronRun</code> </InvalidOperand> <InvalidReturnStatement occurrences="2"> - <code>new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.')</code> <code>$response</code> + <code>new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.')</code> </InvalidReturnStatement> <InvalidReturnType occurrences="1"> <code>DataResponse</code> </InvalidReturnType> <InvalidScalarArgument occurrences="2"> - <code>0</code> <code>$lastCronRun</code> + <code>0</code> </InvalidScalarArgument> - <TooManyArguments occurrences="2"> + <TooManyArguments occurrences="3"> + <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> </TooManyArguments> </file> - <file src="apps/settings/lib/Controller/MailSettingsController.php"> - <InvalidArgument occurrences="3"> - <code>$this->l10n->t('Invalid SMTP password.')</code> - <code>$this->l10n->t('A problem occurred while sending the email. Please revise your settings. (Error: %s)', [$e->getMessage()])</code> - <code>$this->l10n->t('You need to set your user email before being able to send test emails.')</code> - </InvalidArgument> - </file> <file src="apps/settings/lib/Hooks.php"> <InvalidArgument occurrences="1"> <code>[$user->getEMailAddress() => $user->getDisplayName()]</code> @@ -2239,23 +2032,6 @@ </NullableReturnStatement> </file> <file src="apps/sharebymail/lib/ShareByMailProvider.php"> - <ImplicitToStringCast occurrences="15"> - <code>$qb->createNamedParameter(IShare::TYPE_EMAIL)</code> - <code>$qb->createNamedParameter($itemType)</code> - <code>$qb->createNamedParameter($itemSource)</code> - <code>$qb->createNamedParameter($itemSource)</code> - <code>$qb->createNamedParameter($shareWith)</code> - <code>$qb->createNamedParameter($uidOwner)</code> - <code>$qb->createNamedParameter($sharedBy)</code> - <code>$qb->createNamedParameter($permissions)</code> - <code>$qb->createNamedParameter($token)</code> - <code>$qb->createNamedParameter($password)</code> - <code>$qb->createNamedParameter($sendPasswordByTalk, IQueryBuilder::PARAM_BOOL)</code> - <code>$qb->createNamedParameter(time())</code> - <code>$qb->createNamedParameter((int)$hideDownload, IQueryBuilder::PARAM_INT)</code> - <code>$qb->createNamedParameter('')</code> - <code>$qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> <InvalidReturnStatement occurrences="1"> <code>$shares</code> </InvalidReturnStatement> @@ -2263,9 +2039,9 @@ <code>getSharesInFolder</code> </InvalidReturnType> <InvalidScalarArgument occurrences="4"> + <code>$share->getId()</code> <code>$shareId</code> <code>$shareId</code> - <code>$share->getId()</code> <code>(int)$data['id']</code> </InvalidScalarArgument> </file> @@ -2277,11 +2053,11 @@ </file> <file src="apps/testing/lib/Controller/LockingController.php"> <InvalidScalarArgument occurrences="5"> - <code>$type</code> - <code>$type</code> <code>$this->config->getAppValue('testing', $lock)</code> <code>$this->config->getAppValue('testing', $lock)</code> <code>$this->config->getAppValue('testing', $lock)</code> + <code>$type</code> + <code>$type</code> </InvalidScalarArgument> </file> <file src="apps/theming/lib/Controller/IconController.php"> @@ -2297,18 +2073,10 @@ <code>$iconFile !== false</code> </RedundantCondition> </file> - <file src="apps/theming/lib/Controller/ThemingController.php"> - <InvalidScalarArgument occurrences="4"> - <code>'r'</code> - <code>$newHeight</code> - <code>'r'</code> - <code>'r'</code> - </InvalidScalarArgument> - </file> <file src="apps/theming/lib/IconBuilder.php"> <InvalidScalarArgument occurrences="2"> - <code>$offset_w</code> <code>$offset_h</code> + <code>$offset_w</code> </InvalidScalarArgument> </file> <file src="apps/theming/lib/ImageManager.php"> @@ -2324,12 +2092,8 @@ <code>getSlogan</code> </InvalidReturnType> <InvalidScalarArgument occurrences="1"> - <code>(int)$cacheBusterKey+1</code> + <code>(int)$cacheBusterKey + 1</code> </InvalidScalarArgument> - <NullArgument occurrences="2"> - <code>null</code> - <code>null</code> - </NullArgument> </file> <file src="apps/theming/lib/Util.php"> <InvalidReturnStatement occurrences="1"> @@ -2346,9 +2110,6 @@ <InvalidPropertyAssignmentValue occurrences="1"> <code>$registry</code> </InvalidPropertyAssignmentValue> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> <UndefinedMethod occurrences="1"> <code>getProviderStates</code> </UndefinedMethod> @@ -2364,12 +2125,9 @@ </InvalidArgument> </file> <file src="apps/updatenotification/lib/Controller/AdminController.php"> - <InvalidArgument occurrences="1"> - <code>$newToken</code> - </InvalidArgument> <InvalidScalarArgument occurrences="2"> - <code>0</code> <code>$this->timeFactory->getTime()</code> + <code>0</code> </InvalidScalarArgument> </file> <file src="apps/updatenotification/lib/Notification/BackgroundJob.php"> @@ -2377,9 +2135,9 @@ <code>$this->users</code> </InvalidPropertyAssignmentValue> <InvalidScalarArgument occurrences="3"> - <code>0</code> <code>$errors</code> <code>0</code> + <code>0</code> </InvalidScalarArgument> </file> <file src="apps/updatenotification/lib/Notification/Notifier.php"> @@ -2402,7 +2160,7 @@ </file> <file src="apps/user_ldap/ajax/getNewServerConfigPrefix.php"> <InvalidScalarArgument occurrences="1"> - <code>$ln+1</code> + <code>$ln + 1</code> </InvalidScalarArgument> </file> <file src="apps/user_ldap/appinfo/routes.php"> @@ -2418,42 +2176,32 @@ <code>$record</code> </InvalidArgument> <InvalidReturnStatement occurrences="2"> - <code>$values</code> <code>$uuid</code> + <code>$values</code> </InvalidReturnStatement> <InvalidReturnType occurrences="1"> <code>string[]</code> </InvalidReturnType> - <InvalidScalarArgument occurrences="13"> - <code>[$attr => $result['values']]</code> + <InvalidScalarArgument occurrences="4"> + <code>$e->getCode()</code> <code>$key</code> <code>$key</code> - <code>$e->getCode()</code> - <code>$nameAttribute</code> - <code>$filter</code> - <code>$this->connection->ldapLoginFilter</code> - <code>$this->connection->ldapLoginFilter</code> - <code>$this->connection->ldapUserDisplayName</code> - <code>$this->connection->ldapUserDisplayName</code> - <code>$this->connection->ldapGroupDisplayName</code> - <code>$filter</code> + <code>[$attr => $result['values']]</code> </InvalidScalarArgument> <NullArgument occurrences="1"> <code>$cookie</code> </NullArgument> - <RedundantCondition occurrences="5"> + <RedundantCondition occurrences="4"> + <code>!is_null($limit)</code> <code>!isset($ldapName[0]) && empty($ldapName[0])</code> - <code>is_null($limit)</code> - <code>!is_null($limit) && (int)$this->connection->ldapPagingSize !== 0</code> + <code>$limit === 0</code> <code>is_array($result)</code> - <code>$limit === 0 && !empty($this->lastCookie)</code> </RedundantCondition> <TypeDoesNotContainNull occurrences="2"> - <code>is_null($findings)</code> <code>!$attribute === null</code> + <code>is_null($findings)</code> </TypeDoesNotContainNull> - <TypeDoesNotContainType occurrences="3"> - <code>is_array($attr)</code> + <TypeDoesNotContainType occurrences="2"> <code>!is_null($attr) && !is_array($attr)</code> <code>isset($ldapRecord[$this->connection->$uuidAttr])</code> </TypeDoesNotContainType> @@ -2488,18 +2236,16 @@ <ParadoxicalCondition occurrences="1"/> </file> <file src="apps/user_ldap/lib/Group_LDAP.php"> - <InvalidArgument occurrences="3"> - <code>$this->cachedGroupMembers[$gid]</code> - <code>'dn'</code> + <InvalidArgument occurrences="2"> <code>$this->cachedGroupsByMember[$uid]</code> + <code>'dn'</code> </InvalidArgument> - <InvalidPropertyAssignmentValue occurrences="6"> + <InvalidPropertyAssignmentValue occurrences="5"> + <code>$this->cachedGroupsByMember</code> + <code>$this->cachedNestedGroups</code> <code>new CappedMemoryCache()</code> <code>new CappedMemoryCache()</code> <code>new CappedMemoryCache()</code> - <code>$this->cachedGroupMembers</code> - <code>$this->cachedNestedGroups</code> - <code>$this->cachedGroupsByMember</code> </InvalidPropertyAssignmentValue> <InvalidReturnStatement occurrences="1"> <code>$groupName</code> @@ -2507,37 +2253,14 @@ <InvalidReturnType occurrences="1"> <code>bool</code> </InvalidReturnType> - <InvalidScalarArgument occurrences="26"> - <code>$gAssoc</code> - <code>$this->access->connection->ldapLoginFilter</code> - <code>$this->access->connection->ldapDynamicGroupMemberURL</code> - <code>$this->access->connection->ldapGroupFilter</code> - <code>$this->access->connection->ldapGroupMemberAssocAttr</code> - <code>$this->access->connection->ldapGidNumber</code> + <InvalidScalarArgument occurrences="2"> <code>$groupID</code> <code>$groupID</code> - <code>$this->access->connection->ldapDynamicGroupMemberURL</code> - <code>$this->access->connection->ldapGroupFilter</code> - <code>$this->access->connection->ldapUserDisplayName</code> - <code>$this->access->connection->ldapGroupMemberAssocAttr</code> - <code>[strtolower($this->access->connection->ldapGroupMemberAssocAttr), $this->access->connection->ldapGroupDisplayName, 'dn']</code> - <code>$this->access->connection->ldapLoginFilter</code> - <code>$this->access->connection->ldapUserDisplayName</code> - <code>$this->access->connection->ldapLoginFilter</code> - <code>$this->access->connection->ldapUserDisplayName</code> - <code>[$this->access->connection->ldapGroupDisplayName, 'dn']</code> - <code>$this->access->connection->ldapGroupFilter</code> - <code>$this->access->connection->ldapGroupDisplayName</code> </InvalidScalarArgument> - <RedundantCondition occurrences="4"> - <code>!is_array($members) || count($members) === 0</code> - <code>is_array($members)</code> - <code>is_array($list)</code> + <RedundantCondition occurrences="2"> <code>is_array($groupDNs)</code> + <code>is_array($list)</code> </RedundantCondition> - <TypeDoesNotContainType occurrences="1"> - <code>is_array($members)</code> - </TypeDoesNotContainType> </file> <file src="apps/user_ldap/lib/Helper.php"> <InvalidScalarArgument occurrences="1"> @@ -2551,21 +2274,21 @@ </file> <file src="apps/user_ldap/lib/Jobs/CleanUp.php"> <InvalidScalarArgument occurrences="3"> - <code>0</code> <code>$newOffset</code> + <code>0</code> <code>50</code> </InvalidScalarArgument> </file> <file src="apps/user_ldap/lib/Jobs/Sync.php"> <InvalidOperand occurrences="2"> - <code>$lastChange</code> <code>$i</code> + <code>$lastChange</code> </InvalidOperand> <InvalidScalarArgument occurrences="5"> - <code>self::MIN_INTERVAL</code> <code>$interval</code> <code>0</code> <code>0</code> + <code>self::MIN_INTERVAL</code> </InvalidScalarArgument> <MoreSpecificImplementedParamType occurrences="1"> <code>$argument</code> @@ -2587,72 +2310,60 @@ </file> <file src="apps/user_ldap/lib/LDAP.php"> <ImplementedParamTypeMismatch occurrences="22"> + <code>$baseDN</code> + <code>$baseDN</code> <code>$link</code> <code>$link</code> - <code>$result</code> <code>$link</code> <code>$link</code> <code>$link</code> - <code>$result</code> <code>$link</code> - <code>$result</code> <code>$link</code> - <code>$result</code> <code>$link</code> - <code>$result</code> <code>$link</code> <code>$link</code> - <code>$baseDN</code> <code>$link</code> - <code>$baseDN</code> <code>$link</code> <code>$link</code> <code>$link</code> <code>$resource</code> + <code>$result</code> + <code>$result</code> + <code>$result</code> + <code>$result</code> + <code>$result</code> </ImplementedParamTypeMismatch> <InvalidArgument occurrences="1"> <code>$baseDN</code> </InvalidArgument> <LessSpecificImplementedReturnType occurrences="13"> + <code>array|mixed</code> + <code>array|mixed</code> + <code>bool|mixed</code> + <code>bool|mixed</code> <code>bool|mixed</code> - <code>mixed|true</code> <code>mixed</code> <code>mixed</code> - <code>array|mixed</code> - <code>mixed|string</code> - <code>array|mixed</code> <code>mixed</code> <code>mixed</code> <code>mixed</code> - <code>bool|mixed</code> + <code>mixed|string</code> + <code>mixed|true</code> <code>mixed|true</code> - <code>bool|mixed</code> </LessSpecificImplementedReturnType> <UndefinedDocblockClass occurrences="1"> <code>Resource</code> </UndefinedDocblockClass> </file> - <file src="apps/user_ldap/lib/LDAPProviderFactory.php"> - <ImplementedReturnTypeMismatch occurrences="1"> - <code>OCP\LDAP\ILDAPProvider</code> - </ImplementedReturnTypeMismatch> - <InvalidReturnStatement occurrences="1"/> - <InvalidReturnType occurrences="1"> - <code>OCP\LDAP\ILDAPProvider</code> - </InvalidReturnType> - <UndefinedDocblockClass occurrences="1"> - <code>OCP\LDAP\ILDAPProvider</code> - </UndefinedDocblockClass> - </file> <file src="apps/user_ldap/lib/LogWrapper.php"> <InvalidReturnType occurrences="1"> <code>bool</code> </InvalidReturnType> </file> <file src="apps/user_ldap/lib/Mapping/AbstractMapping.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->createNamedParameter($fdns, QueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> + <InvalidOperand occurrences="1"> + <code>$result</code> + </InvalidOperand> </file> <file src="apps/user_ldap/lib/Proxy.php"> <InvalidDocblock occurrences="1"> @@ -2663,10 +2374,6 @@ <InvalidDocblock occurrences="1"> <code>public function setLdapAccess(Access $access) {</code> </InvalidDocblock> - <InvalidScalarArgument occurrences="2"> - <code>$homeRule</code> - <code>$homeRule</code> - </InvalidScalarArgument> </file> <file src="apps/user_ldap/lib/User/User.php"> <FalsableReturnStatement occurrences="1"> @@ -2679,36 +2386,20 @@ <code>null</code> <code>null</code> </InvalidReturnType> - <InvalidScalarArgument occurrences="15"> - <code>$this->connection->ldapQuotaAttribute</code> - <code>$this->connection->ldapUserDisplayName</code> - <code>$this->connection->ldapUserDisplayName2</code> - <code>$this->connection->ldapEmailAttribute</code> - <code>$this->connection->homeFolderNamingRule</code> - <code>$this->connection->homeFolderNamingRule</code> + <InvalidScalarArgument occurrences="3"> <code>$this->getHomePath($ldapEntry[$attr][0])</code> - <code>$this->connection->ldapExtStorageHomeAttribute</code> - <code>$this->access->connection->homeFolderNamingRule</code> - <code>$this->access->connection->homeFolderNamingRule</code> - <code>true</code> <code>1</code> - <code>$emailAttribute</code> - <code>$quotaAttribute</code> - <code>$this->connection->ldapExtStorageHomeAttribute</code> + <code>true</code> </InvalidScalarArgument> </file> <file src="apps/user_ldap/lib/User_LDAP.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>string|false</code> </ImplementedReturnTypeMismatch> - <InvalidScalarArgument occurrences="8"> - <code>$this->access->connection->ldapUserFilter</code> - <code>$this->access->connection->ldapUserFilter</code> - <code>$path</code> - <code>$additionalAttribute</code> - <code>$this->access->connection->ldapUserDisplayName</code> + <InvalidScalarArgument occurrences="3"> <code>$limit</code> <code>$offset</code> + <code>$path</code> </InvalidScalarArgument> <MoreSpecificImplementedParamType occurrences="2"> <code>$limit</code> @@ -2719,9 +2410,9 @@ </NullableReturnStatement> </file> <file src="apps/user_ldap/lib/User_Proxy.php"> - <FalseOperand occurrences="1"> + <InvalidReturnStatement occurrences="1"> <code>$users</code> - </FalseOperand> + </InvalidReturnStatement> </file> <file src="apps/user_ldap/lib/Wizard.php"> <FalsableReturnStatement occurrences="2"> @@ -2729,29 +2420,28 @@ <code>false</code> </FalsableReturnStatement> <InvalidArgument occurrences="4"> + <code>$attributes</code> <code>$er</code> <code>$er</code> <code>$er</code> - <code>$attributes</code> </InvalidArgument> <InvalidDocblock occurrences="3"> - <code>private function detectGroupMemberAssoc() {</code> <code>private function checkAgentRequirements() {</code> + <code>private function detectGroupMemberAssoc() {</code> <code>private function getAttributeValuesFromEntry($result, $attribute, &$known) {</code> </InvalidDocblock> <InvalidScalarArgument occurrences="8"> <code>$port</code> <code>$port</code> - <code>LDAP_OPT_PROTOCOL_VERSION</code> - <code>LDAP_OPT_REFERRALS</code> + <code>LDAP_OPT_NETWORK_TIMEOUT</code> <code>LDAP_OPT_NETWORK_TIMEOUT</code> <code>LDAP_OPT_PROTOCOL_VERSION</code> + <code>LDAP_OPT_PROTOCOL_VERSION</code> + <code>LDAP_OPT_REFERRALS</code> <code>LDAP_OPT_REFERRALS</code> - <code>LDAP_OPT_NETWORK_TIMEOUT</code> </InvalidScalarArgument> - <RedundantCondition occurrences="2"> - <code>is_array($item['cn'])</code> - <code>!isset($item['cn']) && !is_array($item['cn']) && !isset($item['cn'][0])</code> + <RedundantCondition occurrences="1"> + <code>!isset($item['cn']) && !is_array($item['cn'])</code> </RedundantCondition> <TypeDoesNotContainType occurrences="1"> <code>$total === false</code> @@ -2762,15 +2452,7 @@ <code>registerProvider</code> </UndefinedInterfaceMethod> </file> - <file src="apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php"> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> - </file> <file src="apps/user_status/lib/Db/UserStatusMapper.php"> - <ImplicitToStringCast occurrences="2"> - <code>$qb->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> <MoreSpecificImplementedParamType occurrences="1"/> </file> <file src="apps/user_status/lib/Service/StatusService.php"> @@ -2817,9 +2499,6 @@ </InvalidArgument> </file> <file src="apps/workflowengine/lib/Controller/AWorkflowController.php"> - <InvalidArgument occurrences="1"> - <code>$deleted</code> - </InvalidArgument> <InvalidScalarArgument occurrences="3"> <code>$e->getCode()</code> <code>$e->getCode()</code> @@ -2832,23 +2511,17 @@ </InvalidReturnType> </file> <file src="apps/workflowengine/lib/Manager.php"> - <ImplicitToStringCast occurrences="1"> - <code>$query->createNamedParameter($checkIds, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> <InvalidArgument occurrences="3"> + <code>IManager::EVENT_NAME_REG_CHECK</code> <code>IManager::EVENT_NAME_REG_ENTITY</code> <code>IManager::EVENT_NAME_REG_OPERATION</code> - <code>IManager::EVENT_NAME_REG_CHECK</code> </InvalidArgument> + <InvalidOperand occurrences="1"> + <code>$result</code> + </InvalidOperand> <InvalidPropertyAssignmentValue occurrences="1"> <code>[]</code> </InvalidPropertyAssignmentValue> - <InvalidReturnStatement occurrences="1"> - <code>array_merge($this->getBuildInChecks(), $this->registeredChecks)</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>ICheck[]</code> - </InvalidReturnType> <InvalidScalarArgument occurrences="1"> <code>$missingCheck</code> </InvalidScalarArgument> @@ -2868,11 +2541,11 @@ </file> <file src="apps/workflowengine/lib/Service/RuleMatcher.php"> <UndefinedInterfaceMethod occurrences="5"> - <code>isUserScopeEnabled</code> - <code>getOperations</code> <code>getAllConfiguredScopesForOperation</code> - <code>getOperations</code> <code>getChecks</code> + <code>getOperations</code> + <code>getOperations</code> + <code>isUserScopeEnabled</code> </UndefinedInterfaceMethod> </file> <file src="apps/workflowengine/lib/Settings/Personal.php"> @@ -2883,11 +2556,6 @@ <code>$this->manager->isUserScopeEnabled() ? 'workflow' : null</code> </NullableReturnStatement> </file> - <file src="core/BackgroundJobs/CleanupLoginFlowV2.php"> - <InvalidReturnType occurrences="1"> - <code>run</code> - </InvalidReturnType> - </file> <file src="core/Command/App/CheckCode.php"> <InvalidScalarArgument occurrences="1"/> </file> @@ -2955,16 +2623,18 @@ <code>dispatch</code> </TooManyArguments> </file> + <file src="core/Command/Db/AddMissingPrimaryKeys.php"> + <InvalidArgument occurrences="1"> + <code>IDBConnection::ADD_MISSING_PRIMARY_KEYS_EVENT</code> + </InvalidArgument> + <TooManyArguments occurrences="1"> + <code>dispatch</code> + </TooManyArguments> + </file> <file src="core/Command/Db/ConvertType.php"> - <ImplicitToStringCast occurrences="1"> - <code>$insertQuery->createParameter($key)</code> - </ImplicitToStringCast> - <InternalMethod occurrences="1"> - <code>setFilterSchemaAssetsExpression</code> - </InternalMethod> <InvalidArgument occurrences="2"> - <code>$chunkSize</code> <code>$chunk * $chunkSize</code> + <code>$chunkSize</code> </InvalidArgument> <InvalidScalarArgument occurrences="2"> <code>0</code> @@ -3037,16 +2707,16 @@ <file src="core/Command/Upgrade.php"> <InvalidScalarArgument occurrences="11"> <code>0</code> - <code>1</code> - <code>1</code> - <code>1</code> <code>0</code> - <code>1</code> <code>0</code> <code>0</code> <code>0</code> <code>0</code> <code>0</code> + <code>1</code> + <code>1</code> + <code>1</code> + <code>1</code> </InvalidScalarArgument> <UndefinedThisPropertyAssignment occurrences="1"> <code>$this->installer</code> @@ -3077,12 +2747,8 @@ </TooManyArguments> </file> <file src="core/Controller/ClientFlowLoginV2Controller.php"> - <RedundantCondition occurrences="2"> - <code>!is_string($stateToken) || !is_string($currentToken)</code> - <code>is_string($stateToken)</code> - </RedundantCondition> <TypeDoesNotContainType occurrences="1"> - <code>is_string($stateToken)</code> + <code>!is_string($stateToken)</code> </TypeDoesNotContainType> </file> <file src="core/Controller/CollaborationResourcesController.php"> @@ -3108,38 +2774,25 @@ <code>$this->request->server</code> </NoInterfaceProperties> </file> - <file src="core/Migrations/Version14000Date20180404140050.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->func()->lower('uid')</code> - </ImplicitToStringCast> - </file> <file src="core/ajax/update.php"> <InvalidScalarArgument occurrences="12"> <code>0</code> - <code>1</code> <code>0</code> - <code>1</code> <code>0</code> - <code>1</code> <code>0</code> - <code>1</code> <code>0</code> <code>0</code> <code>0</code> <code>0</code> + <code>1</code> + <code>1</code> + <code>1</code> + <code>1</code> </InvalidScalarArgument> </file> - <file src="core/register_command.php"> - <NullArgument occurrences="3"> - <code>null</code> - <code>null</code> - <code>null</code> - </NullArgument> - </file> <file src="core/routes.php"> <InvalidScope occurrences="2"> <code>$this</code> - <code>$this</code> </InvalidScope> </file> <file src="core/templates/layout.public.php"> @@ -3147,10 +2800,15 @@ <code>getIcon</code> </UndefinedInterfaceMethod> </file> + <file src="lib/autoloader.php"> + <RedundantCondition occurrences="1"> + <code>$this->memoryCache</code> + </RedundantCondition> + </file> <file src="lib/base.php"> <InternalMethod occurrences="2"> - <code>getIncompatibleApps</code> <code>getAppsNeedingUpgrade</code> + <code>getIncompatibleApps</code> </InternalMethod> <InvalidArgument occurrences="1"> <code>$restrictions</code> @@ -3187,9 +2845,9 @@ </file> <file src="lib/private/App/AppManager.php"> <InvalidArgument occurrences="3"> + <code>ManagerEvent::EVENT_APP_DISABLE</code> <code>ManagerEvent::EVENT_APP_ENABLE</code> <code>ManagerEvent::EVENT_APP_ENABLE_FOR_GROUPS</code> - <code>ManagerEvent::EVENT_APP_DISABLE</code> </InvalidArgument> <LessSpecificImplementedReturnType occurrences="2"> <code>array</code> @@ -3311,18 +2969,16 @@ </InvalidReturnType> </file> <file src="lib/private/AppFramework/Http/Request.php"> - <NullableReturnStatement occurrences="11"> - <code>$this->server[$name]</code> - <code>$this->method</code> - <code>isset($this->files[$key]) ? $this->files[$key] : null</code> - <code>isset($this->env[$key]) ? $this->env[$key] : null</code> - <code>isset($this->cookies[$key]) ? $this->cookies[$key] : null</code> - <code>$this->server['UNIQUE_ID']</code> - <code>$remoteAddress</code> - <code>$uri</code> + <NullableReturnStatement occurrences="9"> + <code>$host</code> <code>$name</code> + <code>$remoteAddress</code> <code>$this->getOverwriteHost()</code> - <code>$host</code> + <code>$this->method</code> + <code>$uri</code> + <code>isset($this->cookies[$key]) ? $this->cookies[$key] : null</code> + <code>isset($this->env[$key]) ? $this->env[$key] : null</code> + <code>isset($this->files[$key]) ? $this->files[$key] : null</code> </NullableReturnStatement> <RedundantCondition occurrences="1"> <code>\is_array($params)</code> @@ -3358,20 +3014,19 @@ <InvalidScalarArgument occurrences="1"> <code>$exception->getCode()</code> </InvalidScalarArgument> - <NoInterfaceProperties occurrences="3"> - <code>$this->request->server</code> + <NoInterfaceProperties occurrences="2"> <code>$this->request->server</code> <code>$this->request->server</code> </NoInterfaceProperties> </file> <file src="lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php"> <InvalidScalarArgument occurrences="6"> - <code>$userLimit</code> - <code>$userPeriod</code> <code>$anonLimit</code> <code>$anonPeriod</code> <code>$exception->getCode()</code> <code>$exception->getCode()</code> + <code>$userLimit</code> + <code>$userPeriod</code> </InvalidScalarArgument> </file> <file src="lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php"> @@ -3404,19 +3059,11 @@ <code>strtolower</code> </RedundantCondition> </file> - <file src="lib/private/AppFramework/ScopedPsrLogger.php"> - <InvalidArgument occurrences="1"/> - </file> <file src="lib/private/AppFramework/Services/AppConfig.php"> <MoreSpecificImplementedParamType occurrences="1"> <code>$default</code> </MoreSpecificImplementedParamType> </file> - <file src="lib/private/AppFramework/Services/InitialState.php"> - <ImplementedParamTypeMismatch occurrences="1"> - <code>$closure</code> - </ImplementedParamTypeMismatch> - </file> <file src="lib/private/Archive/TAR.php"> <FalsableReturnStatement occurrences="1"> <code>false</code> @@ -3439,49 +3086,44 @@ </file> <file src="lib/private/Authentication/LoginCredentials/Store.php"> <RedundantCondition occurrences="1"> - <code>$trySession && $this->session->exists('login_credentials')</code> + <code>$trySession</code> </RedundantCondition> </file> <file src="lib/private/Authentication/Token/DefaultToken.php"> <UndefinedMethod occurrences="14"> + <code>parent::getExpires()</code> + <code>parent::getLastCheck()</code> <code>parent::getLoginName()</code> + <code>parent::getName()</code> <code>parent::getPassword()</code> - <code>parent::getLastCheck()</code> - <code>parent::setLastCheck($time)</code> + <code>parent::getRemember()</code> <code>parent::getScope()</code> - <code>parent::setScope(json_encode($scope))</code> - <code>parent::setScope((string)$scope)</code> - <code>parent::getName()</code> + <code>parent::setExpires($expires)</code> + <code>parent::setLastCheck($time)</code> <code>parent::setName($name)</code> - <code>parent::getRemember()</code> - <code>parent::setToken($token)</code> <code>parent::setPassword($password)</code> - <code>parent::setExpires($expires)</code> - <code>parent::getExpires()</code> + <code>parent::setScope((string)$scope)</code> + <code>parent::setScope(json_encode($scope))</code> + <code>parent::setToken($token)</code> </UndefinedMethod> </file> - <file src="lib/private/Authentication/Token/DefaultTokenProvider.php"> - <InvalidArgument occurrences="1"> - <code>$token</code> - </InvalidArgument> - </file> <file src="lib/private/Authentication/Token/PublicKeyToken.php"> <UndefinedMethod occurrences="16"> + <code>parent::getExpires()</code> + <code>parent::getLastCheck()</code> <code>parent::getLoginName()</code> + <code>parent::getName()</code> <code>parent::getPassword()</code> - <code>parent::getLastCheck()</code> - <code>parent::setLastCheck($time)</code> + <code>parent::getRemember()</code> <code>parent::getScope()</code> - <code>parent::setScope(json_encode($scope))</code> - <code>parent::setScope((string)$scope)</code> - <code>parent::getName()</code> + <code>parent::setExpires($expires)</code> + <code>parent::setLastCheck($time)</code> <code>parent::setName($name)</code> - <code>parent::getRemember()</code> - <code>parent::setToken($token)</code> <code>parent::setPassword($password)</code> - <code>parent::setExpires($expires)</code> - <code>parent::getExpires()</code> <code>parent::setPasswordInvalid($invalid)</code> + <code>parent::setScope((string)$scope)</code> + <code>parent::setScope(json_encode($scope))</code> + <code>parent::setToken($token)</code> <code>parent::setType(IToken::WIPE_TOKEN)</code> </UndefinedMethod> </file> @@ -3490,15 +3132,15 @@ <code>$providers</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> - <code>string[]</code> <code>int[]</code> + <code>string[]</code> </InvalidReturnType> </file> <file src="lib/private/Authentication/TwoFactorAuth/Manager.php"> <InvalidArgument occurrences="3"> - <code>IProvider::EVENT_SUCCESS</code> - <code>IProvider::EVENT_FAILED</code> <code>$tokenId</code> + <code>IProvider::EVENT_FAILED</code> + <code>IProvider::EVENT_SUCCESS</code> </InvalidArgument> <InvalidReturnStatement occurrences="1"> <code>$providerStates</code> @@ -3507,9 +3149,9 @@ <code>string[]</code> </InvalidReturnType> <InvalidScalarArgument occurrences="3"> - <code>$tokenId</code> - <code>$token->getId()</code> <code>$this->timeFactory->getTime()</code> + <code>$token->getId()</code> + <code>$tokenId</code> </InvalidScalarArgument> <TooManyArguments occurrences="2"> <code>dispatch</code> @@ -3521,8 +3163,8 @@ <code>$this->providers</code> </InvalidArgument> <InvalidPropertyAssignmentValue occurrences="2"> - <code>[]</code> <code>$this->providers</code> + <code>[]</code> </InvalidPropertyAssignmentValue> <InvalidReturnStatement occurrences="1"> <code>$this->providers</code> @@ -3563,9 +3205,9 @@ <code>ISimpleFile</code> </ImplementedReturnTypeMismatch> <InvalidScalarArgument occurrences="3"> - <code>(int) $this->config->getUserValue($this->user->getUID(), 'avatar', 'version', 0) + 1</code> <code>$data</code> <code>$data</code> + <code>(int) $this->config->getUserValue($this->user->getUID(), 'avatar', 'version', 0) + 1</code> </InvalidScalarArgument> </file> <file src="lib/private/BackgroundJob/JobList.php"> @@ -3606,11 +3248,6 @@ <code>$this->shareeEnumerationInGroupOnly</code> </UndefinedThisPropertyFetch> </file> - <file src="lib/private/Collaboration/Collaborators/Search.php"> - <UndefinedMethod occurrences="1"> - <code>search</code> - </UndefinedMethod> - </file> <file src="lib/private/Collaboration/Resources/Manager.php"> <InvalidArgument occurrences="4"/> <RedundantCondition occurrences="1"> @@ -3620,13 +3257,31 @@ <code>''</code> </TypeDoesNotContainType> </file> + <file src="lib/private/Command/ClosureJob.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\unserialize($serializedCallable)</code> + </UndefinedFunction> + </file> + <file src="lib/private/Command/CommandJob.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\unserialize($serializedCommand)</code> + </UndefinedFunction> + </file> + <file src="lib/private/Command/CronBus.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\serialize($command)</code> + </UndefinedFunction> + </file> <file src="lib/private/Comments/Comment.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>\DateTime|null</code> </ImplementedReturnTypeMismatch> + <TypeDoesNotContainType occurrences="1"> + <code>!is_array($mentions[0])</code> + </TypeDoesNotContainType> </file> <file src="lib/private/Comments/Manager.php"> - <InvalidArgument occurrences="2"/> + <InvalidArgument occurrences="3"/> <InvalidDocblock occurrences="1"> <code>public function getForObjectSince(</code> </InvalidDocblock> @@ -3635,9 +3290,17 @@ </NullArgument> </file> <file src="lib/private/Config.php"> + <FalseOperand occurrences="2"> + <code>$needsUpdate</code> + <code>$needsUpdate</code> + </FalseOperand> <TypeDoesNotContainType occurrences="1"> <code>$needsUpdate</code> </TypeDoesNotContainType> + <UndefinedVariable occurrences="2"> + <code>$CONFIG</code> + <code>$CONFIG</code> + </UndefinedVariable> </file> <file src="lib/private/Console/Application.php"> <InvalidArgument occurrences="1"> @@ -3699,9 +3362,9 @@ <code>IAddressBook[]</code> </ImplementedReturnTypeMismatch> <InvalidNullableReturnType occurrences="3"> - <code>bool</code> - <code>array</code> <code>IAddressBook</code> + <code>array</code> + <code>bool</code> </InvalidNullableReturnType> <NullableReturnStatement occurrences="5"> <code>null</code> @@ -3712,9 +3375,6 @@ </NullableReturnStatement> </file> <file src="lib/private/DB/Adapter.php"> - <ImplicitToStringCast occurrences="1"> - <code>$builder->createNamedParameter($value)</code> - </ImplicitToStringCast> <InvalidReturnStatement occurrences="1"> <code>$builder->execute()</code> </InvalidReturnStatement> @@ -3722,47 +3382,47 @@ <code>int</code> </InvalidReturnType> </file> + <file src="lib/private/DB/AdapterMySQL.php"> + <InternalMethod occurrences="1"> + <code>getParams</code> + </InternalMethod> + </file> <file src="lib/private/DB/AdapterPgSql.php"> <FalsableReturnStatement occurrences="1"> <code>$this->conn->fetchColumn('SELECT lastval()')</code> </FalsableReturnStatement> - <ImplicitToStringCast occurrences="1"> - <code>$builder->createNamedParameter($value)</code> - </ImplicitToStringCast> </file> <file src="lib/private/DB/Connection.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>string</code> </ImplementedReturnTypeMismatch> + <InternalMethod occurrences="1"> + <code>getParams</code> + </InternalMethod> <InvalidReturnStatement occurrences="2"> - <code>$this->adapter->lastInsertId($seqName)</code> <code>$insertQb->execute()</code> + <code>$this->adapter->lastInsertId($seqName)</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> - <code>string</code> <code>int</code> + <code>string</code> </InvalidReturnType> <InvalidScalarArgument occurrences="1"> <code>$e->getCode()</code> </InvalidScalarArgument> + <LessSpecificImplementedReturnType occurrences="1"> + <code>\Doctrine\DBAL\Driver\Statement</code> + </LessSpecificImplementedReturnType> <ParamNameMismatch occurrences="1"> <code>$statement</code> </ParamNameMismatch> </file> - <file src="lib/private/DB/ConnectionFactory.php"> - <InternalClass occurrences="1"> - <code>new Configuration()</code> - </InternalClass> - </file> <file src="lib/private/DB/MDB2SchemaReader.php"> <InvalidScalarArgument occurrences="1"> <code>$options['default']</code> </InvalidScalarArgument> </file> <file src="lib/private/DB/MDB2SchemaWriter.php"> - <InternalMethod occurrences="1"> - <code>setFilterSchemaAssetsExpression</code> - </InternalMethod> <InvalidScalarArgument occurrences="1"> <code>$column->getLength()</code> </InvalidScalarArgument> @@ -3773,27 +3433,22 @@ <code>$offset</code> </InvalidOperand> <UndefinedThisPropertyAssignment occurrences="4"> - <code>$this->migrationsPath</code> <code>$this->migrationsNamespace</code> - <code>$this->migrationsPath</code> <code>$this->migrationsNamespace</code> + <code>$this->migrationsPath</code> + <code>$this->migrationsPath</code> </UndefinedThisPropertyAssignment> <UndefinedThisPropertyFetch occurrences="4"> - <code>$this->migrationsPath</code> <code>$this->migrationsNamespace</code> <code>$this->migrationsNamespace</code> <code>$this->migrationsPath</code> + <code>$this->migrationsPath</code> </UndefinedThisPropertyFetch> </file> <file src="lib/private/DB/Migrator.php"> - <InternalMethod occurrences="3"> - <code>setFilterSchemaAssetsExpression</code> - <code>setFilterSchemaAssetsExpression</code> - <code>setFilterSchemaAssetsExpression</code> - </InternalMethod> <InvalidArgument occurrences="2"> - <code>'\OC\DB\Migrator::executeSql'</code> <code>'\OC\DB\Migrator::checkTable'</code> + <code>'\OC\DB\Migrator::executeSql'</code> </InvalidArgument> <TooManyArguments occurrences="2"> <code>dispatch</code> @@ -3805,11 +3460,6 @@ <code>$key[0]</code> </InvalidArrayAccess> </file> - <file src="lib/private/DB/PgSqlTools.php"> - <InternalMethod occurrences="1"> - <code>setFilterSchemaAssetsExpression</code> - </InternalMethod> - </file> <file src="lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php"> <ImplicitToStringCast occurrences="1"> <code>$this->functionBuilder->lower($x)</code> @@ -3822,6 +3472,11 @@ <code>$y</code> </InvalidScalarArgument> </file> + <file src="lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php"> + <InternalMethod occurrences="1"> + <code>getParams</code> + </InternalMethod> + </file> <file src="lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php"> <InvalidReturnStatement occurrences="1"> <code>parent::castColumn($column, $type)</code> @@ -3830,11 +3485,6 @@ <code>IQueryFunction</code> </InvalidReturnType> </file> - <file src="lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php"> - <ImplicitToStringCast occurrences="1"> - <code>$this->functionBuilder->lower($x)</code> - </ImplicitToStringCast> - </file> <file src="lib/private/DB/QueryBuilder/QueryBuilder.php"> <InvalidArgument occurrences="1"> <code>$this->connection</code> @@ -3854,6 +3504,11 @@ <code>$string</code> </NullableReturnStatement> </file> + <file src="lib/private/DB/ReconnectWrapper.php"> + <InternalMethod occurrences="1"> + <code>parent::__construct($params, $driver, $config, $eventManager)</code> + </InternalMethod> + </file> <file src="lib/private/DateTimeFormatter.php"> <FalsableReturnStatement occurrences="1"/> <InvalidDocblock occurrences="2"> @@ -3876,6 +3531,9 @@ </ImplementedReturnTypeMismatch> </file> <file src="lib/private/Diagnostics/QueryLogger.php"> + <InvalidReturnType occurrences="1"> + <code>stopQuery</code> + </InvalidReturnType> <InvalidScalarArgument occurrences="1"> <code>microtime(true)</code> </InvalidScalarArgument> @@ -3947,11 +3605,6 @@ </TooManyArguments> </file> <file src="lib/private/Files/Cache/Cache.php"> - <ImplicitToStringCast occurrences="3"> - <code>$builder->createNamedParameter($value)</code> - <code>$fun->md5($newPathFunction)</code> - <code>$newPathFunction</code> - </ImplicitToStringCast> <InvalidArgument occurrences="1"> <code>$parentData</code> </InvalidArgument> @@ -3967,27 +3620,15 @@ <code>null</code> <code>null</code> </NullableReturnStatement> - <UndefinedInterfaceMethod occurrences="5"> - <code>$sourceData</code> - <code>$sourceData</code> - <code>$parentData</code> - <code>$parentData</code> - <code>$entry</code> - </UndefinedInterfaceMethod> - </file> - <file src="lib/private/Files/Cache/CacheQueryBuilder.php"> - <ImplicitToStringCast occurrences="1"> - <code>$this->createNamedParameter($parents, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> </file> <file src="lib/private/Files/Cache/FailedCache.php"> <InvalidReturnStatement occurrences="1"> <code>[]</code> </InvalidReturnStatement> <InvalidReturnType occurrences="3"> - <code>put</code> - <code>insert</code> <code>getIncomplete</code> + <code>insert</code> + <code>put</code> </InvalidReturnType> </file> <file src="lib/private/Files/Cache/HomeCache.php"> @@ -3997,34 +3638,17 @@ <MoreSpecificImplementedParamType occurrences="1"> <code>$path</code> </MoreSpecificImplementedParamType> - <UndefinedInterfaceMethod occurrences="5"> - <code>$entry</code> - <code>$entry</code> - <code>$entry</code> - <code>$filesData</code> - <code>$data</code> - </UndefinedInterfaceMethod> - <UndefinedMagicMethod occurrences="1"> - <code>closeCursor</code> - </UndefinedMagicMethod> </file> <file src="lib/private/Files/Cache/LocalRootScanner.php"> <InvalidNullableReturnType occurrences="2"> - <code>scanFile</code> <code>scan</code> + <code>scanFile</code> </InvalidNullableReturnType> <NullableReturnStatement occurrences="2"> <code>null</code> <code>null</code> </NullableReturnStatement> </file> - <file src="lib/private/Files/Cache/Propagator.php"> - <ImplicitToStringCast occurrences="4"> - <code>$builder->func()->greatest('mtime', $builder->createNamedParameter((int)$time, IQueryBuilder::PARAM_INT))</code> - <code>$query->createFunction('GREATEST(' . $query->getColumnName('mtime') . ', ' . $query->createParameter('time') . ')')</code> - <code>$sizeQuery->func()->add('size', $sizeQuery->createParameter('size'))</code> - </ImplicitToStringCast> - </file> <file src="lib/private/Files/Cache/QuerySearchHelper.php"> <InvalidScalarArgument occurrences="4"> <code>$value</code> @@ -4056,9 +3680,6 @@ <TypeDoesNotContainType occurrences="1"> <code>$data ?? $this->getData($file)</code> </TypeDoesNotContainType> - <UndefinedInterfaceMethod occurrences="1"> - <code>$child</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Cache/Storage.php"> <InvalidNullableReturnType occurrences="1"> @@ -4068,23 +3689,11 @@ <code>self::getGlobalCache()->getStorageInfo($storageId)</code> </NullableReturnStatement> </file> - <file src="lib/private/Files/Cache/StorageGlobal.php"> - <ImplicitToStringCast occurrences="1"> - <code>$builder->createNamedParameter(array_values($storageIds), IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> - </file> <file src="lib/private/Files/Cache/Updater.php"> <RedundantCondition occurrences="1"> <code>$this->cache instanceof Cache</code> </RedundantCondition> </file> - <file src="lib/private/Files/Cache/Watcher.php"> - <UndefinedInterfaceMethod occurrences="3"> - <code>$cachedData</code> - <code>$entry</code> - <code>$entry</code> - </UndefinedInterfaceMethod> - </file> <file src="lib/private/Files/Cache/Wrapper/CacheJail.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>array</code> @@ -4099,20 +3708,6 @@ <code>array</code> <code>array</code> </LessSpecificImplementedReturnType> - <UndefinedInterfaceMethod occurrences="1"> - <code>$entry</code> - </UndefinedInterfaceMethod> - </file> - <file src="lib/private/Files/Cache/Wrapper/CachePermissionsMask.php"> - <InvalidReturnStatement occurrences="1"> - <code>$entry</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>formatCacheEntry</code> - </InvalidReturnType> - <UndefinedInterfaceMethod occurrences="1"> - <code>$entry</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php"> <LessSpecificImplementedReturnType occurrences="1"> @@ -4139,35 +3734,24 @@ </TypeDoesNotContainType> </file> <file src="lib/private/Files/Config/UserMountCache.php"> - <ImplicitToStringCast occurrences="1"> - <code>$builder->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> <InvalidArgument occurrences="1"/> <InvalidReturnType occurrences="2"> - <code>removeUserStorageMount</code> <code>remoteStorageMounts</code> + <code>removeUserStorageMount</code> </InvalidReturnType> <LessSpecificImplementedReturnType occurrences="1"> <code>array</code> </LessSpecificImplementedReturnType> <UndefinedInterfaceMethod occurrences="9"> + <code>$this->cacheInfoCache</code> + <code>$this->cacheInfoCache</code> + <code>$this->cacheInfoCache</code> <code>$this->mountsForUsers</code> <code>$this->mountsForUsers</code> <code>$this->mountsForUsers</code> <code>$this->mountsForUsers</code> <code>$this->mountsForUsers</code> <code>$this->mountsForUsers</code> - <code>$this->cacheInfoCache</code> - <code>$this->cacheInfoCache</code> - <code>$this->cacheInfoCache</code> - </UndefinedInterfaceMethod> - </file> - <file src="lib/private/Files/FileInfo.php"> - <UndefinedInterfaceMethod occurrences="4"> - <code>$this->data</code> - <code>$data</code> - <code>$data</code> - <code>$data</code> </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Filesystem.php"> @@ -4221,8 +3805,8 @@ </file> <file src="lib/private/Files/Node/File.php"> <InvalidReturnStatement occurrences="2"> - <code>new NonExistingFile($this->root, $this->view, $path)</code> <code>$this->view->hash($type, $this->path, $raw)</code> + <code>new NonExistingFile($this->root, $this->view, $path)</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> <code>string</code> @@ -4241,12 +3825,12 @@ <code>string</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="2"> - <code>new NonExistingFolder($this->root, $this->view, $path)</code> <code>$this->root->get($this->getFullPath($path))</code> + <code>new NonExistingFolder($this->root, $this->view, $path)</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> - <code>string</code> <code>\OC\Files\Node\Node</code> + <code>string</code> </InvalidReturnType> <MoreSpecificImplementedParamType occurrences="1"> <code>$node</code> @@ -4255,8 +3839,8 @@ <code>null</code> </NullableReturnStatement> <UndefinedInterfaceMethod occurrences="2"> - <code>getUnJailedPath</code> <code>getSourceStorage</code> + <code>getUnJailedPath</code> </UndefinedInterfaceMethod> <UndefinedThisPropertyAssignment occurrences="1"> <code>$this->exists</code> @@ -4264,18 +3848,18 @@ </file> <file src="lib/private/Files/Node/HookConnector.php"> <InvalidArgument occurrences="13"> - <code>'\OCP\Files::preWrite'</code> - <code>'\OCP\Files::postWrite'</code> - <code>'\OCP\Files::preCreate'</code> + <code>'\OCP\Files::postCopy'</code> <code>'\OCP\Files::postCreate'</code> - <code>'\OCP\Files::preDelete'</code> <code>'\OCP\Files::postDelete'</code> - <code>'\OCP\Files::preTouch'</code> - <code>'\OCP\Files::postTouch'</code> - <code>'\OCP\Files::preRename'</code> <code>'\OCP\Files::postRename'</code> + <code>'\OCP\Files::postTouch'</code> + <code>'\OCP\Files::postWrite'</code> <code>'\OCP\Files::preCopy'</code> - <code>'\OCP\Files::postCopy'</code> + <code>'\OCP\Files::preCreate'</code> + <code>'\OCP\Files::preDelete'</code> + <code>'\OCP\Files::preRename'</code> + <code>'\OCP\Files::preTouch'</code> + <code>'\OCP\Files::preWrite'</code> <code>'\OCP\Files::read'</code> </InvalidArgument> <TooManyArguments occurrences="13"> @@ -4325,15 +3909,15 @@ <code>int</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="3"> - <code>$this->root->get($newPath)</code> <code>$targetNode</code> <code>$targetNode</code> + <code>$this->root->get($newPath)</code> </InvalidReturnStatement> <InvalidReturnType occurrences="4"> <code>Node</code> - <code>getChecksum</code> <code>\OC\Files\Node\Node</code> <code>\OC\Files\Node\Node</code> + <code>getChecksum</code> </InvalidReturnType> <NullableReturnStatement occurrences="1"> <code>$this->getFileInfo()->getId()</code> @@ -4347,16 +3931,16 @@ </file> <file src="lib/private/Files/Node/Root.php"> <ImplementedReturnTypeMismatch occurrences="2"> - <code>string</code> <code>Node</code> + <code>string</code> </ImplementedReturnTypeMismatch> <InvalidNullableReturnType occurrences="7"> - <code>\OC\User\User</code> <code>\OC\Files\Mount\MountPoint</code> - <code>int</code> + <code>\OC\User\User</code> <code>array</code> <code>int</code> <code>int</code> + <code>int</code> <code>string</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="1"> @@ -4366,8 +3950,8 @@ <code>string</code> </InvalidReturnType> <NullableReturnStatement occurrences="7"> - <code>$this->user</code> <code>$this->mountManager->find($mountPoint)</code> + <code>$this->user</code> <code>null</code> <code>null</code> <code>null</code> @@ -4393,12 +3977,6 @@ <code>$source</code> <code>$target</code> </ParamNameMismatch> - <UndefinedInterfaceMethod occurrences="4"> - <code>$child</code> - <code>$child</code> - <code>$child</code> - <code>$file</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/ObjectStore/S3ConnectionTrait.php"> <InternalClass occurrences="1"> @@ -4449,11 +4027,14 @@ <code>string|false</code> </ImplementedReturnTypeMismatch> <InvalidNullableReturnType occurrences="2"> - <code>getMetaData</code> <code>array</code> + <code>getMetaData</code> </InvalidNullableReturnType> - <InvalidOperand occurrences="1"> + <InvalidOperand occurrences="4"> <code>!$permissions</code> + <code>$result</code> + <code>$result</code> + <code>$result</code> </InvalidOperand> <InvalidReturnStatement occurrences="1"> <code>$count</code> @@ -4464,16 +4045,16 @@ <NoInterfaceProperties occurrences="8"> <code>$storage->cache</code> <code>$storage->cache</code> - <code>$storage->scanner</code> - <code>$storage->scanner</code> <code>$storage->propagator</code> <code>$storage->propagator</code> + <code>$storage->scanner</code> + <code>$storage->scanner</code> <code>$storage->updater</code> <code>$storage->updater</code> </NoInterfaceProperties> <NullableReturnStatement occurrences="2"> - <code>null</code> <code>$this->getStorageCache()->getAvailability()</code> + <code>null</code> </NullableReturnStatement> </file> <file src="lib/private/Files/Storage/DAV.php"> @@ -4495,26 +4076,18 @@ <code>fopen</code> <code>int</code> </InvalidReturnType> - <NullArgument occurrences="1"> - <code>null</code> - </NullArgument> <NullableReturnStatement occurrences="1"> <code>null</code> </NullableReturnStatement> - <UndefinedInterfaceMethod occurrences="3"> - <code>$cachedData</code> - <code>$cachedData</code> - <code>$cachedData</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Storage/FailedStorage.php"> <InvalidReturnStatement occurrences="2"> - <code>true</code> <code>new FailedCache()</code> + <code>true</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> - <code>verifyPath</code> <code>getCache</code> + <code>verifyPath</code> </InvalidReturnType> <InvalidScalarArgument occurrences="39"> <code>$this->e->getCode()</code> @@ -4567,9 +4140,9 @@ </InvalidReturnType> <ParamNameMismatch occurrences="4"> <code>$source</code> - <code>$target</code> <code>$source</code> <code>$target</code> + <code>$target</code> </ParamNameMismatch> </file> <file src="lib/private/Files/Storage/Local.php"> @@ -4579,23 +4152,26 @@ <InvalidNullableReturnType occurrences="1"> <code>getMetaData</code> </InvalidNullableReturnType> + <InvalidOperand occurrences="1"> + <code>$result</code> + </InvalidOperand> <InvalidReturnStatement occurrences="3"> <code>$helper->getFileSize($fullPath)</code> - <code>file_put_contents($this->getSourcePath($path), $data)</code> <code>$space</code> + <code>file_put_contents($this->getSourcePath($path), $data)</code> </InvalidReturnStatement> <InvalidReturnType occurrences="3"> - <code>filesize</code> <code>file_put_contents</code> + <code>filesize</code> <code>free_space</code> </InvalidReturnType> <NullableReturnStatement occurrences="2"> - <code>null</code> <code>$helper->getFileSize($fullPath)</code> + <code>null</code> </NullableReturnStatement> <TypeDoesNotContainNull occurrences="2"> - <code>is_null($space)</code> <code>$space === false || is_null($space)</code> + <code>is_null($space)</code> </TypeDoesNotContainNull> <TypeDoesNotContainType occurrences="1"> <code>$stat === false</code> @@ -4608,41 +4184,42 @@ </NoInterfaceProperties> </file> <file src="lib/private/Files/Storage/Wrapper/Availability.php"> - <InvalidNullableReturnType occurrences="34"> - <code>mkdir</code> - <code>rmdir</code> - <code>opendir</code> - <code>is_dir</code> - <code>is_file</code> - <code>stat</code> - <code>filesize</code> - <code>isCreatable</code> - <code>isReadable</code> - <code>isUpdatable</code> - <code>isDeletable</code> - <code>isSharable</code> - <code>getPermissions</code> + <InvalidNullableReturnType occurrences="35"> + <code>copy</code> + <code>copyFromStorage</code> <code>file_exists</code> - <code>filemtime</code> <code>file_get_contents</code> <code>file_put_contents</code> - <code>unlink</code> - <code>rename</code> - <code>copy</code> + <code>filemtime</code> + <code>filesize</code> + <code>filetype</code> <code>fopen</code> - <code>getMimeType</code> - <code>hash</code> <code>free_space</code> - <code>search</code> - <code>touch</code> + <code>getDirectDownload</code> + <code>getETag</code> <code>getLocalFile</code> - <code>hasUpdated</code> + <code>getMetaData</code> + <code>getMimeType</code> <code>getOwner</code> - <code>getETag</code> - <code>getDirectDownload</code> - <code>copyFromStorage</code> + <code>getPermissions</code> + <code>hasUpdated</code> + <code>hash</code> + <code>isCreatable</code> + <code>isDeletable</code> + <code>isReadable</code> + <code>isSharable</code> + <code>isUpdatable</code> + <code>is_dir</code> + <code>is_file</code> + <code>mkdir</code> <code>moveFromStorage</code> - <code>getMetaData</code> + <code>opendir</code> + <code>rename</code> + <code>rmdir</code> + <code>search</code> + <code>stat</code> + <code>touch</code> + <code>unlink</code> </InvalidNullableReturnType> <InvalidReturnType occurrences="1"> <code>\Traversable</code> @@ -4650,18 +4227,18 @@ </file> <file src="lib/private/Files/Storage/Wrapper/Encoding.php"> <FalsableReturnStatement occurrences="12"> - <code>$this->storage->opendir($this->findPathToUse($path))</code> - <code>$this->storage->stat($this->findPathToUse($path))</code> - <code>$this->storage->filesize($this->findPathToUse($path))</code> - <code>$this->storage->filemtime($this->findPathToUse($path))</code> - <code>$this->storage->file_get_contents($this->findPathToUse($path))</code> <code>$result</code> + <code>$this->storage->file_get_contents($this->findPathToUse($path))</code> + <code>$this->storage->filemtime($this->findPathToUse($path))</code> + <code>$this->storage->filesize($this->findPathToUse($path))</code> + <code>$this->storage->free_space($this->findPathToUse($path))</code> + <code>$this->storage->getETag($this->findPathToUse($path))</code> + <code>$this->storage->getLocalFile($this->findPathToUse($path))</code> <code>$this->storage->getMimeType($this->findPathToUse($path))</code> <code>$this->storage->hash($type, $this->findPathToUse($path), $raw)</code> - <code>$this->storage->free_space($this->findPathToUse($path))</code> + <code>$this->storage->opendir($this->findPathToUse($path))</code> <code>$this->storage->search($query)</code> - <code>$this->storage->getLocalFile($this->findPathToUse($path))</code> - <code>$this->storage->getETag($this->findPathToUse($path))</code> + <code>$this->storage->stat($this->findPathToUse($path))</code> </FalsableReturnStatement> <ImplementedReturnTypeMismatch occurrences="1"> <code>bool</code> @@ -4690,11 +4267,11 @@ </file> <file src="lib/private/Files/Storage/Wrapper/Encryption.php"> <FalsableReturnStatement occurrences="5"> - <code>$this->storage->filesize($path)</code> - <code>false</code> + <code>$stat</code> <code>$this->storage->file_get_contents($path)</code> + <code>$this->storage->filesize($path)</code> <code>$this->storage->getLocalFile($path)</code> - <code>$stat</code> + <code>false</code> </FalsableReturnStatement> <ImplementedReturnTypeMismatch occurrences="1"> <code>resource|bool</code> @@ -4706,9 +4283,14 @@ <InvalidNullableReturnType occurrences="1"> <code>array</code> </InvalidNullableReturnType> + <InvalidOperand occurrences="3"> + <code>$result</code> + <code>$result</code> + <code>$result</code> + </InvalidOperand> <InvalidReturnStatement occurrences="2"> - <code>$written</code> <code>$newUnencryptedSize</code> + <code>$written</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> <code>bool</code> @@ -4721,30 +4303,21 @@ <NullableReturnStatement occurrences="1"> <code>null</code> </NullableReturnStatement> - <UndefinedInterfaceMethod occurrences="7"> - <code>$info</code> - <code>$info</code> - <code>$info</code> - <code>$entry</code> - <code>$sourceStorage->getCache()->get($sourceInternalPath)</code> - <code>$info</code> - <code>$info</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Storage/Wrapper/Jail.php"> <FalsableReturnStatement occurrences="12"> - <code>$this->getWrapperStorage()->opendir($this->getUnjailedPath($path))</code> - <code>$this->getWrapperStorage()->stat($this->getUnjailedPath($path))</code> - <code>$this->getWrapperStorage()->filesize($this->getUnjailedPath($path))</code> - <code>$this->getWrapperStorage()->filemtime($this->getUnjailedPath($path))</code> <code>$this->getWrapperStorage()->file_get_contents($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->filemtime($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->filesize($this->getUnjailedPath($path))</code> <code>$this->getWrapperStorage()->fopen($this->getUnjailedPath($path), $mode)</code> + <code>$this->getWrapperStorage()->free_space($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->getETag($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->getLocalFile($this->getUnjailedPath($path))</code> <code>$this->getWrapperStorage()->getMimeType($this->getUnjailedPath($path))</code> <code>$this->getWrapperStorage()->hash($type, $this->getUnjailedPath($path), $raw)</code> - <code>$this->getWrapperStorage()->free_space($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->opendir($this->getUnjailedPath($path))</code> <code>$this->getWrapperStorage()->search($query)</code> - <code>$this->getWrapperStorage()->getLocalFile($this->getUnjailedPath($path))</code> - <code>$this->getWrapperStorage()->getETag($this->getUnjailedPath($path))</code> + <code>$this->getWrapperStorage()->stat($this->getUnjailedPath($path))</code> </FalsableReturnStatement> <ImplementedReturnTypeMismatch occurrences="1"> <code>bool</code> @@ -4763,8 +4336,8 @@ </file> <file src="lib/private/Files/Storage/Wrapper/Quota.php"> <FalsableReturnStatement occurrences="2"> - <code>$this->storage->free_space($path)</code> <code>$source</code> + <code>$this->storage->free_space($path)</code> </FalsableReturnStatement> <InvalidReturnStatement occurrences="1"> <code>$extension === 'part'</code> @@ -4779,25 +4352,22 @@ <code>$source</code> <code>$target</code> </ParamNameMismatch> - <UndefinedInterfaceMethod occurrences="1"> - <code>$data</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Files/Storage/Wrapper/Wrapper.php"> <FalsableReturnStatement occurrences="13"> - <code>$this->getWrapperStorage()->opendir($path)</code> - <code>$this->getWrapperStorage()->stat($path)</code> - <code>$this->getWrapperStorage()->filesize($path)</code> - <code>$this->getWrapperStorage()->filemtime($path)</code> <code>$this->getWrapperStorage()->file_get_contents($path)</code> + <code>$this->getWrapperStorage()->filemtime($path)</code> + <code>$this->getWrapperStorage()->filesize($path)</code> <code>$this->getWrapperStorage()->fopen($path, $mode)</code> + <code>$this->getWrapperStorage()->free_space($path)</code> + <code>$this->getWrapperStorage()->getDirectDownload($path)</code> + <code>$this->getWrapperStorage()->getETag($path)</code> + <code>$this->getWrapperStorage()->getLocalFile($path)</code> <code>$this->getWrapperStorage()->getMimeType($path)</code> <code>$this->getWrapperStorage()->hash($type, $path, $raw)</code> - <code>$this->getWrapperStorage()->free_space($path)</code> + <code>$this->getWrapperStorage()->opendir($path)</code> <code>$this->getWrapperStorage()->search($query)</code> - <code>$this->getWrapperStorage()->getLocalFile($path)</code> - <code>$this->getWrapperStorage()->getETag($path)</code> - <code>$this->getWrapperStorage()->getDirectDownload($path)</code> + <code>$this->getWrapperStorage()->stat($path)</code> </FalsableReturnStatement> <ImplementedReturnTypeMismatch occurrences="1"> <code>bool</code> @@ -4811,14 +4381,6 @@ <code>true</code> </InvalidReturnType> </file> - <file src="lib/private/Files/Stream/Encryption.php"> - <InvalidScalarArgument occurrences="1"> - <code>$position</code> - </InvalidScalarArgument> - <UndefinedInterfaceMethod occurrences="1"> - <code>$cacheEntry</code> - </UndefinedInterfaceMethod> - </file> <file src="lib/private/Files/Stream/SeekableHttpStream.php"> <FalsableReturnStatement occurrences="3"> <code>false</code> @@ -4835,9 +4397,6 @@ </InvalidReturnType> </file> <file src="lib/private/Files/Type/Loader.php"> - <ImplicitToStringCast occurrences="1"> - <code>$update->func()->lower('name')</code> - </ImplicitToStringCast> <InvalidReturnStatement occurrences="1"> <code>$update->execute()</code> </InvalidReturnStatement> @@ -4859,8 +4418,8 @@ <code>$mount</code> </InvalidArgument> <InvalidNullableReturnType occurrences="2"> - <code>string</code> <code>\OCP\Files\Mount\IMountPoint</code> + <code>string</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="1"> <code>$results</code> @@ -4869,49 +4428,27 @@ <code>\OC\Files\Mount\MountPoint</code> </InvalidReturnType> <InvalidScalarArgument occurrences="3"> + <code>$fileId</code> <code>$mtime</code> <code>$user</code> - <code>$fileId</code> </InvalidScalarArgument> <NullableReturnStatement occurrences="6"> - <code>null</code> + <code>$mount</code> <code>Filesystem::getMountManager()->find($this->getAbsolutePath($path))</code> <code>null</code> <code>null</code> <code>null</code> - <code>$mount</code> + <code>null</code> </NullableReturnStatement> <RedundantCondition occurrences="3"> + <code>$result && in_array('delete', $hooks) and $result</code> <code>$storage1</code> <code>is_resource($source)</code> - <code>$result && in_array('delete', $hooks) and $result</code> </RedundantCondition> <UndefinedDocblockClass occurrences="2"> - <code>list($storage, $internalPath)</code> <code>$storage</code> + <code>[$storage, $internalPath]</code> </UndefinedDocblockClass> - <UndefinedInterfaceMethod occurrences="20"> - <code>$data</code> - <code>$data</code> - <code>$data</code> - <code>$data</code> - <code>$content</code> - <code>$content</code> - <code>$content</code> - <code>$content</code> - <code>$content</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - <code>$rootEntry</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/FullTextSearch/Model/IndexDocument.php"> <TypeDoesNotContainNull occurrences="1"> @@ -4919,12 +4456,6 @@ </TypeDoesNotContainNull> </file> <file src="lib/private/Group/Database.php"> - <ImplicitToStringCast occurrences="4"> - <code>$builder->createNamedParameter($gid)</code> - <code>$builder->createNamedParameter($gid)</code> - <code>$qb->createNamedParameter($uid)</code> - <code>$qb->createNamedParameter($gid)</code> - </ImplicitToStringCast> <InvalidArgument occurrences="1"/> <InvalidArrayOffset occurrences="1"> <code>$this->groupCache[$gid]['displayname']</code> @@ -4936,20 +4467,32 @@ </InvalidPropertyAssignmentValue> </file> <file src="lib/private/Group/Group.php"> - <InvalidArgument occurrences="6"> - <code>IGroup::class . '::preAddUser'</code> + <InvalidArgument occurrences="7"> <code>IGroup::class . '::postAddUser'</code> - <code>IGroup::class . '::preRemoveUser'</code> + <code>IGroup::class . '::postDelete'</code> <code>IGroup::class . '::postRemoveUser'</code> + <code>IGroup::class . '::preAddUser'</code> <code>IGroup::class . '::preDelete'</code> - <code>IGroup::class . '::postDelete'</code> + <code>IGroup::class . '::preRemoveUser'</code> + <code>bool</code> </InvalidArgument> <InvalidOperand occurrences="1"> <code>$hide</code> </InvalidOperand> + <InvalidReturnStatement occurrences="1"> + <code>$users</code> + </InvalidReturnStatement> + <InvalidReturnType occurrences="1"> + <code>int|bool</code> + </InvalidReturnType> <MoreSpecificImplementedParamType occurrences="1"> <code>$user</code> </MoreSpecificImplementedParamType> + <RedundantCondition occurrences="3"> + <code>$this->emitter</code> + <code>$this->emitter</code> + <code>$this->emitter</code> + </RedundantCondition> <TooManyArguments occurrences="6"> <code>dispatch</code> <code>dispatch</code> @@ -4960,9 +4503,9 @@ </TooManyArguments> <UndefinedMethod occurrences="4"> <code>addToGroup</code> - <code>removeFromGroup</code> <code>countUsersInGroup</code> <code>deleteGroup</code> + <code>removeFromGroup</code> </UndefinedMethod> </file> <file src="lib/private/Group/Manager.php"> @@ -4979,8 +4522,8 @@ <code>\OC\Group\Group[]</code> </InvalidReturnType> <UndefinedInterfaceMethod occurrences="3"> - <code>getGroupDetails</code> <code>createGroup</code> + <code>getGroupDetails</code> <code>isAdmin</code> </UndefinedInterfaceMethod> </file> @@ -5049,13 +4592,6 @@ <code>$data</code> </InvalidScalarArgument> </file> - <file src="lib/private/Lock/DBLockingProvider.php"> - <ImplicitToStringCast occurrences="3"> - <code>$query->func()->subtract('lock', $query->createNamedParameter(1))</code> - <code>$builder->func()->subtract('lock', $builder->expr()->literal(1))</code> - <code>$builder->createNamedParameter($chunk, IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> - </file> <file src="lib/private/Lockdown/Filesystem/NullCache.php"> <InvalidNullableReturnType occurrences="1"> <code>get</code> @@ -5070,16 +4606,16 @@ </file> <file src="lib/private/Lockdown/Filesystem/NullStorage.php"> <InvalidNullableReturnType occurrences="2"> - <code>getPermissions</code> <code>getOwner</code> + <code>getPermissions</code> </InvalidNullableReturnType> <InvalidReturnStatement occurrences="2"> <code>new IteratorDirectory([])</code> <code>new NullCache()</code> </InvalidReturnStatement> <InvalidReturnType occurrences="2"> - <code>opendir</code> <code>getCache</code> + <code>opendir</code> </InvalidReturnType> <NullableReturnStatement occurrences="2"> <code>null</code> @@ -5099,28 +4635,19 @@ </file> <file src="lib/private/Log.php"> <RedundantCondition occurrences="1"> - <code>$request && hash_equals($logCondition['shared_secret'], $logSecretRequest)</code> + <code>$request</code> </RedundantCondition> </file> <file src="lib/private/Log/File.php"> - <RedundantCondition occurrences="1"> - <code>$limit === null ||$entriesCount < $limit</code> - </RedundantCondition> + <TypeDoesNotContainNull occurrences="1"> + <code>$limit === null</code> + </TypeDoesNotContainNull> </file> <file src="lib/private/Log/LogDetails.php"> <RedundantCondition occurrences="1"> <code>is_string($request->getMethod())</code> </RedundantCondition> </file> - <file src="lib/private/Log/LogFactory.php"> - <InvalidReturnStatement occurrences="2"> - <code>$this->c->resolve(Syslog::class)</code> - <code>$this->c->resolve(Systemdlog::class)</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>IWriter</code> - </InvalidReturnType> - </file> <file src="lib/private/Log/Systemdlog.php"> <UndefinedFunction occurrences="1"/> </file> @@ -5132,24 +4659,16 @@ <code>$failedRecipients</code> </NullableReturnStatement> <UndefinedInterfaceMethod occurrences="3"> + <code>getSubject</code> <code>getSwiftMessage</code> <code>getTo</code> - <code>getSubject</code> </UndefinedInterfaceMethod> </file> <file src="lib/private/Memcache/APCu.php"> - <InvalidReturnStatement occurrences="5"> - <code>apcu_store($this->getPrefix() . $key, $value, $ttl)</code> - <code>apcu_exists($this->getPrefix() . $key)</code> - <code>apcu_delete($this->getPrefix() . $key)</code> - <code>apcu_delete($iter)</code> + <InvalidReturnStatement occurrences="1"> <code>apcu_add($this->getPrefix() . $key, $value, $ttl)</code> </InvalidReturnStatement> - <InvalidReturnType occurrences="5"> - <code>set</code> - <code>hasKey</code> - <code>remove</code> - <code>clear</code> + <InvalidReturnType occurrences="1"> <code>bool</code> </InvalidReturnType> </file> @@ -5162,9 +4681,9 @@ </LessSpecificImplementedReturnType> </file> <file src="lib/private/Memcache/Factory.php"> - <RedundantCondition occurrences="1"> - <code>$lockingCacheClass && class_exists($distributedCacheClass) && $lockingCacheClass::isAvailable()</code> - </RedundantCondition> + <TypeDoesNotContainType occurrences="1"> + <code>$lockingCacheClass && class_exists($distributedCacheClass)</code> + </TypeDoesNotContainType> </file> <file src="lib/private/Memcache/Memcached.php"> <RedundantCondition occurrences="1"> @@ -5179,12 +4698,6 @@ <code>exec</code> <code>exec</code> </InvalidMethodCall> - <InvalidReturnStatement occurrences="1"> - <code>self::$cache->exists($this->getNameSpace() . $key)</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>hasKey</code> - </InvalidReturnType> </file> <file src="lib/private/Migration/BackgroundRepair.php"> <MoreSpecificImplementedParamType occurrences="1"> @@ -5192,10 +4705,10 @@ </MoreSpecificImplementedParamType> </file> <file src="lib/private/Notification/Manager.php"> - <RedundantCondition occurrences="2"> - <code>!($notification instanceof INotification) || !$notification->isValidParsed()</code> - <code>!($notification instanceof INotification) || !$notification->isValidParsed()</code> - </RedundantCondition> + <TypeDoesNotContainType occurrences="2"> + <code>!($notification instanceof INotification)</code> + <code>!($notification instanceof INotification)</code> + </TypeDoesNotContainType> </file> <file src="lib/private/Preview/BackgroundCleanupJob.php"> <InvalidReturnStatement occurrences="1"> @@ -5209,8 +4722,8 @@ </file> <file src="lib/private/Preview/Generator.php"> <InvalidArgument occurrences="2"> - <code>IPreview::EVENT</code> <code>$maxPreviewImage</code> + <code>IPreview::EVENT</code> </InvalidArgument> <InvalidNullableReturnType occurrences="1"> <code>ISimpleFile</code> @@ -5229,13 +4742,13 @@ <code>dispatch</code> </TooManyArguments> <UndefinedInterfaceMethod occurrences="7"> - <code>valid</code> <code>height</code> - <code>width</code> - <code>width</code> <code>height</code> <code>preciseResizeCopy</code> <code>resizeCopy</code> + <code>valid</code> + <code>width</code> + <code>width</code> </UndefinedInterfaceMethod> </file> <file src="lib/private/Preview/GeneratorHelper.php"> @@ -5293,8 +4806,8 @@ </file> <file src="lib/private/RedisFactory.php"> <InvalidPropertyAssignmentValue occurrences="2"> - <code>new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $config['password'])</code> <code>new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout)</code> + <code>new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $config['password'])</code> </InvalidPropertyAssignmentValue> <InvalidScalarArgument occurrences="1"> <code>\RedisCluster::OPT_SLAVE_FAILOVER</code> @@ -5324,17 +4837,10 @@ <code>dispatch</code> </TooManyArguments> </file> - <file src="lib/private/Repair/CleanTags.php"> - <ImplicitToStringCast occurrences="2"> - <code>$query->createNamedParameter($users, IQueryBuilder::PARAM_STR_ARRAY)</code> - <code>$qb->createParameter('ids')</code> - </ImplicitToStringCast> - </file> <file src="lib/private/Repair/RemoveLinkShares.php"> - <ImplicitToStringCast occurrences="3"> - <code>$subQuery->createFunction('(' . $subSubQuery->getSQL() . ')')</code> - <code>$query->createFunction('(' . $subQuery->getSQL() . ')')</code> + <ImplicitToStringCast occurrences="2"> <code>$query->createFunction('(' . $subQuery->getSQL() . ')')</code> + <code>$subQuery->createFunction('(' . $subSubQuery->getSQL() . ')')</code> </ImplicitToStringCast> <InvalidPropertyAssignmentValue occurrences="1"> <code>$this->userToNotify</code> @@ -5346,16 +4852,6 @@ <code>\Doctrine\DBAL\Driver\Statement</code> </InvalidReturnType> </file> - <file src="lib/private/Repair/RepairInvalidShares.php"> - <ImplicitToStringCast occurrences="1"> - <code>$permsFunc</code> - </ImplicitToStringCast> - </file> - <file src="lib/private/Repair/RepairMimeTypes.php"> - <InvalidOperand occurrences="1"> - <code>\OC_DB::executeAudited(self::updateByNameStmt(), [$mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension])</code> - </InvalidOperand> - </file> <file src="lib/private/Route/Router.php"> <InvalidClass occurrences="1"> <code>\OC_APP</code> @@ -5378,15 +4874,12 @@ <file src="lib/private/Search/Result/File.php"> <InvalidPropertyAssignmentValue occurrences="4"> <code>$data->getId()</code> - <code>$data->getPermissions()</code> <code>$data->getMtime()</code> + <code>$data->getPermissions()</code> <code>$this->hasPreview($data)</code> </InvalidPropertyAssignmentValue> </file> <file src="lib/private/Security/Bruteforce/Throttler.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->createNamedParameter($value)</code> - </ImplicitToStringCast> <NullArgument occurrences="1"> <code>null</code> </NullArgument> @@ -5403,11 +4896,6 @@ <code>string|null</code> </ImplementedReturnTypeMismatch> </file> - <file src="lib/private/Security/CertificateManager.php"> - <NullArgument occurrences="1"> - <code>null</code> - </NullArgument> - </file> <file src="lib/private/Security/CredentialsManager.php"> <InvalidReturnStatement occurrences="2"> <code>$qb->execute()</code> @@ -5420,12 +4908,12 @@ </file> <file src="lib/private/Security/Crypto.php"> <InternalMethod occurrences="6"> - <code>setPassword</code> - <code>setIV</code> + <code>decrypt</code> <code>encrypt</code> - <code>setPassword</code> <code>setIV</code> - <code>decrypt</code> + <code>setIV</code> + <code>setPassword</code> + <code>setPassword</code> </InternalMethod> </file> <file src="lib/private/Server.php"> @@ -5434,22 +4922,7 @@ <code>\OCP\Calendar\Room\IManager</code> <code>\OCP\Files\Folder|null</code> </ImplementedReturnTypeMismatch> - <InternalMethod occurrences="1"> - <code>setSQLLogger</code> - </InternalMethod> - <InvalidArgument occurrences="1"> - <code>'OCP\IUser::preDelete'</code> - </InvalidArgument> <InvalidCatch occurrences="1"/> - <InvalidScalarArgument occurrences="1"> - <code>$uid</code> - </InvalidScalarArgument> - <MoreSpecificImplementedParamType occurrences="1"> - <code>$userId</code> - </MoreSpecificImplementedParamType> - <TooManyArguments occurrences="1"> - <code>dispatch</code> - </TooManyArguments> <UndefinedDocblockClass occurrences="1"> <code>\OC\OCSClient</code> </UndefinedDocblockClass> @@ -5501,9 +4974,8 @@ <InvalidOperand occurrences="1"> <code>!self::isResharingAllowed()</code> </InvalidOperand> - <InvalidScalarArgument occurrences="3"> + <InvalidScalarArgument occurrences="2"> <code>\OC_User::getUser()</code> - <code>$shareWith</code> <code>\OC_User::getUser()</code> </InvalidScalarArgument> <UndefinedInterfaceMethod occurrences="2"> @@ -5512,32 +4984,6 @@ </UndefinedInterfaceMethod> </file> <file src="lib/private/Share20/DefaultShareProvider.php"> - <ImplicitToStringCast occurrences="27"> - <code>$qb->createNamedParameter($share->getShareType())</code> - <code>$qb->createNamedParameter($share->getSharedWith())</code> - <code>$qb->createNamedParameter(IShare::STATUS_PENDING)</code> - <code>$qb->createNamedParameter($share->getExpirationDate(), 'datetime')</code> - <code>$qb->createNamedParameter($share->getSharedWith())</code> - <code>$qb->createNamedParameter($share->getExpirationDate(), 'datetime')</code> - <code>$qb->createNamedParameter($share->getLabel())</code> - <code>$qb->createNamedParameter($share->getToken())</code> - <code>$qb->createNamedParameter($share->getPassword())</code> - <code>$qb->createNamedParameter($share->getSendPasswordByTalk(), IQueryBuilder::PARAM_BOOL)</code> - <code>$qb->createNamedParameter($share->getExpirationDate(), 'datetime')</code> - <code>$qb->createNamedParameter($share->getParent())</code> - <code>$qb->createParameter('itemType')</code> - <code>$qb->createNamedParameter($share->getNode()->getId())</code> - <code>$qb->createNamedParameter($share->getNode()->getId())</code> - <code>$qb->createNamedParameter($share->getPermissions())</code> - <code>$qb->createNamedParameter($share->getSharedBy())</code> - <code>$qb->createNamedParameter($share->getShareOwner())</code> - <code>$qb->createNamedParameter($share->getTarget())</code> - <code>$qb->createNamedParameter(time())</code> - <code>$qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($chunk, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($chunk, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)</code> - </ImplicitToStringCast> <InvalidReturnStatement occurrences="1"> <code>$shares</code> </InvalidReturnStatement> @@ -5558,27 +5004,26 @@ </file> <file src="lib/private/Share20/Manager.php"> <InvalidArgument occurrences="7"> - <code>'OCP\Share::preShare'</code> - <code>'OCP\Share::postShare'</code> + <code>$data</code> <code>'OCP\Share::postAcceptShare'</code> - <code>'OCP\Share::preUnshare'</code> + <code>'OCP\Share::postShare'</code> <code>'OCP\Share::postUnshare'</code> <code>'OCP\Share::postUnshareFromSelf'</code> - <code>$data</code> + <code>'OCP\Share::preShare'</code> + <code>'OCP\Share::preUnshare'</code> </InvalidArgument> - <InvalidScalarArgument occurrences="3"> - <code>$this->shareApiLinkDefaultExpireDays()</code> - <code>$this->shareApiLinkDefaultExpireDays()</code> + <InvalidScalarArgument occurrences="2"> <code>$id</code> + <code>$this->shareApiLinkDefaultExpireDays()</code> </InvalidScalarArgument> <TooManyArguments occurrences="7"> <code>dispatch</code> <code>dispatch</code> - <code>update</code> <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> <code>dispatch</code> + <code>update</code> </TooManyArguments> <UndefinedClass occurrences="1"> <code>\OCA\Circles\Api\v1\Circles</code> @@ -5592,17 +5037,14 @@ <code>FederatedShareProvider</code> <code>ShareByMailProvider</code> </InvalidNullableReturnType> - <InvalidReturnStatement occurrences="5"> - <code>$this->shareByCircleProvider</code> - <code>$this->roomShareProvider</code> + <InvalidReturnStatement occurrences="4"> <code>$provider</code> <code>$provider</code> - <code>$shares</code> + <code>$this->roomShareProvider</code> + <code>$this->shareByCircleProvider</code> </InvalidReturnStatement> - <InvalidReturnType occurrences="3"> - <code>getProvider</code> + <InvalidReturnType occurrences="1"> <code>getProviderForType</code> - <code>getAllProviders</code> </InvalidReturnType> <NullableReturnStatement occurrences="6"> <code>null</code> @@ -5616,11 +5058,11 @@ <code>\OCA\Circles\ShareByCircleProvider</code> </UndefinedClass> <UndefinedDocblockClass occurrences="5"> + <code>RoomShareProvider</code> <code>\OCA\Circles\ShareByCircleProvider</code> <code>\OCA\Talk\Share\RoomShareProvider</code> - <code>RoomShareProvider</code> - <code>private $shareByCircleProvider = null;</code> <code>private $roomShareProvider = null;</code> + <code>private $shareByCircleProvider = null;</code> </UndefinedDocblockClass> <UndefinedInterfaceMethod occurrences="4"> <code>getLazyRootFolder</code> @@ -5644,7 +5086,8 @@ </UndefinedInterfaceMethod> </file> <file src="lib/private/Support/Subscription/Registry.php"> - <UndefinedInterfaceMethod occurrences="1"> + <UndefinedInterfaceMethod occurrences="2"> + <code>countUsers</code> <code>getSupportedApps</code> </UndefinedInterfaceMethod> </file> @@ -5654,15 +5097,10 @@ <code>false</code> <code>false</code> </FalsableReturnStatement> - <ImplicitToStringCast occurrences="3"> - <code>$query->createParameter('tagids')</code> - <code>$query->createParameter('tagids')</code> - <code>$query->createParameter('tagids')</code> - </ImplicitToStringCast> <InvalidArgument occurrences="3"> <code>ManagerEvent::EVENT_CREATE</code> - <code>ManagerEvent::EVENT_UPDATE</code> <code>ManagerEvent::EVENT_DELETE</code> + <code>ManagerEvent::EVENT_UPDATE</code> </InvalidArgument> <InvalidReturnType occurrences="2"> <code>bool</code> @@ -5675,12 +5113,6 @@ </TooManyArguments> </file> <file src="lib/private/SystemTag/SystemTagObjectMapper.php"> - <ImplicitToStringCast occurrences="4"> - <code>$query->createParameter('objectids')</code> - <code>$query->createNamedParameter($tagIds, IQueryBuilder::PARAM_INT_ARRAY)</code> - <code>$query->createParameter('tagids')</code> - <code>$query->createParameter('objectids')</code> - </ImplicitToStringCast> <InvalidArgument occurrences="2"> <code>MapperEvent::EVENT_ASSIGN</code> <code>MapperEvent::EVENT_UNASSIGN</code> @@ -5724,16 +5156,13 @@ </file> <file src="lib/private/Template/JSResourceLocator.php"> <InvalidOperand occurrences="6"> - <code>$this->appendIfExist($this->serverroot, 'core/'.$script.'.js')</code> - <code>$this->appendIfExist($this->serverroot, $theme_dir.'core/'.$script.'.js')</code> <code>$this->appendIfExist($this->serverroot, $script.'.js')</code> <code>$this->appendIfExist($this->serverroot, $theme_dir.$script.'.js')</code> - <code>$this->appendIfExist($this->serverroot, 'apps/'.$script.'.js')</code> <code>$this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$script.'.js')</code> + <code>$this->appendIfExist($this->serverroot, $theme_dir.'core/'.$script.'.js')</code> + <code>$this->appendIfExist($this->serverroot, 'apps/'.$script.'.js')</code> + <code>$this->appendIfExist($this->serverroot, 'core/'.$script.'.js')</code> </InvalidOperand> - <TypeDoesNotContainType occurrences="1"> - <code>$found</code> - </TypeDoesNotContainType> </file> <file src="lib/private/Template/SCSSCacher.php"> <InvalidScalarArgument occurrences="1"> @@ -5745,11 +5174,10 @@ <code>string</code> <code>string</code> </InvalidParamDefault> - <InvalidScalarArgument occurrences="4"> - <code>\OC_User::getUser()</code> - <code>\OC_User::getUser()</code> + <InvalidScalarArgument occurrences="3"> <code>$appName</code> <code>$appName</code> + <code>\OC_User::getUser()</code> </InvalidScalarArgument> <TooManyArguments occurrences="1"> <code>Util::addScript('dist/unified-search', null, true)</code> @@ -5767,26 +5195,23 @@ <InvalidScalarArgument occurrences="13"> <code>0</code> <code>0</code> - <code>1</code> <code>0</code> - <code>1</code> - <code>1</code> <code>0</code> - <code>1</code> <code>0</code> <code>0</code> <code>0</code> <code>0</code> <code>0</code> + <code>1</code> + <code>1</code> + <code>1</code> + <code>1</code> </InvalidScalarArgument> - <UndefinedMethod occurrences="1"> - <code>\OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId) . '/appinfo/database.xml')</code> - </UndefinedMethod> </file> <file src="lib/private/Updater/VersionCheck.php"> <InvalidScalarArgument occurrences="2"> - <code>time()</code> <code>microtime(true)</code> + <code>time()</code> </InvalidScalarArgument> </file> <file src="lib/private/User/Backend.php"> @@ -5812,9 +5237,6 @@ <ImplementedReturnTypeMismatch occurrences="1"> <code>array|int</code> </ImplementedReturnTypeMismatch> - <ImplicitToStringCast occurrences="1"> - <code>$queryBuilder->createNamedParameter($groups, IQueryBuilder::PARAM_STR_ARRAY)</code> - </ImplicitToStringCast> <InvalidNullableReturnType occurrences="1"> <code>bool|IUser</code> </InvalidNullableReturnType> @@ -5828,8 +5250,8 @@ </NullableReturnStatement> <UndefinedInterfaceMethod occurrences="4"> <code>checkPassword</code> - <code>createUser</code> <code>countUsers</code> + <code>createUser</code> <code>getUsersForUserValueCaseInsensitive</code> </UndefinedInterfaceMethod> </file> @@ -5857,11 +5279,11 @@ </file> <file src="lib/private/User/User.php"> <InvalidArgument occurrences="5"> - <code>IUser::class . '::preDelete'</code> + <code>IUser::class . '::changeUser'</code> <code>IUser::class . '::postDelete'</code> - <code>IUser::class . '::preSetPassword'</code> <code>IUser::class . '::postSetPassword'</code> - <code>IUser::class . '::changeUser'</code> + <code>IUser::class . '::preDelete'</code> + <code>IUser::class . '::preSetPassword'</code> </InvalidArgument> <InvalidNullableReturnType occurrences="1"> <code>getBackend</code> @@ -5876,8 +5298,8 @@ <code>IImage|null</code> </InvalidReturnType> <InvalidScalarArgument occurrences="2"> - <code>$this->lastLogin</code> <code>$quota</code> + <code>$this->lastLogin</code> </InvalidScalarArgument> <NullableReturnStatement occurrences="1"> <code>$this->backend</code> @@ -5890,11 +5312,11 @@ <code>dispatch</code> </TooManyArguments> <UndefinedInterfaceMethod occurrences="5"> - <code>setDisplayName</code> + <code>canChangeAvatar</code> <code>deleteUserAvatar</code> - <code>setPassword</code> <code>getHome</code> - <code>canChangeAvatar</code> + <code>setDisplayName</code> + <code>setPassword</code> </UndefinedInterfaceMethod> </file> <file src="lib/private/UserStatus/Manager.php"> @@ -5926,13 +5348,11 @@ <NullableReturnStatement occurrences="1"> <code>null</code> </NullableReturnStatement> - <RedundantCondition occurrences="1"> - <code>$appId === null || trim($appId) === ''</code> - </RedundantCondition> <TooManyArguments occurrences="1"> <code>dispatch</code> </TooManyArguments> - <TypeDoesNotContainNull occurrences="1"> + <TypeDoesNotContainNull occurrences="2"> + <code>$appId === null</code> <code>$appId === null</code> </TypeDoesNotContainNull> </file> @@ -5960,11 +5380,10 @@ </UndefinedDocblockClass> </file> <file src="lib/private/legacy/OC_Files.php"> - <EmptyArrayAccess occurrences="2"/> <InvalidArgument occurrences="3"> + <code>$fh</code> <code>$fileInfos</code> <code>[$fileInfo]</code> - <code>$fh</code> </InvalidArgument> <InvalidScalarArgument occurrences="1"> <code>mt_rand()</code> @@ -5979,6 +5398,9 @@ </UndefinedInterfaceMethod> </file> <file src="lib/private/legacy/OC_Helper.php"> + <InvalidOperand occurrences="1"> + <code>$matches[1][$last_match][0]</code> + </InvalidOperand> <InvalidReturnStatement occurrences="4"> <code>(INF > 0)? INF: PHP_INT_MAX</code> <code>INF</code> @@ -5989,13 +5411,13 @@ <code>int</code> </InvalidReturnType> <InvalidScalarArgument occurrences="4"> - <code>$path</code> <code>$includeExtStorage ? 'ext' : false</code> + <code>$path</code> <code>$quota</code> <code>'ext'</code> </InvalidScalarArgument> <RedundantCondition occurrences="1"> - <code>count($obd_values) > 0 and $obd_values[0]</code> + <code>count($obd_values) > 0</code> </RedundantCondition> <UndefinedInterfaceMethod occurrences="1"> <code>getSourceStorage</code> @@ -6003,9 +5425,9 @@ </file> <file src="lib/private/legacy/OC_Image.php"> <FalsableReturnStatement occurrences="3"> + <code>$this->resource</code> <code>$this->valid() ? imagesx($this->resource) : -1</code> <code>$this->valid() ? imagesy($this->resource) : -1</code> - <code>$this->resource</code> </FalsableReturnStatement> <ImplementedReturnTypeMismatch occurrences="1"> <code>null|string</code> @@ -6014,12 +5436,13 @@ <code>$data[floor($p)]</code> <code>$data[floor($p)]</code> </InvalidArrayOffset> + <InvalidPropertyAssignmentValue occurrences="1"> + <code>$resource</code> + </InvalidPropertyAssignmentValue> <InvalidReturnType occurrences="1"> <code>bool</code> </InvalidReturnType> <InvalidScalarArgument occurrences="17"> - <code>$this->bitDepth</code> - <code>90</code> <code>$imagePath</code> <code>$imagePath</code> <code>$imagePath</code> @@ -6033,15 +5456,21 @@ <code>$imagePath</code> <code>$imagePath</code> <code>$imagePath</code> + <code>$this->bitDepth</code> <code>$x</code> <code>$y</code> + <code>90</code> </InvalidScalarArgument> <MismatchingDocblockReturnType occurrences="1"> <code>bool</code> </MismatchingDocblockReturnType> <RedundantCondition occurrences="1"> - <code>$isWritable && file_exists($filePath)</code> + <code>$isWritable</code> </RedundantCondition> + <TypeDoesNotContainType occurrences="2"> + <code>get_class($resource) === 'GdImage'</code> + <code>get_class($this->resource) === 'GdImage'</code> + </TypeDoesNotContainType> </file> <file src="lib/private/legacy/OC_JSON.php"> <InvalidScalarArgument occurrences="1"> @@ -6055,15 +5484,12 @@ </file> <file src="lib/private/legacy/OC_Util.php"> <InternalMethod occurrences="2"> - <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false)</code> <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($prevLogging)</code> + <code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false)</code> </InternalMethod> - <InvalidOperand occurrences="4"> - <code>$version</code> - <code>$version</code> - <code>$version</code> - <code>$version</code> - </InvalidOperand> + <InvalidLiteralArgument occurrences="1"> + <code>\OCP\Constants::FILENAME_INVALID_CHARS</code> + </InvalidLiteralArgument> <InvalidReturnStatement occurrences="1"> <code>OC_Helper::computerFileSize($userQuota)</code> </InvalidReturnStatement> @@ -6075,13 +5501,13 @@ <code>OC_User::getUser()</code> </InvalidScalarArgument> <RedundantCondition occurrences="2"> - <code>is_string($expected)</code> <code>'off'</code> + <code>is_string($expected)</code> </RedundantCondition> <TypeDoesNotContainType occurrences="3"> <code>is_bool($expected)</code> - <code>is_int($expected)</code> <code>is_bool($setting[1])</code> + <code>is_int($expected)</code> </TypeDoesNotContainType> <UndefinedInterfaceMethod occurrences="1"> <code>clearCache</code> @@ -6105,19 +5531,6 @@ <code>$column</code> </NullableReturnStatement> </file> - <file src="lib/public/AppFramework/Db/QBMapper.php"> - <ImplicitToStringCast occurrences="1"> - <code>$qb->createNamedParameter($value, $type)</code> - </ImplicitToStringCast> - </file> - <file src="lib/public/AppFramework/Http/DataResponse.php"> - <InvalidReturnStatement occurrences="1"> - <code>$this->data</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>array</code> - </InvalidReturnType> - </file> <file src="lib/public/AppFramework/Http/JSONResponse.php"> <InvalidReturnStatement occurrences="1"> <code>$this->data</code> @@ -6131,9 +5544,9 @@ </file> <file src="lib/public/AppFramework/Http/ZipResponse.php"> <InvalidArrayAccess occurrences="5"> - <code>$resource['size']</code> - <code>$resource['resource']</code> <code>$resource['internalName']</code> + <code>$resource['resource']</code> + <code>$resource['size']</code> <code>$resource['size']</code> <code>$resource['time']</code> </InvalidArrayAccess> @@ -6141,14 +5554,6 @@ <code>$this->resources</code> </InvalidPropertyAssignmentValue> </file> - <file src="lib/public/AppFramework/Services/IInitialState.php"> - <MismatchingDocblockParamType occurrences="1"> - <code>Closure</code> - </MismatchingDocblockParamType> - <UndefinedDocblockClass occurrences="1"> - <code>Closure</code> - </UndefinedDocblockClass> - </file> <file src="lib/public/BackgroundJob/TimedJob.php"> <MoreSpecificImplementedParamType occurrences="1"> <code>$jobList</code> @@ -6178,17 +5583,9 @@ </FalsableReturnStatement> </file> <file src="lib/public/Files/Storage.php"> - <InvalidReturnType occurrences="1"> - <code>string|false</code> - </InvalidReturnType> - </file> - <file src="lib/public/Files/Storage/IStorage.php"> <InvalidParamDefault occurrences="1"> <code>array</code> </InvalidParamDefault> - <InvalidReturnType occurrences="1"> - <code>string|false</code> - </InvalidReturnType> </file> <file src="lib/public/FullTextSearch/Model/ISearchRequest.php"> <InvalidClass occurrences="1"> diff --git a/build/psalm/AppFrameworkTainter.php b/build/psalm/AppFrameworkTainter.php new file mode 100644 index 00000000000..9b2f719a447 --- /dev/null +++ b/build/psalm/AppFrameworkTainter.php @@ -0,0 +1,60 @@ +<?php + +/** + * Copyright (c) 2020 Lukas Reschke <lukas@statuscode.ch> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +use Psalm\CodeLocation; +use Psalm\Plugin\Hook\AfterFunctionLikeAnalysisInterface; +use Psalm\Type\TaintKindGroup; + +class AppFrameworkTainter implements AfterFunctionLikeAnalysisInterface { + public static function afterStatementAnalysis( + PhpParser\Node\FunctionLike $stmt, + Psalm\Storage\FunctionLikeStorage $classlike_storage, + Psalm\StatementsSource $statements_source, + Psalm\Codebase $codebase, + array &$file_replacements = [] + ): ?bool { + if ($statements_source->getFQCLN() !== null) { + if ($codebase->classExtendsOrImplements($statements_source->getFQCLN(), \OCP\AppFramework\Controller::class)) { + if ($stmt instanceof PhpParser\Node\Stmt\ClassMethod) { + if ($stmt->isPublic() && !$stmt->isMagic()) { + foreach ($stmt->params as $i => $param) { + $expr_type = new Psalm\Type\Union([new Psalm\Type\Atomic\TString()]); + $expr_identifier = (strtolower($statements_source->getFQCLN()) . '::' . strtolower($classlike_storage->cased_name) . '#' . ($i+1)); + + if ($expr_type) { + $codebase->addTaintSource( + $expr_type, + $expr_identifier, + TaintKindGroup::ALL_INPUT, + new CodeLocation($statements_source, $param) + ); + } + } + } + } + } + } + return null; + } +} |