Download the PHP package anteris-dev/faker-map without Composer

On this page you can find all versions of the php package anteris-dev/faker-map. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package faker-map

Your Factory's Guide to Faking

Tests Style

Have you ever wanted faker to just create some values for you automatically without having to instruct it on what they represent? Yeah, probably not, but at least you now know it's possible!

This package allows you to dynamically lookup the method you might be looking for by doing something like this: FakerMap::new()->closest('male name')->fake().

So how do you install it? How does it work? Let's dive in!

To Install

Run composer require anteris-dev/faker-map.

Getting Started

This FakerMap class comes with three useful methods for dynamically figuring out what value should be generated. The first of these methods is closeEnough(). This method takes a single string and finds the first possible Faker method that even comes close to matching it.

The second method is closest(). This also takes a single string but it tries to find the closest possible match to the Faker value you are looking for.

Finally, the guess() method allows you to determine how close or distant the match is. Its first parameter is the query and the second is an integer that defines how many letters may be changed in your query to make the match.

Each of these methods returns an instance of Anteris\FakerMap\FakerMap which gives you various addon methods that can be called to help you with your search for the perfect method. These methods are:

See examples of all of these below:

But why?

Why did we choose to create this package? Well, we wanted to be able to fake realistic values based on the names of properties retrieved using PHPs reflection API. This would allow us to fill the following class with realistic data. Pretty cool right?

Reference

There are some cool packages out there that do some cool things with Faker. While it did not suit our needs, Jason McCreary put together a nice Faker Registry package that does some similar things for generating Laravel Factory files. It may be worth checking out here. His registry array inspired our FakerDictionary class.


All versions of faker-map with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
fakerphp/faker Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anteris-dev/faker-map contains the following files

Loading the files please wait ....