gui\Application::__construct PHP Method

__construct() public method

The constructor method
public __construct ( array $defaultAttributes = [], React\EventLoop\LoopInterface $loop = null ) : void
$defaultAttributes array
$loop React\EventLoop\LoopInterface
return void
    public function __construct(array $defaultAttributes = [], LoopInterface $loop = null)
    {
        $this->window = $window = new Window([], null, $this);
        $this->loop = $loop ?: Factory::create();
        $this->on('start', function () use($window, $defaultAttributes) {
            foreach ($defaultAttributes as $attr => $value) {
                $method = 'set' . ucfirst($attr);
                if (method_exists($window, $method)) {
                    $window->{$method}($value);
                }
            }
        });
    }