@@ -41,8 +41,7 @@ |
||
41 | 41 | $a = $b->getName(); |
42 | 42 | if(!$b->children()){ |
43 | 43 | $arr[$a] = trim($b[0]); |
44 | - } |
|
45 | - else{ |
|
44 | + } else{ |
|
46 | 45 | $arr[$a][$iter] = array(); |
47 | 46 | $arr[$a][$iter] = xml2phpArray($b,$arr[$a][$iter]); |
48 | 47 | } |
@@ -19,6 +19,9 @@ |
||
19 | 19 | protected $config; |
20 | 20 | |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $config |
|
24 | + */ |
|
22 | 25 | public function __construct($config){ //print_r((array)simplexml_load_string($config)); |
23 | 26 | $this->config = ($config); |
24 | 27 | } |
@@ -19,40 +19,40 @@ |
||
19 | 19 | protected $config; |
20 | 20 | |
21 | 21 | |
22 | - public function __construct($config){ //print_r((array)simplexml_load_string($config)); |
|
22 | + public function __construct($config) { //print_r((array)simplexml_load_string($config)); |
|
23 | 23 | $this->config = ($config); |
24 | 24 | } |
25 | 25 | |
26 | - public function read(){ |
|
26 | + public function read() { |
|
27 | 27 | $iterator = new \SimpleXMLIterator($this->config); |
28 | 28 | $iterator->rewind(); |
29 | - while($iterator->valid()){ |
|
29 | + while ($iterator->valid()) { |
|
30 | 30 | |
31 | 31 | $arrayNode = XMLArrayTranslator::translate($iterator->current()->asXML()); |
32 | 32 | $this->doFireEvent('read_node', array('NODE'=>$arrayNode)); |
33 | 33 | $iterator->next(); |
34 | 34 | } |
35 | 35 | |
36 | - foreach($iterator as $xmlNode){ |
|
36 | + foreach ($iterator as $xmlNode) { |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | $this->config = array(); |
40 | 40 | } |
41 | 41 | |
42 | - public static function convertXmlToArray(\SimpleXMLElement $node, array $array = array()){ |
|
42 | + public static function convertXmlToArray(\SimpleXMLElement $node, array $array = array()) { |
|
43 | 43 | $node->type = $node->type ? $node->type : $node->getName(); |
44 | 44 | |
45 | - foreach($node->attributes() as $name=>$value){ |
|
45 | + foreach ($node->attributes() as $name=>$value) { |
|
46 | 46 | $array[$name] = (string)$value; |
47 | 47 | } |
48 | - foreach($node->children() as $child){ |
|
48 | + foreach ($node->children() as $child) { |
|
49 | 49 | $a = $b->getName(); |
50 | - if(!$b->children()){ |
|
50 | + if (!$b->children()) { |
|
51 | 51 | $arr[$a] = trim($b[0]); |
52 | 52 | } |
53 | - else{ |
|
53 | + else { |
|
54 | 54 | $arr[$a][$iter] = array(); |
55 | - $arr[$a][$iter] = xml2phpArray($b,$arr[$a][$iter]); |
|
55 | + $arr[$a][$iter] = xml2phpArray($b, $arr[$a][$iter]); |
|
56 | 56 | } |
57 | 57 | $iter++; |
58 | 58 | } |
@@ -25,13 +25,13 @@ |
||
25 | 25 | extends \PEIP\INF\Event\Connectable { |
26 | 26 | |
27 | 27 | |
28 | - /** |
|
29 | - * Notifies all listeners of a given event. |
|
30 | - * |
|
31 | - * @param $event A instance |
|
32 | - * |
|
33 | - * @return The instance |
|
34 | - */ |
|
28 | + /** |
|
29 | + * Notifies all listeners of a given event. |
|
30 | + * |
|
31 | + * @param $event A instance |
|
32 | + * |
|
33 | + * @return The instance |
|
34 | + */ |
|
35 | 35 | public function notify($name, $subject); |
36 | 36 | |
37 | 37 |
@@ -24,12 +24,12 @@ |
||
24 | 24 | |
25 | 25 | interface ListDispatcher extends \PEIP\INF\Dispatcher\Dispatcher { |
26 | 26 | |
27 | - public function connect( $handler); |
|
27 | + public function connect( $handler); |
|
28 | 28 | |
29 | - public function disconnect( $handler); |
|
29 | + public function disconnect( $handler); |
|
30 | 30 | |
31 | - public function hasListeners(); |
|
31 | + public function hasListeners(); |
|
32 | 32 | |
33 | - public function getListeners(); |
|
33 | + public function getListeners(); |
|
34 | 34 | |
35 | 35 | } |
36 | 36 | \ No newline at end of file |
@@ -24,9 +24,9 @@ |
||
24 | 24 | |
25 | 25 | interface ListDispatcher extends \PEIP\INF\Dispatcher\Dispatcher { |
26 | 26 | |
27 | - public function connect( $handler); |
|
27 | + public function connect($handler); |
|
28 | 28 | |
29 | - public function disconnect( $handler); |
|
29 | + public function disconnect($handler); |
|
30 | 30 | |
31 | 31 | public function hasListeners(); |
32 | 32 |
@@ -25,11 +25,11 @@ |
||
25 | 25 | interface EventDispatcher |
26 | 26 | extends \PEIP\INF\Event\Connectable { |
27 | 27 | |
28 | - public function notify($subject); |
|
28 | + public function notify($subject); |
|
29 | 29 | |
30 | - public function notifyUntil($subject); |
|
30 | + public function notifyUntil($subject); |
|
31 | 31 | |
32 | - public function filter($subject); |
|
32 | + public function filter($subject); |
|
33 | 33 | |
34 | 34 | |
35 | 35 | } |
36 | 36 | \ No newline at end of file |
@@ -23,14 +23,14 @@ |
||
23 | 23 | |
24 | 24 | interface Event extends \PEIP\INF\Message\Message { |
25 | 25 | |
26 | - public function getName(); |
|
26 | + public function getName(); |
|
27 | 27 | |
28 | - public function setReturnValue($value); |
|
28 | + public function setReturnValue($value); |
|
29 | 29 | |
30 | - public function getReturnValue(); |
|
30 | + public function getReturnValue(); |
|
31 | 31 | |
32 | - public function setProcessed($processed); |
|
32 | + public function setProcessed($processed); |
|
33 | 33 | |
34 | - public function isProcessed(); |
|
34 | + public function isProcessed(); |
|
35 | 35 | |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -22,19 +22,19 @@ |
||
22 | 22 | |
23 | 23 | interface MessageDispatcher { |
24 | 24 | |
25 | - public function connect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
25 | + public function connect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
26 | 26 | |
27 | - public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
27 | + public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
28 | 28 | |
29 | - public function notify( $event); |
|
29 | + public function notify( $event); |
|
30 | 30 | |
31 | - public function notifyUntil( $event); |
|
31 | + public function notifyUntil( $event); |
|
32 | 32 | |
33 | - public function filter( $event, $value); |
|
33 | + public function filter( $event, $value); |
|
34 | 34 | |
35 | - public function hasListeners($name); |
|
35 | + public function hasListeners($name); |
|
36 | 36 | |
37 | - public function getListeners($name); |
|
37 | + public function getListeners($name); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
28 | 28 | |
29 | - public function notify( $event); |
|
29 | + public function notify($event); |
|
30 | 30 | |
31 | - public function notifyUntil( $event); |
|
31 | + public function notifyUntil($event); |
|
32 | 32 | |
33 | - public function filter( $event, $value); |
|
33 | + public function filter($event, $value); |
|
34 | 34 | |
35 | 35 | public function hasListeners($name); |
36 | 36 |
@@ -23,26 +23,26 @@ |
||
23 | 23 | |
24 | 24 | interface ParameterHolderCollection { |
25 | 25 | |
26 | - public function setParameters($namespace, array $parameters); |
|
26 | + public function setParameters($namespace, array $parameters); |
|
27 | 27 | |
28 | - public function addParameters($namespace, array $parameters); |
|
28 | + public function addParameters($namespace, array $parameters); |
|
29 | 29 | |
30 | - public function getParameters($namespace); |
|
30 | + public function getParameters($namespace); |
|
31 | 31 | |
32 | - public function getParameter($namespace, $name); |
|
32 | + public function getParameter($namespace, $name); |
|
33 | 33 | |
34 | - public function setParameter($namespace, $name, $value); |
|
34 | + public function setParameter($namespace, $name, $value); |
|
35 | 35 | |
36 | - public function hasParameter($namespace, $name); |
|
36 | + public function hasParameter($namespace, $name); |
|
37 | 37 | |
38 | - public function deleteParameter($namespace, $name); |
|
38 | + public function deleteParameter($namespace, $name); |
|
39 | 39 | |
40 | - public function setParameterHolder($namespace, \PEIP\INF\Data\ParameterHolder $holder); |
|
40 | + public function setParameterHolder($namespace, \PEIP\INF\Data\ParameterHolder $holder); |
|
41 | 41 | |
42 | - public function getParameterHolder($namespace); |
|
42 | + public function getParameterHolder($namespace); |
|
43 | 43 | |
44 | - public function hasParameterHolder($namespace); |
|
44 | + public function hasParameterHolder($namespace); |
|
45 | 45 | |
46 | - public function deleteParameterHolder($namespace); |
|
46 | + public function deleteParameterHolder($namespace); |
|
47 | 47 | |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -22,18 +22,18 @@ |
||
22 | 22 | |
23 | 23 | interface ParameterHolder { |
24 | 24 | |
25 | - public function setParameters(array $parameters); |
|
25 | + public function setParameters(array $parameters); |
|
26 | 26 | |
27 | - public function addParameters(array $parameters); |
|
27 | + public function addParameters(array $parameters); |
|
28 | 28 | |
29 | - public function getParameters(); |
|
29 | + public function getParameters(); |
|
30 | 30 | |
31 | - public function getParameter($name); |
|
31 | + public function getParameter($name); |
|
32 | 32 | |
33 | - public function setParameter($name, $value); |
|
33 | + public function setParameter($name, $value); |
|
34 | 34 | |
35 | - public function hasParameter($name); |
|
35 | + public function hasParameter($name); |
|
36 | 36 | |
37 | - public function deleteParameter($name); |
|
37 | + public function deleteParameter($name); |
|
38 | 38 | |
39 | 39 | } |
@@ -25,26 +25,26 @@ |
||
25 | 25 | |
26 | 26 | interface StoreCollection { |
27 | 27 | |
28 | - public function setValues($namespace, array $parameters); |
|
28 | + public function setValues($namespace, array $parameters); |
|
29 | 29 | |
30 | - public function addValues($namespace, array $parameters); |
|
30 | + public function addValues($namespace, array $parameters); |
|
31 | 31 | |
32 | - public function getValues($namespace); |
|
32 | + public function getValues($namespace); |
|
33 | 33 | |
34 | - public function getValue($namespace, $name); |
|
34 | + public function getValue($namespace, $name); |
|
35 | 35 | |
36 | - public function setValue($namespace, $name, $value); |
|
36 | + public function setValue($namespace, $name, $value); |
|
37 | 37 | |
38 | - public function hasValue($namespace, $name); |
|
38 | + public function hasValue($namespace, $name); |
|
39 | 39 | |
40 | - public function deleteValue($namespace, $name); |
|
40 | + public function deleteValue($namespace, $name); |
|
41 | 41 | |
42 | - public function setStore($namespace, \PEIP\INF\Data\Store $store); |
|
42 | + public function setStore($namespace, \PEIP\INF\Data\Store $store); |
|
43 | 43 | |
44 | - public function getStore($namespace); |
|
44 | + public function getStore($namespace); |
|
45 | 45 | |
46 | - public function hasStore($namespace); |
|
46 | + public function hasStore($namespace); |
|
47 | 47 | |
48 | - public function deleteStore($namespace); |
|
48 | + public function deleteStore($namespace); |
|
49 | 49 | |
50 | 50 | } |
51 | 51 | \ No newline at end of file |