Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if a value exists in an array
<?php in_array(mixed $needle, array $haystack, bool $strict = false): bool
<?php             ! isset($event['requestContext']['domainName']) ||

            ! isset($event['requestContext']['apiId']) ||

            ! isset($event['requestContext']['stage']) ||

            ! in_array(

                $event['requestContext']['eventType'],

                [

                    'CONNECT',

                    'DISCONNECT',

                    'MESSAGE',

                ],

                true

            )

        ) {

            throw new InvalidLambdaEvent('Websocket', $event);

        }