comparison vendor/symfony/translation/Extractor/AbstractFileExtractor.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
25 * 25 *
26 * @return array 26 * @return array
27 */ 27 */
28 protected function extractFiles($resource) 28 protected function extractFiles($resource)
29 { 29 {
30 if (is_array($resource) || $resource instanceof \Traversable) { 30 if (\is_array($resource) || $resource instanceof \Traversable) {
31 $files = array(); 31 $files = [];
32 foreach ($resource as $file) { 32 foreach ($resource as $file) {
33 if ($this->canBeExtracted($file)) { 33 if ($this->canBeExtracted($file)) {
34 $files[] = $this->toSplFileInfo($file); 34 $files[] = $this->toSplFileInfo($file);
35 } 35 }
36 } 36 }
37 } elseif (is_file($resource)) { 37 } elseif (is_file($resource)) {
38 $files = $this->canBeExtracted($resource) ? array($this->toSplFileInfo($resource)) : array(); 38 $files = $this->canBeExtracted($resource) ? [$this->toSplFileInfo($resource)] : [];
39 } else { 39 } else {
40 $files = $this->extractFromDirectory($resource); 40 $files = $this->extractFromDirectory($resource);
41 } 41 }
42 42
43 return $files; 43 return $files;