Issue #2627018 by Lars Toomre: Some fixes for 'e.g.' in docblocks and code comments

8.1.x
Jennifer Hodgdon 2015-12-03 11:04:31 -08:00
parent 0fb0add63c
commit aaabb05c3d
34 changed files with 204 additions and 177 deletions

View File

@ -341,7 +341,7 @@ Drupal 7.0, 2011-01-05
- Improved time zone support:
* Drupal now uses PHP's time zone database when rendering dates in local
time. Site-wide and user-configured time zone offsets have been converted
to time zone names, e.g. Africa/Abidjan.
to time zone names; for example, Africa/Abidjan.
* In some cases the upgrade and install scripts do not choose the preferred
site default time zone. The automatically-selected time zone can be
corrected at admin/config/regional/settings.
@ -399,7 +399,7 @@ Drupal 7.0, 2011-01-05
preserved but renamed to file_unmanaged_*().
* Rewrote file handling to use PHP stream wrappers to enable support for
both public and private files and to support pluggable storage mechanisms
and access to remote resources (e.g. S3 storage or Flickr photos).
and access to remote resources (for example, S3 storage or Flickr photos).
* The mime_extension_mapping variable has been removed. Modules that need to
alter the default MIME type extension mappings should implement
hook_file_mimetype_mapping_alter().
@ -816,7 +816,7 @@ Drupal 4.7.0, 2006-05-01
- Added support for PHP5's 'mysqli' extension.
- Search module:
* Made indexer smarter and more robust.
* Added advanced search operators (e.g., phrase, node type, etc.).
* Added advanced search operators (phrase, node type, etc.).
* Added customizable result ranking.
- PostgreSQL support:
* Removed dependency on PL/pgSQL procedural language.

View File

@ -32,8 +32,8 @@ use Drupal\Core\Site\Settings;
* The prepared statement query to run. Although it will accept both named and
* unnamed placeholders, named placeholders are strongly preferred as they are
* more self-documenting. If the argument corresponding to a placeholder is
* an array of values to be expanded, e.g. for an IN query, the placeholder
* should be named with a trailing bracket like :example[]
* an array of values to be expanded (for example, with an IN query), the
* placeholder should be named with a trailing bracket like :example[].
* @param array $args
* An array of values to substitute into the query. If the query uses named
* placeholders, this is an associative array in any order. If the query uses
@ -47,7 +47,7 @@ use Drupal\Core\Site\Settings;
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call query() on it. E.g.
* call query() on it. For example,
* $injected_database->query($query, $args, $options);
*
* @see \Drupal\Core\Database\Connection::query()
@ -85,7 +85,7 @@ function db_query($query, array $args = array(), array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call queryRange() on it. E.g.
* call queryRange() on it. For example,
* $injected_database->queryRange($query, $from, $count, $args, $options);
*
* @see \Drupal\Core\Database\Connection::queryRange()
@ -121,7 +121,7 @@ function db_query_range($query, $from, $count, array $args = array(), array $opt
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call queryTemporary() on it. E.g.
* call queryTemporary() on it. For example,
* $injected_database->queryTemporary($query, $args, $options);
*
* @see \Drupal\Core\Database\Connection::queryTemporary()
@ -148,7 +148,8 @@ function db_query_temporary($query, array $args = array(), array $options = arra
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call insert() on it. E.g. $injected_database->insert($table, $options);
* call insert() on it. For example,
* $injected_database->insert($table, $options);
*
* @see \Drupal\Core\Database\Connection::insert()
* @see \Drupal\Core\Database\Connection::defaultOptions()
@ -173,7 +174,8 @@ function db_insert($table, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call merge() on it. E.g. $injected_database->merge($table, $options);
* call merge() on it. For example,
* $injected_database->merge($table, $options);
*
* @see \Drupal\Core\Database\Connection::merge()
* @see \Drupal\Core\Database\Connection::defaultOptions()
@ -198,7 +200,8 @@ function db_merge($table, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call update() on it. E.g. $injected_database->update($table, $options);
* call update() on it. For example,
* $injected_database->update($table, $options);
*
* @see \Drupal\Core\Database\Connection::update()
* @see \Drupal\Core\Database\Connection::defaultOptions()
@ -223,7 +226,8 @@ function db_update($table, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call delete() on it. E.g. $injected_database->delete($table, $options);
* call delete() on it. For example,
* $injected_database->delete($table, $options);
*
* @see \Drupal\Core\Database\Connection::delete()
* @see \Drupal\Core\Database\Connection::defaultOptions()
@ -248,7 +252,8 @@ function db_delete($table, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call truncate() on it. E.g. $injected_database->truncate($table, $options);
* call truncate() on it. For example,
* $injected_database->truncate($table, $options);
*
* @see \Drupal\Core\Database\Connection::truncate()
* @see \Drupal\Core\Database\Connection::defaultOptions()
@ -277,7 +282,7 @@ function db_truncate($table, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call select() on it. E.g.
* call select() on it. For example,
* $injected_database->select($table, $alias, $options);
*
* @see \Drupal\Core\Database\Connection::select()
@ -304,7 +309,7 @@ function db_select($table, $alias = NULL, array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call startTransaction() on it. E.g.
* call startTransaction() on it. For example,
* $injected_database->startTransaction($name);
*
* @see \Drupal\Core\Database\Connection::startTransaction()
@ -346,7 +351,8 @@ function db_set_active($key = 'default') {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeTable() on it. E.g. $injected_database->escapeTable($table);
* call escapeTable() on it. For example,
* $injected_database->escapeTable($table);
*
* @see \Drupal\Core\Database\Connection::escapeTable()
*/
@ -367,7 +373,8 @@ function db_escape_table($table) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeTable() on it. E.g. $injected_database->escapeTable($table);
* call escapeTable() on it. For example,
* $injected_database->escapeTable($table);
*
* @see \Drupal\Core\Database\Connection::escapeField()
*/
@ -407,7 +414,8 @@ function db_escape_field($field) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeLike() on it. E.g. $injected_database->escapeLike($string);
* call escapeLike() on it. For example,
* $injected_database->escapeLike($string);
*
* @see \Drupal\Core\Database\Connection::escapeLike()
*/
@ -423,7 +431,7 @@ function db_like($string) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call driver() on it. E.g. $injected_database->driver($string);
* call driver() on it. For example, $injected_database->driver($string);
*
* @see \Drupal\Core\Database\Connection::driver()
*/
@ -467,7 +475,7 @@ function db_close(array $options = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call nextId() on it. E.g. $injected_database->nextId($existing_id);
* call nextId() on it. For example, $injected_database->nextId($existing_id);
*
* @see \Drupal\Core\Database\Connection::nextId()
*/
@ -565,7 +573,7 @@ function db_condition($conjunction) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call createTable() on it. E.g.
* its schema driver, and call createTable() on it. For example,
* $injected_database->schema()->createTable($name, $table);
*
* @see \Drupal\Core\Database\Schema::createTable()
@ -588,7 +596,7 @@ function db_create_table($name, $table) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldNames() on it. E.g.
* its schema driver, and call fieldNames() on it. For example,
* $injected_database->schema()->fieldNames($fields);
*
* @see \Drupal\Core\Database\Schema::fieldNames()
@ -610,7 +618,7 @@ function db_field_names($fields) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call indexExists() on it. E.g.
* its schema driver, and call indexExists() on it. For example,
* $injected_database->schema()->indexExists($table, $name);
*
* @see \Drupal\Core\Database\Schema::indexExists()
@ -630,7 +638,7 @@ function db_index_exists($table, $name) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call tableExists() on it. E.g.
* its schema driver, and call tableExists() on it. For example,
* $injected_database->schema()->tableExists($table);
*
* @see \Drupal\Core\Database\Schema::tableExists()
@ -652,7 +660,7 @@ function db_table_exists($table) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldExists() on it. E.g.
* its schema driver, and call fieldExists() on it. For example,
* $injected_database->schema()->fieldExists($table, $field);
*
* @see \Drupal\Core\Database\Schema::fieldExists()
@ -672,7 +680,7 @@ function db_field_exists($table, $field) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call findTables() on it. E.g.
* its schema driver, and call findTables() on it. For example,
* $injected_database->schema()->findTables($table_expression);
*
* @see \Drupal\Core\Database\Schema::findTables()
@ -691,7 +699,7 @@ function db_find_tables($table_expression) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call renameTable() on it. E.g.
* its schema driver, and call renameTable() on it. For example,
* $injected_database->schema()->renameTable($table, $new_name);
*
* @see \Drupal\Core\Database\Schema::renameTable()
@ -708,7 +716,7 @@ function db_rename_table($table, $new_name) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropTable() on it. E.g.
* its schema driver, and call dropTable() on it. For example,
* $injected_database->schema()->dropTable($table);
*
* @see \Drupal\Core\Database\Schema::dropTable()
@ -738,7 +746,7 @@ function db_drop_table($table) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addField() on it. E.g.
* its schema driver, and call addField() on it. For example,
* $injected_database->schema()->addField($table, $field, $spec, $keys_new);
*
* @see \Drupal\Core\Database\Schema::addField()
@ -762,7 +770,7 @@ function db_add_field($table, $field, $spec, $keys_new = array()) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropField() on it. E.g.
* its schema driver, and call dropField() on it. For example,
* $injected_database->schema()->dropField($table, $field);
*
* @see \Drupal\Core\Database\Schema::dropField()
@ -783,7 +791,7 @@ function db_drop_field($table, $field) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldSetDefault() on it. E.g.
* its schema driver, and call fieldSetDefault() on it. For example,
* $injected_database->schema()->fieldSetDefault($table, $field, $default);
*
* @see \Drupal\Core\Database\Schema::fieldSetDefault()
@ -802,7 +810,7 @@ function db_field_set_default($table, $field, $default) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldSetNoDefault() on it. E.g.
* its schema driver, and call fieldSetNoDefault() on it. For example,
* $injected_database->schema()->fieldSetNoDefault($table, $field);
*
* @see \Drupal\Core\Database\Schema::fieldSetNoDefault()
@ -821,7 +829,7 @@ function db_field_set_no_default($table, $field) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addPrimaryKey() on it. E.g.
* its schema driver, and call addPrimaryKey() on it. For example,
* $injected_database->schema()->addPrimaryKey($table, $fields);
*
* @see \Drupal\Core\Database\Schema::addPrimaryKey()
@ -842,7 +850,7 @@ function db_add_primary_key($table, $fields) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropPrimaryKey() on it. E.g.
* its schema driver, and call dropPrimaryKey() on it. For example,
* $injected_database->schema()->dropPrimaryKey($table);
*
* @see \Drupal\Core\Database\Schema::dropPrimaryKey()
@ -863,7 +871,7 @@ function db_drop_primary_key($table) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addUniqueKey() on it. E.g.
* its schema driver, and call addUniqueKey() on it. For example,
* $injected_database->schema()->addUniqueKey($table, $name, $fields);
*
* @see \Drupal\Core\Database\Schema::addUniqueKey()
@ -886,7 +894,7 @@ function db_add_unique_key($table, $name, $fields) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropUniqueKey() on it. E.g.
* its schema driver, and call dropUniqueKey() on it. For example,
* $injected_database->schema()->dropUniqueKey($table, $name);
*
* @see \Drupal\Core\Database\Schema::dropUniqueKey()
@ -911,7 +919,7 @@ function db_drop_unique_key($table, $name) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addIndex() on it. E.g.
* its schema driver, and call addIndex() on it. For example,
* $injected_database->schema()->addIndex($table, $name, $fields, $spec);
*
* @see hook_schema()
@ -936,7 +944,7 @@ function db_add_index($table, $name, $fields, array $spec) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropIndex() on it. E.g.
* its schema driver, and call dropIndex() on it. For example,
* $injected_database->schema()->dropIndex($table, $name);
*
* @see \Drupal\Core\Database\Schema::dropIndex()
@ -1007,7 +1015,7 @@ function db_drop_index($table, $name) {
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call changeField() on it. E.g.
* its schema driver, and call changeField() on it. For example,
* $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new);
*
* @see \Drupal\Core\Database\Schema::changeField()

View File

@ -423,11 +423,11 @@ class Drupal {
* Returns the entity query object for this entity type.
*
* @param string $entity_type
* The entity type, e.g. node, for which the query object should be
* The entity type (for example, node) for which the query object should be
* returned.
* @param string $conjunction
* AND if all conditions in the query need to apply, OR if any of them is
* enough. Optional, defaults to AND.
* (optional) Either 'AND' if all conditions in the query need to apply, or
* 'OR' if any of them is sufficient. Defaults to 'AND'.
*
* @return \Drupal\Core\Entity\Query\QueryInterface
* The query object that can query the given entity type.
@ -440,11 +440,11 @@ class Drupal {
* Returns the entity query aggregate object for this entity type.
*
* @param string $entity_type
* The entity type, e.g. node, for which the query object should be
* The entity type (for example, node) for which the query object should be
* returned.
* @param string $conjunction
* AND if all conditions in the query need to apply, OR if any of them is
* enough. Optional, defaults to AND.
* (optional) Either 'AND' if all conditions in the query need to apply, or
* 'OR' if any of them is sufficient. Defaults to 'AND'.
*
* @return \Drupal\Core\Entity\Query\QueryAggregateInterface
* The query object that can query the given entity type.

View File

@ -36,10 +36,11 @@ class UrlHelper {
* http_build_query() directly.
*
* @param array $query
* The query parameter array to be processed,
* e.g. \Drupal::request()->query->all().
* The query parameter array to be processed; for instance,
* \Drupal::request()->query->all().
* @param string $parent
* Internal use only. Used to build the $query array key for nested items.
* (optional) Internal use only. Used to build the $query array key for
* nested items. Defaults to an empty string.
*
* @return string
* A rawurlencoded string which can be used as or appended to the URL query
@ -168,8 +169,8 @@ class UrlHelper {
}
// Internal URLs.
else {
// parse_url() does not support relative URLs, so make it absolute. E.g. the
// relative URL "foo/bar:1" isn't properly parsed.
// parse_url() does not support relative URLs, so make it absolute. For
// instance, the relative URL "foo/bar:1" isn't properly parsed.
$parts = parse_url('http://example.com/' . $url);
// Strip the leading slash that was just added.
$options['path'] = substr($parts['path'], 1);
@ -200,10 +201,11 @@ class UrlHelper {
}
/**
* Determines whether a path is external to Drupal (e.g. http://example.com).
* Determines whether a path is external to Drupal.
*
* If a path cannot be assessed by Drupal's menu handler, then we must
* treat it as potentially insecure.
* An example of an external path is http://example.com. If a path cannot be
* assessed by Drupal's menu handler, then we must treat it as potentially
* insecure.
*
* @param string $path
* The internal path or external URL being linked to, such as "node/34" or
@ -296,7 +298,7 @@ class UrlHelper {
}
/**
* Strips dangerous protocols (e.g. 'javascript:') from a URI.
* Strips dangerous protocols (for example, 'javascript:') from a URI.
*
* This function must be called for all URIs within user-entered input prior
* to being output to an HTML attribute value. It is often called as part of
@ -316,8 +318,8 @@ class UrlHelper {
* for well-formed URLs will be invoked, which strips most substrings that
* precede a ":". The result can be used in URL attributes such as "href"
* or "src" (only after calling Html::escape() separately), but this may not
* produce valid HTML (e.g., malformed URLs within "href" attributes fail
* HTML validation). This can be avoided by using
* produce valid HTML (for example, malformed URLs within "href" attributes
* fail HTML validation). This can be avoided by using
* Url::fromUri($possibly_not_a_url)->toString(), which either throws an
* exception or returns a well-formed URL.
*

View File

@ -13,8 +13,9 @@ use Symfony\Component\HttpFoundation\Request;
* Restrict authentication methods to a subset of the site.
*
* Some authentication methods should not be available throughout a whole site.
* E.g., there are good reasons to restrict insecure methods like HTTP basic
* auth or an URL token authentication method to API-only routes.
* For instance, there are good reasons to restrict insecure methods like HTTP
* basic authentication or an URL token authentication method to API-only
* routes.
*/
interface AuthenticationProviderFilterInterface {

View File

@ -17,9 +17,9 @@ interface CacheableResponseInterface {
/**
* Adds a dependency on an object: merges its cacheability metadata.
*
* E.g. when a response depends on some configuration, an entity, or an access
* result, we must make sure their cacheability metadata is present on the
* response. This method makes doing that simple.
* For instance, when a response depends on some configuration, an entity, or
* an access result, we must make sure their cacheability metadata is present
* on the response. This method makes doing that simple.
*
* @param \Drupal\Core\Cache\CacheableDependencyInterface|mixed $dependency
* The dependency. If the object implements CacheableDependencyInterface,

View File

@ -92,9 +92,10 @@ class CacheContextsManager {
*
* A cache context token is either:
* - a cache context ID (if the service ID is 'cache_context.foo', then 'foo'
* is a cache context ID), e.g. 'foo'
* - a calculated cache context ID, followed by a double colon, followed by
* the parameter for the calculated cache context, e.g. 'bar:some_parameter'
* is a cache context ID); for example, 'foo'.
* - a calculated cache context ID, followed by a colon, followed by
* the parameter for the calculated cache context; for example,
* 'bar:some_parameter'.
*
* @param string[] $context_tokens
* An array of cache context tokens.
@ -142,11 +143,12 @@ class CacheContextsManager {
* If a cache context is being optimized away, it is able to set cacheable
* metadata for itself which will be bubbled up.
*
* E.g. when caching per user ('user'), also caching per role ('user.roles')
* is meaningless because "per role" is implied by "per user".
* For example, when caching per user ('user'), also caching per role
* ('user.roles') is meaningless because "per role" is implied by "per user".
*
* Examples remember that the period indicates hierarchy and the colon can
* be used to get a specific value of a calculated cache context:
* In the following examples, remember that the period indicates hierarchy and
* the colon can be used to get a specific value of a calculated cache
* context:
* - ['a', 'a.b'] -> ['a']
* - ['a', 'a.b.c'] -> ['a']
* - ['a.b', 'a.b.c'] -> ['a.b']

View File

@ -18,10 +18,10 @@ interface ConfigEntityStorageInterface extends EntityStorageInterface {
* Extracts the configuration entity ID from the full configuration name.
*
* @param string $config_name
* The full configuration name to extract the ID from. E.g.
* The full configuration name to extract the ID from; for example,
* 'views.view.archive'.
* @param string $config_prefix
* The config prefix of the configuration entity. E.g. 'views.view'
* The config prefix of the configuration entity; for example, 'views.view'.
*
* @return string
* The ID of the configuration entity.

View File

@ -80,9 +80,9 @@ class InstallStorage extends FileStorage {
* The path to the configuration file.
*
* @todo Improve this when figuring out how we want to handle configuration in
* installation profiles. E.g., a config object actually has to be searched
* in the profile first (whereas the profile is never the owner), only
* afterwards check for a corresponding module or theme.
* installation profiles. For instance, a config object actually has to be
* searched in the profile first (whereas the profile is never the owner);
* only afterwards check for a corresponding module or theme.
*/
public function getFilePath($name) {
$folders = $this->getAllFolders();

View File

@ -160,8 +160,8 @@ class EarlyRenderingControllerWrapperSubscriber implements EventSubscriberInterf
}
else {
// A Response or domain object is returned that does not care about
// attachments nor cacheability. E.g. a RedirectResponse. It is safe to
// discard any early rendering metadata.
// attachments nor cacheability; for instance, a RedirectResponse. It is
// safe to discard any early rendering metadata.
}
}

View File

@ -86,9 +86,12 @@ interface ImageInterface {
* @param string $operation
* The operation to be performed against the image.
* @param array $arguments
* An associative array of arguments to be passed to the toolkit
* operation, e.g. array('width' => 50, 'height' => 100,
* 'upscale' => TRUE).
* (optional) An associative array of arguments to be passed to the toolkit
* operation; for instance,
* @code
* ['width' => 50, 'height' => 100, 'upscale' => TRUE]
* @endcode
* Defaults to an empty array.
*
* @return bool
* TRUE on success, FALSE on failure.
@ -120,11 +123,11 @@ interface ImageInterface {
* @param int $height
* The height of the new image, in pixels.
* @param string $extension
* (Optional) The extension of the image file (e.g. 'png', 'gif', etc.).
* Allowed values depend on the implementation of the image toolkit.
* (optional) The extension of the image file (for instance, 'png', 'gif',
* etc.). Allowed values depend on the implementation of the image toolkit.
* Defaults to 'png'.
* @param string $transparent_color
* (Optional) The hexadecimal string representing the color to be used
* (optional) The hexadecimal string representing the color to be used
* for transparency, needed for GIF images. Defaults to '#ffffff' (white).
*
* @return bool
@ -176,8 +179,8 @@ interface ImageInterface {
* extension.
*
* @param string $extension
* The extension to convert to (e.g. 'jpeg' or 'png'). Allowed values depend
* on the current image toolkit.
* The extension to convert to (for instance, 'jpeg' or 'png'). Allowed
* values depend on the current image toolkit.
*
* @return bool
* TRUE on success, FALSE on failure.
@ -231,10 +234,10 @@ interface ImageInterface {
* The number of (clockwise) degrees to rotate the image.
* @param string|null $background
* (optional) An hexadecimal integer specifying the background color to use
* for the uncovered area of the image after the rotation. E.g. 0x000000 for
* black, 0xff00ff for magenta, and 0xffffff for white. For images that
* support transparency, this will default to transparent. Otherwise it will
* be white.
* for the uncovered area of the image after the rotation; for example,
* 0x000000 for black, 0xff00ff for magenta, and 0xffffff for white. When
* NULL (the default) is specified, for images that support transparency,
* this will default to transparent; otherwise, it will default to white.
*
* @return bool
* TRUE on success, FALSE on failure.

View File

@ -297,8 +297,8 @@ class MailFormatHelper {
* Note that we are skipping MIME content header lines, because attached
* files, especially applications, could have long MIME types or long
* filenames which result in line length longer than the 77 characters limit
* and wrapping that line will break the email format. E.g., the attached file
* hello_drupal.docx will produce the following Content-Type:
* and wrapping that line will break the email format. For instance, the
* attached file hello_drupal.docx will produce the following Content-Type:
* @code
* Content-Type:
* application/vnd.openxmlformats-officedocument.wordprocessingml.document;

View File

@ -32,9 +32,9 @@ interface ContextInterface extends ComponentContextInterface, CacheableDependenc
/**
* Adds a dependency on an object: merges its cacheability metadata.
*
* E.g. when a context depends on some configuration, an entity, or an access
* result, we must make sure their cacheability metadata is present on the
* response. This method makes doing that simple.
* For example, when a context depends on some configuration, an entity, or an
* access result, we must make sure their cacheability metadata is present on
* the response. This method makes doing that simple.
*
* @param \Drupal\Core\Cache\CacheableDependencyInterface|mixed $dependency
* The dependency. If the object implements CacheableDependencyInterface,

View File

@ -120,13 +120,13 @@ class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery {
if ($this->namespaceSuffix) {
foreach ($this->rootNamespacesIterator as $namespace => $dirs) {
// Append the namespace suffix to the base namespace, to obtain the
// plugin namespace. E.g. 'Drupal\Views' may become
// plugin namespace; for example, 'Drupal\Views' may become
// 'Drupal\Views\Plugin\Block'.
$namespace .= $this->namespaceSuffix;
foreach ((array) $dirs as $dir) {
// Append the directory suffix to the PSR-4 base directory, to obtain
// the directory where plugins are found.
// E.g. DRUPAL_ROOT . '/core/modules/views/src' may become
// the directory where plugins are found. For example,
// DRUPAL_ROOT . '/core/modules/views/src' may become
// DRUPAL_ROOT . '/core/modules/views/src/Plugin/Block'.
$plugin_namespaces[$namespace][] = $dir . $this->directorySuffix;
}

View File

@ -47,8 +47,8 @@ class YamlDiscovery implements DiscoveryInterface {
* Construct a YamlDiscovery object.
*
* @param string $name
* The file name suffix to use for discovery. E.g. 'test' will become
* 'MODULE.test.yml'.
* The file name suffix to use for discovery; for example, 'test' will
* become 'MODULE.test.yml'.
* @param array $directories
* An array of directories to scan.
*/

View File

@ -30,8 +30,8 @@ class YamlDiscoveryDecorator extends YamlDiscovery {
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated
* The discovery object that is being decorated.
* @param string $name
* The file name suffix to use for discovery. E.g. 'test' will become
* 'MODULE.test.yml'.
* The file name suffix to use for discovery; for instance, 'test' will
* become 'MODULE.test.yml'.
* @param array $directories
* An array of directories to scan.
*/

View File

@ -42,9 +42,9 @@ interface RendererInterface {
*
* Calls ::render() in such a way that placeholders are replaced.
*
* Useful for e.g. rendering the values of tokens or emails, which need a
* render array being turned into a string, but don't need any of the
* bubbleable metadata (the attached assets the cache tags).
* Useful for instance when rendering the values of tokens or emails, which
* need a render array being turned into a string, but do not need any of the
* bubbleable metadata (the attached assets and cache tags).
*
* Some of these are a relatively common use case and happen *within* a
* ::renderRoot() call, but that is generally highly problematic (and hence an
@ -138,8 +138,8 @@ interface RendererInterface {
* - 'keys': An array of one or more keys that identify the element. If
* 'keys' is set, the cache ID is created automatically from these keys.
* - 'contexts': An array of one or more cache context IDs. These are
* converted to a final value depending on the request. (e.g. 'user' is
* mapped to the current user's ID.)
* converted to a final value depending on the request. (For instance,
* 'user' is mapped to the current user's ID.)
* - 'max-age': A time in seconds. Zero seconds means it is not cacheable.
* \Drupal\Core\Cache\Cache::PERMANENT means it is cacheable forever.
* - 'bin': Specify a cache bin to cache the element in. Default is
@ -298,14 +298,14 @@ interface RendererInterface {
* placeholder element containing a #lazy_builder function is rendered in
* isolation. The resulting markup is used to replace the placeholder, and
* any bubbleable metadata is merged.
* Placeholders must be unique, to guarantee that e.g. samples of
* Placeholders must be unique, to guarantee that for instance, samples of
* placeholders are not replaced as well.
* - Just before finishing the rendering of this element, this element's
* stack frame (the topmost one) is bubbled: the two topmost frames are
* popped from the stack, they are merged and the result is pushed back
* onto the stack.
* So if this element e.g. was a child element, then a new frame was
* pushed onto the stack element at the beginning of rendering this
* So if for instance this element was a child element, then a new frame
* was pushed onto the stack element at the beginning of rendering this
* element, it was updated when the rendering was completed, and now we
* merge it with the frame for the parent, so that the parent now has the
* bubbleable rendering metadata for its child.
@ -401,9 +401,9 @@ interface RendererInterface {
/**
* Adds a dependency on an object: merges its cacheability metadata.
*
* E.g. when a render array depends on some configuration, an entity, or an
* access result, we must make sure their cacheability metadata is present on
* the render array. This method makes doing that simple.
* For instance, when a render array depends on some configuration, an entity,
* or an access result, we must make sure their cacheability metadata is
* present on the render array. This method makes doing that simple.
*
* @param array &$elements
* The render array to update.

View File

@ -66,8 +66,10 @@ interface StreamWrapperInterface extends PhpStreamWrapperInterface {
*/
/**
* Not visible in the UI or accessible via web, but readable and writable.
* E.g. the temporary directory for uploads.
* Defines the stream wrapper bit flag for a hidden file.
*
* This is not visible in the UI or accessible via web, but readable and
* writable; for instance, the temporary directory for file uploads.
*/
const HIDDEN = 0x000C;

View File

@ -315,8 +315,8 @@ class TwigExtension extends \Twig_Extension {
* ampersand ("&") which separates query params. Thus we cannot mark
* the generated URL as always safe, but only when we are sure there won't be
* multiple query params. This is the case when there are none or only one
* constant parameter given. E.g. we know beforehand this will not need to
* be escaped:
* constant parameter given. For instance, we know beforehand this will not
* need to be escaped:
* - path('route')
* - path('route', {'param': 'value'})
* But the following may need to be escaped:

View File

@ -78,7 +78,7 @@ interface TypedDataManagerInterface extends PluginManagerInterface, CachedDiscov
* class used by a data type is known, this method allows the creation of data
* definitions for any given data type.
*
* E.g., if a definition for a map is to be created, the following code
* For example, if a definition for a map is to be created, the following code
* could be used instead of calling this method with the argument 'map':
* @code
* $map_definition = \Drupal\Core\TypedData\MapDataDefinition::create();
@ -137,9 +137,10 @@ interface TypedDataManagerInterface extends PluginManagerInterface, CachedDiscov
* Get a typed data instance for a property of a given typed data object.
*
* This method will use prototyping for fast and efficient instantiation of
* many property objects with the same property path; e.g.,
* many property objects with the same property path; for example,
* when multiple comments are used comment_body.0.value needs to be
* instantiated very often.
*
* Prototyping is done by the root object's data type and the given
* property path, i.e. all property instances having the same property path
* and inheriting from the same data type are prototyped.
@ -203,9 +204,10 @@ interface TypedDataManagerInterface extends PluginManagerInterface, CachedDiscov
* Gets default constraints for the given data definition.
*
* This generates default constraint definitions based on the data definition;
* e.g. a NotNull constraint is generated if the data is defined as required.
* Besides that any constraints defined for the data type, i.e. below the
* 'constraint' key of the type's plugin definition, are taken into account.
* for example, a NotNull constraint is generated if the data is defined as
* required. Besides that, any constraints defined for the data type (that is,
* below the 'constraint' key of the type's plugin definition) are taken into
* account.
*
* @param \Drupal\Core\TypedData\DataDefinitionInterface $definition
* A data definition.
@ -222,12 +224,12 @@ interface TypedDataManagerInterface extends PluginManagerInterface, CachedDiscov
*
* The canonical representation is typically used when data is passed on to
* other code components. In many use cases, the TypedData object is mostly
* unified adapter wrapping a primary value (e.g. a string, an entity...)
* which is the canonical representation that consuming code like constraint
* unified adapter wrapping a primary value (a string, an entity, etc.) which
* is the canonical representation that consuming code like constraint
* validators are really interested in. For some APIs, though, the domain
* object (e.g. Field API's FieldItem and FieldItemList) directly implements
* TypedDataInterface, and the canonical representation is thus the data
* object itself.
* object (for example, Field API's FieldItem and FieldItemList) directly
* implements TypedDataInterface, and the canonical representation is thus the
* data object itself.
*
* When a TypedData object gets validated, for example, its canonical
* representation is passed on to constraint validators, which thus receive

View File

@ -22,8 +22,8 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
* plugin configuration during plugin instantiation.
*
* While core does not prefix constraint plugins, modules have to prefix them
* with the module name in order to avoid any naming conflicts. E.g. a "profile"
* module would have to prefix any constraints with "Profile".
* with the module name in order to avoid any naming conflicts; for example, a
* "profile" module would have to prefix any constraints with "Profile".
*
* Constraint plugins may specify data types to which support is limited via the
* 'type' key of plugin definitions. See

View File

@ -68,8 +68,8 @@ class AllowedValuesConstraintValidator extends ChoiceValidator implements Contai
// The parent implementation ignores values that are not set, but makes
// sure some choices are available firstly. However, we want to support
// empty choices for undefined values, e.g. if a term reference field
// points to an empty vocabulary.
// empty choices for undefined values; for instance, if a term reference
// field points to an empty vocabulary.
if (!isset($value)) {
return;
}

View File

@ -190,7 +190,8 @@ function hook_block_build_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\
* @param \Drupal\block\Entity\Block $block
* The block instance.
* @param string $operation
* The operation to be performed, e.g., 'view', 'create', 'delete', 'update'.
* The operation to be performed; for instance, 'view', 'create', 'delete', or
* 'update'.
* @param \Drupal\Core\Session\AccountInterface $account
* The user object to perform the access check operation on.
*

View File

@ -211,14 +211,15 @@ class BlockViewBuilder extends EntityViewBuilder {
if ($content !== NULL && !Element::isEmpty($content)) {
// Place the $content returned by the block plugin into a 'content' child
// element, as a way to allow the plugin to have complete control of its
// properties and rendering (e.g., its own #theme) without conflicting
// with the properties used above, or alternate ones used by alternate
// block rendering approaches in contrib (e.g., Panels). However, the use
// of a child element is an implementation detail of this particular block
// rendering approach. Semantically, the content returned by the plugin
// "is the" block, and in particular, #attributes and #contextual_links is
// information about the *entire* block. Therefore, we must move these
// properties from $content and merge them into the top-level element.
// properties and rendering (for instance, its own #theme) without
// conflicting with the properties used above, or alternate ones used by
// alternate block rendering approaches in contrib (for instance, Panels).
// However, the use of a child element is an implementation detail of this
// particular block rendering approach. Semantically, the content returned
// by the plugin "is the" block, and in particular, #attributes and
// #contextual_links is information about the *entire* block. Therefore,
// we must move these properties from $content and merge them into the
// top-level element.
foreach (array('#attributes', '#contextual_links') as $property) {
if (isset($content[$property])) {
$build[$property] += $content[$property];
@ -232,8 +233,8 @@ class BlockViewBuilder extends EntityViewBuilder {
else {
// Abort rendering: render as the empty string and ensure this block is
// render cached, so we can avoid the work of having to repeatedly
// determine whether the block is empty. E.g. modifying or adding entities
// could cause the block to no longer be empty.
// determine whether the block is empty. For instance, modifying or adding
// entities could cause the block to no longer be empty.
$build = array(
'#markup' => '',
'#cache' => $build['#cache'],

View File

@ -58,9 +58,9 @@ class BookExport {
* The given node is embedded to its absolute depth in a top level section. For
* example, a child node with depth 2 in the hierarchy is contained in
* (otherwise empty) <div> elements corresponding to depth 0 and depth 1.
* This is intended to support WYSIWYG output - e.g., level 3 sections always
* look like level 3 sections, no matter their depth relative to the node
* selected to be exported as printer-friendly HTML.
* This is intended to support WYSIWYG output; for instance, level 3 sections
* always look like level 3 sections, no matter their depth relative to the
* node selected to be exported as printer-friendly HTML.
*
* @param \Drupal\node\NodeInterface $node
* The node to export.

View File

@ -16,9 +16,10 @@ use Drupal\editor\Entity\Editor;
* or enable themselves based on the configuration of another setting, such as
* enabling based on a particular button being present in the toolbar.
*
* If a contextually enabled CKEditor plugin must also be configurable (e.g. in
* the case where it must be enabled based on an explicit setting), then one
* must also implement the CKEditorPluginConfigurableInterface interface.
* If a contextually enabled CKEditor plugin must also be configurable (for
* instance, in the case where it must be enabled based on an explicit setting),
* then one must also implement the CKEditorPluginConfigurableInterface
* interface.
*
* @see \Drupal\ckeditor\CKEditorPluginInterface
* @see \Drupal\ckeditor\CKEditorPluginButtonsInterface

View File

@ -477,11 +477,11 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
// Once validated, an element or its property cannot be
// invalidated by another rule.
// That means that the most permissive setting wins. Which means that
// it will still be allowed by CKEditor to e.g. define any style, no
// matter what the "*" tag's restrictions may be. If there's a setting
// for either the "style" or "class" attribute, it cannot possibly be
// more permissive than what was set above. Hence: inherit from the
// "*" tag where possible.
// it will still be allowed by CKEditor, for instance, to define any
// style, no matter what the "*" tag's restrictions may be. If there
// is a setting for either the "style" or "class" attribute, it cannot
// possibly be more permissive than what was set above. Hence, inherit
// from the "*" tag where possible.
if (isset($html_restrictions['allowed']['*'])) {
$wildcard = $html_restrictions['allowed']['*'];
if (isset($wildcard['style'])) {

View File

@ -187,8 +187,8 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
// Hidden CKEditor instance. We need a hidden CKEditor instance with all
// plugins enabled, so we can retrieve CKEditor's per-feature metadata (on
// which tags, attributes, styles and classes are enabled). This metadata is
// necessary for certain filters' (e.g. the html_filter filter) settings to
// be updated accordingly.
// necessary for certain filters' (for instance, the html_filter filter)
// settings to be updated accordingly.
// Get a list of all external plugins and their corresponding files.
$plugins = array_keys($this->ckeditorPluginManager->getDefinitions());
$all_external_plugins = array();
@ -348,9 +348,10 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
// If this language code is available in a Drupal mapping, use that to
// compute a possibility for matching from the Drupal langcode to the
// CKEditor langcode.
// e.g. CKEditor uses the langcode 'no' for Norwegian, Drupal uses 'nb'.
// This would then remove the 'no' => 'no' mapping and replace it with
// 'nb' => 'no'. Now Drupal knows which CKEditor translation to load.
// For instance, CKEditor uses the langcode 'no' for Norwegian, Drupal
// uses 'nb'. This would then remove the 'no' => 'no' mapping and replace
// it with 'nb' => 'no'. Now Drupal knows which CKEditor translation to
// load.
if (isset($language_mappings[$langcode]) && !isset($langcodes[$language_mappings[$langcode]])) {
$langcodes[$language_mappings[$langcode]] = $langcode;
unset($langcodes[$langcode]);

View File

@ -245,7 +245,8 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
* @param \Drupal\comment\CommentInterface $comment
* The comment object.
* @param $view_mode
* (optional) View mode; e.g., 'full', 'teaser', etc. Defaults to 'full'.
* (optional) View mode; for instance, 'full', 'teaser', etc. Defaults to
* 'full'.
* @param $langcode
* (optional) A language code to use for rendering. Defaults to the global
* content language of the current request.
@ -266,7 +267,8 @@ function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode
* @param $comments
* An array of comments as returned by entity_load_multiple().
* @param $view_mode
* View mode; e.g., 'full', 'teaser', etc.
* (optional) View mode; for instance, 'full', 'teaser', etc. Defaults to
* 'full'.
* @param $langcode
* (optional) A string indicating the language field values are to be shown
* in. If no language is provided the current content language is used.
@ -641,8 +643,8 @@ function template_preprocess_comment(&$variables) {
}
if (theme_get_setting('features.comment_user_picture')) {
// To change user picture settings (e.g., image style), edit the 'compact'
// view mode on the User entity.
// To change user picture settings (for instance, image style), edit the
// 'compact' view mode on the User entity.
$variables['user_picture'] = user_view($account, 'compact');
}
else {

View File

@ -27,7 +27,7 @@
* - title: Comment title, linked to the comment.
* - attributes: HTML attributes for the containing element.
* The attributes.class may contain one or more of the following classes:
* - comment: The current template type; e.g., 'theming hook'.
* - comment: The current template type; for instance, 'theming hook'.
* - by-anonymous: Comment by an unregistered user.
* - by-{entity-type}-author: Comment by the author of the parent entity,
* eg. by-node-author.

View File

@ -87,13 +87,14 @@ class ConfigMapperManager extends DefaultPluginManager implements ConfigMapperMa
if (!isset($this->discovery)) {
// Look at all themes and modules.
// @todo If the list of installed modules and themes is changed, new
// definitions are not picked up immediately and obsolete definitions are
// not removed, because the list of search directories is only compiled
// once in this constructor. The current code only works due to
// coincidence: The request that installs e.g. a new theme does not
// instantiate this plugin manager at the beginning of the request; when
// routes are being rebuilt at the end of the request, this service only
// happens to get instantiated with the updated list of installed themes.
// definitions are not picked up immediately and obsolete definitions
// are not removed, because the list of search directories is only
// compiled once in this constructor. The current code only works due to
// coincidence: The request that installs (for instance, a new theme)
// does not instantiate this plugin manager at the beginning of the
// request; when routes are being rebuilt at the end of the request,
// this service only happens to get instantiated with the updated list
// of installed themes.
$directories = array();
foreach ($this->moduleHandler->getModuleList() as $name => $module) {
$directories[$name] = $module->getPath();

View File

@ -96,9 +96,9 @@ function content_translation_language_types_info_alter(array &$language_types) {
* canonical link template cannot be enabled for translation. Setting this key
* to TRUE overrides that. When that key is set, the Content Translation
* module will not provide any UI for translating the entity type, and the
* entity type should implement its own UI. This is useful for (e.g.) entity
* types that are embedded into others for editing (which would not need a
* canonical link, but could still support translation).
* entity type should implement its own UI. For instance, this is useful for
* entity types that are embedded into others for editing (which would not
* need a canonical link, but could still support translation).
* - content_translation_metadata: To implement its business logic the content
* translation UI relies on various metadata items describing the translation
* state. The default implementation is provided by

View File

@ -177,8 +177,8 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface, E
protected function hasAuthor() {
// Check for field named uid, but only in case the entity implements the
// EntityOwnerInterface. This helps to exclude cases, where the uid is
// defined as field name, but is not meant to be an owner field e.g. the
// User entity.
// defined as field name, but is not meant to be an owner field; for
// instance, the User entity.
return $this->entityType->isSubclassOf('\Drupal\user\EntityOwnerInterface') && $this->checkFieldStorageDefinitionTranslatability('uid');
}
@ -550,7 +550,7 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface, E
// Update #title attribute for all elements that are allowed to have a
// #title attribute according to the Form API Reference. The reason for this
// check is because some elements have a #title attribute even though it is
// not rendered, e.g. field containers.
// not rendered; for instance, field containers.
if (isset($element['#type']) && isset($fapi_title_elements[$element['#type']]) && isset($element['#title'])) {
$element['#title'] .= $suffix;
}

View File

@ -33,9 +33,9 @@ abstract class FileManagedTestBase extends WebTestBase {
* Assert that all of the specified hook_file_* hooks were called once, other
* values result in failure.
*
* @param array $expected
* Array with string containing with the hook name, e.g. 'load', 'save',
* 'insert', etc.
* @param string[] $expected
* An array of strings containing with the hook name; for example, 'load',
* 'save', 'insert', etc.
*/
function assertFileHooksCalled($expected) {
\Drupal::state()->resetCache();
@ -66,7 +66,7 @@ abstract class FileManagedTestBase extends WebTestBase {
* Assert that a hook_file_* hook was called a certain number of times.
*
* @param string $hook
* String with the hook name, e.g. 'load', 'save', 'insert', etc.
* String with the hook name; for instance, 'load', 'save', 'insert', etc.
* @param int $expected_count
* Optional integer count.
* @param string|NULL $message