Prose\FromTestEnvironment::get PHP Method

get() public method

public get ( $name )
    public function get($name)
    {
        // what are we doing?
        $log = usingLog()->startAction("get '{$name}' from the test environment config");
        // what is the full path to this data?
        $fullPath = 'target';
        if (!empty($name)) {
            $fullPath = $fullPath . '.' . $name;
        }
        // get the details
        $config = $this->st->getActiveConfig();
        if (!$config->hasData($fullPath)) {
            $log->endAction("no such setting '{$name}'");
            return null;
        }
        // if we get here, then success \o/
        $value = $config->getData($fullPath);
        // log the settings
        $printer = new DataPrinter();
        $logValue = $printer->convertToString($value);
        $log->endAction("value is: '{$logValue}'");
        // all done
        return $value;
    }