Example #1
0
 public function __construct()
 {
     $app = new Application();
     if ($app->getInstance() != NULL) {
         $this->app = $app::getInstance();
     } else {
         $this->app = $app;
     }
 }
Example #2
0
 public function testApplicationIsSingleton()
 {
     $container = new Application($this->path);
     $this->assertSame($container, Application::getInstance());
     $container2 = new Application($this->path);
     $this->assertInstanceOf(Application::class, $container2);
     $this->assertNotSame($container, $container2);
 }
Example #3
0
 /**
  * Get the available container instance.
  *
  * @return application main instance
  */
 function app()
 {
     return \Betasyntax\Core\Application::getInstance();
 }