Skip to content

refactor: fix PHPStan errors #6470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions phpstan-baseline.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ parameters:
count: 1
path: system/Cache/Handlers/FileHandler.php

-
message: "#^Method MemcachePool\\:\\:decrement\\(\\) invoked with 4 parameters, 1\\-2 required\\.$#"
count: 1
path: system/Cache/Handlers/MemcachedHandler.php

-
message: "#^Method MemcachePool\\:\\:increment\\(\\) invoked with 4 parameters, 1\\-2 required\\.$#"
count: 1
path: system/Cache/Handlers/MemcachedHandler.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
Expand Down Expand Up @@ -545,11 +535,6 @@ parameters:
count: 1
path: system/HTTP/Request.php

-
message: "#^Cannot unset offset 'path' on array{host: non-empty-string}\\.$#"
count: 1
path: system/HTTP/URI.php

-
message: "#^Property CodeIgniter\\\\HTTP\\\\URI\\:\\:\\$fragment \\(string\\) on left side of \\?\\? is not nullable\\.$#"
count: 1
Expand Down Expand Up @@ -580,11 +565,6 @@ parameters:
count: 1
path: system/Helpers/number_helper.php

-
message: "#^Variable \\$pool might not be defined\\.$#"
count: 2
path: system/Helpers/text_helper.php

-
message: "#^Variable \\$count might not be defined\\.$#"
count: 1
Expand Down
4 changes: 2 additions & 2 deletions system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public function insert($data = null, bool $returnID = true)
{
if (! empty($this->tempData['data'])) {
if (empty($data)) {
$data = $this->tempData['data'] ?? null;
$data = $this->tempData['data'];
} else {
$data = $this->transformDataToArray($data, 'insert');
$data = array_merge($this->tempData['data'], $data);
Expand All @@ -680,7 +680,7 @@ public function update($id = null, $data = null): bool
{
if (! empty($this->tempData['data'])) {
if (empty($data)) {
$data = $this->tempData['data'] ?? null;
$data = $this->tempData['data'];
} else {
$data = $this->transformDataToArray($data, 'update');
$data = array_merge($this->tempData['data'], $data);
Expand Down