for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Flipbox\OAuth2\Client\Provider;
use Craft;
use flipbox\ember\helpers\ModelHelper;
use Exception;
use InvalidArgumentException;
class Salesforce extends \Stevenmaguire\OAuth2\Client\Provider\Salesforce
{
/**
* @var string
*/
public $apiVersion = 'v20.0';
* Retrieves the currently configured provider api version.
*
* @return string
public function getApiVersion()
return $this->apiVersion;
}
* Updates the provider api version with a given value.
* @throws InvalidArgumentException
* @param string $apiVersion
* @return Salesforce
public function setApiVersion($apiVersion)
try {
$this->domain = (string) $apiVersion;
} catch (Exception $e) {
catch (\Exception $e) { ...on is not a string'); }
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
throw new InvalidArgumentException(
'Value provided as api version is not a string'
);
return $this;
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
orexit
statements that have been added for debug purposes.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.