public function getTarget($classname = null)
    {
        if (null === $classname || true === $this->isTargetInstanceOf($classname)) {
            return $this->target;
        }

        throw new \InvalidArgumentException(sprintf(
            'Invalid target: expected `%s`, `%s` provided.',
            $classname,
            'object' === gettype($this->target) ? get_class($this->target) : $this->target
        ));
    }
public function getTarget($classname = null)
    {
        if (null === $classname || true === $this->isTargetInstanceOf($classname)) {
            return $this->target;
        }

        throw new \InvalidArgumentException(sprintf(
            'Invalid target: expected `%s`, `%s` provided.',
            $classname,
            'object' === gettype($this->target) ? get_class($this->target) : $this->target
        ));
    }
public function getTarget ( $ classname = null ) { if ( null === $ classname || true === $ this -> isTargetInstanceOf ( $ classname ) ) { return $ this -> target ; } throw new \ InvalidArgumentException ( sprintf ( 'Invalid target: expected `%s`, `%s` provided.' , $ classname , 'object' === gettype ( $ this -> target ) ? get_class ( $ this -> target ) : $ this -> target ) ) ; }
Returns the target of the event, optionally checks the class of the target.

@param type $classname The optional class name to checks

@return mixed

@throws \InvalidArgumentException Occures on invalid type of target
according to the waited class name
Returns the target of the event optionally checks the class of the target .