Passed
Push — master ( 3295fe...37d5c2 )
by Richard
04:14 queued 14s
created

Children   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 31
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A byUuid() 0 29 1
1
<?php
2
3
4
namespace Testcomponents\Storyblok\Blocks;
5
6
use Riclep\Storyblok\Block;
7
8
class Children extends Block
9
{
10
	public function byUuid($block) {
0 ignored issues
show
Unused Code introduced by
The parameter $block is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

10
	public function byUuid(/** @scrutinizer ignore-unused */ $block) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
11
12
		$json = '{"story": {
13
				"id": 107350,
14
				"uuid": "ac0d2ed0-e323-43ca-ae59-5cd7d38683cb",
15
				"name": "Child content",
16
				"slug": "child-content",
17
				"full_slug": "pages/default-page",
18
				"created_at": "2018-04-24T11:57:29.302Z",
19
				"published_at": "2018-12-07T01:31:36.134Z",
20
				"first_published_at": "2018-08-07T09:40:13.000Z",
21
				"content": {
22
				  "component": "child-content",
23
				  "title": "Child Content Title"
24
				},
25
				"position": -20,
26
				"tag_list": [ ],
27
				"is_startpage": false,
28
				"parent_id": 107348,
29
				"group_id": "d5ea8520-1296-40b7-8360-894461fdc5b6",
30
				"alternates": [ ],
31
				"release_id": null,
32
				"lang": "default"
33
			  }
34
			}';
35
36
		$this->storyblokResponse = json_decode($json, true)['story'];
0 ignored issues
show
Bug Best Practice introduced by
The property storyblokResponse does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
37
38
		return $this;
39
	}
40
}