BurningFlipside /
CommonCode
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | namespace Flipside\LDAP; |
||
| 3 | |||
| 4 | class LDAPObject extends \Flipside\SerializableObject |
||
| 5 | { |
||
| 6 | public $server; |
||
| 7 | |||
| 8 | function __construct($array = false, $server = false) |
||
| 9 | { |
||
| 10 | parent::__construct($array); |
||
| 11 | $this->server = $server; |
||
| 12 | } |
||
| 13 | |||
| 14 | public function jsonSerialize() |
||
| 15 | { |
||
| 16 | $ret = array(); |
||
| 17 | foreach($this as $key => $value) |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 18 | { |
||
| 19 | if($key === 'server' || $key === 'count') |
||
| 20 | { |
||
| 21 | continue; |
||
| 22 | } |
||
| 23 | if(is_numeric($key)) |
||
| 24 | { |
||
| 25 | continue; |
||
| 26 | } |
||
| 27 | if($key === 'jpegphoto') |
||
| 28 | { |
||
| 29 | $ret[$key] = base64_encode($value[0]); |
||
| 30 | continue; |
||
| 31 | } |
||
| 32 | if(is_array($value) && $value['count'] === 1) |
||
| 33 | { |
||
| 34 | $ret[$key] = $value[0]; |
||
| 35 | } |
||
| 36 | else |
||
| 37 | { |
||
| 38 | $ret[$key] = $value; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | return $ret; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
||
| 45 |