public function add_events( array $stops ): void {

		$this->events = array_merge( $this->events, $stops );

		/**
		 * @var int|string $key
		 * @var array      $data
		 */
		foreach ( $stops as $key => $data ) {

			if ( is_int( $key ) ) {
				/** @var array{0:string} $data */
				$this->add_event( ...$data );
				continue;
			}

			/** @var int $priority */
			foreach ( array_keys( $data ) as $priority ) {
				add_action( $key, [ $this, 'tick' ], $priority );
			}
		}
	}
public function add_events( array $stops ): void {

		$this->events = array_merge( $this->events, $stops );

		/**
		 * @var int|string $key
		 * @var array      $data
		 */
		foreach ( $stops as $key => $data ) {

			if ( is_int( $key ) ) {
				/** @var array{0:string} $data */
				$this->add_event( ...$data );
				continue;
			}

			/** @var int $priority */
			foreach ( array_keys( $data ) as $priority ) {
				add_action( $key, [ $this, 'tick' ], $priority );
			}
		}
	}
public function add_events ( array $ stops ) : void { $ this -> events = array_merge ( $ this -> events , $ stops ) ; /**
		 * @var int|string $key
		 * @var array      $data
		 */ foreach ( $ stops as $ key => $ data ) { if ( is_int ( $ key ) ) { /** @var array{0:string} $data */ $ this -> add_event ( ... $ data ) ; continue ; } /** @var int $priority */ foreach ( array_keys ( $ data ) as $ priority ) { add_action ( $ key , [ $ this , 'tick' ] , $ priority ) ; } } }
Hook events by name and priority from array.

@param array $stops Starts and stops to hook.
Hook events by name and priority from array .