GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Convert::objectToArray()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 3
eloc 7
nc 4
nop 1
1
<?php
2
3
namespace prgTW\BaseCRM\Utils;
4
5
class Convert
6
{
7
	/**
8
	 * @param mixed $obj
9
	 *
10
	 * @return array
0 ignored issues
show
Documentation introduced by
Should the return type not be array|integer|double|string|null|boolean|resource? Also, consider making the array more specific, something like array<String>, or String[].

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
11
	 */
12
	public static function objectToArray($obj)
13
	{
14
		if (is_object($obj))
15
		{
16
			$obj = get_object_vars($obj);
17
		}
18
19
		if (is_array($obj))
20
		{
21
			return array_map('self::objectToArray', $obj);
22
		}
23
		else
24
		{
25
			return $obj;
26
		}
27
	}
28
}
29