Don't call localisation functions when initializing pageset
[lhc/web/wiklou.git] / includes / HtmlFormatter.php
index 38aa392..f74c15a 100644 (file)
@@ -130,7 +130,7 @@ class HtmlFormatter {
        /**
         * Removes content we've chosen to remove.  The text of the removed elements can be
         * extracted with the getText method.
-        * @return array of removed DOMElements
+        * @return array Array of removed DOMElements
         */
        public function filterContent() {
                wfProfileIn( __METHOD__ );
@@ -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
@@ -178,7 +178,7 @@ class HtmlFormatter {
 
                // CSS Classes
                $domElemsToRemove = array();
-               $xpath = new DOMXpath( $doc );
+               $xpath = new DOMXPath( $doc );
                foreach ( $removals['CLASS'] as $classToRemove ) {
                        $elements = $xpath->query( '//*[contains(@class, "' . $classToRemove . '")]' );
 
@@ -209,7 +209,7 @@ class HtmlFormatter {
        /**
         * Removes a list of elelments from DOMDocument
         * @param array|DOMNodeList $elements
-        * @return array of removed elements
+        * @return array Array of removed elements
         */
        private function removeElements( $elements ) {
                $list = $elements;
@@ -237,7 +237,7 @@ class HtmlFormatter {
        private function fixLibXML( $html ) {
                wfProfileIn( __METHOD__ );
                static $replacements;
-               if ( ! $replacements ) {
+               if ( !$replacements ) {
                        // We don't include rules like '"' => '"' because entities had already been
                        // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE!
                        $replacements = new ReplacementArray( array(
@@ -322,6 +322,7 @@ class HtmlFormatter {
         * @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
+        * @throws MWException
         */
        protected function parseSelector( $selector, &$type, &$rawName ) {
                if ( strpos( $selector, '.' ) === 0 ) {