Skip to content
Snippets Groups Projects

Issue #3514612: Added logger.

Closes #3514612

Merge request reports

Members who can merge are allowed to add commits.
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
109 109 * {@inheritdoc}
110 110 */
111 111 public function offsetSet($name, $value): void {
112 // Check if the attribute name contains a space.
113 if (strpos($name, ' ') !== FALSE) {
114 \Drupal::logger('system')->warning('Invalid attribute name "@name" detected. Attribute names cannot contain spaces.', ['@name' => $name]);
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 382967ce - Trying to fix a unit test error.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 6310adde - Tests confirm the value is being stored as an array instead of a normalized

    Compare with previous version

  • 85 protected $logger;
    86
    79 87 /**
    80 88 * Constructs a \Drupal\Core\Template\Attribute object.
    81 89 *
    82 90 * @param array $attributes
    83 91 * An associative array of key-value pairs to be converted to attributes.
    92 * @param \Psr\Log\LoggerInterface $logger
    93 * The logger.
    84 94 */
    85 public function __construct($attributes = []) {
    95 public function __construct($attributes = [], ?LoggerInterface $logger = NULL) {
    86 96 foreach ($attributes as $name => $value) {
    87 97 $this->offsetSet($name, $value);
    88 98 }
    99 $this->logger = $logger;
  • Stephen Mustgrave left review comments

    left review comments

  • Please register or sign in to reply
    Loading