KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/irtiweb/CATS/vendor/behat/behat/src/Behat/Testwork/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/irtiweb/CATS/vendor/behat/behat/src/Behat/Testwork/ApplicationFactory.php
<?php

/*
 * This file is part of the Behat Testwork.
 * (c) Konstantin Kudryashov <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Behat\Testwork;

use Behat\Testwork\Cli\Application;
use Behat\Testwork\ServiceContainer\Configuration\ConfigurationLoader;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;

/**
 * Defines the way application is created.
 *
 * Extend and implement this class to create an entry point for your framework.
 *
 * @author Konstantin Kudryashov <[email protected]>
 */
abstract class ApplicationFactory
{
    /**
     * Returns application name.
     *
     * @return string
     */
    abstract protected function getName();

    /**
     * Returns current application version.
     *
     * @return string
     */
    abstract protected function getVersion();

    /**
     * Returns list of extensions enabled by default.
     *
     * @return Extension[]
     */
    abstract protected function getDefaultExtensions();

    /**
     * Returns the name of configuration environment variable.
     *
     * @return string
     */
    abstract protected function getEnvironmentVariableName();

    /**
     * Returns user config path.
     *
     * @return null|string
     */
    abstract protected function getConfigPath();

    /**
     * Creates application instance.
     *
     * @return Application
     */
    public function createApplication()
    {
        $configurationLoader = $this->createConfigurationLoader();
        $extensionManager = $this->createExtensionManager();

        return new Application($this->getName(), $this->getVersion(), $configurationLoader, $extensionManager);
    }

    /**
     * Creates configuration loader.
     *
     * @return ConfigurationLoader
     */
    protected function createConfigurationLoader()
    {
        return new ConfigurationLoader($this->getEnvironmentVariableName(), $this->getConfigPath());
    }

    /**
     * Creates extension manager.
     *
     * @return ExtensionManager
     */
    protected function createExtensionManager()
    {
        return new ExtensionManager($this->getDefaultExtensions());
    }
}

Anon7 - 2021