splash / metadata
Splash Metadata Accessor for Symfony Applications
Installs: 7 164
Dependents: 5
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
Type:symfony-bundle
pkg:composer/splash/metadata
Requires
- php: ^8.1
- ext-json: *
- burgov/key-value-form-bundle: @stable
- gaufrette/ftp-adapter: @stable
- gaufrette/phpseclib-sftp-adapter: @stable
- splash/php-bundle: dev-master
Requires (Dev)
- badpixxel/php-sdk: ^2.0
- splash/toolkit: dev-master
README
Splash Metadata
Metadata-driven field automation for Splash Sync on Doctrine entities.
Splash Metadata eliminates manual field definitions in Splash connectors by using PHP 8.1+ attributes to automatically discover, configure, and expose Doctrine entity properties as Splash fields.
What It Does
- Automatic field discovery -- annotate your Doctrine entities with PHP attributes, and Splash Metadata collects, types, and publishes fields for you.
- SubResource & ListResource support -- nested objects (addresses, line items) are flattened into child fields with zero boilerplate.
- Built-in data transformation -- PHP types (
DateTime,bool,float, ...) are converted to/from Splash types transparently.
Installation
composer require splash/metadata
The Symfony bundle is registered automatically via Flex.
Quick Start
use Doctrine\ORM\Mapping as ORM;
use Splash\Metadata\Attributes as SPL;
#[ORM\Entity]
#[SPL\SplashObject(name: "Product", ico: "fa fa-box")]
class Product
{
#[ORM\Id]
#[ORM\Column]
#[ORM\GeneratedValue]
public ?int $id = null;
#[ORM\Column]
#[SPL\Field(desc: "Product name")]
#[SPL\Flags(required: true, listed: true, searchable: true)]
#[SPL\Microdata(itemType: "https://schema.org/Product", itemProp: "name")]
public ?string $name = null;
#[ORM\Column(nullable: true)]
#[SPL\Field(desc: "Unit price")]
public ?float $price = null;
#[ORM\Column(nullable: true)]
#[SPL\Field(desc: "Is product active")]
public ?bool $active = null;
}
That's it. The library handles field collection, type detection, and data transformation automatically.
Compatibility
| PHP | Symfony 5.4 | Symfony 6.4 | Symfony 7.0 |
|---|---|---|---|
| 8.1 | yes | yes | -- |
| 8.2 | yes | yes | yes |
| 8.3 | -- | yes | yes |
| 8.4 | -- | -- | yes |
Runtime requirement: splash/php-bundle ^3.0
Documentation
| Page | Description |
|---|---|
| Attributes Reference | Complete reference of all 24 PHP attributes |
| Fields | Field discovery lifecycle, identifiers, type detection |
| SubResources | Nested objects, ListResource, separator patterns |
| Multilingual | Language attribute, multi-language field grouping |
| Data Transformers | Built-in transformers, custom transformer creation |
| Generic Objects | GenericDoctrineObject, AbstractDoctrineObject |
Contributing
All code must pass quality checks before commit:
make quality # Runs lint + style + stan (GrumPHP via badpixxel/php-sdk)
Individual suites:
make lint # Linters (composer, phplint, jsonlint, xmllint, yamllint)
make style # Code standards (phpcpd, phpcs, phpmd, phpcsfixer)
make stan # PHPStan static analysis
Run tests across all supported PHP versions with Docker:
make test # PHPUnit in all containers (PHP 8.1-8.4)
make verify # quality + tests in all containers
License
This project is licensed under the MIT License. See LICENSE for details.
