src/Image.php
protected function extractHashFromLocationHeader(array $headers)
    {
        $location = reset($headers);

        // Check if we got a Location header, otherwise something went wrong here.
        if (empty($location)) {
            return false;
        }

        $uri = new Uri($location);
        $parts = explode('/', $uri->getPath());

        // Returning just the HASH part for "api.rokka.io/organization/sourceimages/{HASH}"
        $return = array_pop($parts);
        if (null === $return) {
            return false;
        }

        return $return;
    }
protected function extractHashFromLocationHeader(array $headers)
    {
        $location = reset($headers);

        // Check if we got a Location header, otherwise something went wrong here.
        if (empty($location)) {
            return false;
        }

        $uri = new Uri($location);
        $parts = explode('/', $uri->getPath());

        // Returning just the HASH part for "api.rokka.io/organization/sourceimages/{HASH}"
        $return = array_pop($parts);
        if (null === $return) {
            return false;
        }

        return $return;
    }
protected function extractHashFromLocationHeader ( array $ headers ) { $ location = reset ( $ headers ) ; // Check if we got a Location header, otherwise something went wrong here. if ( empty ( $ location ) ) { return false ; } $ uri = new Uri ( $ location ) ; $ parts = explode ( '/' , $ uri -> getPath ( ) ) ; // Returning just the HASH part for "api.rokka.io/organization/sourceimages/{HASH}" $ return = array_pop ( $ parts ) ; if ( null === $ return ) { return false ; } return $ return ; }
Helper function to extract from a Location header the image hash, only the first Location is used.

@param array $headers The collection of Location headers

@return string|false
Helper function to extract from a Location header the image hash only the first Location is used .