cf1e7830524276679e3a1cd2345c082e8ea23d15
[yaffs-website] / vendor / consolidation / annotated-command / src / CommandCreationListener.php
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 }