@trigger_error('Passing a non-string value to the $target parameter in '.__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Pass only string values instead. See https://www.drupal.org/node/3577925',E_USER_DEPRECATED);
}
if(!isset($this->target)){
$this->target=$target;
}
@@ -534,6 +537,9 @@ public function getTarget() {
* The key this connection is for.
*/
publicfunctionsetKey($key){
if(!is_string($key)){
@trigger_error('Passing a non-string value to the $key parameter in '.__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Pass only string values instead. See https://www.drupal.org/node/3577925',E_USER_DEPRECATED);
Changes for core/lib/Drupal/Core/Database/Log.php: 14 added lines, 2 removed lines.
Original line number
Diff line number
Diff line
@@ -14,6 +14,15 @@
*
* Every connection has one and only one logging object on it for all targets
* and logging keys.
*
* @phpstan-type DatabaseLogEntry array{
* 'query': string,
* 'args': list<mixed>,
* 'caller': string,
* 'target': string,
* 'time': float,
* 'start': float,
* }
*/
classLog{
@@ -22,7 +31,7 @@ class Log {
*
* This will only be used if the query logger is enabled.
*
* @var array
* @var array<string,list<DatabaseLogEntry>>
* The structure for the logging array is as follows:
*
* @code
@@ -50,6 +59,9 @@ class Log {
* The database connection key for which to enable logging.
*/
publicfunction__construct($key='default'){
if(!is_string($key)){
@trigger_error('Passing a non-string value to the $key parameter in '.__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Pass only string values instead. See https://www.drupal.org/node/3577925',E_USER_DEPRECATED);
}
$this->connectionKey=$key;
}
@@ -75,7 +87,7 @@ public function start($logging_key) {
* @param string $logging_key
* The logging key to fetch.
*
* @return array
* @return list<DatabaseLogEntry>
* An indexed array of all query records for this logging key.