| 1 | <?php |
||
| 7 | * @author Christian Blank <[email protected]> |
||
| 8 | */ |
||
| 9 | class SessionFormatter implements IRestSerializeFormatter { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Returns an array with entries for `user`. |
||
| 13 | * |
||
| 14 | * @param ApiSession $data |
||
| 15 | * @param array $access |
||
|
|
|||
| 16 | * @param array $fields |
||
| 17 | * @return array the user data in a serializable structure |
||
| 18 | */ |
||
| 19 | public static function format($data, $access=null, $fields=null) { |
||
| 20 | return [ |
||
| 21 | 'user' => $data->User->URLSegment, |
||
| 22 | 'token' => $data->Token |
||
| 23 | ]; |
||
| 24 | } |
||
| 26 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.