Download the PHP package alexrili/phmap without Composer

On this page you can find all versions of the php package alexrili/phmap. 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 phmap

Phmap

This is just a payload map written in php. This lib helps you to get values from A structure and put it on B struscture

Screenshot 2022-12-04 at 02 09 39

Note: Phmap uses illuminate/support under the hood. If you are using laravel or lumen framework, make sure that you version is >= 9.x, if you're not using any of these frameworks or this dependency(illuminate/support) , than you have nothing to worry about.

Install

Via Composer

Basic usage

Under the hood we provide a payload_map() helper function. The payload_map() accpets two arguments: 1º is your input data, 2º is your map config. Both needs to be array type. Let`s see the example bellow.

Now let's imagine that you have a multliple values from an array and needs to change the inside properties. With Phmap you can do that :)

Notice: The mainAddress property was not in the new payload, this is happening because we're not tells the payload map to map that

Map configs

Direct values

you can map a value from a direct path in your structure just point where the values are in from key and point the destination path within to key

Concatanated values

you can concatanate one or more values using the .+. symbol

Fixed values

you can add some fixed values using the__()__ symbol

Collection(array) of values

you can map a nested property inside an array using the .*. symbol

One Or Antoher value

you can map two(or more) direferente paths to bring a value, then the phmap will go through all the paths until it finds a value. To make one or another value, you can use || symbol

Nullable values

you may need to map some properties that has a null value, for that you just need to pass a string flag called nullable with one of this two values ["true"|"false"], if trues, means you want to bring this property to you new structure even if their value is null.

Default value is "false"

Advanced usage

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email alexrili instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of phmap with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
alexrili/vephar Version ^2.0
illuminate/support Version >=9
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 alexrili/phmap contains the following files

Loading the files please wait ....