webnet-fr / database-anonymizer

CLI tool an PHP library to anonymize data in various databases
MIT License
33 stars 16 forks source link

Error when using longitude + latitude faker formatter #4

Open r-ichard opened 3 years ago

r-ichard commented 3 years ago

When I use longitude / latitude fields since it can return negative floats so Anonymizer throw an error :

In Anonymizer.php line 46

  [WebnetFr\DatabaseAnonymizer\Exception\InvalidAnonymousValueException]  
  Generated value must be null or string  
sload commented 3 years ago

Hello @r-ichard,

Could you give me more elements so that I can reproduce the error ?

r-ichard commented 3 years ago

Hello,

Sure ! Here is my config file :

webnet_fr_database_anonymizer:
    tables:
        project:
            fields:
                name:
                    generator: faker
                    formatter: word
                longitude:
                    generator: faker
                    formatter: longitude
                latitude:
                    generator: faker
                    formatter: latitude
                address:
                    generator: faker
                    formatter: streetAddress
                zipCode:
                    generator: faker
                    formatter: postcode
                city:
                    generator: faker
                    formatter: city
                address_typed:
                    generator: faker
                    formatter: streetAddress

If I dump $anonValue in Anonymizer on line 46 i get : 149.299745