Laravelium/laravel-feed

View on GitHub

Showing 151 of 151 total issues

Property \Laravelium\Feed\Feed->view has undeclared type \Illuminate\Contracts\View\Factory
Open

    protected $view = null;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Property \Laravelium\Feed\Feed->file has undeclared type \Illuminate\Filesystem\Filesystem
Open

    protected $file = null;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Call to method make from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open

            return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
Severity: Critical
Found in src/Laravelium/Feed/Feed.php by phan

Call to method has from undeclared class \Illuminate\Contracts\Cache\Repository
Open

        if (0 < $this->caching && $this->cache->has($this->cacheKey)) {
Severity: Critical
Found in src/Laravelium/Feed/Feed.php by phan

Call to method make from undeclared class \Illuminate\Contracts\View\Factory
Open

            return $this->response->make($this->view->make($view, $viewData), 200, ['Content-Type' => $ctype.'; charset='.$this->charset]);
Severity: Critical
Found in src/Laravelium/Feed/Feed.php by phan

Class extends undeclared class \Illuminate\Support\ServiceProvider
Open

class FeedServiceProvider extends ServiceProvider implements DeferrableProvider

Returning type int but getCacheDuration() is declared to return string
Open

        return $this->caching;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

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

        $this->publishes([

Call to undeclared function \config()
Open

    'cache_key'            =>     'laravel-feed.' . config('app.url'),
Severity: Critical
Found in src/config/config.php by phan

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

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

Parameter $cache has undeclared type \Laravelium\Feed\datetime (Did you mean class \DateTime)
Open

    public function render($format = null, $cache = null, $key = null)
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Returning type string but getCustomView() is declared to return void
Open

        return $this->customView;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Call to undeclared function \config_path()
Open

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

Define a constant instead of duplicating this literal "description" 4 times.
Open

            $append = (strlen($item['description']) > $this->shorteningLimit) ? '...' : '';
Severity: Critical
Found in src/Laravelium/Feed/Feed.php by sonar-php

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.

Property \Laravelium\Feed\Feed->configRepository has undeclared type \Illuminate\Contracts\Config\Repository
Open

    protected $configRepository = null;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Returning type string but getDateFormat() is declared to return void
Open

        return $this->dateFormat;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

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'],

Property \Laravelium\Feed\Feed->cache has undeclared type \Illuminate\Contracts\Cache\Repository
Open

    public $cache = null;
Severity: Minor
Found in src/Laravelium/Feed/Feed.php by phan

Call to method forget from undeclared class \Illuminate\Contracts\Cache\Repository
Open

            $this->cache->forget($this->cacheKey);
Severity: Critical
Found in src/Laravelium/Feed/Feed.php by phan
Severity
Category
Status
Source
Language