foo.php 668 B

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