Skip to content

Commit

Permalink
solve null issue with cover
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rubio committed May 25, 2015
1 parent 574ec82 commit 2a102f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ephp_func_vars.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
php_is_integer/2,
php_is_float/2,
php_is_numeric/2,
% php_is_null/2,
php_is_null/2,
php_is_object/2,
php_is_string/2,
print_r/2,
Expand Down Expand Up @@ -38,7 +38,7 @@ init() -> [
{php_is_float, <<"is_float">>},
{php_is_float, <<"is_double">>},
{php_is_numeric, <<"is_numeric">>},
% {php_is_null, <<"is_null">>},
{php_is_null, <<"is_null">>},
{php_is_object, <<"is_object">>},
{php_is_string, <<"is_string">>},
print_r,
Expand All @@ -64,8 +64,10 @@ php_is_numeric(_Context, {_,Value}) -> erlang:is_number(Value).
-spec php_is_float(context(), var_value()) -> boolean().
php_is_float(_Context, {_,Value}) -> erlang:is_float(Value).

% -spec php_is_null(context(), var_value()) -> boolean().
% php_is_null(_Context, {_,Value}) -> Value =:= null orelse Value =:= undefined.
-spec php_is_null(context(), var_value()) -> boolean().
php_is_null(_Context, {_,null}) -> true;
php_is_null(_Context, {_,undefined}) -> true;
php_is_null(_Context, _Var) -> false.

-spec php_is_string(context(), var_value()) -> boolean().
php_is_string(_Context, {_,Value}) -> erlang:is_binary(Value).
Expand Down

0 comments on commit 2a102f7

Please sign in to comment.