Skip to content

Commit

Permalink
Merge pull request #643 from CuriousInc/fix-641
Browse files Browse the repository at this point in the history
Fix strict type error in Picqer\Financials\Exact\QueryFindable:findId
  • Loading branch information
stephangroen committed May 7, 2024
2 parents e0e9016 + 9caf45b commit 729c879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Picqer/Financials/Exact/Query/Findable.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function findWithSelect($id, $select = '')
/**
* Return the value of the primary key.
*
* @param string $code the value to search for
* @param string|int $code the value to search for
* @param string $key the key being searched (defaults to 'Code')
*
* @return string|void (guid)
Expand All @@ -64,7 +64,7 @@ public function findId($code, $key = 'Code')
{
if ($this->isFillable($key)) {
$format = ($this->url() == 'crm/Accounts' && $key === 'Code') ? '%18s' : '%s';
if (preg_match('/^[\w]{8}-([\w]{4}-){3}[\w]{12}$/', $code)) {
if (is_string($code) && preg_match('/^[\w]{8}-([\w]{4}-){3}[\w]{12}$/', $code)) {
$format = "guid'$format'";
} elseif (is_string($code)) {
$format = "'$format'";
Expand Down

0 comments on commit 729c879

Please sign in to comment.