foo.php 644 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. class FooClass
  3. {
  4. public $bar = null, $initialized = false, $configured = false, $called = false, $arguments = array();
  5. public function __construct($arguments = array())
  6. {
  7. $this->arguments = $arguments;
  8. }
  9. static public function getInstance($arguments = array())
  10. {
  11. $obj = new self($arguments);
  12. $obj->called = true;
  13. return $obj;
  14. }
  15. public function initialize()
  16. {
  17. $this->initialized = true;
  18. }
  19. public function configure()
  20. {
  21. $this->configured = true;
  22. }
  23. public function setBar($value = null)
  24. {
  25. $this->bar = $value;
  26. }
  27. }