Completed
Push — master ( 95af13...697c38 )
by Marko
8s
created

MockComponent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
ccs 3
cts 3
cp 1
rs 10
c 1
b 1
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 5 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jul 3, 2016 - 8:36:14 PM
5
 * Contact      [email protected]
6
 * @copyright   2016 Marko Kungla - https://github.com/mkungla
7
 * @license     The MIT License (MIT)
8
 * 
9
 * @category       AframeVR
10
 * @package        aframe-php
11
 * 
12
 * Lang         PHP (php version >= 7)
13
 * Encoding     UTF-8
14
 * File         MockComponent.php
15
 * Code format  PSR-2 and 12
16
 * @link        https://github.com/mkungla/aframe-php
17
 ^ @issues      https://github.com/mkungla/aframe-php/issues
18
 * ********************************************************************
19
 * Contributors:
20
 * @author Marko Kungla <[email protected]>
21
 * ********************************************************************
22
 * Comments:
23
 * @formatter:on */
24
namespace AframeVR\Core\Helpers;
25
26
final class MockComponent
27
{
28
    /**
29
     * Record all menthod / args to be called when mixin is used on some entity
30
     *
31
     * @var array
32
     */
33
    protected $component_methods = array();
34
    
35
    /**
36
     * Call passes all calls to no existing methods to self::methodProvider
37
     *
38
     * @param string $method
39
     * @param array $args
40
     * @throws InvalidComponentMethodException
41
     * @return MockComponent
42
     */
43 3
    public function __call(string $method, $args)
44
    {
45 3
        $this->component_methods[$method] = $args;
46 3
        return $this;
47
    }
48
}
49