DataSift\Storyplayer\Phases\Phase::getPhaseName PHP Method

getPhaseName() public method

get the name of this phase
public getPhaseName ( ) : string
return string
    public function getPhaseName()
    {
        static $phaseName = null;
        if (!isset($phaseName)) {
            $parts = explode('\\', get_class($this));
            $phaseName = str_replace('Phase', '', end($parts));
        }
        return $phaseName;
    }

Usage Example

Beispiel #1
0
 /**
  *
  * @param  StoryTeller $st
  * @param  Injectables $injectables
  * @param  Phase       $phase
  * @param  boolean     $isActive
  * @return Phase_Result
  */
 public function playPhase(StoryTeller $st, Injectables $injectables, Phase $phase, $isActive, $thingBeingPlayed = null)
 {
     // shorthand
     $output = $st->getOutput();
     $phaseName = $phase->getPhaseName();
     // run the phase if we're allowed to
     if ($isActive) {
         $st->setCurrentPhase($phase);
         $phaseResult = $phase->doPhase($thingBeingPlayed);
     } else {
         $phaseResult = new Phase_Result($phaseName);
         $phaseResult->setContinuePlaying($phaseResult::SKIPPED);
         $output->logPhaseSkipped($phaseName, self::MSG_PHASE_NOT_ACTIVE);
     }
     // close off any open log actions
     $st->closeAllOpenActions();
     // stop any running test devices
     if (!$st->getPersistDevice()) {
         $st->stopDevice();
     }
     // close off any log actions left open by closing down
     // the test device
     $st->closeAllOpenActions();
     // all done
     return $phaseResult;
 }
All Usage Examples Of DataSift\Storyplayer\Phases\Phase::getPhaseName