Abstract.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_CodeGenerator
  17. * @subpackage PHP
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_CodeGenerator_Abstract
  24. */
  25. require_once 'Zend/CodeGenerator/Abstract.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_CodeGenerator
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. abstract class Zend_CodeGenerator_Php_Abstract extends Zend_CodeGenerator_Abstract
  33. {
  34. /**
  35. * Line feed to use in place of EOL
  36. *
  37. */
  38. const LINE_FEED = "\n";
  39. /**
  40. * @var bool
  41. */
  42. protected $_isSourceDirty = true;
  43. /**
  44. * @var int|string
  45. */
  46. protected $_indentation = ' ';
  47. /**
  48. * setSourceDirty()
  49. *
  50. * @param bool $isSourceDirty
  51. * @return Zend_CodeGenerator_Php_Abstract
  52. */
  53. public function setSourceDirty($isSourceDirty = true)
  54. {
  55. $this->_isSourceDirty = ($isSourceDirty) ? true : false;
  56. return $this;
  57. }
  58. /**
  59. * isSourceDirty()
  60. *
  61. * @return bool
  62. */
  63. public function isSourceDirty()
  64. {
  65. return $this->_isSourceDirty;
  66. }
  67. /**
  68. * setIndentation()
  69. *
  70. * @param string|int $indentation
  71. * @return Zend_CodeGenerator_Php_Abstract
  72. */
  73. public function setIndentation($indentation)
  74. {
  75. $this->_indentation = $indentation;
  76. return $this;
  77. }
  78. /**
  79. * getIndentation()
  80. *
  81. * @return string|int
  82. */
  83. public function getIndentation()
  84. {
  85. return $this->_indentation;
  86. }
  87. }