evaluateSuccessDataProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Core\Specification\Tests\Units;
11
12
use Cubiche\Core\Specification\Criteria;
13
14
/**
15
 * Not Specification Tests Class.
16
 *
17
 * @author Ivannis Suárez Jerez <[email protected]>
18
 * @author Karel Osorio Ramírez <[email protected]>
19
 */
20 View Code Duplication
class NotSpecificationTests extends SpecificationTestCase
0 ignored issues
show
Duplication introduced by
This class 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.

Loading history...
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function defaultConstructorArguments()
26
    {
27
        return array(Criteria::lte(25)->or(Criteria::gt(30)));
0 ignored issues
show
Documentation Bug introduced by
The method or does not exist on object<Cubiche\Core\Spec...nstraint\LessThanEqual>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

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 { }
Loading history...
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    protected function evaluateSuccessDataProvider()
34
    {
35
        return array(
36
            array(26),
37
            array(30),
38
        );
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    protected function evaluateFailureDataProvider()
45
    {
46
        return array(
47
            array(20),
48
            array(25),
49
            array(31),
50
        );
51
    }
52
}
53