src/Laravelium/Feed/FeedServiceProvider.php
Parameter $app
has undeclared type \Illuminate\Contracts\Container\Container
Open
Open
$this->app->bind('feed', function (Container $app) {
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
Open
'cache' => $app['Illuminate\Cache\Repository'],
- Exclude checks
Class extends undeclared class \Illuminate\Support\ServiceProvider
Open
Open
class FeedServiceProvider extends ServiceProvider implements DeferrableProvider
- Exclude checks
Call to undeclared method \Laravelium\Feed\FeedServiceProvider::publishes
Open
Open
$this->publishes([
- Exclude checks
Reference to undeclared property \Laravelium\Feed\FeedServiceProvider->app
Open
Open
$this->app->alias('feed', Feed::class);
- Exclude checks
Call to undeclared function \config_path()
Open
Open
$config_file => config_path('feed.php')
- Exclude checks
Call to undeclared method \Laravelium\Feed\FeedServiceProvider::mergeConfigFrom
Open
Open
$this->mergeConfigFrom($config_file, 'feed');
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
Open
'config' => $app['config'],
- Exclude checks
Class implements undeclared interface \Illuminate\Contracts\Support\DeferrableProvider
Open
Open
class FeedServiceProvider extends ServiceProvider implements DeferrableProvider
- Exclude checks
Call to undeclared method \Laravelium\Feed\FeedServiceProvider::publishes
Open
Open
$this->publishes([
- Exclude checks
Call to undeclared function \base_path()
Open
Open
__DIR__ . '/../../views' => base_path('resources/views/vendor/feed')
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
Open
'files' => $app['files'],
- Exclude checks
Call to undeclared method \Laravelium\Feed\FeedServiceProvider::loadViewsFrom
Open
Open
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
- Exclude checks
Reference to constant class
from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open
Open
'response' => $app[ResponseFactory::class],
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
Open
'view' => $app['view']
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
Open
'response' => $app[ResponseFactory::class],
- Exclude checks
Reference to undeclared property \Laravelium\Feed\FeedServiceProvider->app
Open
Open
$this->app->bind('feed', function (Container $app) {
- Exclude checks
Define a constant instead of duplicating this literal "config" 3 times. Open
Open
], 'config');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
], 'views');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
__DIR__ . '/../../views' => base_path('resources/views/vendor/feed')
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
], 'config');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
$config_file => config_path('feed.php')
- Exclude checks
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}