Complex classes like Doku_Renderer often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Doku_Renderer, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 26 | abstract class Doku_Renderer extends DokuWiki_Plugin { |
||
| 27 | /** @var array Settings, control the behavior of the renderer */ |
||
| 28 | public $info = array( |
||
| 29 | 'cache' => true, // may the rendered result cached? |
||
| 30 | 'toc' => true, // render the TOC? |
||
| 31 | ); |
||
| 32 | |||
| 33 | /** @var array contains the smiley configuration, set in p_render() */ |
||
| 34 | public $smileys = array(); |
||
| 35 | /** @var array contains the entity configuration, set in p_render() */ |
||
| 36 | public $entities = array(); |
||
| 37 | /** @var array contains the acronym configuration, set in p_render() */ |
||
| 38 | public $acronyms = array(); |
||
| 39 | /** @var array contains the interwiki configuration, set in p_render() */ |
||
| 40 | public $interwiki = array(); |
||
| 41 | |||
| 42 | /** @var array the list of headers used to create unique link ids */ |
||
| 43 | protected $headers = array(); |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var string the rendered document, this will be cached after the renderer ran through |
||
| 47 | */ |
||
| 48 | public $doc = ''; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * clean out any per-use values |
||
| 52 | * |
||
| 53 | * This is called before each use of the renderer object and should be used to |
||
| 54 | * completely reset the state of the renderer to be reused for a new document |
||
| 55 | */ |
||
| 56 | public function reset(){ |
||
| 57 | $this->headers = array(); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Allow the plugin to prevent DokuWiki from reusing an instance |
||
| 62 | * |
||
| 63 | * Since most renderer plugins fail to implement Doku_Renderer::reset() we default |
||
| 64 | * to reinstantiating the renderer here |
||
| 65 | * |
||
| 66 | * @return bool false if the plugin has to be instantiated |
||
| 67 | */ |
||
| 68 | public function isSingleton() { |
||
| 69 | return false; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Returns the format produced by this renderer. |
||
| 74 | * |
||
| 75 | * Has to be overidden by sub classes |
||
| 76 | * |
||
| 77 | * @return string |
||
| 78 | */ |
||
| 79 | abstract public function getFormat(); |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Disable caching of this renderer's output |
||
| 83 | */ |
||
| 84 | public function nocache() { |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Disable TOC generation for this renderer's output |
||
| 90 | * |
||
| 91 | * This might not be used for certain sub renderer |
||
| 92 | */ |
||
| 93 | public function notoc() { |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Handle plugin rendering |
||
| 99 | * |
||
| 100 | * Most likely this needs NOT to be overwritten by sub classes |
||
| 101 | * |
||
| 102 | * @param string $name Plugin name |
||
| 103 | * @param mixed $data custom data set by handler |
||
| 104 | * @param string $state matched state if any |
||
| 105 | * @param string $match raw matched syntax |
||
| 106 | */ |
||
| 107 | public function plugin($name, $data, $state = '', $match = '') { |
||
| 114 | |||
| 115 | /** |
||
| 116 | * handle nested render instructions |
||
| 117 | * this method (and nest_close method) should not be overloaded in actual renderer output classes |
||
| 118 | * |
||
| 119 | * @param array $instructions |
||
| 120 | */ |
||
| 121 | public function nest($instructions) { |
||
| 129 | |||
| 130 | /** |
||
| 131 | * dummy closing instruction issued by Doku_Handler_Nest |
||
| 132 | * |
||
| 133 | * normally the syntax mode should override this instruction when instantiating Doku_Handler_Nest - |
||
| 134 | * however plugins will not be able to - as their instructions require data. |
||
| 135 | */ |
||
| 136 | public function nest_close() { |
||
| 138 | |||
| 139 | #region Syntax modes - sub classes will need to implement them to fill $doc |
||
| 140 | |||
| 141 | /** |
||
| 142 | * Initialize the document |
||
| 143 | */ |
||
| 144 | public function document_start() { |
||
| 146 | |||
| 147 | /** |
||
| 148 | * Finalize the document |
||
| 149 | */ |
||
| 150 | public function document_end() { |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Render the Table of Contents |
||
| 155 | * |
||
| 156 | * @return string |
||
| 157 | */ |
||
| 158 | public function render_TOC() { |
||
| 161 | |||
| 162 | /** |
||
| 163 | * Add an item to the TOC |
||
| 164 | * |
||
| 165 | * @param string $id the hash link |
||
| 166 | * @param string $text the text to display |
||
| 167 | * @param int $level the nesting level |
||
| 168 | */ |
||
| 169 | public function toc_additem($id, $text, $level) { |
||
| 171 | |||
| 172 | /** |
||
| 173 | * Render a heading |
||
| 174 | * |
||
| 175 | * @param string $text the text to display |
||
| 176 | * @param int $level header level |
||
| 177 | * @param int $pos byte position in the original source |
||
| 178 | */ |
||
| 179 | public function header($text, $level, $pos) { |
||
| 181 | |||
| 182 | /** |
||
| 183 | * Open a new section |
||
| 184 | * |
||
| 185 | * @param int $level section level (as determined by the previous header) |
||
| 186 | */ |
||
| 187 | public function section_open($level) { |
||
| 189 | |||
| 190 | /** |
||
| 191 | * Close the current section |
||
| 192 | */ |
||
| 193 | public function section_close() { |
||
| 195 | |||
| 196 | /** |
||
| 197 | * Render plain text data |
||
| 198 | * |
||
| 199 | * @param string $text |
||
| 200 | */ |
||
| 201 | public function cdata($text) { |
||
| 203 | |||
| 204 | /** |
||
| 205 | * Open a paragraph |
||
| 206 | */ |
||
| 207 | public function p_open() { |
||
| 209 | |||
| 210 | /** |
||
| 211 | * Close a paragraph |
||
| 212 | */ |
||
| 213 | public function p_close() { |
||
| 215 | |||
| 216 | /** |
||
| 217 | * Create a line break |
||
| 218 | */ |
||
| 219 | public function linebreak() { |
||
| 221 | |||
| 222 | /** |
||
| 223 | * Create a horizontal line |
||
| 224 | */ |
||
| 225 | public function hr() { |
||
| 227 | |||
| 228 | /** |
||
| 229 | * Start strong (bold) formatting |
||
| 230 | */ |
||
| 231 | public function strong_open() { |
||
| 233 | |||
| 234 | /** |
||
| 235 | * Stop strong (bold) formatting |
||
| 236 | */ |
||
| 237 | public function strong_close() { |
||
| 239 | |||
| 240 | /** |
||
| 241 | * Start emphasis (italics) formatting |
||
| 242 | */ |
||
| 243 | public function emphasis_open() { |
||
| 245 | |||
| 246 | /** |
||
| 247 | * Stop emphasis (italics) formatting |
||
| 248 | */ |
||
| 249 | public function emphasis_close() { |
||
| 251 | |||
| 252 | /** |
||
| 253 | * Start underline formatting |
||
| 254 | */ |
||
| 255 | public function underline_open() { |
||
| 257 | |||
| 258 | /** |
||
| 259 | * Stop underline formatting |
||
| 260 | */ |
||
| 261 | public function underline_close() { |
||
| 263 | |||
| 264 | /** |
||
| 265 | * Start monospace formatting |
||
| 266 | */ |
||
| 267 | public function monospace_open() { |
||
| 269 | |||
| 270 | /** |
||
| 271 | * Stop monospace formatting |
||
| 272 | */ |
||
| 273 | public function monospace_close() { |
||
| 275 | |||
| 276 | /** |
||
| 277 | * Start a subscript |
||
| 278 | */ |
||
| 279 | public function subscript_open() { |
||
| 281 | |||
| 282 | /** |
||
| 283 | * Stop a subscript |
||
| 284 | */ |
||
| 285 | public function subscript_close() { |
||
| 287 | |||
| 288 | /** |
||
| 289 | * Start a superscript |
||
| 290 | */ |
||
| 291 | public function superscript_open() { |
||
| 293 | |||
| 294 | /** |
||
| 295 | * Stop a superscript |
||
| 296 | */ |
||
| 297 | public function superscript_close() { |
||
| 299 | |||
| 300 | /** |
||
| 301 | * Start deleted (strike-through) formatting |
||
| 302 | */ |
||
| 303 | public function deleted_open() { |
||
| 305 | |||
| 306 | /** |
||
| 307 | * Stop deleted (strike-through) formatting |
||
| 308 | */ |
||
| 309 | public function deleted_close() { |
||
| 311 | |||
| 312 | /** |
||
| 313 | * Start a footnote |
||
| 314 | */ |
||
| 315 | public function footnote_open() { |
||
| 317 | |||
| 318 | /** |
||
| 319 | * Stop a footnote |
||
| 320 | */ |
||
| 321 | public function footnote_close() { |
||
| 323 | |||
| 324 | /** |
||
| 325 | * Open an unordered list |
||
| 326 | */ |
||
| 327 | public function listu_open() { |
||
| 329 | |||
| 330 | /** |
||
| 331 | * Close an unordered list |
||
| 332 | */ |
||
| 333 | public function listu_close() { |
||
| 335 | |||
| 336 | /** |
||
| 337 | * Open an ordered list |
||
| 338 | */ |
||
| 339 | public function listo_open() { |
||
| 341 | |||
| 342 | /** |
||
| 343 | * Close an ordered list |
||
| 344 | */ |
||
| 345 | public function listo_close() { |
||
| 347 | |||
| 348 | /** |
||
| 349 | * Open a list item |
||
| 350 | * |
||
| 351 | * @param int $level the nesting level |
||
| 352 | * @param bool $node true when a node; false when a leaf |
||
| 353 | */ |
||
| 354 | public function listitem_open($level,$node=false) { |
||
| 356 | |||
| 357 | /** |
||
| 358 | * Close a list item |
||
| 359 | */ |
||
| 360 | public function listitem_close() { |
||
| 362 | |||
| 363 | /** |
||
| 364 | * Start the content of a list item |
||
| 365 | */ |
||
| 366 | public function listcontent_open() { |
||
| 368 | |||
| 369 | /** |
||
| 370 | * Stop the content of a list item |
||
| 371 | */ |
||
| 372 | public function listcontent_close() { |
||
| 374 | |||
| 375 | /** |
||
| 376 | * Output unformatted $text |
||
| 377 | * |
||
| 378 | * Defaults to $this->cdata() |
||
| 379 | * |
||
| 380 | * @param string $text |
||
| 381 | */ |
||
| 382 | public function unformatted($text) { |
||
| 385 | |||
| 386 | /** |
||
| 387 | * Output inline PHP code |
||
| 388 | * |
||
| 389 | * If $conf['phpok'] is true this should evaluate the given code and append the result |
||
| 390 | * to $doc |
||
| 391 | * |
||
| 392 | * @param string $text The PHP code |
||
| 393 | */ |
||
| 394 | public function php($text) { |
||
| 396 | |||
| 397 | /** |
||
| 398 | * Output block level PHP code |
||
| 399 | * |
||
| 400 | * If $conf['phpok'] is true this should evaluate the given code and append the result |
||
| 401 | * to $doc |
||
| 402 | * |
||
| 403 | * @param string $text The PHP code |
||
| 404 | */ |
||
| 405 | public function phpblock($text) { |
||
| 407 | |||
| 408 | /** |
||
| 409 | * Output raw inline HTML |
||
| 410 | * |
||
| 411 | * If $conf['htmlok'] is true this should add the code as is to $doc |
||
| 412 | * |
||
| 413 | * @param string $text The HTML |
||
| 414 | */ |
||
| 415 | public function html($text) { |
||
| 417 | |||
| 418 | /** |
||
| 419 | * Output raw block-level HTML |
||
| 420 | * |
||
| 421 | * If $conf['htmlok'] is true this should add the code as is to $doc |
||
| 422 | * |
||
| 423 | * @param string $text The HTML |
||
| 424 | */ |
||
| 425 | public function htmlblock($text) { |
||
| 427 | |||
| 428 | /** |
||
| 429 | * Output preformatted text |
||
| 430 | * |
||
| 431 | * @param string $text |
||
| 432 | */ |
||
| 433 | public function preformatted($text) { |
||
| 435 | |||
| 436 | /** |
||
| 437 | * Start a block quote |
||
| 438 | */ |
||
| 439 | public function quote_open() { |
||
| 441 | |||
| 442 | /** |
||
| 443 | * Stop a block quote |
||
| 444 | */ |
||
| 445 | public function quote_close() { |
||
| 447 | |||
| 448 | /** |
||
| 449 | * Display text as file content, optionally syntax highlighted |
||
| 450 | * |
||
| 451 | * @param string $text text to show |
||
| 452 | * @param string $lang programming language to use for syntax highlighting |
||
| 453 | * @param string $file file path label |
||
| 454 | */ |
||
| 455 | public function file($text, $lang = null, $file = null) { |
||
| 457 | |||
| 458 | /** |
||
| 459 | * Display text as code content, optionally syntax highlighted |
||
| 460 | * |
||
| 461 | * @param string $text text to show |
||
| 462 | * @param string $lang programming language to use for syntax highlighting |
||
| 463 | * @param string $file file path label |
||
| 464 | */ |
||
| 465 | public function code($text, $lang = null, $file = null) { |
||
| 467 | |||
| 468 | /** |
||
| 469 | * Format an acronym |
||
| 470 | * |
||
| 471 | * Uses $this->acronyms |
||
| 472 | * |
||
| 473 | * @param string $acronym |
||
| 474 | */ |
||
| 475 | public function acronym($acronym) { |
||
| 477 | |||
| 478 | /** |
||
| 479 | * Format a smiley |
||
| 480 | * |
||
| 481 | * Uses $this->smiley |
||
| 482 | * |
||
| 483 | * @param string $smiley |
||
| 484 | */ |
||
| 485 | public function smiley($smiley) { |
||
| 487 | |||
| 488 | /** |
||
| 489 | * Format an entity |
||
| 490 | * |
||
| 491 | * Entities are basically small text replacements |
||
| 492 | * |
||
| 493 | * Uses $this->entities |
||
| 494 | * |
||
| 495 | * @param string $entity |
||
| 496 | */ |
||
| 497 | public function entity($entity) { |
||
| 499 | |||
| 500 | /** |
||
| 501 | * Typographically format a multiply sign |
||
| 502 | * |
||
| 503 | * Example: ($x=640, $y=480) should result in "640×480" |
||
| 504 | * |
||
| 505 | * @param string|int $x first value |
||
| 506 | * @param string|int $y second value |
||
| 507 | */ |
||
| 508 | public function multiplyentity($x, $y) { |
||
| 510 | |||
| 511 | /** |
||
| 512 | * Render an opening single quote char (language specific) |
||
| 513 | */ |
||
| 514 | public function singlequoteopening() { |
||
| 516 | |||
| 517 | /** |
||
| 518 | * Render a closing single quote char (language specific) |
||
| 519 | */ |
||
| 520 | public function singlequoteclosing() { |
||
| 522 | |||
| 523 | /** |
||
| 524 | * Render an apostrophe char (language specific) |
||
| 525 | */ |
||
| 526 | public function apostrophe() { |
||
| 528 | |||
| 529 | /** |
||
| 530 | * Render an opening double quote char (language specific) |
||
| 531 | */ |
||
| 532 | public function doublequoteopening() { |
||
| 534 | |||
| 535 | /** |
||
| 536 | * Render an closinging double quote char (language specific) |
||
| 537 | */ |
||
| 538 | public function doublequoteclosing() { |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Render a CamelCase link |
||
| 543 | * |
||
| 544 | * @param string $link The link name |
||
| 545 | * @see http://en.wikipedia.org/wiki/CamelCase |
||
| 546 | */ |
||
| 547 | public function camelcaselink($link) { |
||
| 549 | |||
| 550 | /** |
||
| 551 | * Render a page local link |
||
| 552 | * |
||
| 553 | * @param string $hash hash link identifier |
||
| 554 | * @param string $name name for the link |
||
| 555 | */ |
||
| 556 | public function locallink($hash, $name = null) { |
||
| 558 | |||
| 559 | /** |
||
| 560 | * Render a wiki internal link |
||
| 561 | * |
||
| 562 | * @param string $link page ID to link to. eg. 'wiki:syntax' |
||
| 563 | * @param string|array $title name for the link, array for media file |
||
| 564 | */ |
||
| 565 | public function internallink($link, $title = null) { |
||
| 567 | |||
| 568 | /** |
||
| 569 | * Render an external link |
||
| 570 | * |
||
| 571 | * @param string $link full URL with scheme |
||
| 572 | * @param string|array $title name for the link, array for media file |
||
| 573 | */ |
||
| 574 | public function externallink($link, $title = null) { |
||
| 576 | |||
| 577 | /** |
||
| 578 | * Render the output of an RSS feed |
||
| 579 | * |
||
| 580 | * @param string $url URL of the feed |
||
| 581 | * @param array $params Finetuning of the output |
||
| 582 | */ |
||
| 583 | public function rss($url, $params) { |
||
| 585 | |||
| 586 | /** |
||
| 587 | * Render an interwiki link |
||
| 588 | * |
||
| 589 | * You may want to use $this->_resolveInterWiki() here |
||
| 590 | * |
||
| 591 | * @param string $link original link - probably not much use |
||
| 592 | * @param string|array $title name for the link, array for media file |
||
| 593 | * @param string $wikiName indentifier (shortcut) for the remote wiki |
||
| 594 | * @param string $wikiUri the fragment parsed from the original link |
||
| 595 | */ |
||
| 596 | public function interwikilink($link, $title, $wikiName, $wikiUri) { |
||
| 598 | |||
| 599 | /** |
||
| 600 | * Link to file on users OS |
||
| 601 | * |
||
| 602 | * @param string $link the link |
||
| 603 | * @param string|array $title name for the link, array for media file |
||
| 604 | */ |
||
| 605 | public function filelink($link, $title = null) { |
||
| 607 | |||
| 608 | /** |
||
| 609 | * Link to windows share |
||
| 610 | * |
||
| 611 | * @param string $link the link |
||
| 612 | * @param string|array $title name for the link, array for media file |
||
| 613 | */ |
||
| 614 | public function windowssharelink($link, $title = null) { |
||
| 616 | |||
| 617 | /** |
||
| 618 | * Render a linked E-Mail Address |
||
| 619 | * |
||
| 620 | * Should honor $conf['mailguard'] setting |
||
| 621 | * |
||
| 622 | * @param string $address Email-Address |
||
| 623 | * @param string|array $name name for the link, array for media file |
||
| 624 | */ |
||
| 625 | public function emaillink($address, $name = null) { |
||
| 627 | |||
| 628 | /** |
||
| 629 | * Render an internal media file |
||
| 630 | * |
||
| 631 | * @param string $src media ID |
||
| 632 | * @param string $title descriptive text |
||
| 633 | * @param string $align left|center|right |
||
| 634 | * @param int $width width of media in pixel |
||
| 635 | * @param int $height height of media in pixel |
||
| 636 | * @param string $cache cache|recache|nocache |
||
| 637 | * @param string $linking linkonly|detail|nolink |
||
| 638 | */ |
||
| 639 | public function internalmedia($src, $title = null, $align = null, $width = null, |
||
| 642 | |||
| 643 | /** |
||
| 644 | * Render an external media file |
||
| 645 | * |
||
| 646 | * @param string $src full media URL |
||
| 647 | * @param string $title descriptive text |
||
| 648 | * @param string $align left|center|right |
||
| 649 | * @param int $width width of media in pixel |
||
| 650 | * @param int $height height of media in pixel |
||
| 651 | * @param string $cache cache|recache|nocache |
||
| 652 | * @param string $linking linkonly|detail|nolink |
||
| 653 | */ |
||
| 654 | public function externalmedia($src, $title = null, $align = null, $width = null, |
||
| 657 | |||
| 658 | /** |
||
| 659 | * Render a link to an internal media file |
||
| 660 | * |
||
| 661 | * @param string $src media ID |
||
| 662 | * @param string $title descriptive text |
||
| 663 | * @param string $align left|center|right |
||
| 664 | * @param int $width width of media in pixel |
||
| 665 | * @param int $height height of media in pixel |
||
| 666 | * @param string $cache cache|recache|nocache |
||
| 667 | */ |
||
| 668 | public function internalmedialink($src, $title = null, $align = null, |
||
| 671 | |||
| 672 | /** |
||
| 673 | * Render a link to an external media file |
||
| 674 | * |
||
| 675 | * @param string $src media ID |
||
| 676 | * @param string $title descriptive text |
||
| 677 | * @param string $align left|center|right |
||
| 678 | * @param int $width width of media in pixel |
||
| 679 | * @param int $height height of media in pixel |
||
| 680 | * @param string $cache cache|recache|nocache |
||
| 681 | */ |
||
| 682 | public function externalmedialink($src, $title = null, $align = null, |
||
| 685 | |||
| 686 | /** |
||
| 687 | * Start a table |
||
| 688 | * |
||
| 689 | * @param int $maxcols maximum number of columns |
||
| 690 | * @param int $numrows NOT IMPLEMENTED |
||
| 691 | * @param int $pos byte position in the original source |
||
| 692 | */ |
||
| 693 | public function table_open($maxcols = null, $numrows = null, $pos = null) { |
||
| 695 | |||
| 696 | /** |
||
| 697 | * Close a table |
||
| 698 | * |
||
| 699 | * @param int $pos byte position in the original source |
||
| 700 | */ |
||
| 701 | public function table_close($pos = null) { |
||
| 703 | |||
| 704 | /** |
||
| 705 | * Open a table header |
||
| 706 | */ |
||
| 707 | public function tablethead_open() { |
||
| 709 | |||
| 710 | /** |
||
| 711 | * Close a table header |
||
| 712 | */ |
||
| 713 | public function tablethead_close() { |
||
| 715 | |||
| 716 | /** |
||
| 717 | * Open a table body |
||
| 718 | */ |
||
| 719 | public function tabletbody_open() { |
||
| 721 | |||
| 722 | /** |
||
| 723 | * Close a table body |
||
| 724 | */ |
||
| 725 | public function tabletbody_close() { |
||
| 727 | |||
| 728 | /** |
||
| 729 | * Open a table footer |
||
| 730 | */ |
||
| 731 | public function tabletfoot_open() { |
||
| 733 | |||
| 734 | /** |
||
| 735 | * Close a table footer |
||
| 736 | */ |
||
| 737 | public function tabletfoot_close() { |
||
| 739 | |||
| 740 | /** |
||
| 741 | * Open a table row |
||
| 742 | */ |
||
| 743 | public function tablerow_open() { |
||
| 745 | |||
| 746 | /** |
||
| 747 | * Close a table row |
||
| 748 | */ |
||
| 749 | public function tablerow_close() { |
||
| 751 | |||
| 752 | /** |
||
| 753 | * Open a table header cell |
||
| 754 | * |
||
| 755 | * @param int $colspan |
||
| 756 | * @param string $align left|center|right |
||
| 757 | * @param int $rowspan |
||
| 758 | */ |
||
| 759 | public function tableheader_open($colspan = 1, $align = null, $rowspan = 1) { |
||
| 761 | |||
| 762 | /** |
||
| 763 | * Close a table header cell |
||
| 764 | */ |
||
| 765 | public function tableheader_close() { |
||
| 767 | |||
| 768 | /** |
||
| 769 | * Open a table cell |
||
| 770 | * |
||
| 771 | * @param int $colspan |
||
| 772 | * @param string $align left|center|right |
||
| 773 | * @param int $rowspan |
||
| 774 | */ |
||
| 775 | public function tablecell_open($colspan = 1, $align = null, $rowspan = 1) { |
||
| 777 | |||
| 778 | /** |
||
| 779 | * Close a table cell |
||
| 780 | */ |
||
| 781 | public function tablecell_close() { |
||
| 783 | |||
| 784 | #endregion |
||
| 785 | |||
| 786 | #region util functions, you probably won't need to reimplement them |
||
| 787 | |||
| 788 | /** |
||
| 789 | * Creates a linkid from a headline |
||
| 790 | * |
||
| 791 | * @author Andreas Gohr <[email protected]> |
||
| 792 | * @param string $title The headline title |
||
| 793 | * @param boolean $create Create a new unique ID? |
||
| 794 | * @return string |
||
| 795 | */ |
||
| 796 | public function _headerToLink($title, $create = false) { |
||
| 804 | |||
| 805 | /** |
||
| 806 | * Removes any Namespace from the given name but keeps |
||
| 807 | * casing and special chars |
||
| 808 | * |
||
| 809 | * @author Andreas Gohr <[email protected]> |
||
| 810 | * |
||
| 811 | * @param string $name |
||
| 812 | * @return string |
||
| 813 | */ |
||
| 814 | protected function _simpleTitle($name) { |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Resolve an interwikilink |
||
| 832 | * |
||
| 833 | * @param string $shortcut identifier for the interwiki link |
||
| 834 | * @param string $reference fragment that refers the content |
||
| 835 | * @param null|bool $exists reference which returns if an internal page exists |
||
| 836 | * @return string interwikilink |
||
| 837 | */ |
||
| 838 | public function _resolveInterWiki(&$shortcut, $reference, &$exists = null) { |
||
| 895 | |||
| 896 | #endregion |
||
| 897 | } |
||
| 898 | |||
| 901 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.