Skip to content

Commit 5faf442

Browse files
committed
fix: Adjust psalm stubs
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 5e68cff commit 5faf442

File tree

4 files changed

+69
-18
lines changed

4 files changed

+69
-18
lines changed

psalm.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
<directory name="vendor/nextcloud/ocp"/>
1414
</extraFiles>
1515
<stubs>
16-
<file name="tests/stubs/stub.phpstub" preloadClasses="true"/>
16+
<file name="tests/stubs/oc_core_command.php" preloadClasses="true"/>
17+
<file name="tests/stubs/oc_log_LogDetails.php"/>
18+
<file name="tests/stubs/oc_SystemConfig.php" preloadClasses="true"/>
1719
</stubs>
1820
<issueHandlers>
1921
<UndefinedClass>

tests/stubs/oc_SystemConfig.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* @copyright Copyright (c) 2021 Robin Appelman <[email protected]>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
namespace OC {
25+
class SystemConfig {
26+
public function getValue(string $key, mixed $default = ''): mixed {
27+
}
28+
}
29+
}

tests/stubs/oc_core_command.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* @copyright Copyright (c) 2021 Robin Appelman <[email protected]>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
namespace OC\Core\Command {
25+
use Symfony\Component\Console\Command\Command;
26+
27+
class Base extends Command {
28+
protected function abortIfInterrupted() {
29+
}
30+
}
31+
32+
class InterruptedException extends \Exception {
33+
}
34+
}

tests/stubs/stub.phpstub tests/stubs/oc_log_LogDetails.php

+3-17
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,15 @@
2121
*
2222
*/
2323

24-
namespace OC\Core\Command {
25-
use Symfony\Component\Console\Command\Command;
26-
27-
class Base extends Command {
28-
protected function abortIfInterrupted(){
29-
}
30-
}
31-
32-
class InterruptedException extends \Exception {
33-
}
34-
}
35-
36-
namespace OC {
37-
class SystemConfig {
38-
}
39-
}
40-
4124
namespace OC\Log {
4225
use OC\SystemConfig;
26+
4327
class LogDetails {
4428
public function __construct(SystemConfig $config) {
4529
}
4630
public function logDetails(string $app, $message, int $level): array {
4731
}
32+
public function logDetailsAsJSON(string $app, $message, int $level): string {
33+
}
4834
}
4935
}

0 commit comments

Comments
 (0)