Returns error if compiled includes is empty.

@param Config $config The config instance.

@return Error|null
557737
protected function errorIfCompiledIncludesIsEmpty(Config $config): ?Error
    {
        $includes = $config->compileIncludes();

        return empty($includes)
            ? ResultFactory::makeError($this, 'Includes is empty.')
            : null;
    }
1041236
protected function checkConfig($config)
    {
        $required_fields = ['namespace', 'table', 'path', 'mapping', 'import_keys'];

        foreach ($required_fields as $key) {
            if (!array_has($config, $key)) {
                $this->error(sprintf('Missing \'%s\' from the dataset configuration file.', $key));
                $this->line('');
                $this->line('');

                exit(1);
            }
        }
    }
812164
protected function getDebugOption(array $config)
    {
        if (isset($config['debug'])) {
            return ($config['debug'] === true) ? fopen('php://stderr', 'ab') : $config['debug'];
        }

        if ($this->debugOverride && $this->debug) {
            return ($this->debug === true) ? fopen('php://stderr', 'ab') : $this->debug;
        } elseif (!$this->debugOverride && static::$staticDebug) {
            return (static::$staticDebug === true) ? fopen('php://stderr', 'ab') : static::$staticDebug;
        }

        return false;
    }
768545
protected function _checkSearchConfig( array $config )
	{
		$required = array( 'id', 'label', 'status', 'level', 'left', 'right' );

		foreach( $required as $key => $entry )
		{
			if( isset( $config[$entry] ) ) {
				unset( $required[$key] );
			}
		}

		if( count( $required ) > 0 )
		{
			$msg = 'Search config in given configuration are missing: "%1$s"';
			throw new MW_Tree_Exception( sprintf( $msg, implode( ', ', $required ) ) );
		}
	}
46610
public function getMessage($config = null)
    {
        if ($config && !$config instanceof ConfigObject) {
            $config = new ConfigObject($config);
        }
        return Loader::getMessage($this->mailerName, $config);
    }
177580
private function getLoaderRecipesByConfig(Config $config)
    {
        $recipes = null;
        $bundleConfig = $config->getBundleConfig();
        if (null !== $bundleConfig && isset($bundleConfig['bundle_loader_recipes'])) {
            $recipes = $bundleConfig['bundle_loader_recipes'];
        }

        return $recipes;
    }
254316
public function check(array $config): bool
    {
        $this->paths = Collection::make(Arr::get($config, 'directories', []));

        $this->paths = $this->paths->reject(function ($path) {
            return $this->filesystem->isWritable($path);
        });

        return $this->paths->isEmpty();
    }
1180699
public function getItem($config)
    {
        //why would you send an empty value?
        if(empty($config) || !is_string($config)) {
            return false;
        }

        $data = $this->loadConfig($config);

        //no config data available
        if(!is_array($data)) {
            return false;
        }

        //return item object
        return new Item($data);
    }
278771
public function execute($config = null)
    {

        if(null == $config){
            $pdo = Config::getDefault()->getPdo();
        }else if($config instanceof \PDO){
            $pdo = $config;
        }else if($config instanceof Config){
            $pdo = $config->getPdo();
        }else{
            throw new BadParameterException('First parameter of FQuery::execute is not correct');
        }

        $stmt = $this->getPdoStatement($pdo);

        if ($stmt->execute()) {
            return $stmt;

        } else {
            // TODO : handle errors ".__FILE__.":".__LINE__;
            throw new QueryFailedException($stmt);
            //return false;
        }

    }
1041946
public function config($config)
    {
        if (is_array($config)) {
            $this->config = array_merge($this->config, $config);
        } elseif (isset($this->config[$config])) {
            return $this->config[$config];
        } else {
            return;
        }
    }
526399
public static function cachePath($config)
    {
        $cachePath = self::getConfigValue('cache.FileName', $config);
        return empty($cachePath) ? __DIR__ . self::$CACHE_PATH : $cachePath;
    }
1327578
public static function start(&$config)
    {
        $config = array_merge(array(
        
            /* @var bool */
            'catch_errors'           => false,
            
            /* @var bool */
            'throw_errors'           => false,
            
            /* Which view to render when an error occurs
             * @var string */
            'error_view'             => 'errors/error',
            
            /* Which view to render when an error occurs
             * @var string */
            '404_view'               => 'errors/404',
            
            /* @var array */
            'error_report_attrs'     => array(
                'atomik-error'               => 'style="padding: 10px"',
                'atomik-error-title'         => 'style="font-size: 1.3em; font-weight: bold; color: #FF0000"',
                'atomik-error-lines'         => 'style="width: 100%; margin-bottom: 20px; background-color: #fff;'
                                              . 'border: 1px solid #000; font-size: 0.8em"',
                'atomik-error-line'          => '',
                'atomik-error-line-error'    => 'style="background-color: #ffe8e7"',
                'atomik-error-line-number'   => 'style="background-color: #eeeeee"',
                'atomik-error-line-text'     => '',
                'atomik-error-stack'         => ''
            )
            
        ), $config);
        self::$config = &$config;

        Atomik::registerHelper('renderException', 'Atomik\Errors::render');
        
        // checks if we are in the CLI
        if (PHP_SAPI === 'cli') {
            return false;
        }
    }
1038107
public function check(array $config): bool
    {
        $this->extensions = Collection::make(Arr::get($config, 'extensions', []));
        if (Arr::get($config, 'include_composer_extensions', false)) {
            $this->extensions = $this->extensions->merge($this->getExtensionsRequiredInComposerFile());
            $this->extensions = $this->extensions->unique();
        }
        $this->extensions = $this->extensions->reject(function ($ext) {
            return extension_loaded($ext);
        });

        return $this->extensions->isEmpty();
    }
1060358
protected function run(Config $config): ResultInterface
    {
        $packages = WP_CLI::runcommand(
            'package list --fields=name,version,update_version --format=json',
            [
                'return' => true,
                'parse' => 'json',
                'launch' => true,
                'exit_error' => false,
            ]
        );

        $outdatedPackages = array_filter($packages, function (array $package): bool {
            return ! empty($package['update_version']);
        });

        $excludes = $config->compileExcludes([]);
        $outdatedPackages = array_filter($outdatedPackages, function (array $package) use ($excludes): bool {
            $isNotExcluded = ! in_array($package['name'], $excludes, true);

            // To exclude dev-master.
            $isNotDev = $package['update_version'] !== $package['version'];

            return $isNotExcluded && $isNotDev;
        });

        $messages = array_map(function (array $package): string {
            return "${package['name']} (${package['version']} => ${package['update_version']})";
        }, $outdatedPackages);

        return (empty($messages))
            ? ResultFactory::makeSuccess($this)
            : ResultFactory::makeFailure(
                $this,
                array_merge(['WP CLI package updates available:'], $messages)
            );
    }
369262
public function initErrorHandler(Config $config)
    {
        if ($this->getDI()->get('environment') === Constants::PROD_ENV) {
            return;
        }

        $this->debug = new Debug();
        $this->debug->listen();

        set_error_handler([$this, 'errorHandler'], error_reporting());

        register_shutdown_function(function() {
            if ((error_reporting() & E_ERROR) === E_ERROR) {
                $lastError = error_get_last();

                if ($lastError['type'] === E_ERROR) {
                    // fatal error
                    $this->errorHandler(E_ERROR, $lastError['message'], $lastError['file'], $lastError['line']);
                }
            }
        });
    }
215860
protected function run(Config $config): ResultInterface
    {
        $blacklistedUsers = array_filter(
            array_map(function (string $blacklistedUserEmail): ?WP_User {
                $user = get_user_by('email', $blacklistedUserEmail);

                return $user ?: null;
            }, $config->compileBlacklist())
        );

        if (! empty($blacklistedUsers)) {
            $messages = array_map(function (WP_User $user): string {
                return sprintf(
                    'ID: %1$d %2$s <%3$s>',
                    $user->get('ID'),
                    $user->get('user_login'),
                    $user->get('user_email')
                );
            }, $blacklistedUsers);

            return ResultFactory::makeFailure(
                $this,
                array_merge(['Blacklisted user emails found:'], $messages)
            );
        }

        return ResultFactory::makeSuccess($this);
    }
457685
public static function checkConfig(&$config, $instanceOf = null, $removeClass = true)
    {
        // Get class from config
        $class = static::getClassFromConfig($config, $removeClass);

        // Make sure we have a valid class
        if ($instanceOf && !is_subclass_of($class, $instanceOf)) {
            static::throwInvalidInstanceException($class, $instanceOf);
        }

        return $class;
    }