Skip to content

Commit

Permalink
Merge pull request #2326 from nextcloud/dependabot/composer/vendor-bi…
Browse files Browse the repository at this point in the history
…n/cs-fixer/main/nextcloud/coding-standard-1.3.1
  • Loading branch information
dependabot[bot] authored Sep 21, 2024
2 parents 8bbaeb7 + f756024 commit 13b1f00
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 33 deletions.
2 changes: 1 addition & 1 deletion lib/Activity/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Filter implements IFilter {
public function __construct(
protected string $appName,
private IL10N $l10n,
private IURLGenerator $urlGenerator
private IURLGenerator $urlGenerator,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Activity/Settings/FormsActivitySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
abstract class FormsActivitySettings extends ActivitySettings {
public function __construct(
protected string $appName,
protected IL10N $l10n
protected IL10N $l10n,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJob/CleanupUploadedFilesJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
private FormMapper $formMapper,
private UploadedFileMapper $uploadedFileMapper,
private LoggerInterface $logger,
ITimeFactory $time
ITimeFactory $time,
) {
parent::__construct($time);

Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJob/UserDeletedJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UserDeletedJob extends QueuedJob {
public function __construct(
private FormMapper $formMapper,
ITimeFactory $time,
private LoggerInterface $logger
private LoggerInterface $logger,
) {
parent::__construct($time);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class Capabilities implements ICapability {
public function __construct(
private IAppManager $appManager
private IAppManager $appManager,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ public function newSubmission(int $formId, array $answers, string $shareHash = '

// If not logged in, anonymous, or embedded use anonID
if (!$this->currentUser || $form->getIsAnonymous()) {
$anonID = 'anon-user-' . hash('md5', strval(time() + rand()));
$anonID = 'anon-user-' . hash('md5', strval(time() + rand()));
$submission->setUserId($anonID);
} else {
$submission->setUserId($this->currentUser->getUID());
Expand Down Expand Up @@ -2326,7 +2326,7 @@ public function insertSubmissionLegacy(int $formId, array $answers, string $shar

// If not logged in, anonymous, or embedded use anonID
if (!$this->currentUser || $form->getIsAnonymous()) {
$anonID = 'anon-user-' . hash('md5', strval(time() + rand()));
$anonID = 'anon-user-' . hash('md5', strval(time() + rand()));
$submission->setUserId($anonID);
} else {
$submission->setUserId($this->currentUser->getUID());
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
private ConfigService $configService,
private IConfig $config,
private LoggerInterface $logger,
IRequest $request
IRequest $request,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/QuestionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class QuestionMapper extends QBMapper {
public function __construct(
IDBConnection $db,
private OptionMapper $optionMapper
private OptionMapper $optionMapper,
) {
parent::__construct($db, 'forms_v2_questions', Question::class);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/SubmissionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SubmissionMapper extends QBMapper {
*/
public function __construct(
IDBConnection $db,
private AnswerMapper $answerMapper
private AnswerMapper $answerMapper,
) {
parent::__construct($db, 'forms_v2_submissions', Submission::class);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/FormsMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct(
private FormsService $formsService,
private SubmissionService $submissionService,
private IL10N $l10n,
private IUserManager $userManager
private IUserManager $userManager,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Listener/UserDeletedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
class UserDeletedListener implements IEventListener {
public function __construct(
private IJobList $jobList
private IJobList $jobList,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
protected string $appName,
private IConfig $config,
private IGroupManager $groupManager,
IUserSession $userSession
IUserSession $userSession,
) {
$this->currentUser = $userSession->getUser();
}
Expand Down
10 changes: 5 additions & 5 deletions lib/Service/FormsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,15 +760,15 @@ public function getFileName(Form $form, string $fileFormat): string {
}

// TRANSLATORS Appendix for CSV-Export: 'Form Title (responses).csv'
$fileName = $form->getTitle() . ' (' . $this->l10n->t('responses') . ').'.$fileFormat;
$fileName = $form->getTitle() . ' (' . $this->l10n->t('responses') . ').' . $fileFormat;

return self::normalizeFileName($fileName);
}

public function getFormUploadedFilesFolderPath(Form $form): string {
return implode('/', [
Constants::FILES_FOLDER,
self::normalizeFileName($form->getId().' - '.$form->getTitle()),
self::normalizeFileName($form->getId() . ' - ' . $form->getTitle()),
]);
}

Expand All @@ -777,16 +777,16 @@ public function getUploadedFilePath(Form $form, int $submissionId, int $question
return implode('/', [
$this->getFormUploadedFilesFolderPath($form),
$submissionId,
self::normalizeFileName($questionId.' - '.($questionName ?: $questionText))
self::normalizeFileName($questionId . ' - ' . ($questionName ?: $questionText))
]);
}

public function getTemporaryUploadedFilePath(Form $form, Question $question): string {
return implode('/', [
Constants::UNSUBMITTED_FILES_FOLDER,
microtime(true),
self::normalizeFileName($form->getId().' - '.$form->getTitle()),
self::normalizeFileName($question->getId().' - '.($question->getName() ?: $question->getText()))
self::normalizeFileName($form->getId() . ' - ' . $form->getTitle()),
self::normalizeFileName($question->getId() . ' - ' . ($question->getName() ?: $question->getText()))
]);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
private string $appName,
private ConfigService $configService,
private IGroupManager $groupManager,
private IInitialState $initialState
private IInitialState $initialState,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/SettingsSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class SettingsSection implements IIconSection {
public function __construct(
private IL10N $l10n,
private IURLGenerator $urlGenerator
private IURLGenerator $urlGenerator,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions license.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ public function writeAuthorsFile() {
';
$authors = implode(PHP_EOL, array_map(function ($author) {
return ' - '.$author;
return ' - ' . $author;
}, $this->authors));
$template = str_replace('@AUTHORS@', $authors, $template);
file_put_contents(__DIR__.'/../AUTHORS', $template);
file_put_contents(__DIR__ . '/../AUTHORS', $template);
}

public function handleFile($path, $gitRoot) {
Expand Down Expand Up @@ -371,7 +371,7 @@ private function checkCoreMailMap($author) {
private function fixInvalidEmail($author) {
preg_match('/<(.*)>/', $author, $mailMatch);
if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) {
$author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author);
$author = str_replace('<' . $mailMatch[1] . '>', '"' . $mailMatch[1] . '"', $author);
}
return $author;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Api/ApiV2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ public function dataInsertSubmission() {
public function testInsertSubmission(array $submissionsExpected) {

$uploadedFileResponse = $this->http->request('POST',
'api/v2.5/uploadFiles/'.$this->testForms[0]['id'].'/'.$this->testForms[0]['questions'][2]['id'],
'api/v2.5/uploadFiles/' . $this->testForms[0]['id'] . '/' . $this->testForms[0]['questions'][2]['id'],
[
'multipart' => [
[
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/FormsServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ public function dataAreExtraSettingsValid() {
'invalid-custom-regex-pattern' => [
'extraSettings' => [
'validationType' => 'regex',
'validationRegex' => '/'.'[/'
'validationRegex' => '/' . '[/'
],
'questionType' => Constants::ANSWER_TYPE_SHORT,
'rval' => false
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Service/SubmissionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public function dataGetSubmissionsData() {
// Expected CSV-Result
'
"User ID","User display name","Timestamp","Question 1"
"user1","User 1","1973-11-29T22:33:09+01:00","file1.txt; '.'
"user1","User 1","1973-11-29T22:33:09+01:00","file1.txt; ' . '
file2.txt"
'
],
Expand Down Expand Up @@ -616,7 +616,7 @@ private function setUpCsvTest(array $questions, array $submissions, string $csvT
}));

// Prepend BOM-Sequence as Writer does and remove formatting-artefacts of dataProvider.
$dataExpectation = chr(239).chr(187).chr(191) . ltrim(preg_replace('/\t+/', '', $csvText));
$dataExpectation = chr(239) . chr(187) . chr(191) . ltrim(preg_replace('/\t+/', '', $csvText));

return $dataExpectation;
}
Expand Down
59 changes: 53 additions & 6 deletions vendor-bin/cs-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13b1f00

Please sign in to comment.