for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Service provider for UnionCloud
*/
namespace Twigger\UnionCloud\API;
use Illuminate\Support\ServiceProvider;
* Allow Laravel to use UnionCloud
* Class UnionCloudServiceProvider
*
* @package Twigger\UnionCloud\API
class UnionCloudServiceProvider extends ServiceProvider
{
* Indicates if loading of the provider is deferred.
* @var bool
protected $defer = true;
* Bootstrap the application events.
* @return void
public function boot()
$this->publishes([
__DIR__ . '/../laravel/resources/config/unioncloud.php' => config_path('unioncloud.php'),
config_path
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
__DIR__ . '/../laravel/resources/config/unioncloud.php' => /** @scrutinizer ignore-call */ config_path('unioncloud.php'),
]);
}
* Register the service provider.
public function register()
$this->app->singleton('handleuc', function($app){
$app
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$this->app->singleton('handleuc', function(/** @scrutinizer ignore-unused */ $app){
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return new UnionCloud();
$unionCloud = new UnionCloud([
$unionCloud = new Twigge...auth']['appPassword']))
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
'email' => $app->config['unioncloud']['v0auth']['email'],
'password' => $app->config['unioncloud']['v0auth']['password'],
'appID' => $app->config['unioncloud']['v0auth']['appID'],
'appPassword' => $app->config['unioncloud']['v0auth']['appPassword'],
$unionCloud->setBaseURL($app->config['unioncloud']['baseURL']);
return $unionCloud;
});