Completed
Push — master ( c497f7...2066be )
by Greg
02:05
created

CommandCreationListener::notifyCommandFileAdded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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