These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace AlgoWeb\ODataMetadata; |
||
3 | |||
4 | abstract class IsOK |
||
5 | { |
||
6 | abstract protected function IsOK(&$msg); |
||
7 | |||
8 | protected function isStringNotNullOrEmpty($str){ |
||
9 | if($this->isStringNull($str)){ |
||
0 ignored issues
–
show
|
|||
10 | return false; |
||
11 | } |
||
12 | if(empty(trim($str))){ |
||
13 | return false; |
||
14 | } |
||
15 | return true; |
||
16 | } |
||
17 | |||
18 | protected function isStringNotNull($str) |
||
19 | { |
||
20 | if(null == $str){ |
||
21 | return false; |
||
22 | } |
||
23 | if(!is_string($str)){ |
||
24 | return false; |
||
25 | } |
||
26 | return true; |
||
27 | } |
||
28 | |||
29 | protected function isNotNullIstanceOf($var, $insanceOf){ |
||
30 | if(null == $var){ |
||
31 | return false; |
||
32 | } |
||
33 | if(!($var instanceof $insanceOf)){ |
||
34 | return false; |
||
35 | } |
||
36 | return true; |
||
37 | } |
||
38 | |||
39 | protected function isValidArray($arr, $insanceOf, $minCount = -1, $maxCount = -1){ |
||
40 | if(null == $arr){ |
||
41 | return false; |
||
42 | } |
||
43 | if(!is_array ($arr)){ |
||
44 | return false; |
||
45 | } |
||
46 | if($minCount != -1 && count($arr) < $minCount){ |
||
47 | return false; |
||
48 | } |
||
49 | if($maxCount != -1 && count($arr) > $maxCount){ |
||
50 | return false; |
||
51 | } |
||
52 | foreach($arr as $item){ |
||
53 | if(!($item instanceof $insanceOf)){ |
||
54 | return false; |
||
55 | } |
||
56 | } |
||
57 | return true; |
||
58 | } |
||
59 | } |
||
60 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.