public function connect($signalClassName, $signalName, $slotClassNameOrObject, $slotMethodName = '', $passSignalInformation = true)
    {
        $class = null;
        $object = null;

        if (strpos($signalName, 'emit') === 0) {
            $possibleSignalName = lcfirst(substr($signalName, strlen('emit')));
            throw new \InvalidArgumentException('The signal should not be connected with the method name ("' . $signalName . '"). Try "' . $possibleSignalName . '" for the signal name.', 1314016630);
        }

        if (is_object($slotClassNameOrObject)) {
            $object = $slotClassNameOrObject;
            $method = ($slotClassNameOrObject instanceof \Closure) ? '__invoke' : $slotMethodName;
        } else {
            if ($slotMethodName === '') {
                throw new \InvalidArgumentException('The slot method name must not be empty (except for closures).', 1229531659);
            }
            $class = $slotClassNameOrObject;
            $method = $slotMethodName;
        }

        $this->slots[$signalClassName][$signalName][] = [
            'class' => $class,
            'method' => $method,
            'object' => $object,
            'passSignalInformation' => ($passSignalInformation === true)
        ];
    }
public function connect($signalClassName, $signalName, $slotClassNameOrObject, $slotMethodName = '', $passSignalInformation = true)
    {
        $class = null;
        $object = null;

        if (strpos($signalName, 'emit') === 0) {
            $possibleSignalName = lcfirst(substr($signalName, strlen('emit')));
            throw new \InvalidArgumentException('The signal should not be connected with the method name ("' . $signalName . '"). Try "' . $possibleSignalName . '" for the signal name.', 1314016630);
        }

        if (is_object($slotClassNameOrObject)) {
            $object = $slotClassNameOrObject;
            $method = ($slotClassNameOrObject instanceof \Closure) ? '__invoke' : $slotMethodName;
        } else {
            if ($slotMethodName === '') {
                throw new \InvalidArgumentException('The slot method name must not be empty (except for closures).', 1229531659);
            }
            $class = $slotClassNameOrObject;
            $method = $slotMethodName;
        }

        $this->slots[$signalClassName][$signalName][] = [
            'class' => $class,
            'method' => $method,
            'object' => $object,
            'passSignalInformation' => ($passSignalInformation === true)
        ];
    }
public function connect ( $ signalClassName , $ signalName , $ slotClassNameOrObject , $ slotMethodName = '' , $ passSignalInformation = true ) { $ class = null ; $ object = null ; if ( strpos ( $ signalName , 'emit' ) === 0 ) { $ possibleSignalName = lcfirst ( substr ( $ signalName , strlen ( 'emit' ) ) ) ; throw new \ InvalidArgumentException ( 'The signal should not be connected with the method name ("' . $ signalName . '"). Try "' . $ possibleSignalName . '" for the signal name.' , 1314016630 ) ; } if ( is_object ( $ slotClassNameOrObject ) ) { $ object = $ slotClassNameOrObject ; $ method = ( $ slotClassNameOrObject instanceof \ Closure ) ? '__invoke' : $ slotMethodName ; } else { if ( $ slotMethodName === '' ) { throw new \ InvalidArgumentException ( 'The slot method name must not be empty (except for closures).' , 1229531659 ) ; } $ class = $ slotClassNameOrObject ; $ method = $ slotMethodName ; } $ this -> slots [ $ signalClassName ] [ $ signalName ] [ ] = [ 'class' => $ class , 'method' => $ method , 'object' => $ object , 'passSignalInformation' => ( $ passSignalInformation === true ) ] ; }
Connects a signal with a slot.
One slot can be connected with multiple signals by calling this method multiple times.

@param string $signalClassName Name of the class containing the signal
@param string $signalName Name of the signal
@param mixed $slotClassNameOrObject Name of the class containing the slot or the instantiated class or a Closure object
@param string $slotMethodName Name of the method to be used as a slot. If $slotClassNameOrObject is a Closure object, this parameter is ignored
@param boolean $passSignalInformation If set to true, the last argument passed to the slot will be information about the signal (EmitterClassName::signalName)
@return void
@throws \InvalidArgumentException
@api
Connects a signal with a slot . One slot can be connected with multiple signals by calling this method multiple times .