Your IP : 216.73.216.219


Current Path : /home/pteabiscqq/www/libraries/quix/src/Config/
Upload File :
Current File : /home/pteabiscqq/www/libraries/quix/src/Config/Validator.php

<?php

namespace ThemeXpert\Config;

use ThemeXpert\Config\Contracts\ValidatorInterface;

class Validator implements ValidatorInterface
{
    /**
     * Validate configuration file.
     *
     * @param $config
     * @param $file
     */
    public function validate($config, $file)
    {
        $name = array_get($config, 'name');
        $slug = array_get($config, 'slug');

        if (!$name) {
            xception("element `name` is not defined in `{$file}`");
        }

        if (!$slug) {
            xception("element `slug` is not defined in `{$file}`");
        }
    }
}