Laravelium/laravel-feed

View on GitHub
src/Laravelium/Feed/FeedServiceProvider.php

Summary

Maintainability
A
0 mins
Test Coverage

Parameter $app has undeclared type \Illuminate\Contracts\Container\Container
Open

        $this->app->bind('feed', function (Container $app) {

Suspicious array access to \Illuminate\Contracts\Container\Container
Open

                'cache' => $app['Illuminate\Cache\Repository'],

Class extends undeclared class \Illuminate\Support\ServiceProvider
Open

class FeedServiceProvider extends ServiceProvider implements DeferrableProvider

Call to undeclared method \Laravelium\Feed\FeedServiceProvider::publishes
Open

        $this->publishes([

Reference to undeclared property \Laravelium\Feed\FeedServiceProvider->app
Open

        $this->app->alias('feed', Feed::class);

Call to undeclared function \config_path()
Open

      $config_file => config_path('feed.php')

Call to undeclared method \Laravelium\Feed\FeedServiceProvider::mergeConfigFrom
Open

        $this->mergeConfigFrom($config_file, 'feed');

Suspicious array access to \Illuminate\Contracts\Container\Container
Open

                'config' => $app['config'],

Class implements undeclared interface \Illuminate\Contracts\Support\DeferrableProvider
Open

class FeedServiceProvider extends ServiceProvider implements DeferrableProvider

Call to undeclared method \Laravelium\Feed\FeedServiceProvider::publishes
Open

        $this->publishes([

Call to undeclared function \base_path()
Open

      __DIR__ . '/../../views' => base_path('resources/views/vendor/feed')

Suspicious array access to \Illuminate\Contracts\Container\Container
Open

                'files' => $app['files'],

Call to undeclared method \Laravelium\Feed\FeedServiceProvider::loadViewsFrom
Open

        $this->loadViewsFrom(__DIR__ . '/../../views', 'feed');

Reference to constant class from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open

                'response' => $app[ResponseFactory::class],

Suspicious array access to \Illuminate\Contracts\Container\Container
Open

                'view' => $app['view']

Suspicious array access to \Illuminate\Contracts\Container\Container
Open

                'response' => $app[ResponseFactory::class],

Reference to undeclared property \Laravelium\Feed\FeedServiceProvider->app
Open

        $this->app->bind('feed', function (Container $app) {

Define a constant instead of duplicating this literal "config" 3 times.
Open

    ], 'config');

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

    ], 'views');

Line indented incorrectly; expected at least 8 spaces, found 6
Open

      __DIR__ . '/../../views' => base_path('resources/views/vendor/feed')

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    ], 'config');

Line indented incorrectly; expected at least 8 spaces, found 6
Open

      $config_file => config_path('feed.php')

The variable $config_file is not named in camelCase.
Open

    public function boot()
    {
        $this->loadViewsFrom(__DIR__ . '/../../views', 'feed');

        $this->publishes([

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

    public function boot()
    {
        $this->loadViewsFrom(__DIR__ . '/../../views', 'feed');

        $this->publishes([

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

    public function boot()
    {
        $this->loadViewsFrom(__DIR__ . '/../../views', 'feed');

        $this->publishes([

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

There are no issues that match your filters.

Category
Status