设置文件头部
@param $str
@param $name
@param $namespace
322146
public function set_head(&$str,$name,$namespace)
    {
        $str = '<?php'.PHP_EOL;
        $str .= '/**'.PHP_EOL;
        $str .= ' * creationTime: '.date('Y-m-d H:i:s').PHP_EOL;
        $str .= ' * @title: 基础配置文件'.PHP_EOL;
        $str .= ' */'.PHP_EOL.PHP_EOL.PHP_EOL;
        if(!empty($namespace)){
            $str .= ' namespace '.$namespace.';'.PHP_EOL.PHP_EOL.PHP_EOL;
        }

        $str .= 'class '.$name.PHP_EOL;
        $str .= '{ '.PHP_EOL;
    }
467517
private function loadModuleAnnotations($namespace)
    {
        $this->loader->loadModuleAnnotations($namespace, function($fileNamespace){
            $this->parser->parse($fileNamespace);
            $this->parser->execParse($fileNamespace);
        });
    }
305640
public static function v3(string $namespace, string $name): string
	{
		$hash = md5(self::toBinary($namespace) . $name);

		return sprintf
		(
			'%s-%s-%x-%x-%s',
			substr($hash, 0, 8),
			substr($hash, 8, 4),
			(hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000,
			(hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
			substr($hash, 20, 12)
		);
	}
525134
public static function has(string $name, string $namespace = '*'): bool
    {
        self::initialize();
        return isset($_SESSION[$namespace]) && array_key_exists($name, $_SESSION[$namespace]);
    }
270572
public function clear($name, $namespace = 'default')
	{
		// Add prefix to namespace to avoid collisions
		$namespace = '__' . $namespace;

		if ($this->state !== 'active')
		{
			// @TODO :: generated error here
			return null;
		}

		$value = null;
		if (isset($_SESSION[$namespace][$name]))
		{
			$value = $_SESSION[$namespace][$name];
			unset($_SESSION[$namespace][$name]);
		}

		return $value;
	}
454116
public function valueAlignmentForNamespace( $namespace, $name )
	{
		$prefix = "";

		// Normalize the prefix
		switch ( $namespace )
		{
			// case "http://www.xbrl.org/dtr/type/numeric":
			case XBRL_Constants::$dtrNumeric:
				$prefix = "num";
				break;

			// case "http://www.xbrl.org/dtr/type/non-numeric":
			case XBRL_Constants::$dtrNonnum:
				$prefix = "nonnum";
				break;

			case XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ]:
				$prefix = STANDARD_PREFIX_XBRLI;
				break;

			default:
				$tax = $this->getTaxonomyForNamespace( $namespace );
				if ( $tax )
				{
					$prefix = $tax->getPrefix();
				}
				else
				{
					$this->log()->warning( "valueAlignmentForNamespace: Need to handle '$namespace'" );
				}
				break;
		}

		/*
valueAlignmentForNamespace: Need to handle ''
valueAlignmentForNamespace: Need to handle 'http://xbrl.sec.gov/dei/2014-01-31'
valueAlignmentForNamespace: Need to handle type ':centralIndexKeyItemType'
valueAlignmentForNamespace: Need to handle type ':filerCategoryItemType'
valueAlignmentForNamespace: Need to handle type ':fiscalPeriodItemType'
valueAlignmentForNamespace: Need to handle type ':perShareItemType'
valueAlignmentForNamespace: Need to handle type ':submissionTypeItemType'
valueAlignmentForNamespace: Need to handle type ':yesNoItemType'
valueAlignmentForNamespace: Need to handle type 'xbrli:tokenItemType'		 * */
		$type = "$prefix:$name";

		switch ( $type )
		{
			case 'num:perShareItemType':
			case 'num:percentItemType':
			case 'xbrli:decimalItemType':
			case 'xbrli:monetaryItemType':
			case 'xbrli:sharesItemType':
			case 'xbrli:integerItemType':
			case 'xbrli:pureItemType':
			case 'types:EPSItemType';
				return "right";

			case 'nonnum:textBlockItemType':
			case 'xbrli:dateItemType':
			case 'xbrli:stringItemType':
			case 'xbrli:booleanItemType':
			case 'xbrli:normalizedStringItemType':
			case 'xbrli:gMonthDayItemType':
			case 'xbrli:gYearItemType':
			case 'xbrli:durationItemType':
			case 'xbrli:tokenItemType':
			case 'types:RelatedPartyItemType':
			case 'types:TextBlockNoteItemType':
			case 'types:TextBlockScheduleItemType':
			case 'types:TextBlockPolicyItemType':
				return "left";

			default:
				$this->log()->warning( "valueAlignmentForNamespace: Need to handle type '$type'" );
				return "left";
		}
	}
78819
@Override
    public void writeNamespace(String prefix, String nsURI) throws XMLStreamException
    {
        if (prefix == null || prefix.length() == 0) {
            writeDefaultNamespace(nsURI);
            return;
        }
        if (!mNsAware) {
            throwOutputError("Can not write namespaces with non-namespace writer.");
        }
        outputAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns", prefix, nsURI);
        mCurrElem.addPrefix(prefix, nsURI);
    }
231730
public function addChild($name, $value = NULL, $namespace = NULL) {
		return parent::addChild($name, ($value !== NULL ? str_replace('&', '&amp;', $value) : NULL), $namespace);
	}
1097541
public function phpSourceFile($path, $source, $namespace = '')
    {
        if ($namespace) {
            $namespace = "namespace {$namespace};".PHP_EOL.PHP_EOL;
        }

        $this->file($path)->text('<?php'.PHP_EOL.PHP_EOL.$namespace.$source.PHP_EOL);
    }
112928
function add(string $name, string $namespace = '\\CismonX\\CaptchaQueue\\Rules') {
        if (isset($this->_formulaList[$name]))
            Console::warning("Overwriting formula \"$name\".");
        $class_name = $namespace . '\\' . $name;
        if (!class_exists($class_name)) {
            Console::warning("Invalid formula \"$name\".");
            return;
        }
        $this->_formulaList[$name] = new $class_name;
        self::enable($name);
    }
1365714
public function addPath(string $path, string $namespace = self::DEFAULT_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = [];

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
746974
public function unserialize($str, $entity, $name) {
		if($this->get('many')) {
			$r = new ManyCollection($entity, $name);
			$arr = unserialize($str);
			if(!is_array($arr))
				return $r;
			foreach($arr as $v)
				$r[] = $this->doUnserialize($v, $entity);
			return $r;
		}
		else
			return $this->doUnserialize($str, $entity);
	}
1135775
public static function WriteLog ($name, $strings) {
		$log_file_path = static::GetClassVar($name .'_log_file_path');
		if ($log_file_path === null || $log_file_path === '') {
			trigger_error(
				sprintf('有効なログファイルパスが設定されていません。\%s::SetLogFilePath(\'%s\', $file_path)として設定を行ってください。仮としてPHPデフォルトのエラーログを使用します。', static::class, $name),
				\E_USER_NOTICE
			);
			$log_file_path = false;

			static::SetLogFilePath($name, $log_file_path);
		}

		if ($log_file_path === false) {
			error_log($strings . static::GetClassVar($name .'_log_file_lf_code'));
		} else {
			error_log($strings . static::GetClassVar($name .'_log_file_lf_code'), 3, $log_file_path);
		}
	}
976362
public function addNamespace($name)
    {
        if (!Arr::in($name, self::$_namespace)) {
            self::$_namespace[] = $name;
            return true;
        }

        return false;
    }
1330929
public function set(string $name, string $value): void
    {
        $key = strtolower($name);
        $this->headers[$key] = [$name, $value];
    }
827188
public function remove($name, $namespace = null)
    {
        // Get previous value
        $value = $this->get($name, null, $namespace);

        // Set value
        $this->set($name, null, $namespace);

        // Return old value
        return $value;
    }
570363
public function addAttribute($name, $value = NULL, $namespace = NULL) {
		parent::addAttribute($name, ($value !== NULL ? str_replace('&', '&amp;', $value) : NULL), $namespace);
	}