@@ -80,7 +80,6 @@ |
||
| 80 | 80 | * |
| 81 | 81 | * @access public |
| 82 | 82 | * @param string $name name of the event |
| 83 | - * @param Callable|PEIP\INF\Handler\Handler $listener listener to connect |
|
| 84 | 83 | * @return |
| 85 | 84 | */ |
| 86 | 85 | public function disconnectAll($name){
|
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * @see PEIP\ABS\Handler\MessageHandler::doSetInputChannel |
| 55 | 55 | * @access public |
| 56 | 56 | * @param \PEIP\INF\Channel\Channel $inputChannel the input-channel |
| 57 | - * @return PEIP\ABS\Handler\MessageHandler $this; |
|
| 57 | + * @return MessageHandler $this; |
|
| 58 | 58 | */ |
| 59 | 59 | public function setInputChannel(\PEIP\INF\Channel\Channel $inputChannel){
|
| 60 | 60 | $this->doSetInputChannel($inputChannel); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | $this->inputChannel = $inputChannel; |
| 78 | 78 | if($this->inputChannel instanceof \PEIP\INF\Channel\SubscribableChannel){
|
| 79 | 79 | $this->inputChannel->subscribe($this); |
| 80 | - }else{
|
|
| 80 | + } else{
|
|
| 81 | 81 | $this->unwrapEvents = true; |
| 82 | 82 | $this->inputChannel->connect('postSend', $this);
|
| 83 | 83 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * Connects the handler to the output-channel. |
| 54 | 54 | * |
| 55 | 55 | * @access protected |
| 56 | - * @param \PEIP\INF\Channel\Channel $inputChannel the output-channel to connect the handler to |
|
| 56 | + * @param \PEIP\INF\Channel\Channel $outputChannel the output-channel to connect the handler to |
|
| 57 | 57 | * @return |
| 58 | 58 | */ |
| 59 | 59 | protected function doSetOutputChannel(\PEIP\INF\Channel\Channel $outputChannel){
|
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * |
| 163 | 163 | * @access public |
| 164 | 164 | * @param string $messageClass name of the message-class to create reply-messages from. |
| 165 | - * @return PEIP\ABS\Handler\ReplyProducingMessageHandler $this |
|
| 165 | + * @return ReplyProducingMessageHandler $this |
|
| 166 | 166 | */ |
| 167 | 167 | public function setMessageClass($messageClass){
|
| 168 | 168 | $this->messageClass = $messageClass; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @access public |
| 197 | 197 | * @param array $headerNames array of message-header names to look for a reply-channel |
| 198 | - * @return PEIP\ABS\Handler\ReplyProducingMessageHandler $this |
|
| 198 | + * @return ReplyProducingMessageHandler $this |
|
| 199 | 199 | */ |
| 200 | 200 | public function setReplyChannelHeaders(array $headerNames){
|
| 201 | 201 | $this->replyChannelHeaders = $headerNames; |
@@ -66,7 +66,8 @@ |
||
| 66 | 66 | * Scans a directory recursively for php-files and adds them to autoload |
| 67 | 67 | * |
| 68 | 68 | * @access public |
| 69 | - * @param string directoy to scan |
|
| 69 | + * @param string directoy to scan |
|
| 70 | + * @param string $dir |
|
| 70 | 71 | * @return void |
| 71 | 72 | */ |
| 72 | 73 | public function scanDirectory($dir){
|
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | while($iterator->valid()){
|
| 108 | 108 | if($iterator->isDir() && !$iterator->isDot()){
|
| 109 | 109 | $paths = self::findPaths($baseDir, $iterator->getChildren(), $paths); |
| 110 | - }elseif($iterator->isFile() && strrchr($iterator->getFilename(), '.') == '.php'){
|
|
| 110 | + } elseif($iterator->isFile() && strrchr($iterator->getFilename(), '.') == '.php'){
|
|
| 111 | 111 | $class = $iterator->getBasename('.php');
|
| 112 | 112 | $paths[$class] = str_replace($baseDir, '', $iterator->getPathName()); |
| 113 | 113 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @access public |
| 41 | 41 | * @param string $className class-name to create objects for |
| 42 | - * @param ReflectionClass $reflectionClass reflection-class for class. default: NULL |
|
| 42 | + * @param \ReflectionClass $reflectionClass reflection-class for class. default: NULL |
|
| 43 | 43 | * @param boolean $storeRef wether to store a reference for new instance. default: true |
| 44 | 44 | * @return |
| 45 | 45 | */ |
@@ -174,7 +174,6 @@ discard block |
||
| 174 | 174 | * </config> |
| 175 | 175 | * |
| 176 | 176 | * @access public |
| 177 | - * @param XMLContext $config the config to include |
|
| 178 | 177 | */ |
| 179 | 178 | public function includeContext(XMLContext $context){
|
| 180 | 179 | $this->services = array_merge($this->services, $context->getServices()); |
@@ -185,7 +184,7 @@ discard block |
||
| 185 | 184 | * |
| 186 | 185 | * @see XMLContext::includeContext |
| 187 | 186 | * @access public |
| 188 | - * @param XMLContext $context the config to include |
|
| 187 | + * @param string $filePath |
|
| 189 | 188 | */ |
| 190 | 189 | public function includeContextFromFile($filePath){
|
| 191 | 190 | if(file_exists($filePath)){
|
@@ -693,7 +692,7 @@ discard block |
||
| 693 | 692 | * |
| 694 | 693 | * @access protected |
| 695 | 694 | * @param object $config configuration object to create arguments from. |
| 696 | - * @return mixed build arguments |
|
| 695 | + * @return \PEIP\INF\Channel\Channel[] build arguments |
|
| 697 | 696 | */ |
| 698 | 697 | protected function getReplyHandlerArguments($config){
|
| 699 | 698 | $args = array( |
@@ -738,7 +737,8 @@ discard block |
||
| 738 | 737 | * |
| 739 | 738 | * @access protected |
| 740 | 739 | * @param string the configuration type ofthe channel (e.g.: 'reply', 'request') |
| 741 | - * @param object $config configuration object to return channel from. |
|
| 740 | + * @param object $config configuration object to return channel from. |
|
| 741 | + * @param string $type |
|
| 742 | 742 | * @return \PEIP\INF\Channel\Channel reply-channel |
| 743 | 743 | */ |
| 744 | 744 | public function doGetChannel($type, $config){
|
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | * @see GenericBuilder |
| 834 | 834 | * @static |
| 835 | 835 | * @access protected |
| 836 | - * @param object $className name of class to build instance for. |
|
| 836 | + * @param string $className name of class to build instance for. |
|
| 837 | 837 | * @param array $arguments arguments for the constructor |
| 838 | 838 | * @return object build and modified srvice instance |
| 839 | 839 | */ |
@@ -841,6 +841,10 @@ discard block |
||
| 841 | 841 | return GenericBuilder::getInstance($className)->build($arguments); |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | + /** |
|
| 845 | + * @param string $type |
|
| 846 | + * @param string $name |
|
| 847 | + */ |
|
| 844 | 848 | protected static function hasPublicProperty($service, $type, $name){
|
| 845 | 849 | $reflection = GenericBuilder::getInstance(get_class($service))->getReflectionClass(); |
| 846 | 850 | if($reflection->{'has'.$type}($name) && $reflection->{'get'.$type}($name)->isPublic()){
|
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public static function createFromFile($file){
|
| 102 | 102 | if(file_exists($file)){
|
| 103 | 103 | return self::createFromString(file_get_contents($file)); |
| 104 | - }else{
|
|
| 104 | + } else{
|
|
| 105 | 105 | throw new \RuntimeException('Cannot open file "'.$file.'".');
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $setter = self::getSetter($property); |
| 394 | 394 | if($setter && self::hasPublicProperty($service, 'Method', $setter)){
|
| 395 | 395 | $service->{$setter}($arg);
|
| 396 | - }elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){
|
|
| 396 | + } elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){
|
|
| 397 | 397 | $service->$setter = $arg; |
| 398 | 398 | } |
| 399 | 399 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | $ref = trim((string)$config['ref']); |
| 627 | 627 | if($ref != ''){
|
| 628 | 628 | $service = $this->getService($ref); |
| 629 | - }else{
|
|
| 629 | + } else{
|
|
| 630 | 630 | $service = $this->createService($config); |
| 631 | 631 | } |
| 632 | 632 | return $service; |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | protected static function getSetter($config){
|
| 647 | 647 | if($config['setter']){
|
| 648 | 648 | $setter = (string)$config['setter']; |
| 649 | - }elseif($config['name']){
|
|
| 649 | + } elseif($config['name']){
|
|
| 650 | 650 | $setter = 'set'.ucfirst((string)$config['name']); |
| 651 | 651 | } |
| 652 | 652 | return $setter; |
@@ -662,26 +662,26 @@ discard block |
||
| 662 | 662 | protected function buildArg($config){
|
| 663 | 663 | if(trim((string)$config['value']) != ''){
|
| 664 | 664 | $arg = (string)$config['value']; |
| 665 | - }elseif($config->getName() == 'value'){
|
|
| 665 | + } elseif($config->getName() == 'value'){
|
|
| 666 | 666 | $arg = (string)$config; |
| 667 | - }elseif($config->getName() == 'list'){
|
|
| 667 | + } elseif($config->getName() == 'list'){
|
|
| 668 | 668 | $arg = array(); |
| 669 | 669 | foreach($config->children() as $entry){
|
| 670 | 670 | if($entry->getName() == 'value'){
|
| 671 | 671 | if($entry['key']){
|
| 672 | 672 | $arg[(string)$entry['key']] = (string)$entry; |
| 673 | - }else{
|
|
| 673 | + } else{
|
|
| 674 | 674 | $arg[] = (string)$entry; |
| 675 | 675 | } |
| 676 | - }elseif($entry->getName() == 'service'){
|
|
| 676 | + } elseif($entry->getName() == 'service'){
|
|
| 677 | 677 | $arg[] = $this->provideService($entry); |
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | - }elseif($config->getName() == 'service'){
|
|
| 680 | + } elseif($config->getName() == 'service'){
|
|
| 681 | 681 | $arg = $this->provideService($config); |
| 682 | - }elseif($config->list){
|
|
| 682 | + } elseif($config->list){
|
|
| 683 | 683 | $arg = $this->buildArg($config->list); |
| 684 | - }elseif($config->service){
|
|
| 684 | + } elseif($config->service){
|
|
| 685 | 685 | $arg = $this->buildArg($config->service); |
| 686 | 686 | } |
| 687 | 687 | return $arg; |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | $channel = $this->services[trim((string)$channelName)]; |
| 750 | 750 | if($channel instanceof \PEIP\INF\Channel\Channel){
|
| 751 | 751 | return $channel; |
| 752 | - }else{
|
|
| 752 | + } else{
|
|
| 753 | 753 | return NULL; |
| 754 | 754 | } |
| 755 | 755 | } |
@@ -770,14 +770,14 @@ discard block |
||
| 770 | 770 | public function buildAndModify($config, $arguments, $defaultClass = false){
|
| 771 | 771 | if("" != (string)$config["class"] || $defaultClass){
|
| 772 | 772 | $service = ServiceFactory::doBuild($config, $arguments, $defaultClass); |
| 773 | - }elseif($config["ref"]){
|
|
| 773 | + } elseif($config["ref"]){
|
|
| 774 | 774 | $service = $this->getService((string)$config['ref']); |
| 775 | - }else{
|
|
| 775 | + } else{
|
|
| 776 | 776 | throw new \RuntimeException('Could not create Service. no class or reference given.');
|
| 777 | 777 | } |
| 778 | 778 | if($config["ref_property"]){
|
| 779 | 779 | $service = $service->{(string)$config["ref_property"]};
|
| 780 | - }elseif($config["ref_method"]){
|
|
| 780 | + } elseif($config["ref_method"]){
|
|
| 781 | 781 | $args = array(); |
| 782 | 782 | if($config->argument){
|
| 783 | 783 | foreach($config->argument as $arg){
|
@@ -814,10 +814,10 @@ discard block |
||
| 814 | 814 | $constructor = (string)$config["constructor"]; |
| 815 | 815 | if($constructor != ''){
|
| 816 | 816 | $service = call_user_func_array(array($cls, $constructor), $arguments); |
| 817 | - }else{
|
|
| 817 | + } else{
|
|
| 818 | 818 | $service = self::build($cls, $arguments); |
| 819 | 819 | } |
| 820 | - }catch(\Exception $e){
|
|
| 820 | + } catch(\Exception $e){
|
|
| 821 | 821 | throw new \RuntimeException('Could not create Service "'.$cls.'" -> '.$e->getMessage());
|
| 822 | 822 | } |
| 823 | 823 | } |
@@ -71,7 +71,6 @@ |
||
| 71 | 71 | * notifies all listeners on a event on a subject |
| 72 | 72 | * |
| 73 | 73 | * @access public |
| 74 | - * @param string $name name of the event |
|
| 75 | 74 | * @param mixed $subject the subject |
| 76 | 75 | * @return |
| 77 | 76 | */ |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | protected function getMessage($object){
|
| 18 | 18 | if($this->channel instanceof \PEIP\INF\Channel\SubscribableChannel){
|
| 19 | 19 | return $object; |
| 20 | - }else{
|
|
| 20 | + } else{
|
|
| 21 | 21 | return $object->getContent()->receive(); |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -65,7 +65,6 @@ |
||
| 65 | 65 | * Disconnects all listeners. |
| 66 | 66 | * |
| 67 | 67 | * @access public |
| 68 | - * @param Callable|PEIP\INF\Handler\Handler $listener |
|
| 69 | 68 | * @return void |
| 70 | 69 | */ |
| 71 | 70 | public function disconnectAll(){
|
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @access public |
| 24 | 24 | * @param string $name name of the event |
| 25 | 25 | * @param \PEIP\INF\Event\Event $object an event object |
| 26 | - * @return boolean |
|
| 26 | + * @return boolean|null |
|
| 27 | 27 | */ |
| 28 | 28 | public function notify($name, $object){
|
| 29 | 29 | if($object instanceof \PEIP\INF\Event\Event){
|
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param array $headers headers of the event-object as key/value pairs |
| 54 | 54 | * @param string $eventClass event-class to create instances from |
| 55 | 55 | * @return |
| 56 | - * @see EventBuilder |
|
| 56 | + boolean|null @see EventBuilder |
|
| 57 | 57 | */ |
| 58 | 58 | public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){
|
| 59 | 59 | if(!$this->hasListeners($name, ($object))){
|
@@ -70,10 +70,10 @@ |
||
| 70 | 70 | ), |
| 71 | 71 | $object |
| 72 | 72 | ); |
| 73 | - }else{
|
|
| 73 | + } else{
|
|
| 74 | 74 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject');
|
| 75 | 75 | } |
| 76 | - }else{
|
|
| 76 | + } else{
|
|
| 77 | 77 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event');
|
| 78 | 78 | } |
| 79 | 79 | } //put your code here |