public final function once( $eventName, $eventCallback ) {

			if ( !is_string( $eventName ) ) {
			
				throw new \browserfs\Exception('Invalid argument $eventName: string expected');
			
			} else {
			
				if ( !strlen( $eventName ) ) {
			
					throw new \browserfs\Exception('Invalid argument $eventName: expected non-empty string');
			
				} else {
			
					if ( !is_callable( $eventCallback ) ) {
			
						throw new \browserfs\Exception('Invalid argument $eventCallback: callable expected' );
			
					} else {

						$this->events[ $eventName ] = isset( $this->events[ $eventName ] ) ? $this->events[ $eventName ] : [];

						$this->events[ $eventName ][] = [
							'once' => true,
							'callback' => $eventCallback,
							'fireId' => 0
						];
					}
				}
			}
		}
public final function once( $eventName, $eventCallback ) {

			if ( !is_string( $eventName ) ) {
			
				throw new \browserfs\Exception('Invalid argument $eventName: string expected');
			
			} else {
			
				if ( !strlen( $eventName ) ) {
			
					throw new \browserfs\Exception('Invalid argument $eventName: expected non-empty string');
			
				} else {
			
					if ( !is_callable( $eventCallback ) ) {
			
						throw new \browserfs\Exception('Invalid argument $eventCallback: callable expected' );
			
					} else {

						$this->events[ $eventName ] = isset( $this->events[ $eventName ] ) ? $this->events[ $eventName ] : [];

						$this->events[ $eventName ][] = [
							'once' => true,
							'callback' => $eventCallback,
							'fireId' => 0
						];
					}
				}
			}
		}
public final function once ( $ eventName , $ eventCallback ) { if ( ! is_string ( $ eventName ) ) { throw new \ browserfs \ Exception ( 'Invalid argument $eventName: string expected' ) ; } else { if ( ! strlen ( $ eventName ) ) { throw new \ browserfs \ Exception ( 'Invalid argument $eventName: expected non-empty string' ) ; } else { if ( ! is_callable ( $ eventCallback ) ) { throw new \ browserfs \ Exception ( 'Invalid argument $eventCallback: callable expected' ) ; } else { $ this -> events [ $ eventName ] = isset ( $ this -> events [ $ eventName ] ) ? $ this -> events [ $ eventName ] : [ ] ; $ this -> events [ $ eventName ] [ ] = [ 'once' => true , 'callback' => $ eventCallback , 'fireId' => 0 ] ; } } } }
Adds a event listener that will be fired only once.
@param eventName: string
@param eventCallback: callable( $e: \browserfs\Event ) => void
@throws \browserfs\Exception
Adds a event listener that will be fired only once .