Merge pull request #215 from nextcloud/dependabot/composer/nextcloud/coding-standard-1.3.2

build(deps-dev): bump nextcloud/coding-standard from 1.1.1 to 1.3.2
This commit is contained in:
Arthur Schiwon 2024-10-17 12:44:20 +02:00 коммит произвёл GitHub
Родитель 226c1d9671 638ae9dcb3
Коммит af7771e6b1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 100 добавлений и 53 удалений

Просмотреть файл

@ -45,7 +45,7 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"nextcloud/coding-standard": "^1.0",
"nextcloud/coding-standard": "^1.3",
"psalm/phar": "^5.26",
"nextcloud/ocp": "dev-master"
}

85
composer.lock сгенерированный
Просмотреть файл

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "67ede0e2200d678cc39965c1ea587455",
"content-hash": "e05683e1bba91bace2ccc7605eb4f8a2",
"packages": [
{
"name": "bamarni/composer-bin-plugin",
@ -272,6 +272,52 @@
],
"time": "2022-12-30T00:15:36+00:00"
},
{
"name": "kubawerlos/php-cs-fixer-custom-fixers",
"version": "v3.22.0",
"source": {
"type": "git",
"url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git",
"reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e",
"reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e",
"shasum": ""
},
"require": {
"ext-filter": "*",
"ext-tokenizer": "*",
"friendsofphp/php-cs-fixer": "^3.61.1",
"php": "^7.4 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6.4 || ^10.5.29"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpCsFixerCustomFixers\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kuba Werłos",
"email": "werlos@gmail.com"
}
],
"description": "A set of custom fixers for PHP CS Fixer",
"support": {
"issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues",
"source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0"
},
"time": "2024-08-16T20:44:35+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.11.1",
@ -333,19 +379,20 @@
},
{
"name": "nextcloud/coding-standard",
"version": "v1.1.1",
"version": "v1.3.2",
"source": {
"type": "git",
"url": "https://github.com/nextcloud/coding-standard.git",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb"
"reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d",
"reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d",
"shasum": ""
},
"require": {
"kubawerlos/php-cs-fixer-custom-fixers": "^3.22",
"php": "^7.3|^8.0",
"php-cs-fixer/shim": "^3.17"
},
@ -368,9 +415,9 @@
"description": "Nextcloud coding standards for the php cs fixer",
"support": {
"issues": "https://github.com/nextcloud/coding-standard/issues",
"source": "https://github.com/nextcloud/coding-standard/tree/v1.1.1"
"source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2"
},
"time": "2023-06-01T12:05:01+00:00"
"time": "2024-10-14T16:49:05+00:00"
},
{
"name": "nextcloud/ocp",
@ -588,16 +635,16 @@
},
{
"name": "php-cs-fixer/shim",
"version": "v3.46.0",
"version": "v3.64.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/shim.git",
"reference": "e9fc76796f284c050615937b9bd2df7688452c33"
"reference": "81ccfd24baf3a10810dab1152c403981a790b837"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/e9fc76796f284c050615937b9bd2df7688452c33",
"reference": "e9fc76796f284c050615937b9bd2df7688452c33",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/81ccfd24baf3a10810dab1152c403981a790b837",
"reference": "81ccfd24baf3a10810dab1152c403981a790b837",
"shasum": ""
},
"require": {
@ -634,9 +681,9 @@
"description": "A tool to automatically fix PHP code style",
"support": {
"issues": "https://github.com/PHP-CS-Fixer/shim/issues",
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.46.0"
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.64.0"
},
"time": "2024-01-03T21:39:12+00:00"
"time": "2024-08-30T23:10:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -1596,16 +1643,16 @@
},
{
"name": "sebastian/diff",
"version": "4.0.5",
"version": "4.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131"
"reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
"reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
"reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
"shasum": ""
},
"require": {
@ -1650,7 +1697,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/4.0.5"
"source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
},
"funding": [
{
@ -1658,7 +1705,7 @@
"type": "github"
}
],
"time": "2023-05-07T05:35:17+00:00"
"time": "2024-03-02T06:30:58+00:00"
},
{
"name": "sebastian/environment",

Просмотреть файл

@ -49,7 +49,7 @@ class Client {
Storage::SP_PROPERTY_SIZE,
];
/** @var ClientContext */
/** @var ClientContext */
protected $context;
/** @var array */
@ -57,7 +57,7 @@ class Client {
/** @var ContextsFactory */
private $contextsFactory;
/** @var string */
/** @var string */
private $sharePointUrl;
/** @var string[] */
@ -76,7 +76,7 @@ class Client {
LoggerInterface $logger,
string $sharePointUrl,
array $credentials,
array $options
array $options,
) {
$this->contextsFactory = $contextsFactory;
$this->sharePointUrl = $sharePointUrl;
@ -95,7 +95,7 @@ class Client {
* @throws NotFoundException
* @throws Exception
*/
public function fetchFileOrFolder($path, array $properties = null) {
public function fetchFileOrFolder($path, ?array $properties = null) {
$fetchFileFunc = function ($path, $props) {
return $this->fetchFile($path, $props);
};
@ -145,7 +145,7 @@ class Client {
* @param array|null $properties
* @return File
*/
public function fetchFile($relativeServerPath, array $properties = null): File {
public function fetchFile($relativeServerPath, ?array $properties = null): File {
$this->ensureConnection();
$file = $this->context->getWeb()->getFileByServerRelativeUrl($relativeServerPath);
$this->loadAndExecute($file, $properties);
@ -159,7 +159,7 @@ class Client {
* @param array|null $properties
* @return Folder
*/
public function fetchFolder($relativeServerPath, array $properties = null) {
public function fetchFolder($relativeServerPath, ?array $properties = null) {
$this->ensureConnection();
$folder = $this->context->getWeb()->getFolderByServerRelativeUrl($relativeServerPath);
$allFields = $folder->getListItemAllFields();
@ -230,7 +230,7 @@ class Client {
$request->ensureHeader('X-HTTP-Method', 'PUT'); // yes, PUT
$this->context->ensureFormDigest($request);
$request->StreamHandle = $fp;
$request->ensureHeader("Content-Length", (string)filesize($localPath));
$request->ensureHeader('Content-Length', (string)filesize($localPath));
$this->context->executeQueryDirect($request);
}
@ -451,7 +451,7 @@ class Client {
* @param ClientObject $object
* @param array|null $properties
*/
public function loadAndExecute(ClientObject $object, array $properties = null) {
public function loadAndExecute(ClientObject $object, ?array $properties = null) {
$this->context->load($object, $properties);
$this->context->executeQuery();
}

Просмотреть файл

@ -36,7 +36,7 @@ class ClientFactory {
ContextsFactory $contextsFactory,
string $sharePointUrl,
array $credentials,
array $options = []
array $options = [],
): Client {
return new Client(
$contextsFactory,

Просмотреть файл

@ -35,7 +35,7 @@ class ContextsFactory {
string $url,
string $user,
string $password,
bool $useNtlm = false
bool $useNtlm = false,
): ClientContext {
$clientContext = new ClientContext($url);
$credentials = new UserCredentials($user, $password);
@ -50,14 +50,14 @@ class ContextsFactory {
*/
protected function withCredentials(
ClientContext $clientContext,
UserCredentials $userCredentials
UserCredentials $userCredentials,
): ClientContext {
return $clientContext->withCredentials($userCredentials);
}
protected function getWithNtlm(
ClientContext $clientContext,
UserCredentials $userCredentials
UserCredentials $userCredentials,
) {
return $clientContext->withNtlm($userCredentials);
}

Просмотреть файл

@ -37,7 +37,7 @@ class ExternalStoragesRegistrationListener implements IEventListener {
public function __construct(
private BackendService $backendService,
private BackendProvider $backendProvider
private BackendProvider $backendProvider,
) {
}

Просмотреть файл

@ -53,22 +53,22 @@ class Storage extends Common {
public const SP_PERMISSION_UPDATE = 3;
public const SP_PERMISSION_DELETE = 4;
/** @var string */
/** @var string */
protected $server;
/** @var string */
/** @var string */
protected $documentLibrary;
/** @var string */
/** @var string */
protected $authUser;
/** @var string */
/** @var string */
protected $authPwd;
/** @var Client */
/** @var Client */
protected $spClient;
/** @var CappedMemoryCache */
/** @var CappedMemoryCache */
protected $fileCache;
/** @var false|mixed */
protected $forceNtlm;
@ -589,7 +589,7 @@ class Storage extends Common {
// cache children instances
foreach ($contents as $collection) {
foreach ($collection->getData() as $item) {
/** @var File|Folder $item */
/** @var File|Folder $item */
$url = $item->getProperty(self::SP_PROPERTY_URL);
if (is_null($url)) {
// at least on SP13 requesting self::SP_PROPERTY_URL against folders causes an exception

Просмотреть файл

@ -41,7 +41,7 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class SharePointClientTest extends TestCase {
/** @var ContextsFactory|\PHPUnit_Framework_MockObject_MockObject */
/** @var ContextsFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $contextsFactory;
protected string $documentLibraryTitle;
@ -174,7 +174,7 @@ class SharePointClientTest extends TestCase {
static $cnt = 0;
$cnt++;
if ($cnt === 1) {
$errorPayload = '{"error":{"code":"-2130575338, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The file ' . $path . ' does not exist."}}}';
$errorPayload = '{"error":{"code":"-2130575338, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The file ' . $path . ' does not exist."}}}';
throw new RequestException($errorPayload, 404);
} elseif ($cnt === 2) {
$errorPayload = '{"error":{"code":"-2147024894, System.IO.FileNotFoundException","message":{"lang":"en-US","value":"File Not Found."}}}';
@ -198,7 +198,7 @@ class SharePointClientTest extends TestCase {
public function testCreateFolderSuccess() {
$dirName = 'New Project Dir';
$parentPath = '/' . $this->documentLibraryTitle . '/Our Directory';
$path = $parentPath . '/'. $dirName;
$path = $parentPath . '/' . $dirName;
$folderCollectionMock = $this->createMock(FolderCollection::class);
$folderCollectionMock->expects($this->once())
@ -233,7 +233,7 @@ class SharePointClientTest extends TestCase {
public function testCreateFolderError() {
$dirName = 'New Project Dir';
$parentPath = '/' . $this->documentLibraryTitle . '/Our Directory';
$path = $parentPath . '/'. $dirName;
$path = $parentPath . '/' . $dirName;
$folderCollectionMock = $this->createMock(FolderCollection::class);
$folderCollectionMock->expects($this->once())

Просмотреть файл

@ -38,19 +38,19 @@ use OCP\Files\FileInfo;
use Test\TestCase;
class StorageTest extends TestCase {
/** @var Storage */
/** @var Storage */
protected $storage;
/** @var ContextsFactory|\PHPUnit_Framework_MockObject_MockObject */
/** @var ContextsFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $factory;
/** @var ClientContext|\PHPUnit_Framework_MockObject_MockObject */
/** @var ClientContext|\PHPUnit_Framework_MockObject_MockObject */
protected $clientContextMock;
/** @var string */
/** @var string */
protected $documentLibraryTitle = 'Fancy Documents';
/** @var SPList|\PHPUnit_Framework_MockObject_MockObject */
/** @var SPList|\PHPUnit_Framework_MockObject_MockObject */
protected $sharePointList;
/** @var string */
@ -62,13 +62,13 @@ class StorageTest extends TestCase {
/** @var string */
protected $examplePwd = 'a123456';
/** @var ClientFactory|\PHPUnit_Framework_MockObject_MockObject */
/** @var ClientFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $clientFactory;
/** @var Client|\PHPUnit_Framework_MockObject_MockObject */
/** @var Client|\PHPUnit_Framework_MockObject_MockObject */
protected $client;
/** @var CappedMemoryCache|\PHPUnit_Framework_MockObject_MockObject */
/** @var CappedMemoryCache|\PHPUnit_Framework_MockObject_MockObject */
protected $fileCache;
protected function setUp(): void {

Просмотреть файл

@ -4,7 +4,7 @@ if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../../lib/base.php';
require_once __DIR__ . '/../../../lib/base.php';
// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');