dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Allow fragments in link= parameter in <gallery> tags."
[lhc/web/wiklou.git]
/
includes
/
parser
/
DateFormatter.php
diff --git
a/includes/parser/DateFormatter.php
b/includes/parser/DateFormatter.php
index
d10841f
..
cfd5370
100644
(file)
--- a/
includes/parser/DateFormatter.php
+++ b/
includes/parser/DateFormatter.php
@@
-49,7
+49,7
@@
class DateFormatter {
const LAST = 8;
/**
const LAST = 8;
/**
- * @param
$lang Language
In which language to format the date
+ * @param
Language $lang
In which language to format the date
*/
function __construct( Language $lang ) {
$this->lang = $lang;
*/
function __construct( Language $lang ) {
$this->lang = $lang;
@@
-120,7
+120,7
@@
class DateFormatter {
/**
* Get a DateFormatter object
*
/**
* Get a DateFormatter object
*
- * @param
$lang Language|string|null
In which language to format the date
+ * @param
Language|string|null $lang
In which language to format the date
* Defaults to the site content language
* @return DateFormatter object
*/
* Defaults to the site content language
* @return DateFormatter object
*/
@@
-142,7
+142,7
@@
class DateFormatter {
/**
* @param string $preference User preference
* @param string $text Text to reformat
/**
* @param string $preference User preference
* @param string $text Text to reformat
- * @param array $options can contain 'linked' and/or 'match-whole'
+ * @param array $options
Array
can contain 'linked' and/or 'match-whole'
*
* @return string
*/
*
* @return string
*/
@@
-193,7
+193,7
@@
class DateFormatter {
}
/**
}
/**
- * @param $matches
+ * @param
array
$matches
* @return string
*/
function replace( $matches ) {
* @return string
*/
function replace( $matches ) {
@@
-205,7
+205,8
@@
class DateFormatter {
$bits = array();
$key = $this->keys[$this->mSource];
$bits = array();
$key = $this->keys[$this->mSource];
- for ( $p = 0; $p < strlen( $key ); $p++ ) {
+ $keyLength = strlen( $key );
+ for ( $p = 0; $p < $keyLength; $p++ ) {
if ( $key[$p] != ' ' ) {
$bits[$key[$p]] = $matches[$p + 1];
}
if ( $key[$p] != ' ' ) {
$bits[$key[$p]] = $matches[$p + 1];
}
@@
-215,8
+216,8
@@
class DateFormatter {
}
/**
}
/**
- * @param
$bits array
- * @param
$link bool
+ * @param
array $bits
+ * @param
bool $link
* @return string
*/
function formatDate( $bits, $link = true ) {
* @return string
*/
function formatDate( $bits, $link = true ) {
@@
-254,7
+255,8
@@
class DateFormatter {
$bits['d'] = sprintf( '%02d', $bits['j'] );
}
$bits['d'] = sprintf( '%02d', $bits['j'] );
}
- for ( $p = 0; $p < strlen( $format ); $p++ ) {
+ $formatLength = strlen( $format );
+ for ( $p = 0; $p < $formatLength; $p++ ) {
$char = $format[$p];
switch ( $char ) {
case 'd': # ISO day of month
$char = $format[$p];
switch ( $char ) {
case 'd': # ISO day of month
@@
-293,6
+295,7
@@
class DateFormatter {
}
}
if ( $fail ) {
}
}
if ( $fail ) {
+ /** @todo FIXME: $matches doesn't exist here, what's expected? */
$text = $matches[0];
}
$text = $matches[0];
}
@@
-326,7
+329,7
@@
class DateFormatter {
/**
* Makes an ISO month, e.g. 02, from a month name
/**
* Makes an ISO month, e.g. 02, from a month name
- * @param string $monthName
m
onth name
+ * @param string $monthName
M
onth name
* @return string ISO month name
*/
function makeIsoMonth( $monthName ) {
* @return string ISO month name
*/
function makeIsoMonth( $monthName ) {
@@
-354,6
+357,7
@@
class DateFormatter {
/**
* @todo document
/**
* @todo document
+ * @param string $iso
* @return int|string
*/
function makeNormalYear( $iso ) {
* @return int|string
*/
function makeNormalYear( $iso ) {