protected function validate()
    {
        $realPath = $this->realPath();

        if (! $realPath) {
            throw new \InvalidArgumentException("Path can not be empty");
        }

        if (! file_exists($realPath)) {
            throw new PathNotFoundException("Path does not exist: [{$realPath}]");
        }

        if (! $this->composer('type')) {
            throw new \Exception('Composer type not provided in composer.json');
        }

        if (! str_is('*.*.*', $this->slug)) {
            throw new \Exception('Slug should be snake case and formatted like: {vendor}.{type}.{name}');
        }
    }
protected function validate()
    {
        $realPath = $this->realPath();

        if (! $realPath) {
            throw new \InvalidArgumentException("Path can not be empty");
        }

        if (! file_exists($realPath)) {
            throw new PathNotFoundException("Path does not exist: [{$realPath}]");
        }

        if (! $this->composer('type')) {
            throw new \Exception('Composer type not provided in composer.json');
        }

        if (! str_is('*.*.*', $this->slug)) {
            throw new \Exception('Slug should be snake case and formatted like: {vendor}.{type}.{name}');
        }
    }
protected function validate ( ) { $ realPath = $ this -> realPath ( ) ; if ( ! $ realPath ) { throw new \ InvalidArgumentException ( "Path can not be empty" ) ; } if ( ! file_exists ( $ realPath ) ) { throw new PathNotFoundException ( "Path does not exist: [{$realPath}]" ) ; } if ( ! $ this -> composer ( 'type' ) ) { throw new \ Exception ( 'Composer type not provided in composer.json' ) ; } if ( ! str_is ( '*.*.*' , $ this -> slug ) ) { throw new \ Exception ( 'Slug should be snake case and formatted like: {vendor}.{type}.{name}' ) ; } }
Validate addon parameters
Validate addon parameters