You are here

class DeprecationMessage in Upgrade Status 8.3

Same name and namespace in other branches
  1. 8.2 src/DeprecationMessage.php \Drupal\upgrade_status\DeprecationMessage

A value object containing a deprecation message with some metadata.

Hierarchy

Expanded class hierarchy of DeprecationMessage

File

src/DeprecationMessage.php, line 10

Namespace

Drupal\upgrade_status
View source
class DeprecationMessage {

  /**
   * The message.
   *
   * @var string
   */
  protected $message;

  /**
   * The line associated to the deprecation message.
   *
   * @var int
   */
  protected $line;

  /**
   * The file related to the deprecation message.
   *
   * @var string
   */
  protected $file;

  /**
   * Constructs a new deprecation message.
   *
   * @param string $message
   *   The message.
   * @param string $file
   *   The file related to the deprecation message.
   * @param int $line
   *   The line associated to the deprecation message.
   */
  public function __construct(string $message, string $file = '', int $line = 0) {
    $this->message = $message;
    $this->file = $file;
    $this->line = $line;
  }

  /**
   * Gets the message.
   *
   * @return string
   */
  public function getMessage() : string {
    return $this->message;
  }

  /**
   * Gets the file.
   *
   * @return string
   */
  public function getFile() : string {
    return $this->file;
  }

  /**
   * Gets the line.
   *
   * @return int
   */
  public function getLine() : int {
    return $this->line;
  }

  /**
   * Sets the line value.
   *
   * @param int $line
   *   The line associated to the deprecation message.
   */
  public function setLine(int $line) {
    $this->line = $line;
  }

  /**
   * Sets the file value.
   *
   * @param string $file
   *   The file related to the deprecation message.
   */
  public function setFile(string $file) {
    $this->file = $file;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeprecationMessage::$file protected property The file related to the deprecation message.
DeprecationMessage::$line protected property The line associated to the deprecation message.
DeprecationMessage::$message protected property The message.
DeprecationMessage::getFile public function Gets the file.
DeprecationMessage::getLine public function Gets the line.
DeprecationMessage::getMessage public function Gets the message.
DeprecationMessage::setFile public function Sets the file value.
DeprecationMessage::setLine public function Sets the line value.
DeprecationMessage::__construct public function Constructs a new deprecation message.