src/Graviton/SchemaBundle/SchemaUtils.php
private function getSchemaVariationName($userData, $variations)
    {
        foreach ($variations as $variationName => $expressions) {
            $results = array_map(
                function ($expression) use ($userData) {
                    return $this->jmesRuntime->__invoke($expression, $userData);
                },
                $expressions
            );

            $results = array_unique($results);

            if (count($results) == 1 && $results[0] === true) {
                return $variationName;
            }
        }

        return null;
    }
private function getSchemaVariationName($userData, $variations)
    {
        foreach ($variations as $variationName => $expressions) {
            $results = array_map(
                function ($expression) use ($userData) {
                    return $this->jmesRuntime->__invoke($expression, $userData);
                },
                $expressions
            );

            $results = array_unique($results);

            if (count($results) == 1 && $results[0] === true) {
                return $variationName;
            }
        }

        return null;
    }
private function getSchemaVariationName ( $ userData , $ variations ) { foreach ( $ variations as $ variationName => $ expressions ) { $ results = array_map ( function ( $ expression ) use ( $ userData ) { return $ this -> jmesRuntime -> __invoke ( $ expression , $ userData ) ; } , $ expressions ) ; $ results = array_unique ( $ results ) ; if ( count ( $ results ) == 1 && $ results [ 0 ] === true ) { return $ variationName ; } } return null ; }
gets the name of the variation to apply based on userdata and the service definition

@param \stdClass $userData   user data
@param \stdClass $variations variations as defined in schema

@return string|null the variation name or null if none
gets the name of the variation to apply based on userdata and the service definition