Browse Source

feat(psalm): Add a stub for the command base class

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/10316/head
Joas Schilling 2 years ago
parent
commit
948f87851d
No known key found for this signature in database GPG Key ID: 74434EFE0D2E2205
  1. 2
      psalm.xml
  2. 166
      tests/psalm-baseline.xml
  3. 60
      tests/stubs/oc_core_command_base.php

2
psalm.xml

@ -44,6 +44,7 @@
<referencedClass name="OCA\DAV\CardDAV\PhotoCache" />
<referencedClass name="OCA\FederatedFileSharing\AddressHandler" />
<referencedClass name="OCA\Files_Sharing\SharedStorage" />
<referencedClass name="Stecman\Component\Symfony\Console\BashCompletion\CompletionContext" />
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
@ -82,6 +83,7 @@
<stubs>
<file name="tests/stubs/oc_comments_comment.php" />
<file name="tests/stubs/oc_comments_manager.php" />
<file name="tests/stubs/oc_core_command_base.php" />
<file name="tests/stubs/oc_hooks_emitter.php" />
<file name="tests/stubs/GuzzleHttp_Exception_ClientException.php" />
<file name="tests/stubs/GuzzleHttp_Exception_ConnectException.php" />

166
tests/psalm-baseline.xml

@ -29,170 +29,10 @@
<code>\OC_Util</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/Install.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/ListBots.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/Remove.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/Setup.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/State.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Bot/Uninstall.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Command/Add.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Command/AddSamples.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Command/Delete.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Command/ListCommand.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Command/Update.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Developer/UpdateDocs.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Monitor/Calls.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Monitor/HasActiveCalls.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Monitor/Room.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Add.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Create.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Delete.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Demote.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Promote.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Remove.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Room/Update.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Signaling/Add.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Signaling/Delete.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Signaling/ListCommand.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Stun/Add.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Stun/Delete.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Stun/ListCommand.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Turn/Add.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Turn/Delete.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/Turn/ListCommand.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/User/Remove.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
</file>
<file src="lib/Command/User/TransferOwnership.php">
<UndefinedClass>
<code>Base</code>
</UndefinedClass>
<ForbiddenCode>
<code><![CDATA[shell_exec('which bc')]]></code>
</ForbiddenCode>
</file>
<file src="lib/Config.php">
<NullArgument>

60
tests/stubs/oc_core_command_base.php

@ -0,0 +1,60 @@
<?php
namespace OC\Core\Command {
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Base {
public const OUTPUT_FORMAT_PLAIN = 'plain';
public const OUTPUT_FORMAT_JSON = 'json';
public const OUTPUT_FORMAT_JSON_PRETTY = 'json_pretty';
protected string $defaultOutputFormat = self::OUTPUT_FORMAT_PLAIN;
public function __construct(string $name = null) {
}
protected function configure() {
}
public function setName(string $name) {
}
public function getApplication(): ?Application {
}
public function getDefinition(): InputDefinition {
}
protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, array $items, string $prefix = ' - '): void {
}
protected function writeTableInOutputFormat(InputInterface $input, OutputInterface $output, array $items): void {
}
protected function writeMixedInOutputFormat(InputInterface $input, OutputInterface $output, $item) {
}
protected function valueToString($value, bool $returnNull = true): ?string {
}
protected function abortIfInterrupted() {
}
protected function cancelOperation() {
}
public function run(InputInterface $input, OutputInterface $output) {
}
public function completeOptionValues($optionName, CompletionContext $context) {
}
public function completeArgumentValues($argumentName, CompletionContext $context) {
}
}
}
Loading…
Cancel
Save