This class is used to manipulate the application
Since: 0.1
Author: Gabriel Couto @gabrielrcouto
Example #1
0
 /**
  * Print debug information
  *
  * @param String $text Text to print
  *
  * @return void
  */
 protected function out($text)
 {
     if ($this->application->getVerboseLevel() == 2) {
         $re = explode('}{', $text);
         foreach ($re as $key => $value) {
             if (count($re) > 1 && $key == 0) {
                 Output::out('=> Sent: ' . $value . '}', 'yellow');
             } elseif (count($re) > 1 && $key == count($re) - 1) {
                 Output::out('=> Sent: {' . $value, 'yellow');
             } elseif (count($re) > 1) {
                 Output::out('=> Sent: {' . $value . '}', 'yellow');
             } else {
                 Output::out('=> Sent: ' . $value, 'yellow');
             }
         }
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function on($eventName, callable $eventHandler)
 {
     $eventName = 'on' . $eventName;
     $this->application->sendCommand('setObjectEventListener', [$this->lazarusObjectId, $eventName], function ($result) {
         // Ok, the event listener created
     });
     if (!array_key_exists($eventName, $this->eventHandlers)) {
         $this->eventHandlers[$eventName] = [];
     }
     $this->eventHandlers[$eventName][] = $eventHandler;
 }
Example #3
0
 /**
  * Parse a debug message
  *
  * @param $message Message
  *
  * @return void
  */
 protected function parseDebug($message)
 {
     if ($this->application->getVerboseLevel() == 2) {
         Output::out('<= Debug: ' . json_encode($message), 'blue');
     }
 }