private function mapDataToFactObjects(array $data)
    {
        return array_map(function($factData) {
            return (new Fact)
                ->setText($factData['text'])
                ->setGroups($factData['groups'])
            ;
        }, $data);
    }
private function mapDataToFactObjects(array $data)
    {
        return array_map(function($factData) {
            return (new Fact)
                ->setText($factData['text'])
                ->setGroups($factData['groups'])
            ;
        }, $data);
    }
private function mapDataToFactObjects ( array $ data ) { return array_map ( function ( $ factData ) { return ( new Fact ) -> setText ( $ factData [ 'text' ] ) -> setGroups ( $ factData [ 'groups' ] ) ; } , $ data ) ; }
Converts an array of data to an array of Fact objects.
@param array $data An array of data with two keys: "text" and "groups"
where text must be a string and groups must be an array of strings.
@return array
Converts an array of data to an array of Fact objects .