Skip to content

Commit

Permalink
run psalm only against master as the app is shipped
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Sep 18, 2023
1 parent d30339d commit 22192c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
ocp-version: [ 'dev-master', 'dev-stable27', 'dev-stable26', 'dev-stable25']
ocp-version: [ 'dev-master' ]

name: Nextcloud ${{ matrix.ocp-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion lib/Listener/LogListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LogListener implements IEventListener {
private ?Console $console;

public function __construct(Formatter $formatter, SystemConfig $config) {
if (\OC_CONSOLE) {
if (defined('OC_CONSOLE') && \OC_CONSOLE) {
$level = getenv('OCC_LOG');
if ($level) {
$terminal = new Terminal();
Expand Down
2 changes: 1 addition & 1 deletion lib/Log/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(Formatter $formatter, SystemConfig $config, string $
$this->terminalWidth = $terminalWidth;

Check warning on line 42 in lib/Log/Console.php

View check run for this annotation

Codecov / codecov/patch

lib/Log/Console.php#L38-L42

Added lines #L38 - L42 were not covered by tests
}

public function log(int $level, string $app, $entry) {
public function log(int $level, string $app, array $entry) {
if ($level >= $this->level) {
$messageWidth = $this->terminalWidth - 8 - 18 - 6;

Check warning on line 47 in lib/Log/Console.php

View check run for this annotation

Codecov / codecov/patch

lib/Log/Console.php#L45-L47

Added lines #L45 - L47 were not covered by tests

Expand Down
15 changes: 15 additions & 0 deletions tests/stubs/stub.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,18 @@ namespace OC\Core\Command {
class InterruptedException extends \Exception {
}
}

namespace OC {
class SystemConfig {
}
}

namespace OC\Log {
use OC\SystemConfig;
class LogDetails {
public function __construct(SystemConfig $config) {
}
public function logDetails(string $app, $message, int $level): array {
}
}
}

0 comments on commit 22192c2

Please sign in to comment.