private function setComplementParams($complement)
    {
        $params = array_intersect_key(
            array_flip(self::$required),
            $complement
        );

        $slug = explode('.', basename($complement['config-file']));
        $default['slug'] = $slug[0];
        $complementType = self::getType('strtoupper');
        $path = App::$complementType() . $default['slug'] . '/';

        if (count($params) != 7) {
            $msg = self::getType('ucfirst') . " configuration file isn't correct";
            throw new ComplementException($msg . ': ' . $path . '.');
        }

        $default['url-import'] = '';
        $default['hooks-controller'] = 'Launcher';
        $default['path']['root'] = Url::addBackSlash($path);
        $default['folder'] = $default['slug'] . '/';
        $default['license'] = 'MIT';
        $default['author'] = '';
        $default['author-url'] = '';
        $default['extra'] = [];

        $lang = $this->getLanguage();

        if (isset($complement['name'][$lang])) {
            $complement['name'] = $complement['name'][$lang];
        }

        if (isset($complement['description'][$lang])) {
            $complement['description'] = $complement['description'][$lang];
        }

        $this->complement = array_merge($default, $complement);

        $this->setImage();
    }
private function setComplementParams($complement)
    {
        $params = array_intersect_key(
            array_flip(self::$required),
            $complement
        );

        $slug = explode('.', basename($complement['config-file']));
        $default['slug'] = $slug[0];
        $complementType = self::getType('strtoupper');
        $path = App::$complementType() . $default['slug'] . '/';

        if (count($params) != 7) {
            $msg = self::getType('ucfirst') . " configuration file isn't correct";
            throw new ComplementException($msg . ': ' . $path . '.');
        }

        $default['url-import'] = '';
        $default['hooks-controller'] = 'Launcher';
        $default['path']['root'] = Url::addBackSlash($path);
        $default['folder'] = $default['slug'] . '/';
        $default['license'] = 'MIT';
        $default['author'] = '';
        $default['author-url'] = '';
        $default['extra'] = [];

        $lang = $this->getLanguage();

        if (isset($complement['name'][$lang])) {
            $complement['name'] = $complement['name'][$lang];
        }

        if (isset($complement['description'][$lang])) {
            $complement['description'] = $complement['description'][$lang];
        }

        $this->complement = array_merge($default, $complement);

        $this->setImage();
    }
private function setComplementParams ( $ complement ) { $ params = array_intersect_key ( array_flip ( self :: $ required ) , $ complement ) ; $ slug = explode ( '.' , basename ( $ complement [ 'config-file' ] ) ) ; $ default [ 'slug' ] = $ slug [ 0 ] ; $ complementType = self :: getType ( 'strtoupper' ) ; $ path = App :: $ complementType ( ) . $ default [ 'slug' ] . '/' ; if ( count ( $ params ) != 7 ) { $ msg = self :: getType ( 'ucfirst' ) . " configuration file isn't correct" ; throw new ComplementException ( $ msg . ': ' . $ path . '.' ) ; } $ default [ 'url-import' ] = '' ; $ default [ 'hooks-controller' ] = 'Launcher' ; $ default [ 'path' ] [ 'root' ] = Url :: addBackSlash ( $ path ) ; $ default [ 'folder' ] = $ default [ 'slug' ] . '/' ; $ default [ 'license' ] = 'MIT' ; $ default [ 'author' ] = '' ; $ default [ 'author-url' ] = '' ; $ default [ 'extra' ] = [ ] ; $ lang = $ this -> getLanguage ( ) ; if ( isset ( $ complement [ 'name' ] [ $ lang ] ) ) { $ complement [ 'name' ] = $ complement [ 'name' ] [ $ lang ] ; } if ( isset ( $ complement [ 'description' ] [ $ lang ] ) ) { $ complement [ 'description' ] = $ complement [ 'description' ] [ $ lang ] ; } $ this -> complement = array_merge ( $ default , $ complement ) ; $ this -> setImage ( ) ; }
Check required params and set complement params.

@param string $complement → complement settings

@uses \Eliasis\Complement\Complement->$complement
@uses \Eliasis\Complement\Traits\ComplementHandler::getType()
@uses \Eliasis\Complement\Traits\ComplementAction->$hooks

@throws ComplementException → complement configuration file error
Check required params and set complement params .