// format class-name : path when they get converted into json.
foreach ( $this->classes as $path => $contained ) {
foreach ( $contained as $fqcn ) {
-
// Using substr to remove the leading '/'
$json[$key][$fqcn] = substr( $path, 1 );
}
}
foreach ( $this->overrides as $path => $fqcn ) {
-
// Using substr to remove the leading '/'
$json[$key][$fqcn] = substr( $path, 1 );
}
ksort( $json[$key] );
// Return the whole JSON file
- return FormatJson::encode( $json, true ) . "\n";
+ return FormatJson::encode( $json, "\t", FormatJson::ALL_OK ) . "\n";
}
/**
];
EOD;
-
}
/**
* @return string
*/
public function getAutoload( $commandName = 'AutoloadGenerator' ) {
-
// We need to check whether an extenson.json or skin.json exists or not, and
// incase it doesn't, update the autoload.php file.
$this->classes[] = $this->alias['name'];
$this->alias = null;
$this->startToken = null;
+ } elseif ( !is_array( $token ) || (
+ $token[0] !== T_STRING &&
+ $token[0] !== T_DOUBLE_COLON &&
+ $token[0] !== T_CLASS &&
+ $token[0] !== T_WHITESPACE
+ ) ) {
+ // Ignore this call to class_alias() - compat/Timestamp.php
+ $this->alias = null;
+ $this->startToken = null;
}
}
break;