Browse files

add some simple event dispatching

  • Loading branch information...
1 parent bcf7514 commit 30eadd65b349cf9c7b8ebc3df6984efd8b4ed646 @iampersistent iampersistent committed Jul 15, 2012
View
16 lib/Vespolina/EventDispatcher/EventDispatcherInterface.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\EventDispatcher;
+
+use Vespolina\EventDispatcher\EventInterface;
+
+interface EventDispatcherInterface
+{
+ function dispatch($eventName, EventInterface $event = null);
+}
View
16 lib/Vespolina/EventDispatcher/EventInterface.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\EventDispatcher;
+
+interface EventInterface
+{
+ function getName();
+
+ function setName();
+}
View
19 lib/Vespolina/EventDispatcher/NullDispatcher.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\EventDispatcher;
+
+use Vespolina\EventDispatcher\EventInterface;
+
+class NullDispatcher implements EventDispatcherInterface
+{
+ public function dispatch($eventName, EventInterface $event = null)
+ {
+ return null;
+ }
+}

0 comments on commit 30eadd6

Please sign in to comment.