src/DateFormat.php
private function processData(array $data): void
    {
        foreach ($data['formatters'] as $locale => $f) {
            if (!isset($this->formatters[$locale])) {
                $this->formatters[$locale] = array();
            }
            
            foreach ($f as $formatter => $d) {
                $calendar = \IntlDateFormatter::GREGORIAN;
                if (isset($d['calendar']) && $d['calendar'] === 'traditional') {
                    $calendar = \IntlDateFormatter::TRADITIONAL;
                }
                
                $this->formatters[$locale][$formatter] = new \IntlDateFormatter($locale, null, null, null, $calendar, $d['pattern']);
            }
        }
    }
private function processData(array $data): void
    {
        foreach ($data['formatters'] as $locale => $f) {
            if (!isset($this->formatters[$locale])) {
                $this->formatters[$locale] = array();
            }
            
            foreach ($f as $formatter => $d) {
                $calendar = \IntlDateFormatter::GREGORIAN;
                if (isset($d['calendar']) && $d['calendar'] === 'traditional') {
                    $calendar = \IntlDateFormatter::TRADITIONAL;
                }
                
                $this->formatters[$locale][$formatter] = new \IntlDateFormatter($locale, null, null, null, $calendar, $d['pattern']);
            }
        }
    }
private function processData ( array $ data ) : void { foreach ( $ data [ 'formatters' ] as $ locale => $ f ) { if ( ! isset ( $ this -> formatters [ $ locale ] ) ) { $ this -> formatters [ $ locale ] = array ( ) ; } foreach ( $ f as $ formatter => $ d ) { $ calendar = \ IntlDateFormatter :: GREGORIAN ; if ( isset ( $ d [ 'calendar' ] ) && $ d [ 'calendar' ] === 'traditional' ) { $ calendar = \ IntlDateFormatter :: TRADITIONAL ; } $ this -> formatters [ $ locale ] [ $ formatter ] = new \ IntlDateFormatter ( $ locale , null , null , null , $ calendar , $ d [ 'pattern' ] ) ; } } }
Processes the resource file data
@param array $data The data from the resource file
Processes the resource file data