{@inheritdoc}

@param Config $config The config instance.

@return ResultInterface
425188
public function run(Config $config): ResultInterface
    {
        $url = home_url('/robots.txt');

        $response = wp_remote_get($url);

        if (is_wp_error($response)) {
            return ResultFactory::makeFailure(
                $this,
                array_merge(
                    ['Unable to reach ' . $url],
                    $response->get_error_messages()
                )
            );
        }

        $responseCode = wp_remote_retrieve_response_code($response);

        if (! is_int($responseCode)) {
            return ResultFactory::makeFailure($this, 'Unable to reach ' . $url);
        }

        return (200 === $responseCode)
            ? ResultFactory::makeSuccess($this)
            : ResultFactory::makeFailure($this, $url . ' returns ' . $responseCode);
    }
1172987
public function init($config)
    {
        $this->pdo = null;

        $dns = '';
        if (is_array($config)) {
            $config += array('user' => null, 'password' => null);
            $dns = "{$config['type']}:host={$config['host']};port={$config['port']};dbname={$config['name']}";
        } else if (is_string($config)) {
            $dns = $config;
        } else if ($config instanceof PDO) {
            $this->pdo = $config;
            return $this;
        }

        try {

            // Use pipe for merging fields - sqlite compatibility
            $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET sql_mode='PIPES_AS_CONCAT'");
            $this->pdo = new PDO($dns, $config['user'], $config['password'], $options);
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        } catch (Exception $ex) {
            $this->pdo = null;
            throw new RuntimeException('Cannot connect to database: ' . $ex->getMessage());
        }

        return $this;
    }
993585
public function connect($config)
    {
        $this->connection = Db::connect($config);
        $this->setBuilder();
        $this->prefix = $this->connection->getConfig('prefix');
        return $this;
    }
789659
public static function getInstance(array $config = array(), DriverInterface $driver = null)
    {
        static $instance = null;

        if (null === $instance) {
            $instance = new static();
        }

        if ($config) {
            $instance->config = $config;
        }

        if ($driver) {
            $instance->driver = $driver;
        }

        return $instance;
    }
1105284
protected function loadExtensions(Config $config)
    {
        $uses = $config->get('uses', []);

        foreach ($uses as $use => $useSettings) {
            $this->loadExtension($use, $useSettings, $config);
        }

        return $this;
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
358476
public static function instance($config = [])
    {
        if (null === self::$instance) {
            self::$instance = new static($config);
        }

        return self::$instance;
    }
1013841
public static function get($config = null)
    {
        /** @var Session $session */
        $session = new static();
        if (is_null($config)) {
            $config = Configuration::get('config');
        }
        $class = $config->get('session.type', 'server');
        $options = $config->get('session', array());
        if ($config->get('session.type', false)) {
            unset ($options['type']);
        }

        $session->class = $class;
        $session->options = $options;
        return $session->initialize();

    }
1362781
protected function run(Config $config): ResultInterface
    {
        $includes = $config->compileIncludes();

        $constants = [];
        foreach ($includes as $key) {
            // phpcs:ignore WordPressVIPMinimum.Constants.ConstantString.NotCheckingConstantName
            $constants[$key] = defined($key)
                ? (string) constant($key)
                : '';
        }

        $duplicatedValues = array_values(
            array_diff_assoc(
                $constants,
                array_unique($constants)
            )
        );

        $duplicated = array_keys(
            array_filter($constants, function (string $value) use ($duplicatedValues): bool {
                return in_array($value, $duplicatedValues, true);
            })
        );

        if (! empty($duplicated)) {
            $messages = array_merge(['Salt constants are not unique(or not defined):'], $duplicated);

            return ResultFactory::makeFailure($this, $messages);
        }

        return ResultFactory::makeSuccess($this);
    }
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
1050750
public function merge(Config $config)
    {
        $this->data = array_replace_recursive(
            $this->data,
            $config->toArray()
        );

        return $this;
    }
1234141
private function _createContainer(Config $config = null)
	{
		$container = new Container();

		if ( isset($config) ) {
			$container['config'] = $config;
		}

		return $container;
	}
661400
private function register_constants( Config $config ) {
		$this->share( 'file', function() use ( $config ) {
			return $config->file;
		} );
		$this->share( 'url', function() use ( $config ) {
			return $config->url;
		} );
		$this->share( 'path', function() use ( $config ) {
			return $config->path;
		} );
		$this->share( 'basename', function() use ( $config ) {
			return $config->basename;
		} );
		$this->share( 'slug', function() use ( $config ) {
			return $config->slug;
		} );
		$this->share( 'version', static::VERSION );
	}
917579
protected function run(Config $config): ResultInterface
    {
        $groups = (array) $config->get('groups');

        // TODO: Test me!
        $results = array_map(function (array $group): ResultInterface {
            $code = (int) $group['code'] ?? 200;

            $this->validator->setExpectedStatusCode($code);

            $urls = array_map(function (string $path): string {
                return home_url($path);
            }, $group['paths'] ?? []);

            return $this->validator->validate(...$urls);
        }, $groups);

        // TODO: Method to merge results? Or, allow returning multiple results?
        // Assume successful results don't have messages .
        $messages = array_map(function (ResultInterface $result): array {
            return $result->getMessages();
        }, $results);

        switch (count($messages)) {
            case 0:
                $messages = [];
                break;
            case 1:
                $messages = $messages[0];
                break;
            default:
                $messages = array_merge(...$messages);
        }

        $messages = array_filter($messages);

        if (! empty($messages)) {
            return ResultFactory::makeFailure(
                $this,
                array_merge(['***** Experimental *****', 'Something went wrong:'], $messages)
            );
        }

        return ResultFactory::makeSuccess($this);
    }
1114058
public static function fromConfig(Config $config)
    {
        $message = sprintf(
            'Could not instantiate OptionRepository from Config with starting key "%1$s".',
            empty($config->getKeys())
                ? '<none>'
                : $config->getKeys()[0]
        );

        return new static($message);
    }
345306
public function make(array $config): Client
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
1322547
public function createProfile($config = [])
    {
        $profileClass = $this->profileClass;
        if (empty($profileClass) || !is_string($this->profileClass)) {
            return null;
        }
        $profile = $profileClass::findOne($this->getGUID());
        if (!$profile) {
            $profile = $this->create($profileClass, $config);
            $profile->setGUID($this->getGUID());
        }
        return $profile;
    }