for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
require "../vendor/autoload.php";
$currentUrl = (isset($_SERVER['HTTPS']) ? 'https' : 'http')."://".$_SERVER['HTTP_HOST'].preg_replace('/\?.*$/', '', $_SERVER["REQUEST_URI"]);
set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($currentUrl) {
$errline
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
set_error_handler(function ($errno, $errstr, $errfile, /** @scrutinizer ignore-unused */ $errline) use ($currentUrl) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$errfile
set_error_handler(function ($errno, $errstr, /** @scrutinizer ignore-unused */ $errfile, $errline) use ($currentUrl) {
$errstr
set_error_handler(function ($errno, /** @scrutinizer ignore-unused */ $errstr, $errfile, $errline) use ($currentUrl) {
if (E_RECOVERABLE_ERROR === $errno) {
header('Location: ' . $currentUrl);
}
return false;
});
$client = new \Stevenmaguire\Services\Trello\Client(array(
'key' => 'your-app-key',
'secret' => 'your-app-secret',
'name' => 'My sweet trello enabled app',
'callbackUrl' => $currentUrl,
'expiration' => '30days',
'scope' => 'read,write',
));
session_start();
if (isset($_GET['oauth_token'], $_GET['oauth_verifier'])) {
try {
$credentials = $client->getAccessToken($_GET['oauth_token'], $_GET['oauth_verifier']);
echo "<pre>";
echo 'Access Token: ' . $credentials->getIdentifier() . "\n";
echo 'Token Secret: ' . $credentials->getSecret() . "\n";
echo "</pre>";
} catch (Exception $e) {
} elseif (isset($_GET['auth'])) {
$authorizationUrl = $client->getAuthorizationUrl();
header('Location: ' . $authorizationUrl);
} else {
echo '<a href="?auth=true">Authenticate</a>';
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.