Download the PHP package norse-blue/prim without Composer
On this page you can find all versions of the php package norse-blue/prim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download norse-blue/prim
More information about norse-blue/prim
Files in norse-blue/prim
Package prim
Short Description PHP Primitive Objects
License MIT
Homepage https://norse.blue/open-source/php-prim
Informations about the package prim
DEPRECATED: This package was growing too big and has now been deprecated in favor of the following smaller, segmented and more contained packages:
- norse-blue/collection-objects
- norse-blue/enum-objects
- norse-blue/extensible-objects
- norse-blue/handy-properties
- norse-blue/optionals
- norse-blue/scalar-objects
- norse-blue/value-objects
PHP Prim is a PHP library that exposes primitive types as immutable objects with convenience methods to operate on them.
Installation
Requirements:
- PHP 7.3+
- BC Math extension (for UUIDs)
- JSON extension
- Multibyte String extension
Install Prim using Composer:
Usage
There are three ways to create a primitive object instance:
-
Using the
new
keyword: -
Using the facades:
_Note: params passed by reference are not supported in facades because the calls depend on
__callStatic
, which does not pass params by reference. See Overloading._ - Using the namespaced functions:
You can also chain methods together:
You don't need to worry about side-effects for scalar objects, as they are implemented as immutable objects and each method returns a new object. To store the value don't forget to assign it to a variable or it will be lost.
Documentation
For the full documentation refer to the docs folder.
Changelog
Please refer to the CHANGELOG.md file for more information about what has changed recently.
Contributing
Contributions to this project are accepted and encouraged. Please read the CONTRIBUTING.md file for details on contributions.
Credits
- Axel Pardemann
- All Contributors
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Support the development
Do you like this project? Support it by donating
License
PHP Prim is open-sourced software licensed under the MIT license.
All versions of prim with dependencies
ext-bcmath Version *
ext-json Version *
ext-mbstring Version *
doctrine/inflector Version ^1.3
moontoast/math Version ^1.1
norse-blue/extensible-objects Version ^0.3
ramsey/uuid Version ^3.8