Creates a Kint instances based on static settings.

Also calls setStatesFromStatics for you

@param array $statics array of statics as returned by getStatics

@return null|\Kint\Kint
11504
public static function createFromStatics(array $statics)
    {
        $mode = false;

        if (isset($statics['enabled_mode'])) {
            $mode = $statics['enabled_mode'];

            if (true === $statics['enabled_mode'] && isset($statics['mode_default'])) {
                $mode = $statics['mode_default'];

                if (PHP_SAPI === 'cli' && !empty($statics['cli_detection']) && isset($statics['mode_default_cli'])) {
                    $mode = $statics['mode_default_cli'];
                }
            }
        }

        if (!$mode) {
            return null;
        }

        if (!isset($statics['renderers'][$mode])) {
            $renderer = new TextRenderer();
        } else {
            /** @var Renderer */
            $renderer = new $statics['renderers'][$mode]();
        }

        return new self(new Parser(), $renderer);
    }
1284924
public static function create(array $data)
    {
        $static = new static();

        if ($static->timestamps) {
            $data = array_merge($data, [
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ]);
        }

        if (!array_key_exists($static->primary_key, $data)) {
            if ($static->autoIncrement) {
                $id_value = [$static->primary_key => null];

                $data = array_merge($id_value, $data);
            } else {
                if ($static->primary_key_type == 'string') {
                    $data = array_merge([
                        $static->primary_key => ''
                    ], $data);
                }
            }
        }

        $static->setAttributes($data);

        $r = $static->save();

        if ($r == 1) {
            $static->fireEvent('oncreated');
        }

        return $static;
    }
1122264
public function setState($state)
		{
		$r = array_pop($this->states);
		array_push($this->states, $state);
		$this->state = $this->states[count($this->states) - 1];
		return $r;
		}
690757
public static function settings($settings = null)
    {
        if ($settings) {
            //set mode
            self::$settings = self::mergeSettings(self::$settings, $settings);
        } else {
            //get mode
        }

        //always return settings
        return self::$settings;
    }
1230190
public static function make(array $components)
    {
        $entity = new static();

        foreach ($components as $k => $v) {
            if ($entity->isPropertyAllowed($k)) {
                $entity->{'set' . NameHelper::snakeToCamel($k)}($v);
            }
        }

        return $entity;
    }
124097
static function __static()
	{
		XmlTypeCode::$typeToCodeMap = array(
			'xs:anyType'				=> XmlTypeCode::AnyType,
			'xs:anySimpleType'			=> XmlTypeCode::AnyAtomicType,
			'xs:untypedAtomic'			=> XmlTypeCode::UntypedAtomic,
			'xs:string'					=> XmlTypeCode::String,
			'xs:boolean'				=> XmlTypeCode::Boolean,
			'xs:decimal'				=> XmlTypeCode::Decimal,
			'xs:double'					=> XmlTypeCode::Double,
			'xs:float'					=> XmlTypeCode::Float,
			'xs:duration'				=> XmlTypeCode::Duration,
			'xs:dateTime'				=> XmlTypeCode::DateTime,
			'xs:time'					=> XmlTypeCode::Time,
			'xs:date'					=> XmlTypeCode::Date,
			'xs:gYearMonth'				=> XmlTypeCode::GYearMonth,
			'xs:gYear'					=> XmlTypeCode::GYear,
			'xs:gMonthDay'				=> XmlTypeCode::GMonthDay,
			'xs:gDay'					=> XmlTypeCode::GDay,
			'xs:gMonth'					=> XmlTypeCode::GMonth,
			'xs:hexBinary'				=> XmlTypeCode::HexBinary,
			'xs:base64Binary'			=> XmlTypeCode::Base64Binary,
			'xs:anyURI'					=> XmlTypeCode::AnyUri,
			'xs:QName'					=> XmlTypeCode::QName,
			'xs:NOTATION'				=> XmlTypeCode::Notation,
			'xs:normalizedString'		=> XmlTypeCode::NormalizedString,
			'xs:token'					=> XmlTypeCode::Token,
			'xs:language'				=> XmlTypeCode::Language,
			'xs:Name'					=> XmlTypeCode::Name,
			'xs:NCName'					=> XmlTypeCode::NCName,
			'xs:NMTOKEN'				=> XmlTypeCode::NmToken,
			'xs:ID'						=> XmlTypeCode::Id,
			'xs:IDREF'					=> XmlTypeCode::Idref,
			'xs:ENTITY'					=> XmlTypeCode::Entity,
			'xs:integer'				=> XmlTypeCode::Integer,
			'xs:nonPositiveInteger'		=> XmlTypeCode::NonPositiveInteger,
			'xs:long'					=> XmlTypeCode::Long,
			'xs:nonNegativeInteger'		=> XmlTypeCode::NonNegativeInteger,
			'xs:negativeInteger' 		=> XmlTypeCode::NegativeInteger,
			'xs:int'					=> XmlTypeCode::Int,
			'xs:short'					=> XmlTypeCode::Short,
			'xs:byte'					=> XmlTypeCode::Byte,
			'xs:positiveInteger' 		=> XmlTypeCode::PositiveInteger,
			'xs:unsignedLong' 			=> XmlTypeCode::UnsignedLong,
			'xs:unsignedInt' 			=> XmlTypeCode::UnsignedInt,
			'xs:unsignedShort'			=> XmlTypeCode::UnsignedShort,
			'xs:unsignedByte'			=> XmlTypeCode::UnsignedByte,
			'xs:IDREFS'					=> XmlTypeCode::IDREFS,
			'xs:ENTITIES'				=> XmlTypeCode::ENTITIES,
			'xs:NMTOKENS'				=> XmlTypeCode::NMTOKENS,
			'xs:yearMonthDuration'		=> XmlTypeCode::YearMonthDuration,
			'xs:dayTimeDuration'		=> XmlTypeCode::DayTimeDuration,
			'xs:UNION'					=> XmlTypeCode::UNION,
		);

		XmlTypeCode::$codeToTypeMap = array_flip( XmlTypeCode::$typeToCodeMap );
	}
861406
public function only($keys)
    {
        if ($keys === null) {
            return new static($this->objects);
        }

        $keys = is_array($keys) ? $keys : func_get_args();

        return new static(array_intersect_key($this->objects, array_flip($keys)));
    }
1264493
public function static_create(array $values=[], $groups=[]) {
		return $this->getDataMapper()->create($this->entityClass, $values, $groups);
	}
453523
protected function setPlatformState($status)
    {
        $state = new MaintenanceState(array(
            MaintenanceState::STATUS => $status
        ));

        $this->getStorage()->setPlatformState($state);
    }
778766
public function setStatic($is_static) {
    if ($is_static) {
      if (!isset($this->static)) {
        $this->static = Token::_static();
        $this->visibility->after([Token::space(), $this->static]);
      }
    }
    else {
      if (isset($this->static)) {
        // Remove whitespace after static keyword.
        $this->static->next()->remove();
        // Remove static keyword.
        $this->static->remove();
      }
    }
    return $this;
  }
1295272
function addStatics(statics, Subclass) {

  // static method inheritance (including `extend`)
  Object.keys(statics).forEach(function(key) {
    var descriptor = Object.getOwnPropertyDescriptor(statics, key);
    if (!descriptor.configurable) return;

    Object.defineProperty(Subclass, key, descriptor);
  });
}
50600
public static function __static()
	{
		ValueProxy::$valueFactory = array();
		ValueProxy::$dynamicValueType = Type::FromNameAndTypeCode( ValueProxy::$CLASSNAME, TypeCode::Object );
	}
302473
static function &getInstance($key=null)
	{
		static $instances;

		if (!isset($instances))
		{
			$instances = array();
		}

		if (!isset($instances[$key]))
		{
			$instances[$key] = new static($key);
		}

		return $instances[$key];
	}
221017
public static function __static()
	{
		SchemaTypes::$nameStartChar = "[:_\.\p{Ll}\p{Lu}\p{Lt}\p{Lo}]";
		SchemaTypes::$nameChar = "[:_\-.\p{L}\p{Ll}\p{M}\p{Nd}\p{Nl}]";
		SchemaTypes::$name = SchemaTypes::$nameStartChar .  SchemaTypes::$nameChar . "*";
		SchemaTypes::$ncName = "(?:(?!:)" . SchemaTypes::$nameStartChar. ")(?:(?!:)" . SchemaTypes::$nameChar . ")*";

		// SchemaTypes are organized hierarchically
		// BMS 2018-04-09 Fixing the kluge
		SchemaTypes::$xsTypes = array(
			'xs:anyType'				=> null,
			'xs:anySimpleType'			=> 'xs:anyType',
			'xs:string'					=> 'xs:anySimpleType',
			'xs:boolean'				=> 'xs:anySimpleType',
			'xs:decimal'				=> 'xs:anySimpleType',
			'xs:double'					=> 'xs:anySimpleType',
			'xs:float'					=> 'xs:anySimpleType',
			'xs:duration'				=> 'xs:anySimpleType',
			'xs:dateTime'				=> 'xs:anySimpleType',
			'xs:time'					=> 'xs:anySimpleType',
			'xs:date'					=> 'xs:anySimpleType',
			'xs:gYearMonth'				=> 'xs:anySimpleType',
			'xs:gYear'					=> 'xs:anySimpleType',
			'xs:gMonthDay'				=> 'xs:anySimpleType',
			'xs:gDay'					=> 'xs:anySimpleType',
			'xs:gMonth'					=> 'xs:anySimpleType',
			'xs:hexBinary'				=> 'xs:anySimpleType',
			'xs:base64Binary'			=> 'xs:anySimpleType',
			'xs:anyURI'					=> 'xs:anySimpleType',
			'xs:QName'					=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:normalizedString'		=> 'xs:string',
			'xs:token'					=> 'xs:normalizedString',
			'xs:Name'					=> 'xs:token',
			'xs:NCName'					=> 'xs:Name',
			'xs:NMTOKEN'				=> 'xs:token',
			'xs:NMTOKENS'				=> 'xs:NMTOKEN',
			'xs:language'				=> 'xs:token',
			'xs:ID'						=> 'xs:NCName',
			'xs:IDREF'					=> 'xs:NCName',
			'xs:ENTITY'					=> 'xs:NCName',
			'xs:IDREFS'					=> 'xs:IDREF',
			'xs:ENTITIES'				=> 'xs:ENTITY',
			'xs:integer'				=> 'xs:decimal',
			'xs:nonPositiveInteger'		=> 'xs:integer',
			'xs:long'					=> 'xs:integer',
			'xs:nonNegativeInteger'		=> 'xs:integer',
			'xs:negativeInteger' 		=> 'xs:nonPositiveInteger',
			'xs:int'					=> 'xs:long',
			'xs:short'					=> 'xs:int',
			'xs:byte'					=> 'xs:short',
			'xs:positiveInteger' 		=> 'xs:nonNegativeInteger',
			'xs:unsignedLong' 			=> 'xs:nonNegativeInteger',
			'xs:unsignedInt' 			=> 'xs:unsignedLong',
			'xs:unsignedShort'			=> 'xs:unsignedInt',
			'xs:unsignedByte'			=> 'xs:unsignedShort',
			'xs:anyComplexType'			=> 'xs:anyType',
			'xs:untypedAtomic'			=> 'xs:anySimpleType',
			// Not really a type but trying to find an easy way to accommodate
			// unions of simple types such as xbrli:dateTimeItemType
			'xs:UNION'					=> 'xs:anySimpleType',
			'xs:yearMonthDuration'		=> 'xs:duration',
			'xs:dayTimeDuration'		=> 'xs:duration',
		);
	}
1312956
public function loadStaticData(Staticdata $staticData)
	{
		$fields    = $this->getStaticFields();
		$optimizer = new StaticOptimizer;
		$optimizer->optimizeFields($fields)
				  ->setStaticInfo($staticData);
		$this->addStaticData($optimizer);

		return $this;
	}
1175752
public function only($keys)
    {
        if (is_null($keys)) {
            return new static($this->items);
        }

        return new static(array_intersect_key($this->items, array_flip((array)$keys)));
    }
696042
public function call_static() {
		$args  = func_get_args();
		$class = array_shift( $args );
		$name  = array_shift( $args );

		return call_user_func_array( [$class, $name], $args );
	}