classes/phing/dispatch/DispatchUtils.php
public static function main($task)
    {
        $methodName = "main";
        $dispatchable = null;
        try {
            if ($task instanceof Dispatchable) {
                $dispatchable = $task;
            } elseif ($task instanceof UnknownElement) {
                $ue = $task;
                $realThing = $ue->getRealThing();
                if ($realThing != null && $realThing instanceof Dispatchable && $realThing instanceof Task) {
                    $dispatchable = $realThing;
                }
            }
            if ($dispatchable != null) {
                $mName = null;

                $name = trim($dispatchable->getActionParameterName());
                if (empty($name)) {
                    throw new BuildException(
                        "Action Parameter Name must not be empty for Dispatchable Task."
                    );
                }
                $mName = "get" . ucfirst($name);
                try {
                    $c = new ReflectionClass($dispatchable);
                    $actionM = $c->getMethod($mName);
                    $o = $actionM->invoke($dispatchable);
                    $methodName = trim((string) $o);
                    if (empty($methodName)) {
                        throw new ReflectionException();
                    }
                } catch (ReflectionException $re) {
                    throw new BuildException(
                        "Dispatchable Task attribute '" . $name . "' not set or value is empty."
                    );
                }
                $executeM = $c->getMethod($methodName);
                $executeM->invoke($dispatchable);

                if ($task instanceof UnknownElement) {
                    $task->setRealThing(null);
                }
            } else {
                try {
                    $refl = new ReflectionClass($task);
                    $executeM = $refl->getMethod($methodName);
                } catch (ReflectionException $re) {
                    throw new BuildException("No public " . $methodName . "() in " . get_class($task));
                }
                $executeM->invoke($task);
                if ($task instanceof UnknownElement) {
                    $task->setRealThing(null);
                }
            }
        } catch (ReflectionException $e) {
            throw new BuildException($e);
        }
    }
public static function main($task)
    {
        $methodName = "main";
        $dispatchable = null;
        try {
            if ($task instanceof Dispatchable) {
                $dispatchable = $task;
            } elseif ($task instanceof UnknownElement) {
                $ue = $task;
                $realThing = $ue->getRealThing();
                if ($realThing != null && $realThing instanceof Dispatchable && $realThing instanceof Task) {
                    $dispatchable = $realThing;
                }
            }
            if ($dispatchable != null) {
                $mName = null;

                $name = trim($dispatchable->getActionParameterName());
                if (empty($name)) {
                    throw new BuildException(
                        "Action Parameter Name must not be empty for Dispatchable Task."
                    );
                }
                $mName = "get" . ucfirst($name);
                try {
                    $c = new ReflectionClass($dispatchable);
                    $actionM = $c->getMethod($mName);
                    $o = $actionM->invoke($dispatchable);
                    $methodName = trim((string) $o);
                    if (empty($methodName)) {
                        throw new ReflectionException();
                    }
                } catch (ReflectionException $re) {
                    throw new BuildException(
                        "Dispatchable Task attribute '" . $name . "' not set or value is empty."
                    );
                }
                $executeM = $c->getMethod($methodName);
                $executeM->invoke($dispatchable);

                if ($task instanceof UnknownElement) {
                    $task->setRealThing(null);
                }
            } else {
                try {
                    $refl = new ReflectionClass($task);
                    $executeM = $refl->getMethod($methodName);
                } catch (ReflectionException $re) {
                    throw new BuildException("No public " . $methodName . "() in " . get_class($task));
                }
                $executeM->invoke($task);
                if ($task instanceof UnknownElement) {
                    $task->setRealThing(null);
                }
            }
        } catch (ReflectionException $e) {
            throw new BuildException($e);
        }
    }
public static function main ( $ task ) { $ methodName = "main" ; $ dispatchable = null ; try { if ( $ task instanceof Dispatchable ) { $ dispatchable = $ task ; } elseif ( $ task instanceof UnknownElement ) { $ ue = $ task ; $ realThing = $ ue -> getRealThing ( ) ; if ( $ realThing != null && $ realThing instanceof Dispatchable && $ realThing instanceof Task ) { $ dispatchable = $ realThing ; } } if ( $ dispatchable != null ) { $ mName = null ; $ name = trim ( $ dispatchable -> getActionParameterName ( ) ) ; if ( empty ( $ name ) ) { throw new BuildException ( "Action Parameter Name must not be empty for Dispatchable Task." ) ; } $ mName = "get" . ucfirst ( $ name ) ; try { $ c = new ReflectionClass ( $ dispatchable ) ; $ actionM = $ c -> getMethod ( $ mName ) ; $ o = $ actionM -> invoke ( $ dispatchable ) ; $ methodName = trim ( ( string ) $ o ) ; if ( empty ( $ methodName ) ) { throw new ReflectionException ( ) ; } } catch ( ReflectionException $ re ) { throw new BuildException ( "Dispatchable Task attribute '" . $ name . "' not set or value is empty." ) ; } $ executeM = $ c -> getMethod ( $ methodName ) ; $ executeM -> invoke ( $ dispatchable ) ; if ( $ task instanceof UnknownElement ) { $ task -> setRealThing ( null ) ; } } else { try { $ refl = new ReflectionClass ( $ task ) ; $ executeM = $ refl -> getMethod ( $ methodName ) ; } catch ( ReflectionException $ re ) { throw new BuildException ( "No public " . $ methodName . "() in " . get_class ( $ task ) ) ; } $ executeM -> invoke ( $ task ) ; if ( $ task instanceof UnknownElement ) { $ task -> setRealThing ( null ) ; } } } catch ( ReflectionException $ e ) { throw new BuildException ( $ e ) ; } }
Determines and Executes the action method for the task.

@param  object $task the task to execute.
@throws BuildException on error.
Determines and Executes the action method for the task .