Skip to content

Commit 7f2facc

Browse files
committed
feat(psalm): Add all stubs
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 32cfbb8 commit 7f2facc

75 files changed

Lines changed: 13745 additions & 1194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
->notPath('l10n')
1818
->notPath('src')
1919
->notPath('vendor')
20+
->notPath('tests/stubs')
2021
->in(__DIR__);
2122
return $config;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@test:unit"
3434
],
3535
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml",
36-
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
36+
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './tests/stubs/*' -print0 | xargs -0 -n1 php -l"
3737
},
3838
"require-dev": {
3939
"phpunit/phpunit": "^10.5",

lib/Command/CirclesCheck.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
use OCA\Circles\Tools\Traits\TNCRequest;
4040
use OCA\Circles\Tools\Traits\TStringTools;
4141
use OCP\IAppConfig;
42+
use Symfony\Component\Console\Helper\QuestionHelper;
4243
use Symfony\Component\Console\Input\InputInterface;
4344
use Symfony\Component\Console\Input\InputOption;
4445
use Symfony\Component\Console\Output\OutputInterface;
@@ -181,6 +182,7 @@ private function checkLoopback(InputInterface $input, OutputInterface $output, s
181182
$output->writeln('- <comment>You do not have a valid loopback address setup right now.</comment>');
182183
$output->writeln('');
183184

185+
/** @var QuestionHelper $helper */
184186
$helper = $this->getHelper('question');
185187
while (true) {
186188
$question = new Question('<info>Please write down a new loopback address to test</info>: ', '');
@@ -328,6 +330,7 @@ private function saveLoopback(InputInterface $input, OutputInterface $output, st
328330
false, '/^(y|Y)/i'
329331
);
330332

333+
/** @var QuestionHelper $helper */
331334
$helper = $this->getHelper('question');
332335
if (!$helper->ask($input, $output, $question)) {
333336
$output->writeln('skipping.');
@@ -364,6 +367,7 @@ private function checkInternal(InputInterface $input, OutputInterface $output, s
364367
'- <comment>Do you want to enable this feature ?</comment> (y/N) ', false, '/^(y|Y)/i'
365368
);
366369

370+
/** @var QuestionHelper $helper */
367371
$helper = $this->getHelper('question');
368372
if (!$helper->ask($input, $output, $question)) {
369373
$output->writeln('skipping.');
@@ -508,6 +512,7 @@ private function saveInternal(InputInterface $input, OutputInterface $output, st
508512
false, '/^(y|Y)/i'
509513
);
510514

515+
/** @var QuestionHelper $helper */
511516
$helper = $this->getHelper('question');
512517
if (!$helper->ask($input, $output, $question)) {
513518
$output->writeln('skipping.');
@@ -543,6 +548,7 @@ private function checkFrontal(InputInterface $input, OutputInterface $output, st
543548
'- <comment>Do you want to enable this feature ?</comment> (y/N) ', false, '/^(y|Y)/i'
544549
);
545550

551+
/** @var QuestionHelper $helper */
546552
$helper = $this->getHelper('question');
547553
if (!$helper->ask($input, $output, $question)) {
548554
$output->writeln('skipping.');
@@ -686,6 +692,7 @@ private function saveFrontal(InputInterface $input, OutputInterface $output, str
686692
false, '/^(y|Y)/i'
687693
);
688694

695+
/** @var QuestionHelper $helper */
689696
$helper = $this->getHelper('question');
690697
if (!$helper->ask($input, $output, $question)) {
691698
$output->writeln('skipping.');
@@ -759,6 +766,7 @@ private function saveUrl(InputInterface $input, OutputInterface $output, string
759766
'The address <info>' . $address . '</info> seems to reach your local Nextcloud.'
760767
);
761768

769+
/** @var QuestionHelper $helper */
762770
$helper = $this->getHelper('question');
763771
$output->writeln('');
764772
$question = new ConfirmationQuestion(

lib/Command/CirclesMaintenance.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use OCA\Circles\Service\MaintenanceService;
1717
use OCA\Circles\Service\OutputService;
1818
use OCP\IDBConnection;
19+
use Symfony\Component\Console\Helper\QuestionHelper;
1920
use Symfony\Component\Console\Input\InputInterface;
2021
use Symfony\Component\Console\Input\InputOption;
2122
use Symfony\Component\Console\Output\OutputInterface;
@@ -92,6 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9293
'/^(y|Y)/i'
9394
);
9495

96+
/** @var QuestionHelper $helper */
9597
$helper = $this->getHelper('question');
9698
if (!$helper->ask($input, $output, $question)) {
9799
$output->writeln('aborted.');
@@ -107,6 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107109
. '\'</comment>: ', ''
108110
);
109111

112+
/** @var QuestionHelper $helper */
110113
$helper = $this->getHelper('question');
111114
$confirmation = $helper->ask($input, $output, $question);
112115
if (strtolower($confirmation) !== $action) {

lib/Command/CirclesRemote.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use OCA\Circles\Tools\Model\NCSignedRequest;
3030
use OCA\Circles\Tools\Traits\TNCWellKnown;
3131
use OCA\Circles\Tools\Traits\TStringTools;
32+
use Symfony\Component\Console\Helper\QuestionHelper;
3233
use Symfony\Component\Console\Helper\Table;
3334
use Symfony\Component\Console\Input\InputArgument;
3435
use Symfony\Component\Console\Input\InputInterface;
@@ -318,6 +319,7 @@ private function requestInstance(string $host): void {
318319
*/
319320
private function saveRemote(RemoteInstance $remoteSignatory) {
320321
$this->output->writeln('');
322+
/** @var QuestionHelper $helper */
321323
$helper = $this->getHelper('question');
322324

323325
$this->output->writeln(
@@ -349,6 +351,7 @@ private function saveRemote(RemoteInstance $remoteSignatory) {
349351
*/
350352
private function updateRemote(RemoteInstance $remoteSignatory): void {
351353
$this->output->writeln('');
354+
/** @var QuestionHelper $helper */
352355
$helper = $this->getHelper('question');
353356

354357
$this->output->writeln(

psalm.xml

Lines changed: 68 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,74 @@
1010
phpVersion="8.1"
1111
>
1212
<stubs>
13-
<file name="tests/stub.phpstub" preloadClasses="true"/>
13+
<file name="tests/stubs/doctrine_dbal_driver_exception.php" />
14+
<file name="tests/stubs/doctrine_dbal_connections_primaryreadreplicaconnection.php" />
15+
<file name="tests/stubs/doctrine_dbal_connection.php" />
16+
<file name="tests/stubs/doctrine_dbal_exception.php" />
17+
<file name="tests/stubs/doctrine_dbal_exception_serverexception.php" />
18+
<file name="tests/stubs/doctrine_dbal_exception_driverexception.php" />
19+
<file name="tests/stubs/doctrine_dbal_exception_constraintviolationexception.php" />
20+
<file name="tests/stubs/doctrine_dbal_exception_uniqueconstraintviolationexception.php" />
21+
<file name="tests/stubs/doctrine_dbal_query_querybuilder.php" />
22+
<file name="tests/stubs/doctrine_dbal_schema_abstractasset.php" />
23+
<file name="tests/stubs/doctrine_dbal_schema_index.php" />
24+
<file name="tests/stubs/doctrine_dbal_schema_schemaexception.php" />
25+
<file name="tests/stubs/doctrine_dbal_schema_table.php" />
26+
<file name="tests/stubs/doctrine_dbal_schema_constraint.php" />
27+
<file name="tests/stubs/oc.php" />
28+
<file name="tests/stubs/oc_appframework_utility_simplecontainer.php" />
29+
<file name="tests/stubs/oc_db_connectionadapter.php" />
30+
<file name="tests/stubs/oc_db_exceptions_dbalexception.php" />
31+
<file name="tests/stubs/oc_db_querybuilder_querybuilder.php" />
32+
<file name="tests/stubs/oc_files_cache_cache.php" />
33+
<file name="tests/stubs/oc_files_cache_cacheentry.php" />
34+
<file name="tests/stubs/oc_files_mount_manager.php" />
35+
<file name="tests/stubs/oc_files_mount_mountpoint.php" />
36+
<file name="tests/stubs/oc_group_group.php" />
37+
<file name="tests/stubs/oc_group_manager.php" />
38+
<file name="tests/stubs/oc_hooks_basicemitter.php" />
39+
<file name="tests/stubs/oc_hooks_emitter.php" />
40+
<file name="tests/stubs/oc_hooks_publicemitter.php" />
41+
<file name="tests/stubs/oc_server.php" />
42+
<file name="tests/stubs/oc_servercontainer.php" />
43+
<file name="tests/stubs/oc_share20_share.php" />
44+
<file name="tests/stubs/oc_share20_shareattributes.php" />
45+
<file name="tests/stubs/oc_systemconfig.php" />
46+
<file name="tests/stubs/oc_user_manager.php" />
47+
<file name="tests/stubs/oc_user_nouserexception.php" />
48+
<file name="tests/stubs/oc_user_user.php" />
49+
<file name="tests/stubs/oca_dav_carddav_contactsmanager.php" />
50+
<file name="tests/stubs/oca_files_sharing_external_manager.php" />
51+
<file name="tests/stubs/symfony_component_console_output_outputinterface.php" />
52+
<file name="tests/stubs/oca_files_app.php" />
53+
<file name="tests/stubs/oc_appframework_bootstrap_coordinator.php" />
54+
<file name="tests/stubs/oc_appframework_bootstrap_serviceregistration.php" />
55+
<file name="tests/stubs/oca_federatedfilesharing_notifications.php" />
56+
<file name="tests/stubs/oc_core_command_base.php" />
57+
<file name="tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php" />
58+
<file name="tests/stubs/oc_appframework_middleware_security_exceptions_securityexception.php" />
59+
<file name="tests/stubs/oc_appframework_bootstrap_registrationcontext.php" />
60+
<file name="tests/stubs/oc_appframework_bootstrap_aregistration.php" />
61+
<file name="tests/stubs/symfony_component_console_command_command.php" />
62+
<file name="tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php" />
63+
<file name="tests/stubs/symfony_component_console_output_consoleoutput.php" />
64+
<file name="tests/stubs/symfony_component_console_output_streamoutput.php" />
65+
<file name="tests/stubs/symfony_component_console_output_output.php" />
66+
<file name="tests/stubs/symfony_component_console_output_consoleoutputinterface.php" />
67+
<file name="tests/stubs/symfony_component_console_input_inputoption.php" />
68+
<file name="tests/stubs/symfony_component_console_input_inputinterface.php" />
69+
<file name="tests/stubs/symfony_component_console_input_inputargument.php" />
70+
<file name="tests/stubs/symfony_component_console_input_inputoption.php" />
71+
<file name="tests/stubs/symfony_component_console_question_question.php" />
72+
<file name="tests/stubs/symfony_component_console_question_confirmationquestion.php" />
73+
<file name="tests/stubs/symfony_component_console_helper_helperinterface.php" />
74+
<file name="tests/stubs/symfony_component_console_helper_questionhelper.php" />
75+
<file name="tests/stubs/symfony_component_console_helper_helper.php" />
76+
<file name="tests/stubs/symfony_component_console_helper_table.php" />
77+
<file name="tests/stubs/symfony_component_console_output_consolesectionoutput.php" />
78+
<file name="tests/stubs/oc_db_schemawrapper.php" />
79+
<file name="tests/stubs/oc_db_connection.php" />
80+
<file name="tests/stubs/symfony_component_process_process.php" />
1481
</stubs>
1582
<projectFiles>
1683
<directory name="lib" />
@@ -24,35 +91,4 @@
2491
<directory name="vendor/phpunit/php-code-coverage" />
2592
</ignoreFiles>
2693
</extraFiles>
27-
<issueHandlers>
28-
<UndefinedClass>
29-
<errorLevel type="suppress">
30-
<referencedClass name="OC" />
31-
<referencedClass name="OC\DB\Exceptions\DbalException" />
32-
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
33-
<referencedClass name="OCA\Files\App" />
34-
<referencedClass name="OCA\Files_Sharing\External\Manager" />
35-
<referencedClass name="OCP\Accounts\UserUpdatedEvent" />
36-
<referencedClass name="OCA\Files\Event\LoadAdditionalScriptsEvent" />
37-
<referencedClass name="OC\Share20\ShareAttributes" />
38-
<referencedClass name="Symfony\Component\Console\Question\Question" />
39-
<referencedClass name="Symfony\Component\Console\Output\ConsoleOutput" />
40-
<referencedClass name="Symfony\Component\Console\Exception\MissingInputException" />
41-
<referencedClass name="Symfony\Component\Process\Process" />
42-
</errorLevel>
43-
</UndefinedClass>
44-
<UndefinedDocblockClass>
45-
<errorLevel type="suppress">
46-
<referencedClass name="Doctrine\DBAL\Schema\Schema" />
47-
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
48-
<referencedClass name="Doctrine\DBAL\Driver\Statement" />
49-
<referencedClass name="Doctrine\DBAL\Schema\Table" />
50-
</errorLevel>
51-
</UndefinedDocblockClass>
52-
<InvalidThrow>
53-
<errorLevel type="suppress">
54-
<referencedClass name="OC\DB\Exceptions\DbalException" />
55-
</errorLevel>
56-
</InvalidThrow>
57-
</issueHandlers>
5894
</psalm>

0 commit comments

Comments
 (0)