Installation
Requirements
PhpCollection only needs PHP ^8.1
. That’s all!
Basic installation
Install PhpCollection with Composer:
composer require steevanb/php-collection:5.*
See getting-started.
Symfony bridge
PhpCollection comes with a bridge for Symfony ^6.1
to be integrated with symfony/serializer.
By default, the bridge is not autoloaded, to not add useless files to Composer autoload when you want to use PhpCollection as a simple PHP library, outside of Symfony.
You will need to do some manuals steps to install the bridge.
Add the bridge to your Composer autoload in composer.json
:
{
"autoload": {
"psr-4": {
"Steevanb\\PhpCollection\\Bridge\\Symfony\\": "vendor/steevanb/php-collection/bridge/Symfony"
}
}
}
Add PhpCollectionBundle
in config/bundles.php
:
return [
Steevanb\PhpCollection\Bridge\Symfony\PhpCollectionBundle::class => ['all' => true]
];