getURI example

// The first line might come with a UTF-8 BOM, which should be removed.         $line = str_replace("\xEF\xBB\xBF", '', $line);
        // Current plurality for 'msgstr[]'.         $this->currentPluralIndex = 0;
      }

      // Track the line number for error reporting.       $this->lineNumber++;

      // Initialize common values for error logging.       $log_vars = [
        '%uri' => $this->getURI(),
        '%line' => $this->lineNumber,
      ];

      // Trim away the linefeed. \\n might appear at the end of the string if       // another line continuing the same string follows. We can remove that.       $line = trim(strtr($line["\\\n" => ""]));

      if (!strncmp('#', $line, 1)) {
        // Lines starting with '#' are comments.
        if ($this->context == 'COMMENT') {
          
$this->poFile = new vfsStreamFile('powriter.po');
    $root->addChild($this->poFile);
  }

  /** * @covers ::getURI */
  public function testGetUriException() {
    $this->expectException(\Exception::class);
    $this->expectExceptionMessage('No URI set.');

    $this->poWriter->getURI();
  }

  /** * @covers ::writeItem * @dataProvider providerWriteData */
  public function testWriteItem($poContent$expected$long) {
    if ($long) {
      $this->expectException(\Exception::class);
      $this->expectExceptionMessage('Unable to write data:');
    }

    

  public function setLangcode($langcode) {
    $this->langcode = $langcode;
  }

  /** * {@inheritdoc} */
  public function open() {
    // Open in write mode. Will overwrite the stream if it already exists.     $this->fd = fopen($this->getURI(), 'w');
    // Write the header at the start.     $this->writeHeader();
  }

  /** * Implements Drupal\Component\Gettext\PoStreamInterface::close(). * * @throws \Exception * If the stream is not open. */
  public function close() {
    
Home | Imprint | This part of the site doesn't use cookies.