Starts the capture.

@param null|string $type Optional; any of the capture type constants

@throws \RuntimeException If capture is already started

@return self
421150
public function captureStart($type = null)
    {
        if ($this->captureStarted) {
            throw new RuntimeException('Capture is already started.');
        }
        if (null !== $type) {
            $this->setCaptureType($type);
        }
        $this->captureStarted = true;

        ob_start();

        return $this;
    }
43706
public static function isCapture($type)
    {
        $transactionTypesList = [
            self::CAPTURE,
            self::KLARNA_CAPTURE
        ];

        return in_array(strtolower($type), $transactionTypesList);
    }
879091
public static void startTimer(final String type) {
    TransactionLogger instance = getInstance();
    if (instance == null) {
      return;
    }

    instance.components.putIfAbsent(type, new Component(type));
    instance.components.get(type).startTimer();
  }
458051
public function withType(string $type): self
    {
        $this->type = IdentityProviderEnum::ensureValid($type);
        return $this;
    }
50903
public function setRedirectType($type) {
        if (!is_int($type)) throw new IllegalTypeException('Illegal type of parameter $type: '.gettype($type));

        $this->redirectType = $type;
        return $this;
    }
1196509
public function getKeyExchange($type)
    {
        if (!isset($this->keyExchanges[$type])) {
            throw new \RuntimeException('Key exchange not configured: ' . $type);
        }
        return $this->keyExchanges[$type];
    }
77568
public function insertType(Type $type, $typeId = null)
    {
        try {
            return $this->innerGateway->insertType($type, $typeId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
213089
public function addFileType($type): self
    {
        $type = '.' . trim($type, '. ');

        if (!isset($this->watchedTypes[$type])) {
            $this->watchedTypes[$type] = true;
        }

        return $this;
    }
571700
public static function create($type=null) {
	$type = self::check_type($type);
	
	self::destroy($type);
	self::start($type);
}
779471
public function setObjectType($type)
    {
        if (!is_null($type)) {
            $type = (string) $type;
        }

        $this->objectType = $type;
        return $this;
    }
466979
protected function packageBooter(string $type): void
	{
		foreach($this->config->get('application.packages.' . $type) as $package)
		{
			$package = new $package($this->container);

			$package->boot();

			$this->packages[$package->getName()] = $package;
		}
	}
499869
public function skipUntil($type)
    {
        while ( ! $this->isNext($type) && $this->moveNext());

        if ( ! $this->isNext($type)) {
            throw new \RuntimeException(sprintf('Could not find the token %s.', $this->getName($type)));
        }
    }
1073689
public function type($type = null)
    {
        if (is_null($type)) {
            return $this->type;
        }

        $this->type = $type;

        return $this;
    }
224981
public static function start($name, $type = '')
    {
        if (!self::isEnabled()) {
            return;
        }

        $currentPointer = 'timetracker_' . self::$uniqueCounter++;
        array_push(self::$currentPointerStack, $currentPointer);
        array_push(self::$stack, $name);

        self::$stackLevel++;
        self::$stackLevelMax[] = self::$stackLevel;

        self::$stackLog[$currentPointer] = array(
            'level' => self::$stackLevel,
            'stack' => self::$stack,
            'time_start' => microtime(true),
            'realmem_start' => memory_get_usage(true),
            // 'emalloc_start' => memory_get_usage(false),
            'type' => $type,
        );

        if ($name == '__EAV_LOAD_MODEL__' && !empty(self::getConfiguration()->captureModelInfo)) {
            $trace = debug_backtrace();
            $className = get_class($trace[1]['args'][0]);
            $entityId = isset($trace[1]['args'][1]) ? $trace[1]['args'][1] : 'not set';
            $attributes = isset($trace[1]['args'][2]) ? $trace[1]['args'][2] : null;
            self::$stackLog[$currentPointer]['detail'] = "$className, id: $entityId, attributes: " . var_export($attributes, true);
        }

        if (!empty(self::getConfiguration()->captureBacktraces)) {
            $trace = isset($trace) ? $trace : debug_backtrace();
            $fileAndLine = self::getFileAndLine($trace, $type, $name);
            self::$stackLog[$currentPointer]['file'] = $fileAndLine['file'];
            self::$stackLog[$currentPointer]['line'] = $fileAndLine['line'];
        }

    }
1020910
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            $this->type = $type;
        }

        return $this;
    }
1185420
public static function start($alias)
    {
        if (isset(self::$timers[$alias])) {
            throw new \RuntimeException('Timer has already been started.');
        }

        self::$timers[$alias] = microtime();
    }
360447
public static function create(string $type): \Menu\Type\TypeInterface
    {
        if (empty($type)) {
            throw new InvalidArgumentException('Type must be a non-empty string.');
        }

        $className = __NAMESPACE__ . '\\Types\\' . Inflector::camelize($type);
        if (!class_exists($className)) {
            throw new RuntimeException('Class [' . $className . '] does not exist.');
        }

        $interface = __NAMESPACE__ . '\\' . static::INTERFACE_CLASS;
        if (!in_array($interface, class_implements($className))) {
            throw new RuntimeException('Class [' . $className . '] must implement [' . $interface . '] interface.');
        }

        return new $className();
    }