fix(cs): Apply auto fixes
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
c0ae809e65
Коммит
979c135512
|
@ -19,7 +19,8 @@ use OCP\WorkflowEngine\Events\RegisterOperationsEvent;
|
||||||
*/
|
*/
|
||||||
class FlowRegisterOperationListener implements IEventListener {
|
class FlowRegisterOperationListener implements IEventListener {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected readonly Operation $operation) {
|
protected readonly Operation $operation,
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(Event $event): void {
|
public function handle(Event $event): void {
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Operation implements IComplexOperation, ISpecificOperation {
|
||||||
protected readonly File $fileEntity,
|
protected readonly File $fileEntity,
|
||||||
protected readonly IMountManager $mountManager,
|
protected readonly IMountManager $mountManager,
|
||||||
protected readonly IRootFolder $rootFolder,
|
protected readonly IRootFolder $rootFolder,
|
||||||
protected readonly LoggerInterface $logger
|
protected readonly LoggerInterface $logger,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ class FeatureContext implements Context {
|
||||||
$statusCodes = [(int)$statusCode];
|
$statusCodes = [(int)$statusCode];
|
||||||
}
|
}
|
||||||
if (!in_array($this->response->getStatusCode(), $statusCodes, true)) {
|
if (!in_array($this->response->getStatusCode(), $statusCodes, true)) {
|
||||||
throw new \Exception("Expected $statusCode, got ".$this->response->getStatusCode());
|
throw new \Exception("Expected $statusCode, got " . $this->response->getStatusCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,9 @@ trait WebDav {
|
||||||
if ($type === 'files') {
|
if ($type === 'files') {
|
||||||
$fullUrl = $this->baseUrl . $this->getDavFilesPath($user) . "$path";
|
$fullUrl = $this->baseUrl . $this->getDavFilesPath($user) . "$path";
|
||||||
} elseif ($type === 'uploads') {
|
} elseif ($type === 'uploads') {
|
||||||
$fullUrl = $this->baseUrl . $this->davPath . "$path";
|
$fullUrl = $this->baseUrl . $this->davPath . "$path";
|
||||||
} else {
|
} else {
|
||||||
$fullUrl = $this->baseUrl . $this->davPath . '/' . $type . "$path";
|
$fullUrl = $this->baseUrl . $this->davPath . '/' . $type . "$path";
|
||||||
}
|
}
|
||||||
$client = new GClient();
|
$client = new GClient();
|
||||||
$options = [
|
$options = [
|
||||||
|
@ -186,7 +186,7 @@ trait WebDav {
|
||||||
*/
|
*/
|
||||||
public function checkPropForFile($file, $prefix, $prop, $value) {
|
public function checkPropForFile($file, $prefix, $prop, $value) {
|
||||||
$elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>");
|
$elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>");
|
||||||
$property = $elementList['/'.$this->getDavFilesPath($this->currentUser).$file][200]["{DAV:}$prop"];
|
$property = $elementList['/' . $this->getDavFilesPath($this->currentUser) . $file][200]["{DAV:}$prop"];
|
||||||
Assert::assertEquals($property, $value);
|
Assert::assertEquals($property, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ trait WebDav {
|
||||||
if ($type === 'files') {
|
if ($type === 'files') {
|
||||||
return $this->encodePath($this->getDavFilesPath($user) . $path);
|
return $this->encodePath($this->getDavFilesPath($user) . $path);
|
||||||
} else {
|
} else {
|
||||||
return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path);
|
return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,28 +689,28 @@ trait WebDav {
|
||||||
$boundary = 'boundary_azertyuiop';
|
$boundary = 'boundary_azertyuiop';
|
||||||
|
|
||||||
$body = '';
|
$body = '';
|
||||||
$body .= '--'.$boundary."\r\n";
|
$body .= '--' . $boundary . "\r\n";
|
||||||
$body .= 'X-File-Path: '.$name1."\r\n";
|
$body .= 'X-File-Path: ' . $name1 . "\r\n";
|
||||||
$body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n";
|
$body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n";
|
||||||
$body .= "X-OC-Mtime: 1111111111\r\n";
|
$body .= "X-OC-Mtime: 1111111111\r\n";
|
||||||
$body .= 'Content-Length: '.strlen($content1)."\r\n";
|
$body .= 'Content-Length: ' . strlen($content1) . "\r\n";
|
||||||
$body .= "\r\n";
|
$body .= "\r\n";
|
||||||
$body .= $content1."\r\n";
|
$body .= $content1 . "\r\n";
|
||||||
$body .= '--'.$boundary."\r\n";
|
$body .= '--' . $boundary . "\r\n";
|
||||||
$body .= 'X-File-Path: '.$name2."\r\n";
|
$body .= 'X-File-Path: ' . $name2 . "\r\n";
|
||||||
$body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n";
|
$body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n";
|
||||||
$body .= "X-OC-Mtime: 2222222222\r\n";
|
$body .= "X-OC-Mtime: 2222222222\r\n";
|
||||||
$body .= 'Content-Length: '.strlen($content2)."\r\n";
|
$body .= 'Content-Length: ' . strlen($content2) . "\r\n";
|
||||||
$body .= "\r\n";
|
$body .= "\r\n";
|
||||||
$body .= $content2."\r\n";
|
$body .= $content2 . "\r\n";
|
||||||
$body .= '--'.$boundary."\r\n";
|
$body .= '--' . $boundary . "\r\n";
|
||||||
$body .= 'X-File-Path: '.$name3."\r\n";
|
$body .= 'X-File-Path: ' . $name3 . "\r\n";
|
||||||
$body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n";
|
$body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n";
|
||||||
$body .= "X-File-Mtime: 3333333333\r\n";
|
$body .= "X-File-Mtime: 3333333333\r\n";
|
||||||
$body .= 'Content-Length: '.strlen($content3)."\r\n";
|
$body .= 'Content-Length: ' . strlen($content3) . "\r\n";
|
||||||
$body .= "\r\n";
|
$body .= "\r\n";
|
||||||
$body .= $content3."\r\n";
|
$body .= $content3 . "\r\n";
|
||||||
$body .= '--'.$boundary."--\r\n";
|
$body .= '--' . $boundary . "--\r\n";
|
||||||
|
|
||||||
$stream = fopen('php://temp', 'r+');
|
$stream = fopen('php://temp', 'r+');
|
||||||
fwrite($stream, $body);
|
fwrite($stream, $body);
|
||||||
|
@ -720,7 +720,7 @@ trait WebDav {
|
||||||
$options = [
|
$options = [
|
||||||
'auth' => [$user, $this->regularUser],
|
'auth' => [$user, $this->regularUser],
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Content-Type' => 'multipart/related; boundary='.$boundary,
|
'Content-Type' => 'multipart/related; boundary=' . $boundary,
|
||||||
'Content-Length' => (string)strlen($body),
|
'Content-Length' => (string)strlen($body),
|
||||||
],
|
],
|
||||||
'body' => $body
|
'body' => $body
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (!defined('PHPUNIT_RUN')) {
|
||||||
define('PHPUNIT_RUN', 1);
|
define('PHPUNIT_RUN', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__.'/../../../lib/base.php';
|
require_once __DIR__ . '/../../../lib/base.php';
|
||||||
|
|
||||||
if (!class_exists('\PHPUnit\Framework\TestCase')) {
|
if (!class_exists('\PHPUnit\Framework\TestCase')) {
|
||||||
require_once('PHPUnit/Autoload.php');
|
require_once('PHPUnit/Autoload.php');
|
||||||
|
|
Загрузка…
Ссылка в новой задаче