for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ntb\RestAPI;
/**
* The session formatter can format a session into a representation which is consumable from a IRestSerializer.
* @author Christian Blank <[email protected]>
*/
class SessionFormatter implements IRestSerializeFormatter {
* Returns an array with entries for `user`.
*
* @param ApiSession $data
* @param array $access
$access
array|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
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.
* @param array $fields
$fields
* @return array the user data in a serializable structure
public static function format($data, $access=null, $fields=null) {
return [
'user' => $data->User->URLSegment,
'token' => $data->Token
];
}
This check looks for
@param
annotations 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.