You are here

protected function InstantArticleContentEntityNormalizer::getApplicationVersion in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 src/Normalizer/InstantArticleContentEntityNormalizer.php \Drupal\fb_instant_articles\Normalizer\InstantArticleContentEntityNormalizer::getApplicationVersion()

Pull out the module version from the info file.

Return value

string Module version.

1 call to InstantArticleContentEntityNormalizer::getApplicationVersion()
InstantArticleContentEntityNormalizer::normalize in src/Normalizer/InstantArticleContentEntityNormalizer.php

File

src/Normalizer/InstantArticleContentEntityNormalizer.php, line 455

Class

InstantArticleContentEntityNormalizer
Facebook Instant Articles content entity normalizer.

Namespace

Drupal\fb_instant_articles\Normalizer

Code

protected function getApplicationVersion() {
  $path = $this->moduleHandler
    ->getModule('fb_instant_articles')
    ->getPath();
  $info = $this->infoParser
    ->parse($path . '/fb_instant_articles.info.yml');
  if (isset($info['version'])) {
    return $info['version'];
  }
  else {
    return '8.x-2.x-dev';
  }
}