Source for file Route.php

Documentation is available at Route.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6. * ScriptReorganizer Strategy :: Route
  7. *
  8. * PHP version 5
  9. *
  10. * LICENSE: This library is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU Lesser General Public License as published by the Free
  12. * Software Foundation; either version 2.1 of the License, or (at your option) any
  13. * later version.
  14. *
  15. * @category Tools
  16. * @package ScriptReorganizer
  17. * @subpackage Strategy
  18. * @author Stefano F. Rausch <stefano@rausch-e.net>
  19. * @copyright 2005 Stefano F. Rausch <stefano@rausch-e.net>
  20. * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  21. * @version SVN: $Id: Route.php 21 2005-09-26 15:55:48Z stefanorausch $
  22. * @link http://pear.php.net/package/ScriptReorganizer
  23. * @filesource
  24. */
  25.  
  26. /**
  27. * Implements <kbd>ScriptReorganizer_Strategy</kbd>
  28. */
  29. require_once 'ScriptReorganizer/Strategy.php';
  30.  
  31. /**
  32. * Basic strategy
  33. *
  34. * Reorganizes scripts by replacing two or more consecutive blank lines with a single
  35. * one.
  36. *
  37. * @category Tools
  38. * @package ScriptReorganizer
  39. * @subpackage Strategy
  40. * @author Stefano F. Rausch <stefano@rausch-e.net>
  41. * @copyright 2005 Stefano F. Rausch <stefano@rausch-e.net>
  42. * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  43. * @version Release: 0.4.0
  44. * @link http://pear.php.net/package/ScriptReorganizer
  45. */
  46. class ScriptReorganizer_Strategy_Route implements ScriptReorganizer_Strategy
  47. {
  48. // {{{ public function reformat( & $content, $eol )
  49. /**
  50. * Performs the main reorganization of the script's content
  51. *
  52. * @param string &$content a string representing the script's content
  53. * @param string $eol a string representing the EOL identifier to use
  54. * @return string a string representing the reorganized content
  55. */
  56. public function reformat( & $content, $eol )
  57. {
  58. $multiBlankLines = '"([ \t]*[' . $eol . ']){3,}"';
  59. $result = preg_replace( $multiBlankLines, $eol . $eol, $content );
  60. return $result;
  61. }
  62. // }}}
  63.  
  64. }
  65.  
  66. /*
  67. * Local variables:
  68. * tab-width: 4
  69. * c-basic-offset: 4
  70. * c-hanging-comment-ender-p: nil
  71. * End:
  72. */
  73.  
  74. ?>

Documentation generated on Tue, 22 Nov 2005 01:57:13 +0100 by phpDocumentor 1.3.0RC3