function Message::getMessageFromFile

Same name and namespace in other branches
  1. 9 composer/Plugin/ProjectMessage/Message.php \Drupal\Composer\Plugin\ProjectMessage\Message::getMessageFromFile()
  2. 8.9.x composer/Plugin/ProjectMessage/Message.php \Drupal\Composer\Plugin\ProjectMessage\Message::getMessageFromFile()
  3. 10 composer/Plugin/ProjectMessage/Message.php \Drupal\Composer\Plugin\ProjectMessage\Message::getMessageFromFile()

Reads the message file as an array.

Parameters

string $file: The file to read. Relative paths are relative to the project directory.

Return value

string[]

1 call to Message::getMessageFromFile()
Message::getText in composer/Plugin/ProjectMessage/Message.php

File

composer/Plugin/ProjectMessage/Message.php, line 112

Class

Message
Determine configuration.

Namespace

Drupal\Composer\Plugin\ProjectMessage

Code

protected function getMessageFromFile($file) {
    return file_exists($file) ? file($file, FILE_IGNORE_NEW_LINES) : [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.