This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * @link https://github.com/paulzi/yii2-nested-intervals |
||
4 | * @copyright Copyright (c) 2015 PaulZi <[email protected]> |
||
5 | * @license MIT (https://github.com/paulzi/yii2-nested-intervals/blob/master/LICENSE) |
||
6 | */ |
||
7 | |||
8 | namespace paulzi\nestedintervals\tests; |
||
9 | |||
10 | use paulzi\nestedintervals\tests\migrations\TestMigration; |
||
11 | use paulzi\nestedintervals\tests\models\MultipleTreeNode64; |
||
12 | use Yii; |
||
13 | |||
14 | /** |
||
15 | * @author PaulZi <[email protected]> |
||
16 | */ |
||
17 | class NestedIntervalsBehavior64TestCase extends BaseTestCase |
||
18 | { |
||
19 | /** |
||
20 | * @inheritdoc |
||
21 | */ |
||
22 | public function getDataSet() |
||
23 | { |
||
24 | return new \PHPUnit_Extensions_Database_DataSet_ArrayDataSet(require(__DIR__ . '/data/data-64.php')); |
||
25 | } |
||
26 | |||
27 | public function testGetParents() |
||
28 | { |
||
29 | $data = [1, 4, 9]; |
||
30 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(21)->parents)); |
||
0 ignored issues
–
show
|
|||
31 | |||
32 | $data = []; |
||
33 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(1)->parents)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
34 | |||
35 | $data = [2, 7]; |
||
36 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(17)->getParents(2)->all())); |
||
0 ignored issues
–
show
The method
getParents does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 17 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
37 | |||
38 | $data = [26, 30]; |
||
39 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(38)->parents)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 38 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
40 | } |
||
41 | |||
42 | public function testGetParent() |
||
43 | { |
||
44 | $this->assertEquals(5, MultipleTreeNode64::findOne(12)->parent->id); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 12 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
45 | |||
46 | $this->assertEquals(26, MultipleTreeNode64::findOne(29)->getParent()->one()->getAttribute('id')); |
||
0 ignored issues
–
show
The method
getParent does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 29 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
47 | |||
48 | $this->assertEquals(null, MultipleTreeNode64::findOne(1)->parent); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
49 | } |
||
50 | |||
51 | public function testGetRoot() |
||
52 | { |
||
53 | $this->assertEquals(26, MultipleTreeNode64::findOne(28)->root->id); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 28 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
54 | |||
55 | $this->assertEquals(26, MultipleTreeNode64::findOne(26)->getRoot()->one()->getAttribute('id')); |
||
0 ignored issues
–
show
The method
getRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 26 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
56 | } |
||
57 | |||
58 | public function testGetDescendants() |
||
59 | { |
||
60 | $data = [8, 9, 20, 21, 22, 10, 23, 24, 25]; |
||
61 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(4)->descendants)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
62 | |||
63 | $data = [2, 5, 6, 7]; |
||
64 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(2)->getDescendants(1, true)->all())); |
||
0 ignored issues
–
show
The method
getDescendants does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
65 | |||
66 | $data = [10, 25, 24, 23, 9, 22, 21, 20, 8]; |
||
67 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(4)->getDescendants(3, false, true)->all())); |
||
0 ignored issues
–
show
The method
getDescendants does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
68 | |||
69 | $data = []; |
||
70 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(8)->descendants)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 8 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
71 | } |
||
72 | |||
73 | public function testGetChildren() |
||
74 | { |
||
75 | $data = [8, 9, 10]; |
||
76 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(4)->children)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
77 | |||
78 | $data = []; |
||
79 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(28)->getChildren()->all())); |
||
0 ignored issues
–
show
The method
getChildren does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 28 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
80 | } |
||
81 | |||
82 | public function testGetLeaves() |
||
83 | { |
||
84 | $data = [8, 20, 21, 22, 23, 24, 25]; |
||
85 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(4)->leaves)); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
86 | |||
87 | $data = [3, 8]; |
||
88 | $this->assertEquals($data, array_map(function ($value) { return $value->id; }, MultipleTreeNode64::findOne(1)->getLeaves(2)->all())); |
||
0 ignored issues
–
show
The method
getLeaves does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
89 | } |
||
90 | |||
91 | public function testGetPrev() |
||
92 | { |
||
93 | $this->assertEquals(11, MultipleTreeNode64::findOne(12)->prev->id); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 12 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
94 | |||
95 | $this->assertEquals(null, MultipleTreeNode64::findOne(20)->getPrev()->one()); |
||
0 ignored issues
–
show
The method
getPrev does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 20 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
96 | } |
||
97 | |||
98 | public function testGetNext() |
||
99 | { |
||
100 | $this->assertEquals(13, MultipleTreeNode64::findOne(12)->next->id); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 12 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
101 | |||
102 | $this->assertEquals(null, MultipleTreeNode64::findOne(19)->getNext()->one()); |
||
0 ignored issues
–
show
The method
getNext does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() The call to
MultipleTreeNode64::findOne() has too many arguments starting with 19 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
103 | } |
||
104 | |||
105 | View Code Duplication | public function testPopulateTree() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
106 | { |
||
107 | $node = MultipleTreeNode64::findOne(2); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
108 | $node->populateTree(); |
||
0 ignored issues
–
show
The method
populateTree does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
109 | $this->assertEquals(true, $node->isRelationPopulated('children')); |
||
110 | $this->assertEquals(true, $node->children[0]->isRelationPopulated('children')); |
||
111 | $this->assertEquals(11, $node->children[0]->children[0]->id); |
||
112 | |||
113 | $node = MultipleTreeNode64::findOne(2); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
114 | $node->populateTree(1); |
||
0 ignored issues
–
show
The method
populateTree does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
115 | $this->assertEquals(true, $node->isRelationPopulated('children')); |
||
116 | $this->assertEquals(false, $node->children[0]->isRelationPopulated('children')); |
||
117 | $this->assertEquals(5, $node->children[0]->id); |
||
118 | |||
119 | $node = MultipleTreeNode64::findOne(19); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 19 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
120 | $node->populateTree(); |
||
0 ignored issues
–
show
The method
populateTree does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
121 | $this->assertEquals(true, $node->isRelationPopulated('children')); |
||
122 | |||
123 | $node = MultipleTreeNode64::findOne(19); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 19 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
124 | $node->populateTree(1); |
||
0 ignored issues
–
show
The method
populateTree does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
125 | $this->assertEquals(true, $node->isRelationPopulated('children')); |
||
126 | } |
||
127 | |||
128 | public function testIsRoot() |
||
129 | { |
||
130 | $this->assertTrue(MultipleTreeNode64::findOne(1)->isRoot()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
131 | $this->assertTrue(MultipleTreeNode64::findOne(26)->isRoot()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 26 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
132 | |||
133 | $this->assertFalse(MultipleTreeNode64::findOne(3)->isRoot()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 3 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
134 | $this->assertFalse(MultipleTreeNode64::findOne(37)->isRoot()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 37 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
135 | } |
||
136 | |||
137 | public function testIsChildOf() |
||
138 | { |
||
139 | $this->assertTrue(MultipleTreeNode64::findOne(10)->isChildOf(MultipleTreeNode64::findOne(1))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 10 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
140 | |||
141 | $this->assertTrue(MultipleTreeNode64::findOne(9)->isChildOf(MultipleTreeNode64::findOne(4))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 9 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
142 | |||
143 | $this->assertFalse(MultipleTreeNode64::findOne(12)->isChildOf(MultipleTreeNode64::findOne(15))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 12 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
144 | |||
145 | $this->assertFalse(MultipleTreeNode64::findOne(21)->isChildOf(MultipleTreeNode64::findOne(22))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 21 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
146 | |||
147 | $this->assertFalse(MultipleTreeNode64::findOne(8)->isChildOf(MultipleTreeNode64::findOne(8))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 8 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
148 | |||
149 | $this->assertFalse(MultipleTreeNode64::findOne(6)->isChildOf(MultipleTreeNode64::findOne(27))); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isChildOf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
150 | } |
||
151 | |||
152 | public function testIsLeaf() |
||
153 | { |
||
154 | $this->assertTrue(MultipleTreeNode64::findOne(3)->isLeaf()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 3 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isLeaf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
155 | |||
156 | $this->assertFalse(MultipleTreeNode64::findOne(4)->isLeaf()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
isLeaf does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
157 | } |
||
158 | |||
159 | public function testMakeRootInsert() |
||
160 | { |
||
161 | (new TestMigration())->up(); |
||
162 | $dataSet = new ArrayDataSet(require(__DIR__ . '/data/empty.php')); |
||
163 | $this->getDatabaseTester()->setDataSet($dataSet); |
||
164 | $this->getDatabaseTester()->onSetUp(); |
||
165 | |||
166 | $node = new MultipleTreeNode64(['slug' => 'r1']); |
||
167 | $this->assertTrue($node->makeRoot()->save()); |
||
0 ignored issues
–
show
The method
makeRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
168 | |||
169 | $node = new MultipleTreeNode64([ |
||
170 | 'slug' => 'r2', |
||
171 | 'tree' => 223372036854775807, |
||
172 | ]); |
||
173 | $this->assertTrue($node->makeRoot()->save()); |
||
0 ignored issues
–
show
The method
makeRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
174 | |||
175 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
176 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-make-root-insert-64.php')); |
||
177 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
178 | } |
||
179 | |||
180 | View Code Duplication | public function testMakeRootUpdate() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
181 | { |
||
182 | $node = MultipleTreeNode64::findOne(9); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 9 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
183 | $this->assertTrue($node->makeRoot()->save()); |
||
0 ignored issues
–
show
The method
makeRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
184 | |||
185 | $node = MultipleTreeNode64::findOne(27); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 27 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
186 | $node->setAttribute('tree', 223372036854775807); |
||
187 | $this->assertTrue($node->makeRoot()->save()); |
||
0 ignored issues
–
show
The method
makeRoot does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
188 | |||
189 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
190 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-make-root-update-64.php')); |
||
191 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
192 | } |
||
193 | |||
194 | View Code Duplication | public function testPrependToInsertInNoEmpty() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
195 | { |
||
196 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
197 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(1))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
198 | |||
199 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
200 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(6))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
201 | |||
202 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
203 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-no-empty-64.php')); |
||
204 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
205 | } |
||
206 | |||
207 | View Code Duplication | public function testPrependToInsertInEmpty() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
208 | { |
||
209 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
210 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
211 | |||
212 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
213 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
214 | |||
215 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
216 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-empty-64.php')); |
||
217 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
218 | } |
||
219 | |||
220 | View Code Duplication | public function testPrependToInsertInEmptyAmount77NoPrepend() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
221 | { |
||
222 | $config = [ |
||
223 | 'amountOptimize' => 77, |
||
224 | 'noPrepend' => true, |
||
225 | ]; |
||
226 | |||
227 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
228 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
229 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
230 | |||
231 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
232 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
233 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
234 | |||
235 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
236 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-empty-amount-77-no-prepend-64.php')); |
||
237 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
238 | } |
||
239 | |||
240 | View Code Duplication | public function testPrependToInsertInEmptyAmount4NoAppend() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
241 | { |
||
242 | $config = [ |
||
243 | 'amountOptimize' => 4, |
||
244 | 'noAppend' => true, |
||
245 | ]; |
||
246 | |||
247 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
248 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
249 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
250 | |||
251 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
252 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
253 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
254 | |||
255 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
256 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-empty-amount-4-no-append-64.php')); |
||
257 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
258 | } |
||
259 | |||
260 | View Code Duplication | public function testPrependToInsertInEmptyAmount7NoInsert() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
261 | { |
||
262 | $config = [ |
||
263 | 'amountOptimize' => 7, |
||
264 | 'noInsert' => true, |
||
265 | ]; |
||
266 | |||
267 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
268 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
269 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
270 | |||
271 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
272 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
273 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
274 | |||
275 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
276 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-empty-amount-7-no-insert-64.php')); |
||
277 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
278 | } |
||
279 | |||
280 | View Code Duplication | public function testPrependToInsertInEmptyAmount13Reserve3() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
281 | { |
||
282 | $config = [ |
||
283 | 'amountOptimize' => 13, |
||
284 | 'reserveFactor' => 3, |
||
285 | ]; |
||
286 | |||
287 | $node = new MultipleTreeNode64(['slug' => 'new']); |
||
288 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
289 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(6))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
290 | |||
291 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
292 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-insert-in-empty-amount-13-reserve-3-64.php')); |
||
293 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
294 | } |
||
295 | |||
296 | public function testPrependToUpdate() |
||
297 | { |
||
298 | $node = MultipleTreeNode64::findOne(4); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
299 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(1))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
300 | |||
301 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
302 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-update-64.php')); |
||
303 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
304 | } |
||
305 | |||
306 | public function testPrependToUpdateAnotherTree() |
||
307 | { |
||
308 | $node = MultipleTreeNode64::findOne(30); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 30 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
309 | $this->assertTrue($node->prependTo(MultipleTreeNode64::findOne(4))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
prependTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
310 | |||
311 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
312 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-update-another-tree-64.php')); |
||
313 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
314 | } |
||
315 | |||
316 | View Code Duplication | public function testAppendToInsertInNoEmpty() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
317 | { |
||
318 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
319 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(2))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
320 | |||
321 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
322 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(6))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
323 | |||
324 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
325 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-no-empty-64.php')); |
||
326 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
327 | } |
||
328 | |||
329 | View Code Duplication | public function testAppendToInsertInEmpty() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
330 | { |
||
331 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
332 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
333 | |||
334 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
335 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
336 | |||
337 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
338 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-empty-64.php')); |
||
339 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
340 | } |
||
341 | |||
342 | View Code Duplication | public function testAppendToInsertInEmptyAmount77NoPrepend() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
343 | { |
||
344 | $config = [ |
||
345 | 'amountOptimize' => 77, |
||
346 | 'noPrepend' => true, |
||
347 | ]; |
||
348 | |||
349 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
350 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
351 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
352 | |||
353 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
354 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
355 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
356 | |||
357 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
358 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-empty-amount-77-no-prepend-64.php')); |
||
359 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
360 | } |
||
361 | |||
362 | View Code Duplication | public function testAppendToInsertInEmptyAmount4NoAppend() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
363 | { |
||
364 | $config = [ |
||
365 | 'amountOptimize' => 4, |
||
366 | 'noAppend' => true, |
||
367 | ]; |
||
368 | |||
369 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
370 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
371 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
372 | |||
373 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
374 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
375 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
376 | |||
377 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
378 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-empty-amount-4-no-append-64.php')); |
||
379 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
380 | } |
||
381 | |||
382 | View Code Duplication | public function testAppendToInsertInEmptyAmount7NoInsert() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
383 | { |
||
384 | $config = [ |
||
385 | 'amountOptimize' => 7, |
||
386 | 'noInsert' => true, |
||
387 | ]; |
||
388 | |||
389 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
390 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
391 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
392 | |||
393 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
394 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
395 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(18))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 18 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
396 | |||
397 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
398 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-empty-amount-7-no-insert-64.php')); |
||
399 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
400 | } |
||
401 | |||
402 | View Code Duplication | public function testAppendToInsertInEmptyAmount13Reserve3() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
403 | { |
||
404 | $config = [ |
||
405 | 'amountOptimize' => 13, |
||
406 | 'reserveFactor' => 3, |
||
407 | ]; |
||
408 | |||
409 | $node = new MultipleTreeNode64(['slug' => 'new']); |
||
410 | Yii::configure($node->getBehavior('tree'), $config); |
||
0 ignored issues
–
show
It seems like
$node->getBehavior('tree') can be null ; however, configure() does not accept null , maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: /** @return stdClass|null */
function mayReturnNull() { }
function doesNotAcceptNull(stdClass $x) { }
// With potential error.
function withoutCheck() {
$x = mayReturnNull();
doesNotAcceptNull($x); // Potential error here.
}
// Safe - Alternative 1
function withCheck1() {
$x = mayReturnNull();
if ( ! $x instanceof stdClass) {
throw new \LogicException('$x must be defined.');
}
doesNotAcceptNull($x);
}
// Safe - Alternative 2
function withCheck2() {
$x = mayReturnNull();
if ($x instanceof stdClass) {
doesNotAcceptNull($x);
}
}
![]() |
|||
411 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(6))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
412 | |||
413 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
414 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-insert-in-empty-amount-13-reserve-3-64.php')); |
||
415 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
416 | } |
||
417 | |||
418 | public function testAppendToUpdate() |
||
419 | { |
||
420 | $node = MultipleTreeNode64::findOne(2); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
421 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(1))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
422 | |||
423 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
424 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-update-64.php')); |
||
425 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
426 | } |
||
427 | |||
428 | public function testAppendToUpdateAnotherTree() |
||
429 | { |
||
430 | $node = MultipleTreeNode64::findOne(30); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 30 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
431 | $this->assertTrue($node->appendTo(MultipleTreeNode64::findOne(4))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
appendTo does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
432 | |||
433 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
434 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-update-another-tree-64.php')); |
||
435 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
436 | } |
||
437 | |||
438 | View Code Duplication | public function testInsertBefore() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
439 | { |
||
440 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
441 | $this->assertTrue($node->insertBefore(MultipleTreeNode64::findOne(16))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 16 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertBefore does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
442 | |||
443 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
444 | $this->assertTrue($node->insertBefore(MultipleTreeNode64::findOne(33))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 33 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertBefore does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
445 | |||
446 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
447 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-before-insert-64.php')); |
||
448 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
449 | } |
||
450 | |||
451 | public function testInsertBeforeUpdate() |
||
452 | { |
||
453 | $node = MultipleTreeNode64::findOne(38); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 38 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
454 | $this->assertTrue($node->insertBefore(MultipleTreeNode64::findOne(37))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 37 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertBefore does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
455 | |||
456 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
457 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-before-update-64.php')); |
||
458 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
459 | } |
||
460 | |||
461 | View Code Duplication | public function testInsertAfterInsert() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
462 | { |
||
463 | $node = new MultipleTreeNode64(['slug' => 'new1']); |
||
464 | $this->assertTrue($node->insertAfter(MultipleTreeNode64::findOne(14))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 14 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertAfter does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
465 | |||
466 | $node = new MultipleTreeNode64(['slug' => 'new2']); |
||
467 | $this->assertTrue($node->insertAfter(MultipleTreeNode64::findOne(37))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 37 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertAfter does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
468 | |||
469 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
470 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-after-insert-64.php')); |
||
471 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
472 | } |
||
473 | |||
474 | public function testInsertAfterUpdate() |
||
475 | { |
||
476 | $node = MultipleTreeNode64::findOne(36); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 36 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
477 | $this->assertTrue($node->insertAfter(MultipleTreeNode64::findOne(37))->save()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 37 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
insertAfter does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
478 | |||
479 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
480 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-after-update-64.php')); |
||
481 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
482 | } |
||
483 | |||
484 | View Code Duplication | public function testDelete() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
485 | { |
||
486 | $this->assertEquals(1, MultipleTreeNode64::findOne(30)->delete()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 30 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
487 | |||
488 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
489 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-delete-64.php')); |
||
490 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
491 | } |
||
492 | |||
493 | View Code Duplication | public function testDeleteWithChildren() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
494 | { |
||
495 | $this->assertEquals(1, MultipleTreeNode64::findOne(28)->deleteWithChildren()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 28 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
deleteWithChildren does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
496 | $this->assertEquals(25, MultipleTreeNode64::findOne(1)->deleteWithChildren()); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 1 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
deleteWithChildren does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
497 | |||
498 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
499 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-delete-with-children-64.php')); |
||
500 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
501 | } |
||
502 | |||
503 | View Code Duplication | public function testOptimize() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
504 | { |
||
505 | MultipleTreeNode64::findOne(6)->optimize(); |
||
0 ignored issues
–
show
The call to
MultipleTreeNode64::findOne() has too many arguments starting with 6 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The method
optimize does not exist on object<paulzi\nestedinte...els\MultipleTreeNode64> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
![]() |
|||
506 | |||
507 | $dataSet = $this->getConnection()->createDataSet(['multiple_tree_64']); |
||
508 | $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-optimize-64.php')); |
||
509 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
||
510 | } |
||
511 | } |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.