comparison vendor/symfony/translation/Loader/FileLoader.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\Config\Resource\FileResource;
14 use Symfony\Component\Translation\Exception\InvalidResourceException; 15 use Symfony\Component\Translation\Exception\InvalidResourceException;
15 use Symfony\Component\Translation\Exception\NotFoundResourceException; 16 use Symfony\Component\Translation\Exception\NotFoundResourceException;
16 use Symfony\Component\Config\Resource\FileResource;
17 17
18 /** 18 /**
19 * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> 19 * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
20 */ 20 */
21 abstract class FileLoader extends ArrayLoader 21 abstract class FileLoader extends ArrayLoader
35 35
36 $messages = $this->loadResource($resource); 36 $messages = $this->loadResource($resource);
37 37
38 // empty resource 38 // empty resource
39 if (null === $messages) { 39 if (null === $messages) {
40 $messages = array(); 40 $messages = [];
41 } 41 }
42 42
43 // not an array 43 // not an array
44 if (!is_array($messages)) { 44 if (!\is_array($messages)) {
45 throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); 45 throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource));
46 } 46 }
47 47
48 $catalogue = parent::load($messages, $locale, $domain); 48 $catalogue = parent::load($messages, $locale, $domain);
49 49