Finished refactoring find() .

This commit is contained in:
Qiang Xue
2014-04-07 16:29:12 -04:00
parent b7d6f6141a
commit 0e143338d7
10 changed files with 148 additions and 62 deletions

View File

@ -504,9 +504,9 @@ class BaseArrayHelper
* the array to be treated as associative.
* @return boolean whether the array is associative
*/
public static function isAssociative(array $array, $allStrings = true)
public static function isAssociative($array, $allStrings = true)
{
if (empty($array)) {
if (!is_array($array) || empty($array)) {
return false;
}
@ -540,8 +540,12 @@ class BaseArrayHelper
* in order for the array to be treated as indexed.
* @return boolean whether the array is associative
*/
public static function isIndexed(array $array, $consecutive = false)
public static function isIndexed($array, $consecutive = false)
{
if (!is_array($array)) {
return false;
}
if (empty($array)) {
return true;
}