Completed
Push — master ( fef923...c0df34 )
by Rafael
03:03
created

CallableParserTest::buildParser()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 1
nop 0
1
<?php
2
3
/**
4
 * LICENSE: This file is subject to the terms and conditions defined in
5
 * file 'LICENSE', which is part of this source code package.
6
 *
7
 * @copyright 2016 Copyright(c) - All rights reserved.
8
 */
9
10
namespace Rafrsr\LibArray2Object\Tests\Parser;
11
12
use Rafrsr\LibArray2Object\Parser\CallableParser;
13
14
class CallableParserTest extends ParserTester
15
{
16
    public function buildParser()
17
    {
18
        return new CallableParser(
19
            function ($value, $type, \ReflectionProperty $property, $object) {
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $property is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $object is not used and could be removed.

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

Loading history...
20
                return ($value === 'success') ? true : false;
21
            }
22
        );
23
    }
24
25
    public function getTypes()
26
    {
27
        return ['\DateTime', 'DateTime'];
28
    }
29
30
    public function getParseValueMap()
31
    {
32
        return [
33
            'success' => true,
34
            'fail' => false,
35
        ];
36
    }
37
}
38