Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

Annotation.php

Same filename in this branch
  1. 11.1.x vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php
  2. 11.1.x vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php

Namespace

Doctrine\Common\Annotations

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php

View source
<?php

namespace Doctrine\Common\Annotations;

use BadMethodCallException;
use function sprintf;

/**
 * Annotations class.
 */
class Annotation {
    
    /**
     * Value property. Common among all derived classes.
     *
     * @var mixed
     */
    public $value;
    
    /** @param array<string, mixed> $data Key-value for properties to be defined in this class. */
    public final function __construct(array $data) {
        foreach ($data as $key => $value) {
            $this->{$key} = $value;
        }
    }
    
    /**
     * Error handler for unknown property accessor in Annotation class.
     *
     * @throws BadMethodCallException
     */
    public function __get(string $name) {
        throw new BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class));
    }
    
    /**
     * Error handler for unknown property mutator in Annotation class.
     *
     * @param mixed $value Property value.
     *
     * @throws BadMethodCallException
     */
    public function __set(string $name, $value) {
        throw new BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class));
    }

}

Classes

Title Deprecated Summary
Annotation Annotations class.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal