mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix phpstan issues.
This commit is contained in:
@@ -6,6 +6,13 @@ includes:
|
|||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
|
- '#is not allowed to extend#'
|
||||||
|
- '#is neither abstract nor final#'
|
||||||
|
- '#has a nullable return type declaration#'
|
||||||
|
- '#with a nullable type declaration#'
|
||||||
|
-
|
||||||
|
message: '#Control structures using switch should not be used.#'
|
||||||
|
path: ../app/Api/V1/Controllers/Data/DestroyController.php
|
||||||
paths:
|
paths:
|
||||||
- ../app
|
- ../app
|
||||||
- ../database
|
- ../database
|
||||||
|
@@ -30,6 +30,6 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||||||
|
|
||||||
# Do static code analysis.
|
# Do static code analysis.
|
||||||
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
|
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
|
||||||
./vendor/bin/phpstan analyse -c .ci/phpstan.neon
|
./vendor/bin/phpstan analyse -c .ci/phpstan.neon --error-format=table > phpstan.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -98,7 +98,7 @@ class AccountController extends Controller
|
|||||||
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
|
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
|
||||||
$default = app('amount')->getDefaultCurrency();
|
$default = app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
if (empty($frontPage->data)) {
|
if (!(is_array($frontPage->data) && count($frontPage->data) > 0)) {
|
||||||
$frontPage->data = $defaultSet;
|
$frontPage->data = $defaultSet;
|
||||||
$frontPage->save();
|
$frontPage->save();
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace FireflyIII\Api\V1\Controllers\Data;
|
namespace FireflyIII\Api\V1\Controllers\Data;
|
||||||
|
|
||||||
use FireflyIII\Api\V1\Controllers\Controller;
|
use FireflyIII\Api\V1\Controllers\Controller;
|
||||||
|
@@ -62,7 +62,7 @@ class TransactionRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[]
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
@@ -101,6 +101,7 @@ class UpdateRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
/** @var Account $account */
|
||||||
$account = $this->route()->parameter('account');
|
$account = $this->route()->parameter('account');
|
||||||
$accountRoles = implode(',', config('firefly.accountRoles'));
|
$accountRoles = implode(',', config('firefly.accountRoles'));
|
||||||
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
||||||
|
Reference in New Issue
Block a user