static function register(string $id, string $dir, $options = []): bool
    {
        if (isset(self::$data[$id])) {
            return false;
        }
        if (!isset($id{0})) {
            throw new \InvalidArgumentException('The value of the id argument cannot be empty.');
        }
        $dir = rtrim(\BearFramework\Internal\Utilities::normalizePath($dir), '/');
        if (!is_dir($dir)) {
            throw new \InvalidArgumentException('The value of the dir argument is not a valid directory.');
        }
        self::$data[$id] = new \BearFramework\Addon($id, $dir, $options);
        return true;
    }
static function register(string $id, string $dir, $options = []): bool
    {
        if (isset(self::$data[$id])) {
            return false;
        }
        if (!isset($id{0})) {
            throw new \InvalidArgumentException('The value of the id argument cannot be empty.');
        }
        $dir = rtrim(\BearFramework\Internal\Utilities::normalizePath($dir), '/');
        if (!is_dir($dir)) {
            throw new \InvalidArgumentException('The value of the dir argument is not a valid directory.');
        }
        self::$data[$id] = new \BearFramework\Addon($id, $dir, $options);
        return true;
    }
static function register ( string $ id , string $ dir , $ options = [ ] ) : bool { if ( isset ( self :: $ data [ $ id ] ) ) { return false ; } if ( ! isset ( $ id { 0 } ) ) { throw new \ InvalidArgumentException ( 'The value of the id argument cannot be empty.' ) ; } $ dir = rtrim ( \ BearFramework \ Internal \ Utilities :: normalizePath ( $ dir ) , '/' ) ; if ( ! is_dir ( $ dir ) ) { throw new \ InvalidArgumentException ( 'The value of the dir argument is not a valid directory.' ) ; } self :: $ data [ $ id ] = new \ BearFramework \ Addon ( $ id , $ dir , $ options ) ; return true ; }
Registers an addon.

@param string $id The id of the addon.
@param string $dir The directory where the addon files are located.
@param array $options The addon options. Available values:
- require - An array containing the ids of addons that must be added before this one.
@return bool TRUE if successfully registered. FALSE otherwise.
Registers an addon .