diff --git a/composer.lock b/composer.lock
index 32535367b..a406a5d05 100644
--- a/composer.lock
+++ b/composer.lock
@@ -2627,23 +2627,23 @@
},
{
"name": "jcalderonzumba/mink-phantomjs-driver",
- "version": "dev-master",
+ "version": "v0.3.1",
"source": {
"type": "git",
"url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git",
- "reference": "10d7c48c9a4129463052321b52450d98983c4332"
+ "reference": "782892dbea4af7d04024374672b3790b6c008def"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/10d7c48c9a4129463052321b52450d98983c4332",
- "reference": "10d7c48c9a4129463052321b52450d98983c4332",
+ "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/782892dbea4af7d04024374672b3790b6c008def",
+ "reference": "782892dbea4af7d04024374672b3790b6c008def",
"shasum": ""
},
"require": {
"behat/mink": "~1.6",
"jcalderonzumba/gastonjs": "~1.0",
"php": ">=5.4",
- "twig/twig": "~1.8"
+ "twig/twig": "~1.20|~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.6",
@@ -2684,7 +2684,7 @@
"phantomjs",
"testing"
],
- "time": "2015-10-05 18:24:44"
+ "time": "2015-12-04 13:55:02"
},
{
"name": "mikey179/vfsStream",
@@ -3740,39 +3740,7 @@
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
- "php": 0,
- "symfony/class-loader": 0,
- "symfony/console": 0,
- "symfony/dependency-injection": 0,
- "symfony/event-dispatcher": 0,
- "symfony/http-foundation": 0,
- "symfony/http-kernel": 0,
- "symfony/routing": 0,
- "symfony/serializer": 0,
- "symfony/translation": 0,
- "symfony/validator": 0,
- "symfony/process": 0,
- "symfony/yaml": 0,
- "twig/twig": 0,
- "doctrine/common": 0,
- "doctrine/annotations": 0,
- "guzzlehttp/guzzle": 0,
- "symfony-cmf/routing": 0,
- "easyrdf/easyrdf": 0,
- "zendframework/zend-feed": 0,
- "stack/builder": 0,
- "egulias/email-validator": 0,
- "masterminds/html5": 0,
- "symfony/psr-http-message-bridge": 0,
- "zendframework/zend-diactoros": 0,
- "composer/semver": 0,
- "behat/mink": 0,
- "behat/mink-goutte-driver": 0,
- "jcalderonzumba/gastonjs": 20,
- "jcalderonzumba/mink-phantomjs-driver": 20,
- "mikey179/vfsstream": 0,
- "phpunit/phpunit": 0,
- "symfony/css-selector": 0
+ "jcalderonzumba/gastonjs": 20
},
"prefer-stable": true,
"prefer-lowest": false,
diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt
index 6b8e812d5..01a3dd484 100644
--- a/core/CHANGELOG.txt
+++ b/core/CHANGELOG.txt
@@ -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.
diff --git a/core/MAINTAINERS.txt b/core/MAINTAINERS.txt
index 1fa3118a6..18556e33e 100644
--- a/core/MAINTAINERS.txt
+++ b/core/MAINTAINERS.txt
@@ -87,7 +87,6 @@ Cron system
CSS
- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin
-- Lewis Nyman 'LewisNyman' https://www.drupal.org/u/lewisnyman
Database system
- Larry Garfield 'Crell' https://www.drupal.org/u/crell
@@ -486,7 +485,10 @@ Classy theme
- Morten Birch Heide-Jørgensen 'mortendk' https://www.drupal.org/u/mortendk
Seven theme
-- Lewis Nyman 'LewisNyman' https://www.drupal.org/u/lewisnyman
+- ?
+
+Stable theme
+- Scott Reeves 'Cottser' https://www.drupal.org/u/cottser
Stark theme
- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin
diff --git a/core/composer.json b/core/composer.json
index afb170ad5..1eabf49ea 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -35,7 +35,7 @@
"behat/mink": "~1.6",
"behat/mink-goutte-driver": "~1.2",
"jcalderonzumba/gastonjs": "^1.1@dev",
- "jcalderonzumba/mink-phantomjs-driver": "dev-master#10d7c48c9a4129463052321b52450d98983c4332",
+ "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsStream": "~1.2",
"phpunit/phpunit": "~4.8",
"symfony/css-selector": "2.7.*"
diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml
index 3edb8057a..4ab0fd769 100644
--- a/core/config/schema/core.data_types.schema.yml
+++ b/core/config/schema/core.data_types.schema.yml
@@ -87,12 +87,22 @@ color_hex:
# Complex extended data types:
# Root of a configuration object.
+
+_core_config_info:
+ type: mapping
+ mapping:
+ default_config_hash:
+ type: string
+ label: 'Default configuration hash'
+
config_object:
type: mapping
mapping:
langcode:
type: string
label: 'Language code'
+ _core:
+ type: _core_config_info
# Mail text with subject and body parts.
mail:
@@ -281,6 +291,8 @@ config_entity:
label: 'Third party settings'
sequence:
type: '[%parent.%parent.%type].third_party.[%key]'
+ _core:
+ type: _core_config_info
block_settings:
type: mapping
diff --git a/core/core.api.php b/core/core.api.php
index 962a0c010..ef04faf2d 100644
--- a/core/core.api.php
+++ b/core/core.api.php
@@ -344,7 +344,7 @@
* Configuration entity classes expose dependencies by overriding the
* \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies()
* method.
- * - On routes for paths staring with '/admin' or otherwise designated as
+ * - On routes for paths starting with '/admin' or otherwise designated as
* administration paths (such as node editing when it is set as an admin
* operation), if they have configuration entity placeholders, configuration
* entities are normally loaded in their original language, without
@@ -567,7 +567,7 @@
*
* By default cached data is stored in the database. This can be configured
* though so that all cached data, or that of an individual cache bin, uses a
- * different cache backend, such as APC or Memcache, for storage.
+ * different cache backend, such as APCu or Memcache, for storage.
*
* In a settings.php file, you can override the service used for a particular
* cache bin. For example, if your service implementation of
@@ -692,7 +692,7 @@
* "service" (such as accessing the database, sending email, or translating user
* interface text) is defined (given a name and an interface or at least a
* class that defines the methods that may be called), and a default class is
- * defined to provide the service. These two steps must be done together, and
+ * designated to provide the service. These two steps must be done together, and
* can be done by Drupal Core or a module. Other modules can then define
* alternative classes to provide the same services, overriding the default
* classes. Classes and functions that need to use the service should always
@@ -843,6 +843,32 @@
* @}
*/
+/**
+ * @defgroup listing_page_service Page header for Services page
+ * @{
+ * Introduction to services
+ *
+ * A "service" (such as accessing the database, sending email, or translating
+ * user interface text) can be defined by a module or Drupal core. Defining a
+ * service means giving it a name and designating a default class to provide the
+ * service; ideally, there should also be an interface that defines the methods
+ * that may be called. Services are collected into the Dependency Injection
+ * Container, and can be overridden to use different classes or different
+ * instantiation by modules. See the
+ * @link container Services and Dependency Injection Container topic @endlink
+ * for details.
+ *
+ * Some services have tags, which are defined in the service definition. Tags
+ * are used to define a group of related services, or to specify some aspect of
+ * how the service behaves. See the
+ * @link service_tag Service Tags topic @endlink for more information.
+ *
+ * @see container
+ * @see service_tag
+ *
+ * @}
+ */
+
/**
* @defgroup typed_data Typed Data API
* @{
@@ -1441,6 +1467,38 @@
* @}
*/
+/**
+ * @defgroup listing_page_class Page header for Classes page
+ * @{
+ * Introduction to classes
+ *
+ * A lot of the PHP code in Drupal is object oriented (OO), making use of
+ * @link http://php.net/manual/language.oop5.php PHP classes, interfaces, and traits. @endlink
+ * See the
+ * @link oo_conventions Objected-oriented programming conventions @endlink
+ * for more information.
+ *
+ * @see oo_conventions
+ *
+ * @}
+ */
+
+/**
+ * @defgroup listing_page_namespace Page header for Namespaces page
+ * @{
+ * Introduction to namespaces
+ *
+ * PHP classes, interfaces, and traits in Drupal are
+ * @link http://php.net/manual/en/language.namespaces.rationale.php namespaced. @endlink
+ * See the
+ * @link oo_conventions Objected-oriented programming conventions @endlink
+ * for more information.
+ *
+ * @see oo_conventions
+ *
+ * @}
+ */
+
/**
* @defgroup best_practices Best practices for developers
* @{
@@ -1667,16 +1725,13 @@
* _form: '\Drupal\mymodule\Form\ExampleForm'
* @endcode
*
- * The $form argument to form-related functions is a structured array containing
- * the elements and properties of the form. For information on the array
- * components and format, and more detailed explanations of the Form API
- * workflow, see the
- * @link forms_api_reference.html Form API reference @endlink
- * and the
+ * The $form argument to form-related functions is a specialized render array
+ * containing the elements and properties of the form. For more about render
+ * arrays, see the @link theme_render Render API topic. @endlink For more
+ * detailed explanations of the Form API workflow, see the
* @link https://www.drupal.org/node/2117411 Form API documentation section. @endlink
- * In addition, there is a set of Form API tutorials in
- * @link form_example_tutorial.inc the Form Example Tutorial @endlink which
- * provide basics all the way up through multistep forms.
+ * In addition, there is a set of Form API tutorials in the
+ * @link https://www.drupal.org/project/examples Examples for Developers project. @endlink
*
* In the form builder, validation, submission, and other form methods,
* $form_state is the primary influence on the processing of the form and is
diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 6d0c8356c..a4b5378df 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -203,7 +203,7 @@ function _batch_progress_page() {
* exceeded. It will continue with the next operation of the same batch set in
* the next request.
*
- * @return
+ * @return array
* An array containing a completion value (in percent) and a status message.
*/
function _batch_process() {
@@ -337,15 +337,15 @@ function _batch_process() {
/**
* Formats the percent completion for a batch set.
*
- * @param $total
+ * @param int $total
* The total number of operations.
- * @param $current
+ * @param int|float $current
* The number of the current operation. This may be a floating point number
* rather than an integer in the case of a multi-step operation that is not
* yet complete; in that case, the fractional part of $current represents the
* fraction of the operation that has been completed.
*
- * @return
+ * @return string
* The properly formatted percentage, as a string. We output percentages
* using the correct number of decimal places so that we never print "100%"
* until we are finished, but we also never print more decimal places than
@@ -372,8 +372,9 @@ function &_batch_current_set() {
* process and execute its form submit handler (if defined), which may add
* further sets to this batch.
*
- * @return
- * TRUE if a subsequent set was found in the batch.
+ * @return true|null
+ * TRUE if a subsequent set was found in the batch; no value will be returned
+ * if no subsequent set was found.
*/
function _batch_next_set() {
$batch = &batch_get();
diff --git a/core/includes/database.inc b/core/includes/database.inc
index 477e8437a..ff03885a2 100644
--- a/core/includes/database.inc
+++ b/core/includes/database.inc
@@ -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()
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 5da67fb07..769e34cf5 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -727,7 +727,8 @@ function template_preprocess_links(&$variables) {
* to an empty string, but can be set to NULL for the attribute to be
* omitted. Usually, neither omission nor an empty string satisfies
* accessibility requirements, so it is strongly encouraged for code
- * calling _theme('image') to pass a meaningful value for this variable.
+ * building variables for image.html.twig templates to pass a meaningful
+ * value for this variable.
* - http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.8
* - http://www.w3.org/TR/xhtml1/dtds.html
* - http://dev.w3.org/html5/spec/Overview.html#alt
@@ -1519,7 +1520,7 @@ function template_preprocess_field(&$variables, $hook) {
}
// Merge attributes when a single-value field has a hidden label.
- if ($element['#label_display'] == 'hidden' && !$variables['multiple']) {
+ if ($element['#label_display'] == 'hidden' && !$variables['multiple'] && !empty($element['#items'][0]->_attributes)) {
$variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], (array) $element['#items'][0]->_attributes);
}
@@ -1721,11 +1722,12 @@ function drupal_common_theme() {
'image' => array(
// HTML 4 and XHTML 1.0 always require an alt attribute. The HTML 5 draft
// allows the alt attribute to be omitted in some cases. Therefore,
- // default the alt attribute to an empty string, but allow code calling
- // _theme('image') to pass explicit NULL for it to be omitted. Usually,
- // neither omission nor an empty string satisfies accessibility
- // requirements, so it is strongly encouraged for code calling
- // _theme('image') to pass a meaningful value for the alt variable.
+ // default the alt attribute to an empty string, but allow code providing
+ // variables to image.html.twig templates to pass explicit NULL for it to
+ // be omitted. Usually, neither omission nor an empty string satisfies
+ // accessibility requirements, so it is strongly encouraged for code
+ // building variables for image.html.twig templates to pass a meaningful
+ // value for the alt variable.
// - http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.8
// - http://www.w3.org/TR/xhtml1/dtds.html
// - http://dev.w3.org/html5/spec/Overview.html#alt
@@ -1765,7 +1767,7 @@ function drupal_common_theme() {
'render element' => 'page',
),
'maintenance_task_list' => array(
- 'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
+ 'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
),
'authorize_report' => array(
'variables' => ['messages' => [], 'attributes' => []],
diff --git a/core/install.php b/core/install.php
index 5940fbebe..b70cec530 100644
--- a/core/install.php
+++ b/core/install.php
@@ -26,6 +26,11 @@ if (version_compare(PHP_VERSION, '5.5.9') < 0) {
exit;
}
+if (function_exists('opcache_get_status') && opcache_get_status()['opcache_enabled'] && !ini_get('opcache.save_comments')) {
+ print 'Systems with OPcache installed must have opcache.save_comments enabled.';
+ exit();
+}
+
// Start the installer.
$class_loader = require_once 'autoload.php';
require_once __DIR__ . '/includes/install.core.inc';
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index b955142c7..8a7ddb0e1 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -63,8 +63,8 @@ use Drupal\Core\Url;
* class StuffDoingClass implements StuffDoingInterface {
* protected $lockBackend;
*
- * public function __construct(LockBackendInterface $lockBackend) {
- * $this->lockBackend = $lockBackend;
+ * public function __construct(LockBackendInterface $lock_backend) {
+ * $this->lockBackend = $lock_backend;
* }
*
* public function doStuff() {
@@ -81,7 +81,7 @@ class Drupal {
/**
* The current system version.
*/
- const VERSION = '8.0.1';
+ const VERSION = '8.0.2';
/**
* Core API compatibility.
@@ -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.
diff --git a/core/lib/Drupal/Component/FileCache/ApcuFileCacheBackend.php b/core/lib/Drupal/Component/FileCache/ApcuFileCacheBackend.php
index 25b609750..b82e1acfe 100644
--- a/core/lib/Drupal/Component/FileCache/ApcuFileCacheBackend.php
+++ b/core/lib/Drupal/Component/FileCache/ApcuFileCacheBackend.php
@@ -16,21 +16,21 @@ class ApcuFileCacheBackend implements FileCacheBackendInterface {
* {@inheritdoc}
*/
public function fetch(array $cids) {
- return apc_fetch($cids);
+ return apcu_fetch($cids);
}
/**
* {@inheritdoc}
*/
public function store($cid, $data) {
- apc_store($cid, $data);
+ apcu_store($cid, $data);
}
/**
* {@inheritdoc}
*/
public function delete($cid) {
- apc_delete($cid);
+ apcu_delete($cid);
}
}
diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php
index aa8ea201e..ebd366ffb 100644
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php
+++ b/core/lib/Drupal/Component/Gettext/PoHeader.php
@@ -471,10 +471,10 @@ class PoHeader {
*
* @param array $element_stack
* Array of plural formula values and operators create by parseArithmetic().
- * @param integer $n
+ * @param int $n
* The @count number for which we are determining the right plural position.
*
- * @return integer
+ * @return int
* Number of the plural string to be used for the given plural value.
*
* @see parseArithmetic()
diff --git a/core/lib/Drupal/Component/Utility/Number.php b/core/lib/Drupal/Component/Utility/Number.php
index 453ed4aba..99bedc873 100644
--- a/core/lib/Drupal/Component/Utility/Number.php
+++ b/core/lib/Drupal/Component/Utility/Number.php
@@ -21,11 +21,11 @@ class Number {
*
* This is based on the number/range verification methods of webkit.
*
- * @param numeric $value
+ * @param float $value
* The value that needs to be checked.
- * @param numeric $step
+ * @param float $step
* The step scale factor. Must be positive.
- * @param numeric $offset
+ * @param float $offset
* (optional) An offset, to which the difference must be a multiple of the
* given step.
*
diff --git a/core/lib/Drupal/Component/Utility/OpCodeCache.php b/core/lib/Drupal/Component/Utility/OpCodeCache.php
index 90b28e7ec..576f3bd03 100644
--- a/core/lib/Drupal/Component/Utility/OpCodeCache.php
+++ b/core/lib/Drupal/Component/Utility/OpCodeCache.php
@@ -30,16 +30,6 @@ class OpCodeCache {
if (function_exists('opcache_invalidate')) {
opcache_invalidate($pathname, TRUE);
}
- // If apcu extension is enabled in PHP 5.5 or greater it emulates apc.
- // This is to provide an easy upgrade path if you are using apc's user
- // caching however the emulation does not extend to opcode caching.
- // Therefore we need to check if the function exists as well.
- if (extension_loaded('apc') && function_exists('apc_delete_file')) {
- // apc_delete_file() throws a PHP warning in case the specified file was
- // not compiled yet.
- // @see http://php.net/manual/en/function.apc-delete-file.php
- @apc_delete_file($pathname);
- }
}
}
diff --git a/core/lib/Drupal/Component/Utility/UrlHelper.php b/core/lib/Drupal/Component/Utility/UrlHelper.php
index 1763c2361..9166b34a5 100644
--- a/core/lib/Drupal/Component/Utility/UrlHelper.php
+++ b/core/lib/Drupal/Component/Utility/UrlHelper.php
@@ -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.
*
diff --git a/core/lib/Drupal/Core/Access/CustomAccessCheck.php b/core/lib/Drupal/Core/Access/CustomAccessCheck.php
index fb2ccddb4..3722d2328 100644
--- a/core/lib/Drupal/Core/Access/CustomAccessCheck.php
+++ b/core/lib/Drupal/Core/Access/CustomAccessCheck.php
@@ -55,6 +55,8 @@ class CustomAccessCheck implements RoutingAccessInterface {
/**
* Checks access for the account and route using the custom access checker.
*
+ * @param \Symfony\Component\Routing\Route $route
+ * The route.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match object to be checked.
* @param \Drupal\Core\Session\AccountInterface $account
diff --git a/core/lib/Drupal/Core/Annotation/QueueWorker.php b/core/lib/Drupal/Core/Annotation/QueueWorker.php
index 85a2296fd..89150c5d2 100644
--- a/core/lib/Drupal/Core/Annotation/QueueWorker.php
+++ b/core/lib/Drupal/Core/Annotation/QueueWorker.php
@@ -10,18 +10,21 @@ namespace Drupal\Core\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
- * Declare queue workers that need to be run periodically.
+ * Declare a worker class for processing a queue item.
*
- * While there can be only one hook_cron() process running at the same time,
- * there can be any number of processes defined here running. Because of
- * this, long running tasks are much better suited for this API. Items queued
- * in hook_cron() might be processed in the same cron run if there are not many
- * items in the queue, otherwise it might take several requests, which can be
- * run in parallel.
+ * Worker plugins are used by some queues for processing the individual items
+ * in the queue. In that case, the ID of the worker plugin needs to match the
+ * machine name of a queue, so that you can retrieve the queue back end by
+ * calling \Drupal\Core\Queue\QueueFactory::get($plugin_id).
*
- * You can create queues, add items to them, claim them, etc. without using a
- * QueueWorker plugin if you want, however, you need to take care of processing
- * the items in the queue in that case. See \Drupal\Core\Cron for an example.
+ * \Drupal\Core\Cron::processQueues() processes queues that use workers; they
+ * can also be processed outside of the cron process.
+ *
+ * Some queues do not use worker plugins: you can create queues, add items to
+ * them, claim them, etc. without using a QueueWorker plugin. However, you will
+ * need to take care of processing the items in the queue in that case. You can
+ * look at \Drupal\Core\Cron::processQueues() for an example of how to process
+ * a queue that uses workers, and adapt it to your queue.
*
* Plugin Namespace: Plugin\QueueWorker
*
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
index a4ec33615..a5a0ad3a8 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
@@ -51,14 +51,14 @@ class LibraryDiscoveryCollector extends CacheCollector {
/**
* Constructs a CacheCollector object.
*
- * @param string $cid
- * The cid for the array being cached.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache
* The cache backend.
* @param \Drupal\Core\Lock\LockBackendInterface $lock
* The lock backend.
* @param \Drupal\Core\Asset\LibraryDiscoveryParser $discovery_parser
* The library discovery parser.
+ * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
+ * The theme manager.
*/
public function __construct(CacheBackendInterface $cache, LockBackendInterface $lock, LibraryDiscoveryParser $discovery_parser, ThemeManagerInterface $theme_manager) {
$this->themeManager = $theme_manager;
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
index 9d6e796e9..f25b7b03b 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
@@ -50,6 +50,8 @@ class LibraryDiscoveryParser {
* The app root.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
+ * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
+ * The theme manager.
*/
public function __construct($root, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager) {
$this->root = $root;
diff --git a/core/lib/Drupal/Core/Authentication/AuthenticationProviderFilterInterface.php b/core/lib/Drupal/Core/Authentication/AuthenticationProviderFilterInterface.php
index 99f8e1050..002d5204b 100644
--- a/core/lib/Drupal/Core/Authentication/AuthenticationProviderFilterInterface.php
+++ b/core/lib/Drupal/Core/Authentication/AuthenticationProviderFilterInterface.php
@@ -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 {
diff --git a/core/lib/Drupal/Core/Cache/Apcu4Backend.php b/core/lib/Drupal/Core/Cache/Apcu4Backend.php
new file mode 100644
index 000000000..537d5848e
--- /dev/null
+++ b/core/lib/Drupal/Core/Cache/Apcu4Backend.php
@@ -0,0 +1,26 @@
+= 4.0.0 and < 5.0.0.
+ */
+class Apcu4Backend extends ApcuBackend {
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return \APCIterator
+ */
+ protected function getIterator($search = NULL, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE) {
+ return new \APCIterator('user', $search, $format, $chunk_size, $list);
+ }
+
+}
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php
index b64fd7177..4d7a4d765 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackend.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php
@@ -60,7 +60,7 @@ class ApcuBackend implements CacheBackendInterface {
}
/**
- * Prepends the APC user variable prefix for this bin to a cache item ID.
+ * Prepends the APCu user variable prefix for this bin to a cache item ID.
*
* @param string $cid
* The cache item ID to prefix.
@@ -76,7 +76,7 @@ class ApcuBackend implements CacheBackendInterface {
* {@inheritdoc}
*/
public function get($cid, $allow_invalid = FALSE) {
- $cache = apc_fetch($this->getApcuKey($cid));
+ $cache = apcu_fetch($this->getApcuKey($cid));
return $this->prepareItem($cache, $allow_invalid);
}
@@ -90,7 +90,7 @@ class ApcuBackend implements CacheBackendInterface {
$map[$this->getApcuKey($cid)] = $cid;
}
- $result = apc_fetch(array_keys($map));
+ $result = apcu_fetch(array_keys($map));
$cache = array();
if ($result) {
foreach ($result as $key => $item) {
@@ -112,18 +112,18 @@ class ApcuBackend implements CacheBackendInterface {
* APCu is a memory cache, shared across all server processes. To prevent
* cache item clashes with other applications/installations, every cache item
* is prefixed with a unique string for this site. Therefore, functions like
- * apc_clear_cache() cannot be used, and instead, a list of all cache items
+ * apcu_clear_cache() cannot be used, and instead, a list of all cache items
* belonging to this application need to be retrieved through this method
* instead.
*
* @param string $prefix
* (optional) A cache ID prefix to limit the result to.
*
- * @return \APCIterator
- * An APCIterator containing matched items.
+ * @return \APCUIterator
+ * An APCUIterator containing matched items.
*/
protected function getAll($prefix = '') {
- return new \APCIterator('user', '/^' . preg_quote($this->getApcuKey($prefix), '/') . '/');
+ return $this->getIterator('/^' . preg_quote($this->getApcuKey($prefix), '/') . '/');
}
/**
@@ -174,12 +174,12 @@ class ApcuBackend implements CacheBackendInterface {
$cache->expire = $expire;
$cache->tags = implode(' ', $tags);
$cache->checksum = $this->checksumProvider->getCurrentChecksum($tags);
- // APC serializes/unserializes any structure itself.
+ // APCu serializes/unserializes any structure itself.
$cache->serialized = 0;
$cache->data = $data;
// Expiration is handled by our own prepareItem(), not APCu.
- apc_store($this->getApcuKey($cid), $cache);
+ apcu_store($this->getApcuKey($cid), $cache);
}
/**
@@ -195,35 +195,35 @@ class ApcuBackend implements CacheBackendInterface {
* {@inheritdoc}
*/
public function delete($cid) {
- apc_delete($this->getApcuKey($cid));
+ apcu_delete($this->getApcuKey($cid));
}
/**
* {@inheritdoc}
*/
public function deleteMultiple(array $cids) {
- apc_delete(array_map(array($this, 'getApcuKey'), $cids));
+ apcu_delete(array_map(array($this, 'getApcuKey'), $cids));
}
/**
* {@inheritdoc}
*/
public function deleteAll() {
- apc_delete(new \APCIterator('user', '/^' . preg_quote($this->binPrefix, '/') . '/'));
+ apcu_delete($this->getIterator('/^' . preg_quote($this->binPrefix, '/') . '/'));
}
/**
* {@inheritdoc}
*/
public function garbageCollection() {
- // APC performs garbage collection automatically.
+ // APCu performs garbage collection automatically.
}
/**
* {@inheritdoc}
*/
public function removeBin() {
- apc_delete(new \APCIterator('user', '/^' . preg_quote($this->binPrefix, '/') . '/'));
+ apcu_delete($this->getIterator('/^' . preg_quote($this->binPrefix, '/') . '/'));
}
/**
@@ -252,4 +252,25 @@ class ApcuBackend implements CacheBackendInterface {
}
}
+ /**
+ * Instantiates and returns the APCUIterator class.
+ *
+ * @param mixed $search
+ * A PCRE regular expression that matches against APC key names, either as a
+ * string for a single regular expression, or as an array of regular
+ * expressions. Or, optionally pass in NULL to skip the search.
+ * @param int $format
+ * The desired format, as configured with one or more of the APC_ITER_*
+ * constants.
+ * @param int $chunk_size
+ * The chunk size. Must be a value greater than 0. The default value is 100.
+ * @param int $list
+ * The type to list. Either pass in APC_LIST_ACTIVE or APC_LIST_DELETED.
+ *
+ * @return \APCUIterator
+ */
+ protected function getIterator($search = NULL, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE) {
+ return new \APCUIterator($search, $format, $chunk_size, $list);
+ }
+
}
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
index f744edc25..dae24dcfa 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
@@ -25,6 +25,13 @@ class ApcuBackendFactory implements CacheFactoryInterface {
*/
protected $checksumProvider;
+ /**
+ * The APCU backend class to use.
+ *
+ * @var string
+ */
+ protected $backendClass;
+
/**
* Constructs an ApcuBackendFactory object.
*
@@ -38,6 +45,12 @@ class ApcuBackendFactory implements CacheFactoryInterface {
public function __construct($root, $site_path, CacheTagsChecksumInterface $checksum_provider) {
$this->sitePrefix = Settings::getApcuPrefix('apcu_backend', $root, $site_path);
$this->checksumProvider = $checksum_provider;
+ if (version_compare(phpversion('apcu'), '5.0.0', '>=')) {
+ $this->backendClass = 'Drupal\Core\Cache\ApcuBackend';
+ }
+ else {
+ $this->backendClass = 'Drupal\Core\Cache\Apcu4Backend';
+ }
}
/**
@@ -50,7 +63,7 @@ class ApcuBackendFactory implements CacheFactoryInterface {
* The cache backend object for the specified cache bin.
*/
public function get($bin) {
- return new ApcuBackend($bin, $this->sitePrefix, $this->checksumProvider);
+ return new $this->backendClass($bin, $this->sitePrefix, $this->checksumProvider);
}
}
diff --git a/core/lib/Drupal/Core/Cache/CacheFactory.php b/core/lib/Drupal/Core/Cache/CacheFactory.php
index a8a5c41ea..a5acf7c84 100644
--- a/core/lib/Drupal/Core/Cache/CacheFactory.php
+++ b/core/lib/Drupal/Core/Cache/CacheFactory.php
@@ -14,7 +14,7 @@ use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
-class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
+class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
use ContainerAwareTrait;
diff --git a/core/lib/Drupal/Core/Cache/CacheableResponseInterface.php b/core/lib/Drupal/Core/Cache/CacheableResponseInterface.php
index 0bca8d1fc..c43085e1f 100644
--- a/core/lib/Drupal/Core/Cache/CacheableResponseInterface.php
+++ b/core/lib/Drupal/Core/Cache/CacheableResponseInterface.php
@@ -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,
diff --git a/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php
index bba9d9409..ca38ca0be 100644
--- a/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php
@@ -53,7 +53,7 @@ class ChainedFastBackendFactory implements CacheFactoryInterface {
}
// Default the fast backend to APCu if it's available.
- if (!isset($fast_service_name) && function_exists('apc_fetch')) {
+ if (!isset($fast_service_name) && function_exists('apcu_fetch')) {
$fast_service_name = 'cache.backend.apcu';
}
diff --git a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
index 81d67350a..c8752716c 100644
--- a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
+++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
@@ -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']
diff --git a/core/lib/Drupal/Core/Condition/ConditionManager.php b/core/lib/Drupal/Core/Condition/ConditionManager.php
index 96cc00e0a..a351c7029 100644
--- a/core/lib/Drupal/Core/Condition/ConditionManager.php
+++ b/core/lib/Drupal/Core/Condition/ConditionManager.php
@@ -49,7 +49,7 @@ class ConditionManager extends DefaultPluginManager implements ExecutableManager
}
/**
- * Override of Drupal\Component\Plugin\PluginManagerBase::createInstance().
+ * {@inheritdoc}
*/
public function createInstance($plugin_id, array $configuration = array()) {
$plugin = $this->getFactory()->createInstance($plugin_id, $configuration);
diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php
index ae12c9186..a77bb1c2f 100644
--- a/core/lib/Drupal/Core/Config/ConfigInstaller.php
+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -7,6 +7,7 @@
namespace Drupal\Core\Config;
+use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\ConfigDependencyManager;
use Drupal\Core\Config\Entity\ConfigEntityDependency;
@@ -279,6 +280,12 @@ class ConfigInstaller implements ConfigInstallerInterface {
}
if ($config_to_create[$name] !== FALSE) {
$new_config->setData($config_to_create[$name]);
+ // Add a hash to configuration created through the installer so it is
+ // possible to know if the configuration was created by installing an
+ // extension and to track which version of the default config was used.
+ if (!$this->isSyncing() && $collection == StorageInterface::DEFAULT_COLLECTION) {
+ $new_config->set('_core.default_config_hash', Crypt::hashBase64(serialize($config_to_create[$name])));
+ }
}
if ($collection == StorageInterface::DEFAULT_COLLECTION && $entity_type = $this->configManager->getEntityTypeIdByName($name)) {
// If we are syncing do not create configuration entities. Pluggable
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
index bb396e6d4..8c0c376c8 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
@@ -103,6 +103,17 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
*/
protected $third_party_settings = array();
+ /**
+ * Information maintained by Drupal core about configuration.
+ *
+ * Keys:
+ * - default_config_hash: A hash calculated by the config.installer service
+ * and added during installation.
+ *
+ * @var array
+ */
+ protected $_core = [];
+
/**
* Trust supplied data and not use configuration schema on save.
*
@@ -296,6 +307,9 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
if (empty($this->third_party_settings)) {
unset($properties['third_party_settings']);
}
+ if (empty($this->_core)) {
+ unset($properties['_core']);
+ }
return $properties;
}
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php
index 8e27aef73..47a8f308a 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php
@@ -54,6 +54,7 @@ abstract class ConfigEntityBundleBase extends ConfigEntityBase {
}
// Entity bundle field definitions may depend on bundle settings.
$entity_manager->clearCachedFieldDefinitions();
+ $entity_manager->clearCachedBundles();
}
}
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php
index 55c119323..10b8142be 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php
@@ -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.
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
index 527a336f3..785b31454 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
@@ -157,6 +157,7 @@ class ConfigEntityType extends EntityType implements ConfigEntityTypeInterface {
'status' => 'status',
'dependencies' => 'dependencies',
'third_party_settings' => 'third_party_settings',
+ '_core' => '_core',
];
foreach ($this->config_export as $property => $name) {
if (is_numeric($property)) {
diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php
index a1d967d06..ca96bd77a 100644
--- a/core/lib/Drupal/Core/Config/InstallStorage.php
+++ b/core/lib/Drupal/Core/Config/InstallStorage.php
@@ -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();
diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php
index 101c3bcff..82e8bd57d 100644
--- a/core/lib/Drupal/Core/CoreServiceProvider.php
+++ b/core/lib/Drupal/Core/CoreServiceProvider.php
@@ -105,8 +105,8 @@ class CoreServiceProvider implements ServiceProviderInterface {
/**
* Determines and registers the UUID service.
*
- * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
- * The container.
+ * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
+ * The container builder.
*
* @return string
* Class name for the UUID service.
@@ -131,6 +131,9 @@ class CoreServiceProvider implements ServiceProviderInterface {
/**
* Registers services and event subscribers for a site under test.
+ *
+ * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
+ * The container builder.
*/
protected function registerTest(ContainerBuilder $container) {
// Do nothing if we are not in a test environment.
diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index 03335773c..2aa63151a 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -90,7 +90,7 @@ abstract class Connection {
/**
* An index used to generate unique temporary table names.
*
- * @var integer
+ * @var int
*/
protected $temporaryNameIndex = 0;
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
index c59e2e43e..d12788f10 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -39,7 +39,7 @@ class Schema extends DatabaseSchema {
* Value will usually be set to a 63 chars limit but PostgreSQL allows
* to higher this value before compiling, so we need to check for that.
*
- * @var integer
+ * @var int
*/
protected $maxIdentifierLength;
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 278826e0f..06938a49b 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -428,7 +428,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
];
// @todo Use extension_loaded('apcu') for non-testbot
// https://www.drupal.org/node/2447753.
- if (function_exists('apc_fetch')) {
+ if (function_exists('apcu_fetch')) {
$configuration['default']['cache_backend_class'] = '\Drupal\Component\FileCache\ApcuFileCacheBackend';
}
}
@@ -968,11 +968,11 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
}
}
- // If the class loader is still the same, possibly upgrade to the APC class
+ // If the class loader is still the same, possibly upgrade to the APCu class
// loader.
if ($class_loader_class == get_class($this->classLoader)
&& Settings::get('class_loader_auto_detect', TRUE)
- && function_exists('apc_fetch')) {
+ && function_exists('apcu_fetch')) {
$prefix = Settings::getApcuPrefix('class_loader', $this->root);
$apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $this->classLoader);
$this->classLoader->unregister();
@@ -1307,7 +1307,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
*
* @return array
* Array where each key is a module name, and each value is a path to the
- * respective *.module or *.profile file.
+ * respective *.info.yml file.
*/
protected function getModuleFileNames() {
$filenames = array();
@@ -1324,7 +1324,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
*
* @param string[] $module_file_names
* Array where each key is a module name, and each value is a path to the
- * respective *.module or *.profile file.
+ * respective *.info.yml file.
*
* @return string[]
* Array where each key is a module namespace like 'Drupal\system', and each
diff --git a/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php b/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
index 4c7524bc1..658b426ca 100644
--- a/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
+++ b/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
@@ -6,15 +6,14 @@
*/
namespace Drupal\Core\Entity\Annotation;
+
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Defines a config entity type annotation object.
*
- * Config Entity type plugins use an object-based annotation method, rather than an
- * array-type annotation method (as commonly used on other annotation types).
* The annotation properties of entity types are found on
- * \Drupal\Core\Entity\ConfigEntityType and are accessed using
+ * \Drupal\Core\Config\Entity\ConfigEntityType and are accessed using
* get/set methods defined in \Drupal\Core\Entity\EntityTypeInterface.
*
* @ingroup entity_api
diff --git a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
index 6dd6e10cf..4273a4165 100644
--- a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
+++ b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
@@ -10,6 +10,7 @@ namespace Drupal\Core\Entity\Element;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Tags;
use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface;
use Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\Textfield;
@@ -146,6 +147,7 @@ class EntityAutocomplete extends Textfield {
'handler' => $element['#selection_handler'],
'handler_settings' => $element['#selection_settings'],
);
+ /** @var /Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
$handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);
$autocreate = (bool) $element['#autocreate'] && $handler instanceof SelectionWithAutocreateInterface;
@@ -164,6 +166,7 @@ class EntityAutocomplete extends Textfield {
);
}
elseif ($autocreate) {
+ /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface $handler */
// Auto-create item. See an example of how this is handled in
// \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::presave().
$value[] = array(
@@ -211,6 +214,7 @@ class EntityAutocomplete extends Textfield {
}
foreach ($invalid_new_entities as $entity) {
+ /** @var \Drupal\Core\Entity\EntityInterface $entity */
$form_state->setError($element, t('This entity (%type: %label) cannot be referenced.', array('%type' => $element['#target_type'], '%label' => $entity->label())));
}
}
@@ -233,6 +237,8 @@ class EntityAutocomplete extends Textfield {
* The method will return an entity ID if one single entity unambuguously
* matches the incoming input, and sill assign form errors otherwise.
*
+ * @param \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler
+ * Entity reference selection plugin.
* @param string $input
* Single string from autocomplete element.
* @param array $element
@@ -243,10 +249,10 @@ class EntityAutocomplete extends Textfield {
* Whether to trigger a form error if an element from $input (eg. an entity)
* is not found.
*
- * @return integer|null
+ * @return int|null
* Value of a matching entity ID, or NULL if none.
*/
- protected static function matchEntityByTitle($handler, $input, &$element, FormStateInterface $form_state, $strict) {
+ protected static function matchEntityByTitle(SelectionInterface $handler, $input, array &$element, FormStateInterface $form_state, $strict) {
$entities_by_bundle = $handler->getReferenceableEntities($input, '=', 6);
$entities = array_reduce($entities_by_bundle, function ($flattened, $bundle_entities) {
return $flattened + $bundle_entities;
diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php
index 8164d7c1a..b49f3d48c 100644
--- a/core/lib/Drupal/Core/Entity/Entity.php
+++ b/core/lib/Drupal/Core/Entity/Entity.php
@@ -320,11 +320,6 @@ abstract class Entity implements EntityInterface {
/**
* {@inheritdoc}
- *
- * Returns a list of URI relationships supported by this entity.
- *
- * @return array
- * An array of link relationships supported by this entity.
*/
public function uriRelationships() {
return array_keys($this->linkTemplates());
@@ -497,9 +492,6 @@ abstract class Entity implements EntityInterface {
/**
* {@inheritdoc}
- *
- * @return static|null
- * The entity object or NULL if there is no entity with the given ID.
*/
public static function load($id) {
$entity_manager = \Drupal::entityManager();
@@ -508,10 +500,6 @@ abstract class Entity implements EntityInterface {
/**
* {@inheritdoc}
- *
- * @return static[]
- * An array of entity objects indexed by their IDs. Returns an empty array
- * if no matching entities are found.
*/
public static function loadMultiple(array $ids = NULL) {
$entity_manager = \Drupal::entityManager();
@@ -520,9 +508,6 @@ abstract class Entity implements EntityInterface {
/**
* {@inheritdoc}
- *
- * @return static
- * The entity object.
*/
public static function create(array $values = array()) {
$entity_manager = \Drupal::entityManager();
diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
index 6d8d7fb3b..27fda29eb 100644
--- a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
+++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
@@ -206,6 +206,7 @@ class EntityAccessControlHandler extends EntityHandlerBase implements EntityAcce
public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE) {
$account = $this->prepareUser($account);
$context += array(
+ 'entity_type_id' => $this->entityTypeId,
'langcode' => LanguageInterface::LANGCODE_DEFAULT,
);
diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php
index 62a8f4476..89b99ac97 100644
--- a/core/lib/Drupal/Core/Entity/EntityInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityInterface.php
@@ -113,7 +113,7 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
* The URL object.
*
* @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
- * Use toUrl() instead.
+ * Use \Drupal\Core\Entity\EntityInterface::toUrl() instead.
*
* @see \Drupal\Core\Entity\EntityInterface::toUrl
*/
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
index 00590a545..365fa5633 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
@@ -41,7 +41,7 @@ class EntityReference extends DataReferenceBase {
/**
* The entity ID.
*
- * @var integer|string
+ * @var int|string
*/
protected $id;
diff --git a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
index 63f8c69af..b108bb45e 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
@@ -257,7 +257,7 @@ class DefaultSelection extends PluginBase implements SelectionInterface, Selecti
$entities = $this->entityManager->getStorage($target_type)->loadMultiple($result);
foreach ($entities as $entity_id => $entity) {
$bundle = $entity->bundle();
- $options[$bundle][$entity_id] = Html::escape($entity->label());
+ $options[$bundle][$entity_id] = Html::escape($this->entityManager->getTranslationFromContext($entity)->label());
}
return $options;
diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php
index 686271d5f..d33b422be 100644
--- a/core/lib/Drupal/Core/Entity/entity.api.php
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -592,7 +592,8 @@ function hook_ENTITY_TYPE_access(\Drupal\Core\Entity\EntityInterface $entity, $o
* The account trying to access the entity.
* @param array $context
* An associative array of additional context values. By default it contains
- * language:
+ * language and the entity type ID:
+ * - entity_type_id - the entity type ID.
* - langcode - the current language code.
* @param string $entity_bundle
* The entity bundle name.
@@ -1964,7 +1965,7 @@ function hook_ENTITY_TYPE_field_values_init(\Drupal\Core\Entity\FieldableEntityI
*
* @return array
* The array structure is identical to that of the return value of
- * \Drupal\Core\Entity\EntityManagerInterface::getExtraFields().
+ * \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields().
*/
function hook_entity_extra_field_info() {
$extra = array();
diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
index 2ae21143b..46336e0a2 100644
--- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
@@ -70,7 +70,7 @@ class DefaultExceptionHtmlSubscriber extends HttpExceptionSubscriberBase {
}
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
protected function getHandledFormats() {
return ['html'];
diff --git a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
index da6327d55..0daf17675 100644
--- a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
@@ -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.
}
}
diff --git a/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
index 0aefe961c..c06adee40 100644
--- a/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
@@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
class ExceptionJsonSubscriber extends HttpExceptionSubscriberBase {
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
protected function getHandledFormats() {
return ['json'];
diff --git a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
index 17c87a34c..73b5ac055 100644
--- a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
@@ -23,7 +23,7 @@ class ExceptionTestSiteSubscriber extends HttpExceptionSubscriberBase {
}
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
protected function getHandledFormats() {
return ['html'];
diff --git a/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
index 3f095b0f1..d3ae5d340 100644
--- a/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
@@ -59,7 +59,7 @@ class Fast404ExceptionHtmlSubscriber extends HttpExceptionSubscriberBase {
}
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
protected function getHandledFormats() {
return ['html'];
diff --git a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
index c088eedb7..3d68561b9 100644
--- a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
+++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
@@ -15,6 +15,13 @@ use Symfony\Component\HttpFoundation\Request;
/**
* Discovers available extensions in the filesystem.
+ *
+ * To also discover test modules, add
+ * @code
+ * $settings['extension_discovery_scan_tests'] = TRUE;
+ * @encode
+ * to your settings.php.
+ *
*/
class ExtensionDiscovery {
@@ -134,6 +141,12 @@ class ExtensionDiscovery {
* - the site-wide directory; i.e., /
* - the site-specific directory; e.g., /sites/example.com
*
+ * To also find test modules, add
+ * @code
+ * $settings['extension_discovery_scan_tests'] = TRUE;
+ * @encode
+ * to your settings.php.
+ *
* The information is returned in an associative array, keyed by the extension
* name (without .info.yml extension). Extensions found later in the search
* will take precedence over extensions found earlier - unless they are not
diff --git a/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php b/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
index bd2923a6d..048b9e639 100644
--- a/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
+++ b/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
@@ -23,6 +23,12 @@ interface ModuleInstallerInterface {
* - Invoke hook_install() and add it to the list of installed modules.
* - Invoke hook_modules_installed().
*
+ * To install test modules add
+ * @code
+ * $settings['extension_discovery_scan_tests'] = TRUE;
+ * @encode
+ * to your settings.php.
+ *
* @param string[] $module_list
* An array of module names.
* @param bool $enable_dependencies
diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php
index c3d868428..59cfd993c 100644
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php
+++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php
@@ -19,9 +19,12 @@ class ThemeHandler implements ThemeHandlerInterface {
* Contains the features enabled for themes by default.
*
* @var array
+ *
+ * @see _system_default_theme_features()
*/
protected $defaultFeatures = array(
'favicon',
+ 'logo',
'node_user_picture',
'comment_user_picture',
'comment_user_verification',
diff --git a/core/lib/Drupal/Core/Field/FieldFilteredMarkup.php b/core/lib/Drupal/Core/Field/FieldFilteredMarkup.php
index 8dcadca69..d2c69e06d 100644
--- a/core/lib/Drupal/Core/Field/FieldFilteredMarkup.php
+++ b/core/lib/Drupal/Core/Field/FieldFilteredMarkup.php
@@ -61,7 +61,7 @@ final class FieldFilteredMarkup implements MarkupInterface, \Countable {
* A list of allowed tags.
*/
public static function allowedTags() {
- return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
+ return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
}
/**
diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php
index 2121334a7..c64a60727 100644
--- a/core/lib/Drupal/Core/Field/FieldItemList.php
+++ b/core/lib/Drupal/Core/Field/FieldItemList.php
@@ -115,7 +115,7 @@ class FieldItemList extends ItemList implements FieldItemListInterface {
* {@inheritdoc}
*/
public function setValue($values, $notify = TRUE) {
- // Support passing in only the value of the first item, either as a litteral
+ // Support passing in only the value of the first item, either as a literal
// (value of the first property) or as an array of properties.
if (isset($values) && (!is_array($values) || (!empty($values) && !is_numeric(current(array_keys($values)))))) {
$values = array(0 => $values);
diff --git a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
index 3d896b275..f99948a8f 100644
--- a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
+++ b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
@@ -156,7 +156,7 @@ class FieldTypePluginManager extends DefaultPluginManager implements FieldTypePl
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function getPluginClass($type) {
$plugin_definition = $this->getDefinition($type, FALSE);
diff --git a/core/lib/Drupal/Core/Field/FormatterPluginManager.php b/core/lib/Drupal/Core/Field/FormatterPluginManager.php
index e6054a9a9..1d6b27e45 100644
--- a/core/lib/Drupal/Core/Field/FormatterPluginManager.php
+++ b/core/lib/Drupal/Core/Field/FormatterPluginManager.php
@@ -136,7 +136,7 @@ class FormatterPluginManager extends DefaultPluginManager {
*
* @param string $field_type
* The field type.
- * @param array $properties
+ * @param array $configuration
* An array of formatter configuration.
*
* @return array
diff --git a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
index c4cfeb184..e675286f5 100644
--- a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
+++ b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
@@ -42,7 +42,7 @@ class FieldItemDeriver implements ContainerDeriverInterface {
*
* @param string $base_plugin_id
* The base plugin ID.
- * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
+ * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_plugin_manager
* The field type plugin manager.
*/
public function __construct($base_plugin_id, FieldTypePluginManagerInterface $field_type_plugin_manager) {
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 8a4a60279..c2f23cf1b 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -52,8 +52,6 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase implem
* The view mode.
* @param array $third_party_settings
* Any third party settings settings.
- * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
- * The entity manager.
* @param LoggerChannelFactoryInterface $logger_factory
* The logger factory.
*/
diff --git a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
index 14bd16b83..cd605bcd5 100644
--- a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
+++ b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
@@ -30,7 +30,7 @@ class FTPExtension extends FTP implements ChmodInterface {
* {@inheritdoc}
*/
protected function copyFileJailed($source, $destination) {
- if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
+ if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
throw new FileTransferException("Cannot move @source to @destination", NULL, array("@source" => $source, "@destination" => $destination));
}
}
diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php
index bd47f1e44..a71e342bf 100644
--- a/core/lib/Drupal/Core/Form/FormState.php
+++ b/core/lib/Drupal/Core/Form/FormState.php
@@ -212,9 +212,8 @@ class FormState implements FormStateInterface {
*
* The validation functions and submit functions use this array for nearly all
* their decision making. (Note that #tree determines whether the values are a
- * flat array or an array whose structure parallels the $form array. See the
- * @link forms_api_reference.html Form API reference @endlink for more
- * information.)
+ * flat array or an array whose structure parallels the $form array. See
+ * \Drupal\Core\Render\Element\FormElement for more information.)
*
* This property is uncacheable.
*
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index afead3d3e..26d739203 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -346,7 +346,7 @@ class FormValidator implements FormValidatorInterface {
foreach ($value as $v) {
if (!isset($options[$v])) {
$form_state->setError($elements, $this->t('An illegal choice has been detected. Please contact the site administrator.'));
- $this->logger->error('Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']));
+ $this->logger->error('Illegal choice %choice in %name element.', array('%choice' => $v, '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']));
}
}
}
diff --git a/core/lib/Drupal/Core/Form/form.api.php b/core/lib/Drupal/Core/Form/form.api.php
index b950ccb3f..adb2d34d8 100644
--- a/core/lib/Drupal/Core/Form/form.api.php
+++ b/core/lib/Drupal/Core/Form/form.api.php
@@ -53,7 +53,7 @@
* such as how many total items were processed.
*/
function callback_batch_operation($MULTIPLE_PARAMS, &$context) {
- $node_storage = $this->container->get('entity.manager')->getStorage('node');
+ $node_storage = \Drupal::entityTypeManager()->getStorage('node');
if (!isset($context['sandbox']['progress'])) {
$context['sandbox']['progress'] = 0;
@@ -194,7 +194,8 @@ function hook_ajax_render_alter(array &$data) {
*
* @see hook_form_BASE_FORM_ID_alter()
* @see hook_form_FORM_ID_alter()
- * @see forms_api_reference.html
+ *
+ * @ingroup form_api
*/
function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
@@ -237,7 +238,8 @@ function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_stat
* @see hook_form_alter()
* @see hook_form_BASE_FORM_ID_alter()
* @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
- * @see forms_api_reference.html
+ *
+ * @ingroup form_api
*/
function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// Modification for the form with the given form ID goes here. For example, if
@@ -286,6 +288,8 @@ function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $f
* @see hook_form_alter()
* @see hook_form_FORM_ID_alter()
* @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
+ *
+ * @ingroup form_api
*/
function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
diff --git a/core/lib/Drupal/Core/Image/ImageInterface.php b/core/lib/Drupal/Core/Image/ImageInterface.php
index da8496b20..2c953f53a 100644
--- a/core/lib/Drupal/Core/Image/ImageInterface.php
+++ b/core/lib/Drupal/Core/Image/ImageInterface.php
@@ -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.
diff --git a/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php
index 46fb892f8..675ca4777 100644
--- a/core/lib/Drupal/Core/Language/Language.php
+++ b/core/lib/Drupal/Core/Language/Language.php
@@ -7,6 +7,8 @@
namespace Drupal\Core\Language;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+
/**
* An object containing the information for an interface language.
*
@@ -151,7 +153,17 @@ class Language implements LanguageInterface {
$a_weight = $a->getWeight();
$b_weight = $b->getWeight();
if ($a_weight == $b_weight) {
- return strnatcasecmp($a->getName(), $b->getName());
+ $a_name = $a->getName();
+ $b_name = $b->getName();
+ // If either name is a TranslatableMarkup object it can not be converted
+ // to a string. This is because translation requires a sorted list of
+ // languages thereby causing an infinite loop. Determine the order based
+ // on ID if this is the case.
+ if ($a_name instanceof TranslatableMarkup || $b_name instanceof TranslatableMarkup) {
+ $a_name = $a->getId();
+ $b_name = $b->getId();
+ }
+ return strnatcasecmp($a_name, $b_name);
}
return ($a_weight < $b_weight) ? -1 : 1;
});
diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php
index 092e9fe2f..4c0172dfd 100644
--- a/core/lib/Drupal/Core/Language/LanguageManager.php
+++ b/core/lib/Drupal/Core/Language/LanguageManager.php
@@ -224,7 +224,7 @@ class LanguageManager implements LanguageManagerInterface {
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public static function getStandardLanguageList() {
// This list is based on languages available from localize.drupal.org. See
diff --git a/core/lib/Drupal/Core/Link.php b/core/lib/Drupal/Core/Link.php
index f739ad1c2..0bf24e84d 100644
--- a/core/lib/Drupal/Core/Link.php
+++ b/core/lib/Drupal/Core/Link.php
@@ -140,11 +140,15 @@ class Link implements RenderableInterface {
/**
* Generates the HTML for this Link object.
*
+ * Do not use this method to render a link in an HTML context. In an HTML
+ * context, self::toRenderable() should be used so that render cache
+ * information is maintained. However, there might be use cases such as tests
+ * and non-HTML contexts where calling this method directly makes sense.
+ *
* @return \Drupal\Core\GeneratedLink
* The link HTML markup.
*
- * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use
- * self::toRenderable() instead.
+ * @see \Drupal\Core\Link::toRenderable()
*/
public function toString() {
return $this->getLinkGenerator()->generateFromLink($this);
diff --git a/core/lib/Drupal/Core/Mail/MailFormatHelper.php b/core/lib/Drupal/Core/Mail/MailFormatHelper.php
index 86e85531a..6ea977f4a 100644
--- a/core/lib/Drupal/Core/Mail/MailFormatHelper.php
+++ b/core/lib/Drupal/Core/Mail/MailFormatHelper.php
@@ -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;
diff --git a/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php b/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php
index 067e76a46..5cda9be05 100644
--- a/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php
+++ b/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php
@@ -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,
diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
index 558556d2d..26b716173 100644
--- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
+++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
@@ -289,7 +289,7 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt
* Invokes the hook to alter the definitions if the alter hook is set.
*
* @param $definitions
- * The discovered plugin defintions.
+ * The discovered plugin definitions.
*/
protected function alterDefinitions(&$definitions) {
if ($this->alterHook) {
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
index 6bc3bbbf6..8cb4888d7 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -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;
}
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php
index 97ea37460..058c752c8 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php
@@ -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.
*/
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php
index 2957dc04c..332e740a4 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php
@@ -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.
*/
diff --git a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
index fee05ec58..06dbbad6c 100644
--- a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
+++ b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
@@ -27,8 +27,7 @@ interface PluginFormInterface {
* callback and build the rest of the form in the callback. By the time the
* callback is executed, the element's #parents and #array_parents properties
* will have been set by the form API. For more documentation on #parents and
- * #array_parents, see
- * https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/8.
+ * #array_parents, see \Drupal\Core\Render\Element\FormElement.
*
* @param array $form
* An associative array containing the initial structure of the plugin form.
diff --git a/core/lib/Drupal/Core/Render/Element/HtmlTag.php b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
index f2bcacf7e..5ec0d3f77 100644
--- a/core/lib/Drupal/Core/Render/Element/HtmlTag.php
+++ b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
@@ -16,6 +16,24 @@ use Drupal\Core\Template\Attribute;
/**
* Provides a render element for any HTML tag, with properties and value.
*
+ * Properties:
+ * - #tag: The tag name to output.
+ * - #attributes: (array, optional) HTML attributes to apply to the tag. The
+ * attributes are escaped, see \Drupal\Core\Template\Attribute.
+ * - #value: (string, optional) A string containing the textual contents of
+ * the tag.
+ * - #noscript: (bool, optional) When set to TRUE, the markup
+ * (including any prefix or suffix) will be wrapped in a