Showing 151 of 151 total issues
Parameter $cache
has undeclared type \Laravelium\Feed\carbon
Open
public function render($format = null, $cache = null, $key = null)
- Exclude checks
Return type of render()
is undeclared type \Laravelium\Feed\view
Open
public function render($format = null, $cache = null, $key = null)
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
'response' => $app[ResponseFactory::class],
- Exclude checks
Variable $namespaces
is undeclared Open
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0" xmlns:media="http://search.yahoo.com/mrss/"<?php foreach ($namespaces as $n) {
- Exclude checks
Define a constant instead of duplicating this literal "D, d M Y H:i:s O" 4 times. Open
$this->pubdate = date('D, d M Y H:i:s O');
- 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.
Define a constant instead of duplicating this literal "UTF-8" 5 times. Open
$item['description'] = mb_substr($item['description'], 0, $this->shorteningLimit, 'UTF-8') . $append;
- 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.
Define a constant instead of duplicating this literal "subtitle" 4 times. Open
if (isset($item['subtitle'])) {
- 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.
Saw a token Phan may have failed to parse after '* @param string/integer $date':
after string,
saw '/'
Open
* @param string/integer $date
- Exclude checks
Reference to undeclared property \Laravelium\Feed\FeedServiceProvider->app
Open
$this->app->bind('feed', function (Container $app) {
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- Exclude checks
Define a constant instead of duplicating this literal "config" 3 times. 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.