for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class SecureAPI extends Http\Rest\RestAPI
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public function setup($app)
$app->post('/login[/]', array($this, 'login'));
$app->post('/logout[/]', array($this, 'logout'));
}
public function login($request, $response, $args)
$args
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$params = $request->getParams();
if(!isset($params['username']) || !isset($params['password']))
return $response->withStatus(400);
$auth = AuthProvider::getInstance();
$res = $auth->login($params['username'], $params['password']);
if($res === false)
return $response->withStatus(403);
else
return $response->withJson($res);
public function logout($request, $response, $args)
FlipSession::end();
return $response->withJson(true);
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.