function ImageStyle::fileUriTarget

Provides a wrapper for file_uri_target() to allow unit testing.

Returns the part of a URI after the schema.

Parameters

string $uri: A stream, referenced as "scheme://target" or "data:target".

Return value

string|bool A string containing the target (path), or FALSE if none. For example, the URI "public://sample/test.txt" would return "sample/test.txt".

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\StreamWrapper\StreamWrapperManager::getUriTarget() instead.

See also

https://www.drupal.org/node/3035273

File

core/modules/image/src/Entity/ImageStyle.php, line 548

Class

ImageStyle
Defines an image style configuration entity.

Namespace

Drupal\image\Entity

Code

protected function fileUriTarget($uri) {
    @trigger_error('fileUriTarget() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. See https://www.drupal.org/node/3035273', E_USER_DEPRECATED);
    return StreamWrapperManager::getTarget($uri);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.