PHPackages                             php-etl/string-expression-language - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-etl/string-expression-language

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-etl/string-expression-language
==================================

This library implements functions for manipulating string data in ExpressionLanguage

v0.2.2(2y ago)03.4k[1 issues](https://github.com/php-etl/string-expression-language/issues)MITPHPPHP ^8.2CI failing

Since Feb 20Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/php-etl/string-expression-language)[ Packagist](https://packagist.org/packages/php-etl/string-expression-language)[ RSS](/packages/php-etl-string-expression-language/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (9)Used By (0)

String Expression Language
==========================

[](#string-expression-language)

This package extends the [ExpressionLanguage](https://symfony.com/doc/current/components/expression_language.html) component of Symfony to compile and evaluate arrays with custom functions.

[![Mutations](https://github.com/php-etl/string-expression-language/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/infection.yaml)[![PHPUnit](https://github.com/php-etl/string-expression-language/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/phpunit.yaml)[![Quality](https://github.com/php-etl/string-expression-language/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/quality.yaml)[![PHPStan level 5](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-5.yaml)[![PHPStan level 6](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-6.yaml)[![PHPStan level 7](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-7.yaml)[![PHPStan level 8](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/string-expression-language/actions/workflows/phpstan-8.yaml)[![PHP](https://camo.githubusercontent.com/df91dacb0b605e94a88e6468d9577c5e041a93c199fc5256e91b482765719b0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068702d65746c2f737472696e672d65787072657373696f6e2d6c616e6775616765)](https://camo.githubusercontent.com/df91dacb0b605e94a88e6468d9577c5e041a93c199fc5256e91b482765719b0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068702d65746c2f737472696e672d65787072657373696f6e2d6c616e6775616765)

Installation
============

[](#installation)

```
composer require php-etl/string-expression-language

```

Usage
=====

[](#usage)

You can use these expressions in your configuration files as in the following example :

```
foo: '@=format("%s", "output")'
```

List of available functions
===========================

[](#list-of-available-functions)

Generic functions
-----------------

[](#generic-functions)

- `format(string $format, mixed ...$values) : string` =&gt; Return a formatted string
- `trim(string $string, string $characters = " \n\r\t\v\x00") : string` =&gt; Strip whitespace (or other characters) from the beginning and end of a string
- `capitalize(string $string) : string` =&gt; Make a string's first character uppercase
- `toLowerCase(string $string) : string` =&gt; Make a string lowercase
- `search(string $string, int $offset, ?int $length = null) : string` =&gt; Return part of a string
- `toUpperCase(string $string) : string` =&gt; Make a string uppercase
- `fileName(string $string) : string` =&gt; Returns information about a file path
- `dateTime(string $string) : string` =&gt; Returns new DateTimeImmutable object formatted according to the specified format
- `formatDate(string $string) : string` =&gt; Returns date formatted according to given format
- `indexOf(string $haystack, string $needle, int $offset) : int|false` =&gt; Find the position of the first occurrence of a substring in a string
- `truncate(string $string, int $limit) : string` =&gt; Truncates the string and adds "…" at the end, if the string is longer than the limit

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance57

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~32 days

Total

5

Last Release

1054d ago

PHP version history (2 changes)v0.1.x-devPHP ^8.0

v0.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/144109625f8029112d56f43d08120cf03a0918ea3b4fd59ab53f09b02f630b00?d=identicon)[gplanchat](/maintainers/gplanchat)

---

Top Contributors

[![sebprt](https://avatars.githubusercontent.com/u/47692802?v=4)](https://github.com/sebprt "sebprt (32 commits)")[![gplanchat](https://avatars.githubusercontent.com/u/152367?v=4)](https://github.com/gplanchat "gplanchat (24 commits)")[![clemzarch](https://avatars.githubusercontent.com/u/28787740?v=4)](https://github.com/clemzarch "clemzarch (5 commits)")[![programgames](https://avatars.githubusercontent.com/u/18596429?v=4)](https://github.com/programgames "programgames (4 commits)")[![JoMessina](https://avatars.githubusercontent.com/u/99172532?v=4)](https://github.com/JoMessina "JoMessina (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/php-etl-string-expression-language/health.svg)

```
[![Health](https://phpackages.com/badges/php-etl-string-expression-language/health.svg)](https://phpackages.com/packages/php-etl-string-expression-language)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[psalm/plugin-symfony

Psalm Plugin for Symfony

24013.8M185](/packages/psalm-plugin-symfony)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[gpslab/geoip2

A Symfony Bundle for the Maxmind GeoIP2 API

541.5M3](/packages/gpslab-geoip2)

PHPackages © 2026

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