Fixes the file for initialization

@return array
197587
private function fixOptions()
    {
        $options = (is_array($this->file))
            ? $this->file
            : [[$this->file]];
        return $options;
    }
117552
public static function init()
    {
        $files = File::getFolder(CONF_PATH)['file'];
        foreach ($files as $item => $file) {
            if (is_file(CONF_PATH . $file)) {
                $conf = self::load(CONF_PATH . $file);
                if (0 === $item) {
                    self::$config = $conf;
                } else {
                    self::$config[basename($file, EXT)] = $conf;
                }
            }
        }
        return self::$config;
    }
51138
private function fixSorting(): void
    {
        $fixer = $this->file->getFixer();

        $fixer->beginChangeset();

        $firstTag = $this->removeOldTagLines();

        $fixer->addContent($firstTag['pointer'] - 1, $this->createNewSortedTagsContent());

        $fixer->endChangeset();
    }
1360494
private function loadResourceFiles()
    {
        return $this->replaceExecutableCode(
            $this->loadResourcesFiles()
        )->mapWithKeys(function ($value, $key) {
            return [$this->removeExtension($key) => $value];
        });
    }
884409
protected function initFiles(): array
    {
        $preview = [];
        if (is_array($this->model->{$this->bucket})) {
            foreach ($this->model->{$this->bucket} as $media) {
                $preview[] = $this->prepareFile($media);
            }
        } elseif ($this->model->{$this->bucket}) {
            $preview = $this->prepareFile($this->model->{$this->bucket});
        }
        return $preview;
    }
908547
protected function initDefaultFiles()
    {
        $logDir = $this->getParam(DirectoryKeys::VAR_LOG) . DIRECTORY_SEPARATOR;
        $this->setParam(FileKeys::APPSERVER_ERRORS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-errors.log');
        $this->setParam(FileKeys::APPSERVER_ACCESS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-access.log');
    }
467801
public static function init()
    {
        if (static::$bIsReady) {
            return;
        }

        $aErrorHandlers = Components::drivers('nails/common', 'ErrorHandler');
        $oDefaultDriver = null;
        $aCustomDrivers = [];
        foreach ($aErrorHandlers as $oErrorHandler) {
            if ($oErrorHandler->slug == static::DEFAULT_ERROR_HANDLER) {
                $oDefaultDriver = $oErrorHandler;
            } else {
                $aCustomDrivers[] = $oErrorHandler;
            }
        }

        if (count($aCustomDrivers) > 1) {
            $aNames = [];
            foreach ($aCustomDrivers as $oErrorHandler) {
                $aNames[] = $oErrorHandler->slug;
            }
            static::halt(implode(', ', $aNames), 'More than one error handler installed');
            return;
        } elseif (count($aCustomDrivers) === 1) {
            $oErrorHandler = reset($aCustomDrivers);
        } else {
            $oErrorHandler = $oDefaultDriver;
        }

        $sDriverNamespace = ArrayHelper::getFromArray('namespace', (array) $oErrorHandler->data);
        $sDriverClass     = ArrayHelper::getFromArray('class', (array) $oErrorHandler->data);
        $sClassName       = '\\' . $sDriverNamespace . $sDriverClass;

        if (!class_exists($sClassName)) {
            static::halt('Expected: ' . $sClassName, 'Driver class not available');
        } elseif (!in_array(static::INTERFACE_NAME, class_implements($sClassName))) {
            static::halt('Error Handler "' . $sClassName . '"  must implement "' . static::INTERFACE_NAME . '"');
        }

        $sClassName::init();

        static::$sDriverClass   = $sClassName;
        static::$oDefaultDriver = $oDefaultDriver;

        static::setHandlers();

        static::$bIsReady = true;
    }
39151
protected function initialize()
    {
        $xmlConfig = simplexml_load_file($this->configFilePath);
        $this->wurflFile = $this->wurflFile($xmlConfig->xpath('/wurfl-config/wurfl/main-file'));
        $this->wurflPatches = $this->wurflPatches($xmlConfig->xpath('/wurfl-config/wurfl/patches/patch'));
        $this->allowReload = $this->allowReload($xmlConfig->xpath('/wurfl-config/allow-reload'));
        $this->capabilityFilter = $this->capabilityFilter($xmlConfig->xpath('/wurfl-config/capability-filter/capability'));
        $this->persistence = $this->persistence($xmlConfig->xpath('/wurfl-config/persistence'));
        $this->cache = $this->persistence($xmlConfig->xpath('/wurfl-config/cache'));
        $this->logDir = $this->logDir($xmlConfig->xpath('/wurfl-config/logDir'));
        $this->matchMode = $this->matchMode($xmlConfig->xpath('/wurfl-config/match-mode'));
    }
161784
public function compileFiles()
    {
        foreach ($this->files as $file) {
            $activeConfig = $this->parser->setConfigFile($file)->getActiveConfig();
            $this->add($activeConfig);
        }

        return $this;
    }
728037
public function init()
    {
        $path = Yii::getAlias($this->configFile);
        if (file_exists($path)) {
            $config = (include($path));
            foreach ($config as $name => $closure) {
                if (is_array($closure)) {
                    $this->addElement($name, $closure[0], $closure[1]);
                } else {
                    $this->addElement($name, $closure);
                }
            }
        }
    }
717627
public function loadIgnoreFile()
    {
        $ignores = [];
        $lines = file('.hgignore');
        foreach ($lines as $line) {
            $nline =  trim($line);
            $nline = preg_replace('/\/\*$/', '/', $nline);
            $ignores[] = $nline;
        }
        $this->ignoreFile = $ignores;
    }
718678
private function getInitializers(): array
    {
        if (empty($this->sortedInitializers)) {
            $this->sortedInitializers = $this->sortInitializers();
        }

        return $this->sortedInitializers;
    }
824013
public function modifyFile()
    {
        foreach (['chown', 'chgrp', 'chmod'] as $key) {
            $value = $this->{$key};
            if ($value) {
                $this->file->{$key}($value);
            }
        }
    }
679772
public function defaultFileChanger()
    {
        $files = [
            base_path('config/auth.php'),
            base_path('config/services.php'),
        ];

        foreach ($files as $file) {
            $contents = file_get_contents($file);
            $contents = str_replace('App\User::class', 'App\Models\User::class', $contents);
            file_put_contents($file, $contents);
        }
    }
1220709
protected function ignoredRepos()
    {
        $lines = file($this->ignored_files_path());

        $ignored_files = [];
        foreach ($lines as $line) {
            $file = preg_replace("/\r|\n/", "", $line);
            if (!File::exists(base_path($file)) || ! is_dir(base_path($file))) {
                continue;
            }
            if (! $this->folderContainsValidGithubRepo($file)) {
                continue;
            }
            $ignored_files[] = $file;
        }
        return $ignored_files;
    }
87726
public function init()
    {
        // Check filepath
        if (empty($this->filepath)) {
            return;
        }

        // Get configurations
        $configs = include $this->filepath;

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $props) {
            $props = !is_array($props) && !is_bool($props) ? [$props] : $props;

            if ('post_type' === $key) {
                // Add or Remove post type supports
                $this->addRemovePostTypeSupport($props);
            } else {
                // Add new theme supports
                $this->addRemoveThemeSupport($key, $props);
            }
        }
    }
17759
public static function initSettings()
    {
        Daemon::$version = file_get_contents('VERSION', true);

        Daemon::$config = new Config\_Object;

        if (!defined('SO_REUSEPORT') && mb_orig_strpos(php_uname('s'), 'BSD') !== false) {
            // @TODO: better if-BSD check
            define('SO_REUSEPORT', 0x200);
        }
    }