comparison vendor/symfony/translation/Loader/IcuResFileLoader.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
9 * file that was distributed with this source code. 9 * file that was distributed with this source code.
10 */ 10 */
11 11
12 namespace Symfony\Component\Translation\Loader; 12 namespace Symfony\Component\Translation\Loader;
13 13
14 use Symfony\Component\Translation\MessageCatalogue; 14 use Symfony\Component\Config\Resource\DirectoryResource;
15 use Symfony\Component\Translation\Exception\InvalidResourceException; 15 use Symfony\Component\Translation\Exception\InvalidResourceException;
16 use Symfony\Component\Translation\Exception\NotFoundResourceException; 16 use Symfony\Component\Translation\Exception\NotFoundResourceException;
17 use Symfony\Component\Config\Resource\DirectoryResource; 17 use Symfony\Component\Translation\MessageCatalogue;
18 18
19 /** 19 /**
20 * IcuResFileLoader loads translations from a resource bundle. 20 * IcuResFileLoader loads translations from a resource bundle.
21 * 21 *
22 * @author stealth35 22 * @author stealth35
74 * @param array $messages Used internally for recursive calls 74 * @param array $messages Used internally for recursive calls
75 * @param string $path Current path being parsed, used internally for recursive calls 75 * @param string $path Current path being parsed, used internally for recursive calls
76 * 76 *
77 * @return array the flattened ResourceBundle 77 * @return array the flattened ResourceBundle
78 */ 78 */
79 protected function flatten(\ResourceBundle $rb, array &$messages = array(), $path = null) 79 protected function flatten(\ResourceBundle $rb, array &$messages = [], $path = null)
80 { 80 {
81 foreach ($rb as $key => $value) { 81 foreach ($rb as $key => $value) {
82 $nodePath = $path ? $path.'.'.$key : $key; 82 $nodePath = $path ? $path.'.'.$key : $key;
83 if ($value instanceof \ResourceBundle) { 83 if ($value instanceof \ResourceBundle) {
84 $this->flatten($value, $messages, $nodePath); 84 $this->flatten($value, $messages, $nodePath);