src/Container/Model/Service.php
public function addService($serviceName, $methodName, $methodParameter, $methodReturn)
    {
        if (!$this->get($serviceName) instanceof Model) {
            $this->add(new Model($this->generator, $serviceName));
        }
        $serviceMethod = $this->get($serviceName)->getMethod($methodName);
        /**
         * Service method does not already exist, register it
         */
        if (!$serviceMethod instanceof MethodModel) {
            $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn);
        } elseif ($serviceMethod->getParameterType() != $methodParameter) {
            /**
             * Service method exists with a different signature, register it too by identifying the service functions as non unique functions
             */
            $serviceMethod->setUnique(false);
            $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn, false);
        }
        return $this;
    }
public function addService($serviceName, $methodName, $methodParameter, $methodReturn)
    {
        if (!$this->get($serviceName) instanceof Model) {
            $this->add(new Model($this->generator, $serviceName));
        }
        $serviceMethod = $this->get($serviceName)->getMethod($methodName);
        /**
         * Service method does not already exist, register it
         */
        if (!$serviceMethod instanceof MethodModel) {
            $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn);
        } elseif ($serviceMethod->getParameterType() != $methodParameter) {
            /**
             * Service method exists with a different signature, register it too by identifying the service functions as non unique functions
             */
            $serviceMethod->setUnique(false);
            $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn, false);
        }
        return $this;
    }
public function addService ( $ serviceName , $ methodName , $ methodParameter , $ methodReturn ) { if ( ! $ this -> get ( $ serviceName ) instanceof Model ) { $ this -> add ( new Model ( $ this -> generator , $ serviceName ) ) ; } $ serviceMethod = $ this -> get ( $ serviceName ) -> getMethod ( $ methodName ) ; /**
         * Service method does not already exist, register it
         */ if ( ! $ serviceMethod instanceof MethodModel ) { $ this -> get ( $ serviceName ) -> addMethod ( $ methodName , $ methodParameter , $ methodReturn ) ; } elseif ( $ serviceMethod -> getParameterType ( ) != $ methodParameter ) { /**
             * Service method exists with a different signature, register it too by identifying the service functions as non unique functions
             */ $ serviceMethod -> setUnique ( false ) ; $ this -> get ( $ serviceName ) -> addMethod ( $ methodName , $ methodParameter , $ methodReturn , false ) ; } return $ this ; }
Adds a service
@param string $serviceName the service name to which add the method
@param string $methodName the original function name
@param string|array $methodParameter the original parameter name
@param string|array $methodReturn the original return name
@return Service
Adds a service