src/Config/BucketResolver.php
public function resolveBucket(string $address, string &$name = null): string
    {
        $bucket = null;
        $length = 0;
        foreach ($this->prefixes as $id => $prefix) {
            if (strpos($address, $prefix) === 0 && strlen($prefix) > $length) {
                $bucket = $id;
                $length = strlen($prefix);
            }
        }

        if (empty($bucket)) {
            throw new ResolveException("Unable to resolve bucket of `{$address}`.");
        }

        $name = substr($address, $length);

        return $bucket;
    }
public function resolveBucket(string $address, string &$name = null): string
    {
        $bucket = null;
        $length = 0;
        foreach ($this->prefixes as $id => $prefix) {
            if (strpos($address, $prefix) === 0 && strlen($prefix) > $length) {
                $bucket = $id;
                $length = strlen($prefix);
            }
        }

        if (empty($bucket)) {
            throw new ResolveException("Unable to resolve bucket of `{$address}`.");
        }

        $name = substr($address, $length);

        return $bucket;
    }
public function resolveBucket ( string $ address , string & $ name = null ) : string { $ bucket = null ; $ length = 0 ; foreach ( $ this -> prefixes as $ id => $ prefix ) { if ( strpos ( $ address , $ prefix ) === 0 && strlen ( $ prefix ) > $ length ) { $ bucket = $ id ; $ length = strlen ( $ prefix ) ; } } if ( empty ( $ bucket ) ) { throw new ResolveException ( "Unable to resolve bucket of `{$address}`." ) ; } $ name = substr ( $ address , $ length ) ; return $ bucket ; }
Locate bucket name using object address.

@param string $address
@param string $name
@return string

@throws ResolveException
Locate bucket name using object address .