newInstance

@return mixed
@throws exceptionclass [description]

@access public
972824
public function newInstance()
    {
        $escaper = $this->escaper;
        $aura = $this->aura;

        return new MetaHelper(
            [
                'title' => function () use ($aura, $escaper) {
                    return new Helper\Title(
                        $aura->get('title'),
                        $aura->get('metas'),
                        $escaper
                    );
                },
                'description' => function () use ($aura) {
                    return new Helper\Description(
                        $aura->get('metas')
                    );
                },
                'robots' => function () use ($aura) {
                    return new Helper\Robots(
                        $aura->get('metas')
                    );
                },
                'icons' => function () use ($aura) {
                    return new Helper\Icons(
                        $aura->get('links')
                    );
                },
                'charset' => function () use ($aura) {
                    return new Helper\Charset(
                        $aura->get('metas')
                    );
                },
                'compat' => function () use ($aura) {
                    return new Helper\Compat(
                        $aura->get('metas')
                    );
                },
                'viewport' => function () use ($aura) {
                    return new Helper\Viewport(
                        $aura->get('metas')
                    );
                },
                'url' => function () use ($aura) {
                    return new Helper\Url(
                        $aura->get('metas')
                    );
                },
                'locale' => function () use ($aura) {
                    return new Helper\Loc(
                        $aura->get('metas')
                    );
                },
                'image' => function () use ($aura) {
                    return new Helper\Image(
                        $aura->get('metas'),
                        $aura->get('links')
                    );
                },
                'containerClass' => function () use ($escaper) {
                    return new Helper\ContainerClass($escaper);
                },
                'bodyClass' => function () use ($escaper) {
                    return new Helper\ContainerClass($escaper);
                },
                'metas' => function () use ($aura) {
                    return $aura->get('metas');
                },
                'links' => function () use ($aura) {
                    return $aura->get('links');
                },
                'scripts' => function () use ($aura) {
                    return $aura->get('scripts');
                },
                'scriptsFoot' => function () use ($aura) {
                    return $aura->get('scriptsFoot');
                },
                'styles' => function () use ($aura) {
                    return $aura->get('styles');
                }
            ]
        );

    }
706363
function new_instance()
	{
		$tab = $this->table_name();
		if(!$tab)
			bors_throw("Try to get new db instance with empty table_name()");

		if(!$this->get('create_time'))
			$this->set_create_time(time());

		if(!$this->get('modify_time'))
			$this->set_modify_time(time());

		$this->set('owner_id', bors()->user_id());
		$this->set('owner_ip', bors()->client()->ip());
		$this->set('last_editor_id', bors()->user_id());

		$this->storage()->create($this);
		$this->changed_fields = array();

		return $this;
	}
749265
public function createNew()
    {
        $resource = $this->factory->createNew();

        if (!$resource instanceof TranslatableInterface) {
            throw new UnexpectedTypeException($resource, TranslatableInterface::class);
        }

        $resource->setCurrentLocale($this->localeProvider->getDefaultLocaleCode());
        $resource->setFallbackLocale($this->localeProvider->getDefaultLocaleCode());

        return $resource;
    }
488862
public static function getInstance()
    {
        if (empty(self::$instances[static::class])) {
            $instance = new static();
            self::$instances[static::class] = $instance;
        } else {
            $instance = self::$instances[static::class];
        }
        return ($instance);
    }
165378
public static function createContact()
    {
        $person = self::getPerson();

        // New person check
        if (isset($person->resourceName)) {
            throw new Exception("You should use newPeron() before create", 500);
        }
        
        return self::getService()->people->createContact($person);
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
136407
public static function instance()
    {
        if (self::$_instance === null) {
            $type = ArrayHelper::getValue(Yii::$app->params, 'mdm.admin.configs', []);
            if (is_array($type) && !isset($type['class'])) {
                $type['class'] = static::className();
            }

            return self::$_instance = Yii::createObject($type);
        }

        return self::$_instance;
    }
1240630
final public static function instance() {
        $c = get_called_class();
       
        if( ! isset( self::$instances[$c] ) )
        {
            self::$instances[$c] = new $c;
        }
       
        return self::$instances[$c];
    }
1266340
public static function newInstance($name = null)
    {
        $currentClass = get_called_class();
        $bean         = Bean::config(is_null($name) ? Bean::name($currentClass) : $name);
        $class        = $bean['class'];
        $properties   = $bean['properties'] ?? [];
        if ($class != $currentClass) {
            throw new \Mix\Exception\ConfigException("Bean class is not equal to the current class, Current class: {$currentClass}, Bean class: {$class}");
        }
        return new $class($properties);
    }
384973
private function newExpr() {
    $node = new NewNode();
    $this->mustMatch(T_NEW, $node);
    $node->addChild($this->classNameReference(), 'className');
    if ($this->currentType === '(') {
      $this->functionCallParameterList($node);
    }
    return $node;
  }
819749
public static function instance($newInstance = null)
    {
        static $instance;

        if ($newInstance instanceof self) {
            $instance = $newInstance;
        }

        if (!($instance instanceof self)) {
            $instance = new self();
        }

        return $instance;
    }
55520
private function createInstance()
    {
        if ($this->arguments === null) {
            $this->arguments = [];

            if (null !== ($method = $this->getReflection()->getConstructor())) {
                $this->arguments = $this->getArguments($method);
            }
        }

        return $this->getReflection()->newInstanceArgs($this->arguments);
    }
1334691
private static function initInstance(): Instance
    {
        $instance = new Instance();
        $instance->setOptions(Config::get('translator'));
        $instance->init();
        return $instance;
    }
1296622
public function create() {
        $migration = $this->getMessages();
        if (!$migration) {
            $this->db()->insert($this->table, array('migration' => get_class($this), 'state' => false));
        } else {
            throw new \Exception('Migration ' .  get_class($this) . ' already created');
        }
    }
158493
public function create()
    {
        try {
            $schema = explode(';', str_replace(PHP_EOL, '', $this->getSchema()));
            array_pop($schema);

            # db structure
            $sql = array_shift($schema);
            $this->db->query($sql . ';');

            # indecies
            foreach($schema as $sql) {
                $this->db->query($sql . ';');
            }
        } catch(Exception $e) {
            throw new Exception($e->getMessage(), 1);
        }
    }
599800
public static function getInstance()
	{
		if ( is_null( self::$instance ) )
		{
			self::$instance = new self();
			self::$instance->createLog( 'error_log', PEAR_LOG_TYPE_SYSTEM, 'xpath2_log',
				array(
					'lineFormat' => '[%{priority}] %{message}',
				)
			);

		}

		return self::$instance;
	}
546333
public static function getInstance()
    {
        $self = get_called_class();
        if (!isset(self::$instances[$self])) {
            self::$instances[$self] = new $self;
        }
        return self::$instances[$self];
    }