PHPackages                             marvin255/value-object-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. marvin255/value-object-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

marvin255/value-object-bundle
=============================

Set of value objects for Dotrine in Symfony.

v0.2.1(3w ago)0121MITPHPPHP &gt;=8.4CI passing

Since Aug 31Pushed 3w agoCompare

[ Source](https://github.com/marvin255/value-object-bundle)[ Packagist](https://packagist.org/packages/marvin255/value-object-bundle)[ RSS](/packages/marvin255-value-object-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (32)Versions (10)Used By (0)

Value objects bundle
====================

[](#value-objects-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/c8a2431ef634dd30ede9a4172f829d3d9bb7bec8879c6bf2131334c0fae2a336/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f76616c75652d6f626a6563742d62756e646c652f76)](https://packagist.org/packages/marvin255/value-object-bundle)[![Total Downloads](https://camo.githubusercontent.com/c6d5f74d6110ad0fe6414373a810099dd0b0ccd11c776471631969de098e41bc/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f76616c75652d6f626a6563742d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/marvin255/value-object-bundle)[![License](https://camo.githubusercontent.com/fe471f647c4cf19b2d898f263145ebb46a41a4f586e94c5d4c32342a18360d77/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f76616c75652d6f626a6563742d62756e646c652f6c6963656e7365)](https://packagist.org/packages/marvin255/value-object-bundle)[![Build Status](https://github.com/marvin255/value-object-bundle/workflows/marvin255_value_object_bundle/badge.svg)](https://github.com/marvin255/value-object-bundle/actions?query=workflow%3A%22marvin255_value_object_bundle%22)

Symfony bundle that provides Doctrine types for common value objects such as Email, Uri, String, Integer, and FileInfo.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require marvin255/value-object-bundle
```

Configuration
-------------

[](#configuration)

Add the bundle to your `config/bundles.php` (if not done automatically):

```
return [
    // ...
    Marvin255\ValueObjectBundle\Marvin255ValueObjectBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

The bundle provides Doctrine DBAL types that automatically convert database values to value objects and vice versa.

### Supported Value Object Types

[](#supported-value-object-types)

- `marvin255_string` - StringValueObject
- `marvin255_non_empty_string` - StringNonEmptyValueObject
- `marvin255_email` - EmailValueObject
- `marvin255_uri` - UriValueObject
- `marvin255_file_info` - FileInfoValueObject
- `marvin255_integer` - IntValueObject
- `marvin255_positive_integer` - IntPositiveValueObject
- `marvin255_negative_integer` - IntNegativeValueObject
- `marvin255_non_negative_integer` - IntNonNegativeValueObject
- `marvin255_non_positive_integer` - IntNonPositiveValueObject
- `marvin255_float` - FloatValueObject
- `marvin255_percentage` - PercentageValueObject
- `marvin255_bc_math_number` - BcMathNumberValueObject (requires bcmath PHP extension)

### Optional Types

[](#optional-types)

Some types are only available when their corresponding PHP extensions are installed:

#### BcMath Type (marvin255\_bc\_math\_number)

[](#bcmath-type-marvin255_bc_math_number)

The `BcMathNumberValueObject` type provides arbitrary-precision decimal arithmetic using PHP's bcmath extension. It's automatically registered only if the `bcmath` extension is enabled.

To enable bcmath on your PHP installation, ensure it's installed and uncommented in `php.ini`:

```
extension=bcmath
```

If the extension is not available, the type will not be registered but the rest of the bundle will continue to function normally.

### Define Entity Properties

[](#define-entity-properties)

Use the Doctrine types in your entity mapping:

```
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Marvin255\ValueObject\EmailValueObject;
use Marvin255\ValueObject\StringValueObject;

#[ORM\Entity]
class User
{
    #[ORM\Column(type: 'marvin255_string')]
    private ?StringValueObject $name = null;

    #[ORM\Column(type: 'marvin255_email')]
    private EmailValueObject $email;

    public function setEmail(EmailValueObject $email): void
    {
        $this->email = $email;
    }

    public function getEmail(): EmailValueObject
    {
        return $this->email;
    }
}
```

### Working with Value Objects

[](#working-with-value-objects)

Create and work with value objects naturally in your code:

```
use Marvin255\ValueObject\EmailValueObject;
use Marvin255\ValueObject\StringValueObject;

$email = new EmailValueObject('user@example.com');
$name = new StringValueObject('John Doe');

$user->setEmail($email);
$user->setName($name);

$repository->save($user);
```

The bundle automatically handles conversion between value objects and their database representations.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance94

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Total

5

Last Release

27d ago

PHP version history (2 changes)v0.1.0PHP &gt;=8.3

v0.2.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c29b776ac327dcfcdfc20619a65826ad94a0cb554503386fb080299edfbe3e8?d=identicon)[marvin255](/maintainers/marvin255)

---

Top Contributors

[![marvin255](https://avatars.githubusercontent.com/u/2802915?v=4)](https://github.com/marvin255 "marvin255 (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

doctrinedoctrine-typesphpsymfonysymfony-bundlevalue-objectphpsymfonyValue Objectdoctrine

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marvin255-value-object-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/marvin255-value-object-bundle/health.svg)](https://phpackages.com/packages/marvin255-value-object-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

9410.8k](/packages/ahmed-bhs-doctrine-doctor)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
