for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Blok\JavaScript;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class JavaScriptServiceProvider extends ServiceProvider
{
protected $defer = false;
public function register()
$this->app->singleton('JavaScript', 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('JavaScript', 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 JavaScript(config('javascript.namespace'));
config
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return new JavaScript(/** @scrutinizer ignore-call */ config('javascript.namespace'));
});
}
public function boot()
require_once __DIR__ . '/helpers.php';
$this->publishes([
__DIR__ . '/config/javascript.php' => config_path('javascript.php'),
config_path
__DIR__ . '/config/javascript.php' => /** @scrutinizer ignore-call */ config_path('javascript.php'),
], 'config');
/**
* @example
* @javascript($namespace, (optional) $array)
*/
Blade::directive('javascript', function ($expression) {
return "<?php echo JavaScript::render({$expression}); ?>";
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.