From 6a9d0bdecd70eb044f692e136fd0955f8e98afc6 Mon Sep 17 00:00:00 2001 From: abdumu Date: Tue, 13 Mar 2018 16:38:32 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/StrHelper.php | 11 ++++++----- src/functions.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/StrHelper.php b/src/StrHelper.php index 74fa851..dbe5242 100644 --- a/src/StrHelper.php +++ b/src/StrHelper.php @@ -156,18 +156,19 @@ function () use ($methodName, $arguments) { $mb_parse_str = function_exists('mb_parse_str') ? 'mb_parse_str' : 'parse_str'; $mb_parse_str($this->currentString, $result); + return $result; } elseif ($snake_method_name === 'strlen') { return $this->count(); - } elseif ($snake_method_name === 'equal' && sizeof($arguments)) { - foreach($arguments as $arg) { - if($this->currentString !== $arg) { + } elseif ($snake_method_name === 'equal' && count($arguments)) { + foreach ($arguments as $arg) { + if ($this->currentString !== $arg) { return false; } } return true; - } elseif ($snake_method_name === 'contains' && sizeof($arguments)) { + } elseif ($snake_method_name === 'contains' && count($arguments)) { foreach ($arguments as $arg) { $mb_strpos = function_exists('mb_strpos') ? 'mb_strpos' : 'strpos'; @@ -184,7 +185,7 @@ function () use ($methodName, $arguments) { } }); } elseif (function_exists($snake_method_name)) { - if(function_exists('mb_'.$snake_method_name)) { + if (function_exists('mb_'.$snake_method_name)) { $snake_method_name = 'mb_'.$snake_method_name; } diff --git a/src/functions.php b/src/functions.php index 062c8d9..dce9791 100644 --- a/src/functions.php +++ b/src/functions.php @@ -2,7 +2,7 @@ use Awssat\StrHelper\StrHelper; -if (! function_exists('str')) { +if (!function_exists('str')) { /** * A flexible & powerful string manipulation helper for PHP. *