X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FHtmlFormatter.php;h=ebced709f232db9460ac72acd55409ac0ba0f67e;hb=53c420e27863984f332b8c052072e3cc00ed952c;hp=b2209c358ed3636f68817015f2b2c907f1bf61e2;hpb=3993bc9cbcb31bda2b70d152b1caae8a16197f49;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HtmlFormatter.php b/includes/HtmlFormatter.php index b2209c358e..ebced709f2 100644 --- a/includes/HtmlFormatter.php +++ b/includes/HtmlFormatter.php @@ -138,7 +138,7 @@ class HtmlFormatter { // Bail out early if nothing to do if ( array_reduce( $removals, - function( $carry, $item ) { + function ( $carry, $item ) { return $carry && !$item; }, true @@ -314,9 +314,13 @@ class HtmlFormatter { } /** + * Helper function for parseItemsToRemove(). This function extracts the selector type + * and the raw name of a selector from a CSS-style selector string and assigns those + * values to parameters passed by reference. For example, if given '#toc' as the + * $selector parameter, it will assign 'ID' as the $type and 'toc' as the $rawName. * @param string $selector CSS selector to parse - * @param string $type - * @param string $rawName + * @param string $type The type of selector (ID, CLASS, TAG_CLASS, or TAG) + * @param string $rawName The raw name of the selector * @return bool Whether the selector was successfully recognised */ protected function parseSelector( $selector, &$type, &$rawName ) { @@ -340,7 +344,8 @@ class HtmlFormatter { } /** - * Transforms CSS selectors into an internal representation suitable for processing + * Transforms CSS-style selectors into an internal representation suitable for + * processing by filterContent() * @return array */ protected function parseItemsToRemove() {