The class Feed has an overall complexity of 52 which is very high. The configured complexity threshold is 50. Open
class Feed
{
const DEFAULT_REF = 'self';
/**
- Exclude checks
Method render
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($format = null, $cache = null, $key = null)
{
if (null === $format) {
$format = "atom";
}
Function render
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function render($format = null, $cache = null, $key = null)
{
if (null === $format) {
$format = "atom";
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The class Feed has 31 fields. Consider redesigning Feed to keep the number of fields under 15. Open
class Feed
{
const DEFAULT_REF = 'self';
/**
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function addItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addItem(array $item)
{
// if is multidimensional
if (array_key_exists(1, $item)) {
foreach ($item as $i) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method render() has an NPath complexity of 36864. The configured NPath complexity threshold is 200. Open
public function render($format = null, $cache = null, $key = null)
{
if (null === $format) {
$format = "atom";
}
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method render() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10. Open
public function render($format = null, $cache = null, $key = null)
{
if (null === $format) {
$format = "atom";
}
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed. Open
public function render($format = null, $cache = null, $key = null)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
The method setShortening has a boolean flag argument $b, which is a certain sign of a Single Responsibility Principle violation. Open
public function setShortening($b=false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method render uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$view = 'feed::'.$format;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method render uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// if cache is 0 delete the key (if exists) and return response
$this->clearCache();
return $this->response->make($this->view->make($view, $viewData), 200, ['Content-Type' => $ctype.'; charset='.$this->charset]);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method formatDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// datetime
$date = ('atom' == $format) ? date('c', strtotime($date)) : date('D, d M Y H:i:s O', strtotime($date));
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method render uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ctype = ($format == 'atom') ? 'application/atom+xml' : 'application/rss+xml';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Rename "$ctype" which has the same name as the field declared at line 145. Open
$ctype = $this->ctype;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "; charset=" 3 times. Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- 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 "_ctype" 3 times. Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- 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 "description" 4 times. Open
$append = (strlen($item['description']) > $this->shorteningLimit) ? '...' : '';
- 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.
Rename "$view" which has the same name as the field declared at line 55. Open
$view = $this->customView;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "title" 4 times. Open
if (isset($item['title'])) {
- 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 "Content-Type" 3 times. Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- 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 "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.
Call to method put
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
$this->cache->put($this->cacheKey."_ctype", $ctype, $this->caching);
- Exclude checks
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]);
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param string/integer $date':
after string,
did not see an element name (will guess based on comment order) Open
* @param string/integer $date
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Config\Repository
Open
$this->link = $this->configRepository->get('application.url');
- Exclude checks
Property \Laravelium\Feed\Feed->response
has undeclared type \Illuminate\Contracts\Routing\ResponseFactory
Open
protected $response = null;
- Exclude checks
Call to method make
from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open
return $this->response->make($this->view->make($view, $viewData), 200, ['Content-Type' => $ctype.'; charset='.$this->charset]);
- Exclude checks
Property \Laravelium\Feed\Feed->view
has undeclared type \Illuminate\Contracts\View\Factory
Open
protected $view = null;
- Exclude checks
Property \Laravelium\Feed\Feed->file
has undeclared type \Illuminate\Filesystem\Filesystem
Open
protected $file = null;
- Exclude checks
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]);
- Exclude checks
Call to method has
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
if (0 < $this->caching && $this->cache->has($this->cacheKey)) {
- Exclude checks
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]);
- Exclude checks
Returning type int
but getCacheDuration()
is declared to return string
Open
return $this->caching;
- Exclude checks
Parameter $cache
has undeclared type \Laravelium\Feed\datetime
(Did you mean class \DateTime) Open
public function render($format = null, $cache = null, $key = null)
- Exclude checks
Returning type string
but getCustomView()
is declared to return void
Open
return $this->customView;
- Exclude checks
Property \Laravelium\Feed\Feed->configRepository
has undeclared type \Illuminate\Contracts\Config\Repository
Open
protected $configRepository = null;
- Exclude checks
Returning type string
but getDateFormat()
is declared to return void
Open
return $this->dateFormat;
- Exclude checks
Property \Laravelium\Feed\Feed->cache
has undeclared type \Illuminate\Contracts\Cache\Repository
Open
public $cache = null;
- Exclude checks
Call to method forget
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
$this->cache->forget($this->cacheKey);
- Exclude checks
Saw an @param annotation for format,
but the param list of function getDateFormat() : void
is empty Open
* @param string $format
- Exclude checks
Call to method put
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
$this->cache->put($this->cacheKey, $this->view->make($view, $viewData)->render(), $this->caching);
- Exclude checks
Saw an @param annotation for a,
but it was not found in the param list of function addItem(array $item) : void
Open
* @param array $a
- Exclude checks
Call to undeclared function \request()
Open
$rssLink = (!empty($this->domain)) ? sprintf('%s/%s', rtrim($this->domain, '/'), ltrim(request()->path(), '/')) : request()->url();
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Config\Repository
Open
$this->lang = $this->configRepository->get('application.language');
- Exclude checks
Call to method toDateTimeString
on non-class type string
Open
$date = ('atom' == $format) ? date('c', strtotime($date->toDateTimeString())) : date('D, d M Y H:i:s O', strtotime($date->toDateTimeString()));
- Exclude checks
Call to method has
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
if ($this->cache->has($this->cacheKey)) {
- 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
Call to method make
from undeclared class \Illuminate\Contracts\View\Factory
Open
$this->cache->put($this->cacheKey, $this->view->make($view, $viewData)->render(), $this->caching);
- Exclude checks
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
Saw a token Phan may have failed to parse after '* @param string/integer $date':
after string,
saw '/'
Open
* @param string/integer $date
- 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
Avoid variables with short names like $ga. Configured minimum length is 3. Open
public $ga;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $l. Configured minimum length is 3. Open
public function setTextLimit($l=150)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $b. Configured minimum length is 3. Open
public function setShortening($b=false)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Blank line found at start of control structure Open
if (0 < $this->caching) {
- Exclude checks
Incorrect spacing between argument "$key" and equals sign; expected 1 but found 0 Open
public function setCache($duration=60, $key="laravel-feed")
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$lang"; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$format"; expected 1 but found 0 Open
public function setDateFormat($format="datetime")
- Exclude checks
Incorrect spacing between argument "$duration" and equals sign; expected 1 but found 0 Open
public function setCache($duration=60, $key="laravel-feed")
- Exclude checks
Incorrect spacing between argument "$title" and equals sign; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$title"; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$b"; expected 1 but found 0 Open
public function setShortening($b=false)
- Exclude checks
Incorrect spacing between argument "$view" and equals sign; expected 1 but found 0 Open
public function setCustomView($view=null)
- Exclude checks
Incorrect spacing between argument "$type" and equals sign; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$key"; expected 1 but found 0 Open
public function setCache($duration=60, $key="laravel-feed")
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$format"; expected 1 but found 0 Open
public function formatDate($date, $format='atom')
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$type"; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$duration"; expected 1 but found 0 Open
public function setCache($duration=60, $key="laravel-feed")
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$view"; expected 1 but found 0 Open
public function setCustomView($view=null)
- Exclude checks
Incorrect spacing between argument "$lang" and equals sign; expected 1 but found 0 Open
public static function link($url, $type='atom', $title=null, $lang=null)
- Exclude checks
Incorrect spacing between argument "$l" and equals sign; expected 1 but found 0 Open
public function setTextLimit($l=150)
- Exclude checks
Incorrect spacing between argument "$format" and equals sign; expected 1 but found 0 Open
public function formatDate($date, $format='atom')
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$l"; expected 1 but found 0 Open
public function setTextLimit($l=150)
- Exclude checks
Incorrect spacing between argument "$b" and equals sign; expected 1 but found 0 Open
public function setShortening($b=false)
- Exclude checks
Incorrect spacing between argument "$format" and equals sign; expected 1 but found 0 Open
public function setDateFormat($format="datetime")
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
return $this->response->make($this->view->make($view, $viewData), 200, ['Content-Type' => $ctype.'; charset='.$this->charset]);
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
$rssLink = (!empty($this->domain)) ? sprintf('%s/%s', rtrim($this->domain, '/'), ltrim(request()->path(), '/')) : request()->url();
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$date = ('atom' == $format) ? date('c', strtotime($date->toDateTimeString())) : date('D, d M Y H:i:s O', strtotime($date->toDateTimeString()));
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$date = ('atom' == $format) ? date('c', strtotime('@'.$date)) : date('D, d M Y H:i:s O', strtotime('@'.$date));
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
];
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
];
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'related' => $this->related,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'channel' => $channel,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'copyright' => $this->copyright
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'logo' => $this->logo,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'cover' => $this->cover,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'description' => $this->description,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'color' => $this->color,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'title' => htmlspecialchars(strip_tags($this->title), ENT_COMPAT, 'UTF-8'),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'ref' => $this->ref,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'link' => $this->link,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'pubdate' => $this->formatDate($this->pubdate, $format),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'items' => $this->items,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'ga' => $this->ga,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'icon' => $this->icon,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'rssLink' => $rssLink,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'subtitle' => htmlspecialchars(strip_tags($this->subtitle), ENT_COMPAT, 'UTF-8'),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'namespaces' => $this->namespaces
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'lang' => $this->lang,
- Exclude checks