getInstance() public static method

Instantiate Zit or the extending, statically called class
public static getInstance ( ) : object
return object
Beispiel #1
0
 public function testStashWithSameIdAsProtectedProperty()
 {
     $zit = Zit::getInstance();
     $instance = new \stdClass();
     $instance->id = 'testServices';
     $zit->stash('services', $instance);
     $this->assertTrue($zit->services instanceof \stdClass);
     $this->assertSame('testServices', $zit->services->id);
 }
Beispiel #2
0
 public function testExtend()
 {
     $zit = Zit::getInstance();
     $zit->extend('myCallable', function () {
         return 12345;
     });
     $this->assertTrue($zit->myCallable() === 12345);
     $this->assertTrue(Zit::myCallable() === 12345);
 }
 function minimee()
 {
     return Zit::getInstance();
 }