@param int $numericLevel

@throws NotImplementedException
@throws \InvalidArgumentException
@return string
777628
public static function toString($numericLevel = self::SWAGGER_JSON)
    {
        if (!is_numeric($numericLevel)) {
            throw new \InvalidArgumentException('The format type "' . $numericLevel . '" is not numeric.');
        }

        return static::nameOf($numericLevel);
    }
389468
static function GetColumnLetter($columnNumber)
	{
		// work with 1-based number
		$colNum = $columnNumber + 1;
		$code = "";
		
		if ($colNum > 26)
		{
			// greater than 26 means the column will be AA, AB, AC, etc.
			$left = floor($columnNumber / 26);
			$right = 1 + ($columnNumber % 26);

			if ($left > 26) throw new Exception("Columns exceed supported amount");
			
			$code = chr($left + 64) . chr($right + 64);
		}
		else
		{
			$code = chr($colNum + 64);
		}
		
		return $code;
		
		
	}
1018059
public function setUpgradeLevel($upgradeLevel)
    {

        if (($upgradeLevel > 5)) {
            throw new \InvalidArgumentException('invalid value for $upgradeLevel when calling GetCharactersCharacterIdPlanets200Ok., must be smaller than or equal to 5.');
        }
        if (($upgradeLevel < 0)) {
            throw new \InvalidArgumentException('invalid value for $upgradeLevel when calling GetCharactersCharacterIdPlanets200Ok., must be bigger than or equal to 0.');
        }

        $this->container['upgradeLevel'] = $upgradeLevel;

        return $this;
    }
1255913
public function prettyPrint($indentLevel, $spacesPerIndent = 4)
    {
        $indent = str_repeat(str_repeat(' ', $spacesPerIndent), $indentLevel);

        $resultString = $indent . $this->name;
        if (!is_null($this->value)) {
            $resultString .= " " . $this->value;
        }

        if (is_null($this->getChildScope())) {
            $resultString .= ";";
        } else {
            $resultString .= " {";
        }

        if (false === $this->hasComment()) {
            $resultString .= "\n";
        } else {
            if (false === $this->getComment()->isMultiline()) {
                $resultString .= " " . $this->comment->prettyPrint(0, 0);
            } else {
                $comment = $this->getComment()->prettyPrint($indentLevel, $spacesPerIndent);
                $resultString = $comment . $resultString;
            }
        }

        if (!is_null($this->getChildScope())) {
            $resultString .= "" . $this->childScope->prettyPrint($indentLevel, $spacesPerIndent) . $indent . "}\n";
        }

        return $resultString;
    }
212833
public function prettyPrint($indentLevel, $spacesPerIndent = 4)
    {
        $resultString = "";
        foreach ($this->printables as $printable) {
            $resultString .= $printable->prettyPrint($indentLevel + 1, $spacesPerIndent);
        }

        return $resultString;
    }
1077250
public final function level(int $code): string
    {
        switch ($code) {
            case 0: return self::ALERT;
            case $this->emergency($code): return self::EMERGENCY;
            case $this->critical($code): return self::CRITICAL;
            case $this->error($code): return self::ERROR;
            case $this->warning($code): return self::WARNING;
            case $this->notice($code): return self::NOTICE;
            case $this->info($code): return self::INFO;
            case $this->debug($code): return self::DEBUG;
            default: return self::ALERT;
        }
    }
17477
public function format(string $isbn) : string
    {
        if ($this->cleanupBeforeValidate) {
            if (preg_match(Internal\Regexp::ASCII, $isbn) === 0) {
                throw Exception\InvalidIsbnException::forIsbn($isbn);
            }

            $isbn = preg_replace(Internal\Regexp::NON_ALNUM, '', $isbn);
        }

        if (preg_match(Internal\Regexp::ISBN13, $isbn) === 1) {
            if ($this->validateCheckDigit) {
                if (! Internal\CheckDigit::validateCheckDigit13($isbn)) {
                    throw Exception\InvalidIsbnException::forIsbn($isbn);
                }
            }

            return Internal\RangeService::format($isbn);
        }

        $isbn = strtoupper($isbn);

        if (preg_match(Internal\Regexp::ISBN10, $isbn) === 1) {
            if ($this->validateCheckDigit) {
                if (! Internal\CheckDigit::validateCheckDigit10($isbn)) {
                    throw Exception\InvalidIsbnException::forIsbn($isbn);
                }
            }

            return Internal\RangeService::format($isbn);
        }

        throw Exception\InvalidIsbnException::forIsbn($isbn);
    }
1177485
protected function getLogLevel($logLevel)
    {
        switch ($logLevel) {
            case Logger::DEBUG:
                return Severity::debug();
            case Logger::INFO:
                return Severity::info();
            case Logger::NOTICE:
                return Severity::info();
            case Logger::WARNING:
                return Severity::warning();
            case Logger::ERROR:
                return Severity::error();
            case Logger::CRITICAL:
                return Severity::fatal();
            case Logger::ALERT:
                return Severity::fatal();
            case Logger::EMERGENCY:
                return Severity::fatal();

        }
    }
839498
public static function recursive(array $array, int $level = 1): string
    {
        if ($level === 1) {
            self::$value = '';
        }

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . PHP_EOL;
                self::recursive($value, $level + 1);
            } else {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . $value . PHP_EOL;
            }
        }

        return self::$value;
    }
700318
public function toCustomString( int $subExceptionLevel = 0, string $indentSpaces = '   ' ) : string
   {

      // Concatenate the base error message from usable elements
      $msg = \sprintf(
         '%s%s in %s[%d]. %s',
         \str_repeat( $indentSpaces, $subExceptionLevel ),
         \get_class( $this ),
         $this->file,
         $this->line,
         \str_replace( "\n", "\n" . \str_repeat( $indentSpaces, $subExceptionLevel ), $this->message )
      );

      // getting a may defined previous exception
      $previous = $this->getPrevious();

      // if no previous exception is defined return the current generated message
      if ( null === $previous || ! ( $previous instanceof \Throwable ) )
      {
         return $msg;
      }

      // If previous message is a framework internal exception
      if ( $previous instanceof NiirrtyException )
      {
         // Simple cast the exception to a string and append it with rewrite the indention
         $msg .= "\n" . $previous->toCustomString( $subExceptionLevel + 1, $indentSpaces );
         // And return the message
         return $msg;
      }

      // Else its a normal PHP exception
      // Concatenate the previous error message from usable elements
      $msg .= \sprintf(
         "\n%s%s %s in %s[%d]\n    %s",
         \str_repeat( $indentSpaces, $subExceptionLevel + 1 ),
         \get_class( $previous ),
         static::GetCodeName( $previous->getCode() ),
         $previous->file,
         $previous->line,
         \str_replace( "\n", "\n" . \str_repeat( $indentSpaces, $subExceptionLevel + 1 ), $previous->message )
      );

      // And return the message
      return $msg;

   }
1291291
private function mountIndents(string $serialized, int $indentLevel): string
    {
        $lines = explode("\n", $serialized);
        foreach ($lines as &$line) {
            $line = $this->addIndent($line, $indentLevel);
            unset($line);
        }

        return ltrim(join("\n", $lines));
    }
606310
public function render(int $indentLevel = 0): string
    {
        $result = '';
        if (!$this->docComment->isEmpty()) {
            $result .= $this->docComment->render($indentLevel) . "\n";
        }

        $method = "{$this->getAccess()} function {$this->getName()}";
        if (!$this->parameters->isEmpty()) {
            $method .= "({$this->parameters->render()})";
        } else {
            $method .= "()";
        }

        $result .= $this->addIndent($method, $indentLevel) . "\n";
        $result .= $this->addIndent('{', $indentLevel) . "\n";

        if (!$this->source->isEmpty()) {
            $result .= $this->source->render($indentLevel + 1) . "\n";
        }

        $result .= $this->addIndent("}", $indentLevel);

        return $result;
    }
1160835
public function setLevel($level)
    {
        if (($level < 0) || ($level > 9)) {
            throw new Exception\InvalidArgumentException('Level must be between 0 and 9');
        }

        $this->options['level'] = (int) $level;
        return $this;
    }
556864
protected function getCallerByLevel($level)
    {
        $level+=1;
        $backtrace=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, static::MAX_TRACE_LEVEL);
        $caller_class=$backtrace[$level]['class']??'';
        if ($this->dn_class && (is_subclass_of($this->dn_class, $caller_class) || $this->dn_class===$caller_class)) {
            $caller_class=$backtrace[$level+1]['class']??'';
        }
          

        return $caller_class;
    }
500727
public function getLevelCode(string $level): int
    {
        if ($this->levelIsValid($level) === false) {
            throw new \InvalidArgumentException('Invalid log-level provided.');
        }
        return array_search($level, $this->levels);
    }
338933
private function addIndentation(string $line, int $indentLevel): string
  {
    return ($line==='') ? '' : str_repeat(' ', $this->indentation * $indentLevel).$line;
  }
134067
public static function getSalt($len, $level=111) {
    $chars = "";
    if($level & 100) {
      $chars .= self::ALPHABETS;
    }
    if($level & 010) {
      $chars .= self::DIGITAL;
    }
    if($level & 001) {
      $chars .= self::SPECIALCHARS;
    }

    $charArr = array();
    for($i = 0; $i < strlen($chars); $i++) {
      $charArr[] = $chars[$i];
    }
    $charArr = str_split( $chars );

    shuffle($charArr);

    return implode("", array_slice($charArr, 0, $len));
  }