Skip to content

Commit

Permalink
Merge pull request #48763 from nextcloud/dependabot/composer/stable30…
Browse files Browse the repository at this point in the history
…/symfony-6.4

[stable30] build: Bump symfony/* to 6.4
  • Loading branch information
nickvergessen authored Oct 21, 2024
2 parents 9e28a1e + 57069e3 commit 97dc0aa
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 32 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 401 files
3 changes: 1 addition & 2 deletions apps/encryption/tests/Crypto/CryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ protected function setUp(): void {
->disableOriginalConstructor()
->getMock();
$this->logger->expects($this->any())
->method('warning')
->willReturn(true);
->method('warning');
$this->userSession = $this->getMockBuilder(IUserSession::class)
->disableOriginalConstructor()
->getMock();
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/lib/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly
$value = json_encode($value);
}
$output->writeln($value);
$output->writeln((string)$value);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions apps/files_external/lib/Command/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCA\Files_External\Service\UserStoragesService;
use OCP\IUserManager;
use OCP\IUserSession;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -64,6 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$listInput->setOption('output', $input->getOption('output'));
$listCommand->listMounts(null, [$mount], $listInput, $output);

/** @var QuestionHelper $questionHelper */
$questionHelper = $this->getHelper('question');
$question = new ConfirmationQuestion('Delete this mount? [y/N] ', false);

Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/lib/Command/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
if (!is_string($value)) { // show bools and objects correctly
$value = json_encode($value);
}
$output->writeln($value);
$output->writeln((string)$value);
}

/**
Expand Down
5 changes: 0 additions & 5 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
<code><![CDATA[array]]></code>
</LessSpecificImplementedReturnType>
</file>
<file src="3rdparty/symfony/routing/Route.php">
<MethodSignatureMustProvideReturnType>
<code><![CDATA[unserialize]]></code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="apps/dav/appinfo/v1/caldav.php">
<UndefinedGlobalVariable>
<code><![CDATA[$baseuri]]></code>
Expand Down
2 changes: 2 additions & 0 deletions core/Command/Background/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use OC\Core\Command\Base;
use OCP\BackgroundJob\IJobList;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -51,6 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'/^(y|Y)/i'
);

/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('aborted.');
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function cancelOperation(): void {
$this->interrupted = true;
}

public function run(InputInterface $input, OutputInterface $output) {
public function run(InputInterface $input, OutputInterface $output): int {
// check if the php pcntl_signal functions are accessible
$this->php_pcntl_signal = function_exists('pcntl_signal');
if ($this->php_pcntl_signal) {
Expand Down
2 changes: 2 additions & 0 deletions core/Command/Config/App/SetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\Exceptions\AppConfigIncorrectTypeException;
use OCP\Exceptions\AppConfigUnknownKeyException;
use OCP\IAppConfig;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -229,6 +230,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

private function ask(InputInterface $input, OutputInterface $output, string $request): bool {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if ($input->getOption('no-interaction')) {
return true;
Expand Down
2 changes: 2 additions & 0 deletions core/Command/Db/ConvertFilecacheBigInt.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OCP\DB\Types;
use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
Expand Down Expand Up @@ -89,6 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<comment>This can take up to hours, depending on the number of files in your instance!</comment>');

if ($input->isInteractive()) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', false);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Db/Migrations/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -120,6 +121,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {
$output->writeln('<comment> - Actual: ' . $version . '</comment>');

if ($input->isInteractive()) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Continue with your given version? (y/n) [n] ', false);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Maintenance/RepairShareOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OCP\IUser;
use OCP\IUserManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -60,6 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln("");

if (!$noConfirm) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Repair these shares? [y/N]', false);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Preview/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -133,6 +134,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($input->getOption('batch')) {
$output->writeln('Batch mode active: migration is started right away.');
} else {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('<info>Should the migration be started? (y/[n]) </info>', false);

Expand Down
10 changes: 5 additions & 5 deletions lib/private/Console/TimestampFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(?IConfig $config, OutputFormatterInterface $formatte
*
* @param bool $decorated Whether to decorate the messages or not
*/
public function setDecorated($decorated) {
public function setDecorated(bool $decorated) {
$this->formatter->setDecorated($decorated);
}

Expand All @@ -41,7 +41,7 @@ public function setDecorated($decorated) {
*
* @return bool true if the output will decorate messages, false otherwise
*/
public function isDecorated() {
public function isDecorated(): bool {
return $this->formatter->isDecorated();
}

Expand All @@ -51,7 +51,7 @@ public function isDecorated() {
* @param string $name The style name
* @param OutputFormatterStyleInterface $style The style instance
*/
public function setStyle($name, OutputFormatterStyleInterface $style) {
public function setStyle(string $name, OutputFormatterStyleInterface $style) {
$this->formatter->setStyle($name, $style);
}

Expand All @@ -61,7 +61,7 @@ public function setStyle($name, OutputFormatterStyleInterface $style) {
* @param string $name
* @return bool
*/
public function hasStyle($name) {
public function hasStyle(string $name): bool {
return $this->formatter->hasStyle($name);
}

Expand All @@ -72,7 +72,7 @@ public function hasStyle($name) {
* @return OutputFormatterStyleInterface
* @throws \InvalidArgumentException When style isn't defined
*/
public function getStyle($name) {
public function getStyle(string $name): OutputFormatterStyleInterface {
return $this->formatter->getStyle($name);
}

Expand Down
31 changes: 20 additions & 11 deletions tests/Core/Command/User/SettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ protected function setUp(): void {

public function getCommand(array $methods = []) {
if (empty($methods)) {
return new Setting($this->userManager, $this->config, $this->connection);
return new Setting($this->userManager, $this->config);
} else {
$mock = $this->getMockBuilder('OC\Core\Command\User\Setting')
$mock = $this->getMockBuilder(Setting::class)
->setConstructorArgs([
$this->userManager,
$this->config,
$this->connection,
])
->setMethods($methods)
->onlyMethods($methods)
->getMock();
return $mock;
}
Expand Down Expand Up @@ -194,7 +193,16 @@ public function testCheckInput($arguments, $options, $parameterOptions, $user, $
->willReturnMap($options);
$this->consoleInput->expects($this->any())
->method('hasParameterOption')
->willReturnMap($parameterOptions);
->willReturnCallback(function (string|array $config, bool $default = false) use ($parameterOptions): bool {
foreach ($parameterOptions as $parameterOption) {
if ($config === $parameterOption[0]
// Check the default value if the maps has 3 entries
&& (!isset($parameterOption[2]) || $default === $parameterOption[1])) {
return end($parameterOption);
}
}
return false;
});

if ($user !== false) {
$this->userManager->expects($this->once())
Expand Down Expand Up @@ -402,15 +410,16 @@ public function testExecuteGet($value, $defaultValue, $expectedLine, $expectedRe
if ($defaultValue === null) {
$this->consoleInput->expects($this->atLeastOnce())
->method('hasParameterOption')
->willReturnMap([
['--default-value', false],
]);
->willReturn(false);
} else {
$this->consoleInput->expects($this->atLeastOnce())
->method('hasParameterOption')
->willReturnMap([
['--default-value', false, true],
]);
->willReturnCallback(function (string|array $config, bool $default = false): bool {
if ($config === '--default-value' && $default === false) {
return true;
}
return false;
});
$this->consoleInput->expects($this->once())
->method('getOption')
->with('default-value')
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Mail/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,23 @@ public function testSetRecipients(): void {
$this->symfonyEmail
->expects($this->once())
->method('from')
->willReturn(new Address('[email protected]', 'Pierres General Store'));
->with(new Address('[email protected]', 'Pierres General Store'));
$this->symfonyEmail
->expects($this->once())
->method('to')
->willReturn(new Address('[email protected]', "Lewis' Tent Life"));
->with(new Address('[email protected]', "Lewis' Tent Life"));
$this->symfonyEmail
->expects($this->once())
->method('replyTo')
->willReturn(new Address('[email protected]', 'Penny'));
->with(new Address('[email protected]', 'Penny'));
$this->symfonyEmail
->expects($this->once())
->method('cc')
->willReturn(new Address('[email protected]', 'Gunther'));
->with(new Address('[email protected]', 'Gunther'));
$this->symfonyEmail
->expects($this->once())
->method('bcc')
->willReturn(new Address('[email protected]', 'Pam'));
->with(new Address('[email protected]', 'Pam'));

$this->message->setRecipients();
}
Expand Down

0 comments on commit 97dc0aa

Please sign in to comment.