Completed
Pull Request — master (#60)
by Greg
02:06
created

CommandCreationListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A notifyCommandFileAdded() 0 4 1
1
<?php
2
namespace Consolidation\AnnotatedCommand;
3
4
/**
5
 * Command cration listeners can be added to the annotation
6
 * command factory.  These will be notified whenever a new
7
 * commandfile is provided to the factory.  This is useful for
8
 * initializing new commandfile objects.
9
 *
10
 * @see AnnotatedCommandFactory::addListener()
11
 */
12
class CommandCreationListener implements CommandCreationListenerInterface
13
{
14
    protected $listener;
15
16
    public function __construct($listener)
17
    {
18
        $this->listener = $listener;
19
    }
20
21
    public function notifyCommandFileAdded($command)
22
    {
23
        call_user_func($this->listener, $command);
24
    }
25
}
26