Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Component/Gettext/PoStreamReader.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
144 * Implements Drupal\Component\Gettext\PoStreamInterface::open(). | 144 * Implements Drupal\Component\Gettext\PoStreamInterface::open(). |
145 * | 145 * |
146 * Opens the stream and reads the header. The stream is ready for reading | 146 * Opens the stream and reads the header. The stream is ready for reading |
147 * items after. | 147 * items after. |
148 * | 148 * |
149 * @throws Exception | 149 * @throws \Exception |
150 * If the URI is not yet set. | 150 * If the URI is not yet set. |
151 */ | 151 */ |
152 public function open() { | 152 public function open() { |
153 if (!empty($this->_uri)) { | 153 if (!empty($this->_uri)) { |
154 $this->_fd = fopen($this->_uri, 'rb'); | 154 $this->_fd = fopen($this->_uri, 'rb'); |
160 } | 160 } |
161 | 161 |
162 /** | 162 /** |
163 * Implements Drupal\Component\Gettext\PoStreamInterface::close(). | 163 * Implements Drupal\Component\Gettext\PoStreamInterface::close(). |
164 * | 164 * |
165 * @throws Exception | 165 * @throws \Exception |
166 * If the stream is not open. | 166 * If the stream is not open. |
167 */ | 167 */ |
168 public function close() { | 168 public function close() { |
169 if ($this->_fd) { | 169 if ($this->_fd) { |
170 fclose($this->_fd); | 170 fclose($this->_fd); |
504 } | 504 } |
505 elseif ($this->_context != 'COMMENT') { | 505 elseif ($this->_context != 'COMMENT') { |
506 $this->_errors[] = SafeMarkup::format('The translation stream %uri ended unexpectedly at line %line.', $log_vars); | 506 $this->_errors[] = SafeMarkup::format('The translation stream %uri ended unexpectedly at line %line.', $log_vars); |
507 return FALSE; | 507 return FALSE; |
508 } | 508 } |
509 | |
510 return; | |
509 } | 511 } |
510 | 512 |
511 /** | 513 /** |
512 * Store the parsed values as a PoItem object. | 514 * Store the parsed values as a PoItem object. |
513 */ | 515 */ |