Completed
Push — add/product-ratings-to-search ( 91683c...b05261 )
by
unknown
344:08 queued 334:42
created

SimplePie_File   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
/**
3
 * Implements a basic interface of the SimplePie_Locator class in environments where it doesn't exist.
4
 *
5
 * @package jetpack
6
 */
7
8
if ( ! class_exists( 'SimplePie_File' ) ) {
9
	/**
10
	 * Class SimplePie_Locator
11
	 */
12
	class SimplePie_File {
13
		/**
14
		 * Constructor
15
		 *
16
		 * Stores a response directly into the file body for similating feed markup.
17
		 *
18
		 * @param string $response Response body.
19
		 */
20
		public function __construct( $response ) {
21
			$this->body = $response;
0 ignored issues
show
Bug introduced by
The property body does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
22
		}
23
	}
24
}
25