Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 6
SourceString
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 5
42
0.00% covered (danger)
0.00%
0 / 6
 isSource
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 isTranslation
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getString
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setString
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 isNew
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
/**
 * @file
 * Contains \Drupal\locale\SourceString.
 */
namespace Drupal\locale;
use Drupal\locale\LocaleString;
/**
 * Defines the locale source string object.
 *
 * This class represents a module-defined string value that is to be translated.
 * This string must at least contain a 'source' field, which is the raw source
 * value, and is assumed to be in English language.
 */
class SourceString extends StringBase {
  /**
   * {@inheritdoc}
   */
  public function isSource() {
    return isset($this->source);
  }
  /**
   * {@inheritdoc}
   */
  public function isTranslation() {
    return FALSE;
  }
  /**
   * {@inheritdoc}
   */
  public function getString() {
    return isset($this->source) ? $this->source : '';
  }
  /**
   * {@inheritdoc}
   */
  public function setString($string) {
    $this->source = $string;
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function isNew() {
    return empty($this->lid);
  }
}