Skip to content

Commit

Permalink
Merge pull request #162 from bakaphp/0.6-hofix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken authored May 17, 2022
2 parents 00affe3 + 8b3dab7 commit 24f9ca7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function appPath(string $path = '') : string
$currentDir = basePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);

/**
* since we are calling this file from the diferent path we have to verify if its cli.
* since we are calling this file from the different path we have to verify if its cli.
*
* @todo look for a better solution , hate this
*/
Expand Down Expand Up @@ -103,9 +103,9 @@ function appUrl(string $resource, int $recordId)

if (!function_exists('Baka\paymentGatewayIsActive')) {
/**
* Do we have a payment metho actived on the app?
* Do we have a payment method active on the app?
*
* @return boolean
* @return bool
*/
function paymentGatewayIsActive() : bool
{
Expand All @@ -119,10 +119,14 @@ function paymentGatewayIsActive() : bool
*
* @param string $string
*
* @return boolean
* @return bool
*/
function isJson(string $string) : bool
function isJson(?string $string = null) : bool
{
if ($string === null) {
return false;
}

try {
json_decode($string);
return true;
Expand Down Expand Up @@ -150,7 +154,7 @@ function json_decode(string $json)
/**
* Are we running a Swoole Server for this app?
*
* @return boolean
* @return bool
*/
function isSwooleServer() : bool
{
Expand All @@ -162,7 +166,7 @@ function isSwooleServer() : bool
/**
* Are we running a Swoole Server for this app?
*
* @return boolean
* @return string
*/
function getShortClassName(object $object) : string
{
Expand Down

0 comments on commit 24f9ca7

Please sign in to comment.