Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Dec 9, 2024
1 parent bb15a3d commit a2d51a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Log
run: |
echo "Run action by ${{ github.actor }}"
echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
Expand Down
30 changes: 0 additions & 30 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5496,42 +5496,12 @@ parameters:
count: 1
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountingaccount might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountingjournal might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountstatic might not be defined\.$#'
identifier: variable.undefined
count: 7
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$bankline might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$variousstatic might not be defined\.$#'
identifier: variable.undefined
count: 12
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Loose comparison using \=\= between ''card'' and ''card'' will always evaluate to true\.$#'
identifier: equal.alwaysTrue
Expand Down
13 changes: 5 additions & 8 deletions htdocs/compta/bank/various_payment/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,24 +239,21 @@

$form = new Form($db);
$proj = null;
$bankline = new AccountLine($db);
$variousstatic = new PaymentVarious($db);
$accountstatic = null;
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) {
$formaccounting = new FormAccounting($db);
}
if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) {
$accountingjournal = new AccountingJournal($db);
}
if ($arrayfields['ref']['checked']) {
$variousstatic = new PaymentVarious($db);
}
if ($arrayfields['bank']['checked']) {
$accountstatic = new Account($db);
$accountstatic = new Account($db);
}
if ($arrayfields['project']['checked']) {
$proj = new Project($db);
}
if ($arrayfields['entry']['checked']) {
$bankline = new AccountLine($db);
}
if ($arrayfields['account']['checked']) {
$accountingaccount = new AccountingAccount($db);
}
Expand Down Expand Up @@ -817,7 +814,7 @@
}

// Bank account
if ($arrayfields['bank']['checked']) {
if ($arrayfields['bank']['checked'] && is_object($accountstatic)) {
print '<td class="nowraponall">';
if ($obj->bid > 0) {
$accountstatic->id = $obj->bid;
Expand Down

0 comments on commit a2d51a8

Please sign in to comment.