Download the PHP package darsyn/unboxer without Composer

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

Simple utility to unbox complex data structures (objects) to native data types, suitable for encoding (for example, JSON).

Documentation

Code of Conduct

This project includes and adheres to the Contributor Covenant as a Code of Conduct.

Supported Types

This library returns all scalar and null values as-is, plus recursively processing all array (and stdClass) types.

When this library encounters an object that is an instance of a known type, it will attempt to convert it by using the return value of a specific method. Object types supported by this library out-of-the-box include:

Additionally, any user-land object can implement UnboxableInterface. Similar to JsonSerializable::jsonSerialize() method, the __unbox method can return anything as a representation of its internal state. It is recommended to return unboxable objects as-is, as everything returned from UnboxableInterface::__unbox is recursively iterated over anyway.

Brief Example

var_dumping the variable $output results in:

Note that returning multiple nested unboxable objects will result in the output collapsing down into a single value:

Extending

Additional known object types can be added by extending Unboxer and overriding the getKnownDataTypes method. For each known object type, either a closure or an array specifying which method to call on the object may can specified:

The unboxer will, by default, convert any objects with the __toString() magic method to a string. To turn this functionality off, extend Unboxer and override the class constant STRINGIFY_OBJECTS.

License

Please see the separate license file included in this repository for a full copy of the MIT license, which this project is licensed under.

Authors

If you make a contribution (submit a pull request), don't forget to add your name here!


All versions of unboxer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 darsyn/unboxer contains the following files

Loading the files please wait ....