public function __construct($app = null) { if (!is_object($app)) { $this->app = mw(); } else { $this->app = $app; } }