oskarstark / trimmed-non-empty-string
This library provides a value object which ensures a trimmed non empty string.
Installs: 936 617
Dependents: 15
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/oskarstark/trimmed-non-empty-string
Requires
- php: >=8.2
- symfony/string: ^6.0 || ^7.0 || ^8.0
- webmozart/assert: ^1.11 || ^2.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.45
- ergebnis/data-provider: ^3.2
- fakerphp/faker: ^1.24
- friendsofphp/php-cs-fixer: ^3.70
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5
- dev-main
- 1.11.1
- 1.11.0
- 1.10.0
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.1
- 1.0.0
- 0.2.1
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- dev-use-assertNotSame
- dev-php82-cs-fixer-rules
- dev-remove-php-cs-fixer-env
- dev-replace-ergebnis-test-util
- dev-rename-phpstan-config
- dev-php-8.2-version
- dev-upgrade-phpunit-10
This package is auto-updated.
Last update: 2026-01-12 07:11:26 UTC
README
This library provides a value object which ensures a trimmed non empty string.
Installation
composer require oskarstark/trimmed-non-empty-string
Usage
<?php declare(strict_types=1); namespace App\Domain\Value\Name; use OskarStark\Value\TrimmedNonEmptyString; final class Name { private string $value; private function __construct(string $value) { $this->value = TrimmedNonEmptyString::fromString($value)->toString(); } public static function fromString(string $value): self { return new self($value); } public function toString(): string { return $this->value; } }