for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Logout
*
* @package Intraface
* @author Lars Olesen <[email protected]>
* @since 0.1.0
* @version @package-version@
*/
class Intraface_Controller_Logout extends k_Component
{
protected $auth;
function __construct(Intraface_Auth $auth)
$this->auth = $auth;
}
function execute()
$this->url_state->init("continue", $this->url('/login'));
return parent::execute();
function GET()
if ($this->auth->clearIdentity()) {
$this->session()->set('identity', null);
set
$this->session()
string
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
$this->session()->destroy();
destroy
return new k_SeeOther($this->query('continue'));
} else {
throw new Exception('Could not logout');
return parent::GET();
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.
return
die
exit
function fx() { try { doSomething(); return true; } catch (\Exception $e) { return false; } return false; }
In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.
return false
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.