src/Document.php
/**
     * Creates a new Event of the specified type and returns it.
     *
     * @see https://dom.spec.whatwg.org/#dom-document-createevent
     *
     * @throws \Rowbot\DOM\Exception\NotSupportedError
     */
Creates a new Event of the specified type and returns it.


Creates a new Event of the specified type and returns it .
public function createEvent(string $interface): Event
    {
        $constructor = null;
        $interface = strtolower($interface);
        switch ($interface) {
            case 'customevent':
                $constructor = '\\Rowbot\\DOM\\Event\\CustomEvent';
                break;
            case 'event':
            case 'events':
            case 'htmlevents':
                $constructor = '\\Rowbot\\DOM\\Event\\Event';
        }
        if (!$constructor) {
            throw new NotSupportedError();
        }
        $event = new $constructor('');
        $event->unsetFlag(EventFlags::INITIALIZED);
        return $event;
    }
public function createEvent ( string $ interface ) : Event { $ constructor = null ; $ interface = strtolower ( $ interface ) ; switch ( $ interface ) { case 'customevent' : $ constructor = '\\Rowbot\\DOM\\Event\\CustomEvent' ; break ; case 'event' : case 'events' : case 'htmlevents' : $ constructor = '\\Rowbot\\DOM\\Event\\Event' ; } if ( ! $ constructor ) { throw new NotSupportedError ( ) ; } $ event = new $ constructor ( '' ) ; $ event -> unsetFlag ( EventFlags :: INITIALIZED ) ; return $ event ; }
Creates a new Event of the specified type and returns it.
Creates a new Event of the specified type and returns it .