{@inheritdoc}
@throws \yii\base\InvalidConfigException
172110
public function init() {
		if (!isset($this->options['id'])) {
			$this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
		}
		parent::init();
	}
769072
public function init()
    {
        parent::init();
        if (is_string($this->cassandra)) {
            $this->cassandra = Yii::$app->get($this->cassandra);
        } elseif (is_array($this->cassandra)) {
            if (!isset($this->cassandra['class'])) {
                $this->cassandra['class'] = Connection::className();
            }
            $this->cassandra = Yii::createObject($this->cassandra);
        }
        if (!$this->cassandra instanceof Connection) {
            throw new InvalidConfigException("Cache::cassandra must be either a Cassandra connection instance or the application component ID of a Cassandra connection.");
        }
    }
1355266
public function getIsConsoleRequest()
    {
        if ($this->_isConsoleRequest === null && \Yii::$app !== null) {
            if (\Yii::$app->getRequest() instanceof ConsoleRequest) {
                $this->_isConsoleRequest = true;
            } elseif (\Yii::$app->getRequest() instanceof WebRequest) {
                $this->_isConsoleRequest = false;
            }
        }
        if ($this->_isConsoleRequest === null) {
            throw new InvalidConfigException('Unable to determine if the application is a console or web application.');
        }

        return $this->_isConsoleRequest;
    }
600372
public function init(): void
    {
        parent::init();

        if ($this->name === null || !\is_string($this->name) || $this->name === '') {
            throw new InvalidConfigException('Formatter name must be defined');
        }
        if ($this->path === null) {
            throw new InvalidConfigException('File path property must be defined and be not empty');
        }
        foreach ($this->formatAdapterArray as $i => $formatAdapter) {
            $this->formatAdapterArray[$i] = Container::createObject($formatAdapter);

            if (!($this->formatAdapterArray[$i] instanceof IFormatAdapter)) {
                throw new InvalidConfigException(sprintf('Format adapter must be instance of %s.', IFormatAdapter::class));
            }
        }
    }
70816
public function init()
    {
        if ($this->pagination === null) {
            throw new InvalidConfigException('The "pagination" property must be set.');
        }

        if ($this->widgetId === null) {
            throw new InvalidConfigException('The "widgetId" property must be set.');
        }

        // Publish assets and register main plugin code
        InfiniteScrollAsset::register($this->view);

        // Register configured behavior, if any
        $behavior = ArrayHelper::getValue($this->pluginOptions, 'behavior', null);
        if (!is_null($behavior)) {
            switch ($behavior) {
                case self::BEHAVIOR_TWITTER:
                    $behaviorAsset = 'manual-trigger.js';
                    break;
                case self::BEHAVIOR_LOCAL:
                    $behaviorAsset = 'local.js';
                    break;
                case self::BEHAVIOR_MASONRY:
                    $behaviorAsset = 'masonry-isotope.js';
                    break;
                case self::BEHAVIOR_CUFON:
                    $behaviorAsset = 'cufon.js';
                    break;
                default:
                    $behaviorAsset = false;
            }
            if ($behaviorAsset) {
                $assetManager = $this->view->getAssetManager();
                $assetBundle = $assetManager->getBundle(InfiniteScrollAsset::className());
                $behaviorUrl = $assetManager->getAssetUrl($assetBundle, 'behaviors/' . $behaviorAsset);
                $this->view->registerJsFile($behaviorUrl, [
                    'depends' => [InfiniteScrollAsset::className()]
                ]);
            }
        }

        $widgetSelector = '#' . $this->widgetId;

        // Set default plugin selectors / options if not configured
        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'maxPage', null)))
            $this->pluginOptions['maxPage'] = $this->pagination->getPageCount();

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'contentSelector', null)))
            $this->pluginOptions['contentSelector'] = $widgetSelector . ' .' . $this->itemsCssClass;

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'itemSelector', null)))
            $this->pluginOptions['itemSelector'] = $this->pluginOptions['contentSelector'] . ' >';

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'navSelector', null)))
            $this->pluginOptions['navSelector'] = $widgetSelector . " ul." . $this->options['class'];

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'nextSelector', null)))
            $this->pluginOptions['nextSelector'] = $this->pluginOptions['navSelector'] . ' li.' . $this->nextPageCssClass . " a:first";

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'loading', null)))
            $this->pluginOptions['loading'] = [];
        if (is_null(ArrayHelper::getValue($this->pluginOptions['loading'], 'img', null))) {
            $assetManager = $this->view->getAssetManager();     // Publish loader img
            list ($imgPath, $imgUrl) = $assetManager->publish('@vendor/nirvana-msu/yii2-infinite-scroll/assets/images/ajax-loader.gif');
            $this->pluginOptions['loading']['img'] = $imgUrl;
        }
    }
1111005
public function init () {
        parent::init();
        if ( $this->folder === NULL ) {
            throw new InvalidConfigException( 'FolderDependency::$folder must be set' );
        }
        if ( !is_array( $this->folder ) ) {
            $this->folder = (array) $this->folder;
        }
        if ( !$this->folder ) {
            throw new InvalidConfigException( 'FolderDependency::$folder must be the path to the folder' );
        }
        foreach ( $this->folder as $i => $folder ) {
            $folder = FileHelper::normalizePath( Yii::getAlias( $folder ) );
            if ( !is_dir( $folder ) ) {
                throw new InvalidConfigException( 'FolderDependency::$folder must be the path to the folder' );
            }
            $this->folder[ $i ] = $folder;
        }
    }
356912
public function init()
    {
        if ($this->dataProvider === null) {
            throw new InvalidConfigException('The "dataProvider" property must be set');
        }
        $this->channelAttributes = $this->getAttributes($this->channel);
        foreach ($this->requiredChannelElements as $channelElement) {
            if (!in_array($channelElement, $this->channelAttributes)) {
                throw new InvalidConfigException('Required channel attribute "' . $channelElement . '" must be set');
            }
        }
        $this->itemAttributes = $this->getAttributes($this->items);
        foreach ($this->requiredItemElements as $itemElement) {
            if (!in_array($itemElement, $this->itemAttributes)) {
                throw new InvalidConfigException('Required item attribute "' . $itemElement . '" must be set');
            }
        }
        $this->feed = new Feed;
    }
568520
public function registerAuthorization()
    {
        if ($this->module->rbacComponent !== true && !is_string($this->module->rbacComponent) && !is_array($this->module->rbacComponent)) {
            throw new InvalidConfigException('Invalid value for the rbacComponent parameter.');
        }
        if (is_string($this->module->rbacComponent)) {
            return;
        }
        $this->module->set('podium_rbac', is_array($this->module->rbacComponent)
                ? $this->module->rbacComponent
                : [
                    'class' => 'yii\rbac\DbManager',
                    'db' => $this->module->db,
                    'itemTable' => '{{%podium_auth_item}}',
                    'itemChildTable' => '{{%podium_auth_item_child}}',
                    'assignmentTable' => '{{%podium_auth_assignment}}',
                    'ruleTable' => '{{%podium_auth_rule}}',
                    'cache' => $this->module->cache
                ]);
    }
685225
public function init()
    {
        parent::init();

        if (!isset($this->options['name'])) {
            if($this->hasModel()) {
                $this->options['name'] = Html::getInputName($this->model, $this->attribute);
            } else {
                throw new InvalidConfigException("'Name' property must be specified.");
            }
        }
        if (!isset($this->value) && $this->hasModel()) {
            $this->value = $this->model->{$this->attribute};
        }
    }
82140
public function registerDependencies()
    {
        if(empty($this->languageProvider)) {
            throw new InvalidConfigException("Invalid configuration of '$this->id' module");
        }

        Yii::$container->set('bl\emailTemplates\providers\LanguageProviderInterface', $this->languageProvider);
    }
766716
public function init()
    {
        parent::init();

        if ($this->useSessionFlash) {
            $session = Yii::$app->getSession();
            $flashes = $session->getAllFlashes();

            foreach ($flashes as $type => $data) {
                $data = (array) $data;
                foreach ($data as $message) {
                    $this->options['type'] = $type;
                    $this->options['title'] = $message;
                }
                $session->removeFlash($type);
            }
        } else {
            if (!$this->hasTitle()) {
                throw new InvalidConfigException("The 'title' option is required.");
            }
        }
    }
1026506
public function init() {

		parent::init();

		// Permission
		$this->crudPermission = CoreGlobal::PERM_USER;

		// Config
		$this->baseUrl	= '/user';
		$this->apixBase	= 'core/user';

		// Services
		$this->modelService = Yii::$app->factory->get( 'userService' );

		$this->optionService = Yii::$app->factory->get( 'optionService' );

		$this->countryService		= Yii::$app->factory->get( 'countryService' );
		$this->provinceService		= Yii::$app->factory->get( 'provinceService' );
		$this->regionService		= Yii::$app->factory->get( 'regionService' );
		$this->addressService		= Yii::$app->factory->get( 'addressService' );
		$this->modelAddressService	= Yii::$app->factory->get( 'modelAddressService' );
	}
132703
public function loadConfig()
    {
        $config = \Yii::$app->authManager->config;

        $this->stdout("\tAll config is ready: ", Console::FG_GREEN);
        $this->stdout(" (rules: " . count(ArrayHelper::getValue($config, 'rules', [])) . ';');
        $this->stdout(" roles: " . count(ArrayHelper::getValue($config, 'roles', [])) . ';');
        $this->stdout(" permissions: " . count(ArrayHelper::getValue($config, 'permissions', [])) . ';)');
        $this->stdout("\n");
        return $config;
    }
677913
private function isValidConfigs(array $configs): void
    {
        $allowedConfigKeys = $this->getAllowedConfigKeys();
        if (!empty($configs)) {
            foreach ($configs as $key => $value) {
                if (!\in_array($key, $allowedConfigKeys, true)) {
                    throw new InvalidKeyException(sprintf(
                        '%s is not a valid key. configs must only contain "%s".',
                        $key,
                        implode(', ', $allowedConfigKeys)
                    ));
                }

                $this->isBool($key, $value);
                $this->isString($key, $value);
                $this->isValidNBest($key, $value);
            }
        }
    }
771814
public function init()
    {
        parent::init();
        if (empty ($this->accessId)) {
            throw new InvalidConfigException ('The "accessId" property must be set.');
        }
        if (empty ($this->accessKey)) {
            throw new InvalidConfigException ('The "accessKey" property must be set.');
        }
        if (empty ($this->signName)) {
            throw new InvalidConfigException ('The "signName" property must be set.');
        }
    }
179868
public function config()
    {
        // error
        if (func_num_args() < 1 || func_num_args() > 2) {
            throw new InvalidArgumentException('Invalid Call of method "config"');
        }

        // default main config
        if (func_num_args() == 1) {
            return $this->config('main', func_get_arg(0));
        }

        // return configs
        return $this->configObject(func_get_arg(0))->get(func_get_arg(1));
    }
951356
public function run()
    {
        parent::run();

        if (is_null($this->text)) {
            throw new InvalidConfigException('Text for copy not set');
        }

        if (isset($this->options['id'])) {
            $this->id = $this->options['id'];
        } elseif (is_null($this->id)) {
            $this->id = $this->options['id'] = $this->getId();
        } else {
            $this->options['id'] = $this->id;
        }

        if (!isset($this->options['class'])) {
            $this->options['class'] = 'btn btn-primary';
        }

        $this->registerScript();

        $label = $this->encodeLabel ? Html::encode($this->label) : $this->label;

        return Html::button($label, $this->options);
    }