protected function getLocalImageSettings(
        $image, ?string $alt, array $extra, bool $default, bool $storage = false
    ): ResourceSettings {
        if ($image instanceof LocalSettings) {
            $settings = $image;
        } elseif (is_array($image)) {
            if (!empty($extra)) {
                $image['extra'] = array_merge($image['extra'] ?? [], $extra);
            }

            $settings = new LocalSettings($image);
        } else {
            $settings = new LocalSettings([
                'image' => $image,
                'alt'   => $alt ?? $image,
                'extra' => $extra,
            ]);
        }

        $settings->theme        = $storage ? null : ($default ? $this->getDefaultTheme() : $this->getTheme());
        $settings->default      = $storage ? false : $default;
        $settings->url          = $storage ?
            $this->getStorageUrl($settings->image) :
            $this->getThemeResourceUrl($settings->image, $settings->theme);

        return $settings;
    }
protected function getLocalImageSettings(
        $image, ?string $alt, array $extra, bool $default, bool $storage = false
    ): ResourceSettings {
        if ($image instanceof LocalSettings) {
            $settings = $image;
        } elseif (is_array($image)) {
            if (!empty($extra)) {
                $image['extra'] = array_merge($image['extra'] ?? [], $extra);
            }

            $settings = new LocalSettings($image);
        } else {
            $settings = new LocalSettings([
                'image' => $image,
                'alt'   => $alt ?? $image,
                'extra' => $extra,
            ]);
        }

        $settings->theme        = $storage ? null : ($default ? $this->getDefaultTheme() : $this->getTheme());
        $settings->default      = $storage ? false : $default;
        $settings->url          = $storage ?
            $this->getStorageUrl($settings->image) :
            $this->getThemeResourceUrl($settings->image, $settings->theme);

        return $settings;
    }
protected function getLocalImageSettings ( $ image , ? string $ alt , array $ extra , bool $ default , bool $ storage = false ) : ResourceSettings { if ( $ image instanceof LocalSettings ) { $ settings = $ image ; } elseif ( is_array ( $ image ) ) { if ( ! empty ( $ extra ) ) { $ image [ 'extra' ] = array_merge ( $ image [ 'extra' ] ?? [ ] , $ extra ) ; } $ settings = new LocalSettings ( $ image ) ; } else { $ settings = new LocalSettings ( [ 'image' => $ image , 'alt' => $ alt ?? $ image , 'extra' => $ extra , ] ) ; } $ settings -> theme = $ storage ? null : ( $ default ? $ this -> getDefaultTheme ( ) : $ this -> getTheme ( ) ) ; $ settings -> default = $ storage ? false : $ default ; $ settings -> url = $ storage ? $ this -> getStorageUrl ( $ settings -> image ) : $ this -> getThemeResourceUrl ( $ settings -> image , $ settings -> theme ) ; return $ settings ; }
Create settings for local image

@param             $image
@param null|string $alt
@param array       $extra
@param bool        $default
@param bool        $storage
@return \Laranix\Themer\ResourceSettings|\Laranix\Themer\Images\LocalSettings
Create settings for local image