*/
static function parse( $rawData ) {
$parsed = iptcparse( $rawData );
- $data = array();
+ $data = [];
if ( !is_array( $parsed ) ) {
return $data;
}
// Unknown charset. refuse to parse.
// note: There is a different between
// unknown and no charset specified.
- return array();
+ return [];
}
unset( $parsed['1#090'] );
}
if ( isset( $parsed['2#085'] ) ) {
$titles = self::convIPTC( $parsed['2#085'], $c );
} else {
- $titles = array();
+ $titles = [];
}
$titleCount = count( $titles );
case '2#025': /* keywords */
$data['Keywords'] = self::convIPTC( $val, $c );
break;
- case '2#101': /* Country (shown)*/
+ case '2#101': /* Country (shown) */
$data['CountryDest'] = self::convIPTC( $val, $c );
break;
case '2#095': /* state/province (shown) */
case '2#040': /* special instructions */
$data['SpecialInstructions'] = self::convIPTC( $val, $c );
break;
- case '2#105': /* headline*/
+ case '2#105': /* headline */
$data['Headline'] = self::convIPTC( $val, $c );
break;
case '2#110': /* credit */
// if a version is set for the software.
$softwareVersion = self::convIPTC( $parsed['2#070'], $c );
unset( $parsed['2#070'] );
- $data['Software'] = array( array( $software[0], $softwareVersion[0] ) );
+ $data['Software'] = [ [ $software[0], $softwareVersion[0] ] ];
} else {
$data['Software'] = $software;
}
if ( isset( $parsed['2#060'] ) ) {
$time = $parsed['2#060'];
} else {
- $time = array();
+ $time = [];
}
$timestamp = self::timeHelper( $val, $time, $c );
if ( $timestamp ) {
if ( isset( $parsed['2#063'] ) ) {
$time = $parsed['2#063'];
} else {
- $time = array();
+ $time = [];
}
$timestamp = self::timeHelper( $val, $time, $c );
if ( $timestamp ) {
if ( isset( $parsed['2#035'] ) ) {
$time = $parsed['2#035'];
} else {
- $time = array();
+ $time = [];
}
$timestamp = self::timeHelper( $val, $time, $c );
if ( $timestamp ) {
if ( isset( $parsed['2#038'] ) ) {
$time = $parsed['2#038'];
} else {
- $time = array();
+ $time = [];
}
$timestamp = self::timeHelper( $val, $time, $c );
if ( $timestamp ) {
// in iim 4.1, but not in the XMP
// stuff. We're going to just
// extract the first value.
- $con = self::ConvIPTC( $val, $c );
+ $con = self::convIPTC( $val, $c );
if ( strlen( $con[0] ) < 5 ) {
wfDebugLog( 'iptc', 'IPTC: '
. '2:04 too short. '