From 64233dd0691bf4395cf3ff03bbe55ab61c1952e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= <56673130+dieselxxx@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:00:50 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 113 ++++++++++++++++++++---------------------------------- 1 file changed, 42 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index ccc2058..6c265cd 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ PHP Runtime Foundation
release version @@ -22,46 +22,25 @@ /> +[![PHPStan](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml) +[![PHPUnit](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml) +[![Codecov](https://codecov.io/gh/The-FireHub-Project/Runtime/branch/develop/graph/badge.svg?token=XW2YEONF51)](https://app.codecov.io/gh/The-FireHub-Project/Runtime/tree/develop) +

- - GitHub created at - + GitHub last commit (branch) - + GitHub activity (branch) - - GitHub contributors - + GitHub language count - - GitHub top language - - GitHub repo size - - GitHub code size

@@ -73,55 +52,47 @@ It contains no domain logic, no business rules, and no framework coupling. Its r --- -## FireHub Icon Repository Purpose +## FireHub Icon Development Branch -This repository provides a lightweight PHP runtime abstraction layer that wraps native PHP functionality into clean, consistent, and deterministic APIs. +⚠️ **This is the `develop` branch** -Its purpose is to reduce boilerplate and standardize common execution patterns across the FireHub ecosystem by offering ergonomic helper classes for arrays, strings, files, environment access, and other low-level runtime operations. +- Unstable +- APIs may change without notice +- Not intended for production use -It is strictly focused on execution-level concerns and does not contain domain logic, business rules, or framework-level orchestration. It exists to improve developer productivity while preserving native PHP behavior and ensuring zero framework coupling. +## FireHub Icon Branch Purpose -## FireHub Icon Security +The `develop` branch is the **primary integration branch** for all ongoing development. -For security reporting and guidelines, please refer to our [SECURITY.md](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file. +It serves as the staging area where: +- Feature branches are merged +- Bug fixes are integrated +- Experimental work is stabilized +- Code is prepared for upcoming releases -## FireHub Icon Community +All **release branches** are created **from `develop`**. -![GitHub watchers](https://img.shields.io/github/watchers/The-FireHub-Project/Runtime?style=social) -![GitHub Repo stars](https://img.shields.io/github/stars/The-FireHub-Project/Runtime?style=social) -![GitHub forks](https://img.shields.io/github/forks/The-FireHub-Project/Runtime?style=social) +## Stability Guarantee -- Be sure to review the [Code of Conduct](https://github.com/The-FireHub-Project/.github/blob/master/.github/CODE_OF_CONDUCT.md). -- Read a [Contributing](https://github.com/The-FireHub-Project/.github/blob/master/.github/CONTRIBUTING.md) file to see how you can contribute to this project. -- Read our [Security policy](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file to see how you can report a vulnerability. -- Review the project [Governance model](https://github.com/The-FireHub-Project/.github/blob/master/.github/GOVERNANCE.md), including roles, decision-making, RFC process, and releases. +❌ No backward compatibility guarantee +❌ APIs may change without notice +❌ Behavior may be incomplete or inconsistent +❌ Breaking changes are expected -## FireHub Icon Support +This branch is intended **only for contributors and advanced testers**. -

- - GitHub in-progress issues - - GitHub total issues - - GitHub opened pull requests -

+## FireHub Icon Composer Usage (Not Recommended) -For help with FireHub products, please refer to the following resources: +For internal testing only: -- **General questions & discussions**: [GitHub Discussions](https://github.com/orgs/The-FireHub-Project/discussions) -- **Bug reports & issues**: [Support](https://github.com/The-FireHub-Project/Runtime/issues) -- **Documentation & guides**: [FireHub Docs](https://the-firehub-project.github.io) -- **Commercial support** (Pro/Enterprise): contact your account manager +```json +{ + "require": { + "the-firehub-project/runtime": "dev-develop" + } +} +``` +⚠️ Never use dev-develop in production. ## FireHub Icon Authors and Contributors From c342351f13a50ba6d54f71d2d5501fe9af3bc499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Mon, 3 Aug 2026 09:58:42 +0200 Subject: [PATCH 2/3] Add `RegexFlag` enum and update version badge in README **Details:** - Introduced a new `RegexFlag` enum in the `FireHub\Runtime\Type\Str` namespace. - Provides structured constants for regex flags such as `CASELESS`, `MULTILINE`, `DOT_ALL`, and others. - Includes detailed PHPDoc for each flag to describe its behavior and usage. - Updated the version badge in `README.md` from `v0.1.0` to `v0.1.3`. --- CHANGELOG.md | 5 ++ README.md | 2 +- src/Type/Str/RegexFlag.php | 161 +++++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 src/Type/Str/RegexFlag.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 96fbeab..77e61c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [[v0.1.3](https://github.com/The-FireHub-Project/Runtime/compare/v0.1.2...v0.1.3)] – 2026-08-03 + +### Added +* Add `RegexFlag` enum by @dieselxxx + ## [[v0.1.2](https://github.com/The-FireHub-Project/Runtime/compare/v0.1.1...v0.1.2)] – 2026-07-29 ### Added diff --git a/README.md b/README.md index 6c265cd..b7bc2d9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ /> version diff --git a/src/Type/Str/RegexFlag.php b/src/Type/Str/RegexFlag.php new file mode 100644 index 0000000..f273fab --- /dev/null +++ b/src/Type/Str/RegexFlag.php @@ -0,0 +1,161 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Type\Str; + +/** + * ### Defines regular expression flags for string pattern operations + * + * Provides a set of flags that modify the behavior of regular expression processing when performing pattern-based + * operations on strings. + * + * These flags control matching behavior such as case sensitivity, multiline handling, UTF mode, extended patterns, + * and other PCRE-specific options. + */ +enum RegexFlag:string { + + /** + * ### Makes the expression match case-insensitive + * + * If this modifier is set, letters in the pattern match both upper and lower case letters. + * @since 1.0.0 + */ + case CASELESS = 'i'; + + /** + * ### Multiline characters + * + * By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually + * contains several newlines). The "start of line" metacharacter (^) matches only at the start of the string, while + * the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline + * (unless D modifier is set). This is the same as Perl. When this modifier is set, the "start of line" and + * "end of line" constructs match immediately following or immediately before any newline in the subject string, + * respectively, as well as at the very start and end. This is equivalent to Perl's /m modifier. + * If there are no "\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting this + * modifier has no effect. + * @since 1.0.0 + */ + case MULTILINE = 'm'; + + /** + * ### Dot metacharacter matches all characters + * + * If this modifier is set, a dot metacharacter in the pattern matches all characters, including newlines. + * Without it, newlines are excluded. This modifier is equivalent to Perl's /s modifier. A negative class such as + * [^a] always matches a newline character, independent of the setting for this modifier. + * @since 1.0.0 + */ + case DOT_ALL = 's'; + + /** + * ### Dot metacharacter matches all characters + * + * If this modifier is set, whitespace data characters in the pattern are totally ignored except when escaped + * or inside a character class, and characters between an unescaped # outside a character class + * and the next newline character, inclusive, are also ignored. + * This is equivalent to Perl's /x modifier, and makes it possible to include commentary inside complicated + * patterns. + * Note, however, that this applies only to data characters. + * Whitespace characters may never appear within special character sequences in a pattern, for example, within + * the sequence (?( which introduces a conditional subpattern. + * @since 1.0.0 + */ + case EXTENDED = 'x'; + + /** + * ### Anchored + * + * If this modifier is set, the pattern is forced to be "anchored"; that is, it is constrained to match only at + * the start of the string which is being searched (the "subject string"). This effect can also be achieved by + * appropriate constructs in the pattern itself, which is the only way to do it in Perl. + * @since 1.0.0 + */ + case ANCHORED = 'A'; + + /** + * ### Dollar metacharacter matches only at the end + * + * If this modifier is set, a dollar metacharacter in the pattern matches only at the end of the subject string. + * Without this modifier, a dollar also matches immediately before the final character if it is a newline (but not + * before any other newlines). This modifier is ignored if m modifier is set. There is no equivalent to this + * modifier in Perl. + * @since 1.0.0 + */ + case DOLLAR_END_ONLY = 'D'; + + /** + * ### Extra analysis is performed + * + * When a pattern is going to be used several times, it is worth spending more time analyzing it to speed up + * the time taken for matching. If this modifier is set, then this extra analysis is performed. At present, + * studying a pattern is useful only for non-anchored patterns that don't have a single fixed starting character. + * @since 1.0.0 + */ + case EXTRA_ANALYSIS = 'S'; + + /** + * ### Inverts the greediness + * + * This modifier inverts the "greediness" of the quantifiers so that they aren't greedy by default, but become + * greedy if followed by ?. It is not compatible with Perl. It can also be set by a (?U) modifier setting within + * the pattern or by a question mark behind a quantifier (for example: .*?). + * @since 1.0.0 + * + * @see https://www.php.net/manual/en/pcre.configuration.php#ini.pcre.backtrack-limit To see pcre.backtrack_limit + * configuration. + * + * @note It is usually not possible to match more than pcre.backtrack_limit characters in un greedy mode. + */ + case UN_GREEDY = 'U'; + + /** + * ### Backslash in a pattern that is followed by a letter that has no special meaning causes an error + * + * This modifier turns on additional functionality of PCRE that is incompatible with Perl. Any backslash in + * a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these + * combinations for future expansion. By default, as in Perl, a backslash followed by a letter with no special + * meaning is treated as a literal. There are at present no other features controlled by this modifier. + * @since 1.0.0 + */ + case EXTRA = 'X'; + + /** + * ### Extra analysis is performed + * + * The (?J) internal option setting changes the local PCRE_DUPNAMES option. Allow duplicate names for + * sub-patterns. As of PHP 7.2.0, J is supported as a modifier as well. + * @since 1.0.0 + */ + case INFO_J_CHANGED = 'J'; + + /** + * ### Pattern and subject strings are treated as UTF-8 + * + * This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern and subject + * strings are treated as UTF-8. An invalid subject will cause the preg_* function to match nothing; an invalid + * pattern will trigger an error of level E_WARNING. Five and six-octet UTF-8 sequences are regarded as invalid. + * @since 1.0.0 + */ + case MULTIBYTE = 'u'; + + /** + * ### Don't capture simple groups + * + * This modifier makes simple (xyz) groups non-capturing. Only named groups like (?xyz) are captured. + * This only affects which groups are captured, it is still possible to use numbered subpattern references, and + * the matches array will still contain numbered results. + * @since 1.0.0 + */ + case NO_AUTO_CAPTURE = 'n'; + +} \ No newline at end of file From 25f556e5109ef9046867dd5bb547a30eb0f58ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= <56673130+dieselxxx@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:00:31 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 111 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index b7bc2d9..9b8f749 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ PHP Runtime Foundation
release @@ -22,25 +22,46 @@ /> -[![PHPStan](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml) -[![PHPUnit](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml) -[![Codecov](https://codecov.io/gh/The-FireHub-Project/Runtime/branch/develop/graph/badge.svg?token=XW2YEONF51)](https://app.codecov.io/gh/The-FireHub-Project/Runtime/tree/develop) -

- + + GitHub created at + GitHub last commit (branch) - + GitHub activity (branch) - + + GitHub contributors + GitHub commit difference between two branches + + GitHub top language + + GitHub repo size + + GitHub code size

@@ -52,47 +73,55 @@ It contains no domain logic, no business rules, and no framework coupling. Its r --- -## FireHub Icon Development Branch +## FireHub Icon Repository Purpose -⚠️ **This is the `develop` branch** +This repository provides a lightweight PHP runtime abstraction layer that wraps native PHP functionality into clean, consistent, and deterministic APIs. -- Unstable -- APIs may change without notice -- Not intended for production use +Its purpose is to reduce boilerplate and standardize common execution patterns across the FireHub ecosystem by offering ergonomic helper classes for arrays, strings, files, environment access, and other low-level runtime operations. -## FireHub Icon Branch Purpose +It is strictly focused on execution-level concerns and does not contain domain logic, business rules, or framework-level orchestration. It exists to improve developer productivity while preserving native PHP behavior and ensuring zero framework coupling. -The `develop` branch is the **primary integration branch** for all ongoing development. +## FireHub Icon Security -It serves as the staging area where: -- Feature branches are merged -- Bug fixes are integrated -- Experimental work is stabilized -- Code is prepared for upcoming releases +For security reporting and guidelines, please refer to our [SECURITY.md](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file. -All **release branches** are created **from `develop`**. +## FireHub Icon Community -## Stability Guarantee +![GitHub watchers](https://img.shields.io/github/watchers/The-FireHub-Project/Runtime?style=social) +![GitHub Repo stars](https://img.shields.io/github/stars/The-FireHub-Project/Runtime?style=social) +![GitHub forks](https://img.shields.io/github/forks/The-FireHub-Project/Runtime?style=social) -❌ No backward compatibility guarantee -❌ APIs may change without notice -❌ Behavior may be incomplete or inconsistent -❌ Breaking changes are expected +- Be sure to review the [Code of Conduct](https://github.com/The-FireHub-Project/.github/blob/master/.github/CODE_OF_CONDUCT.md). +- Read a [Contributing](https://github.com/The-FireHub-Project/.github/blob/master/.github/CONTRIBUTING.md) file to see how you can contribute to this project. +- Read our [Security policy](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file to see how you can report a vulnerability. +- Review the project [Governance model](https://github.com/The-FireHub-Project/.github/blob/master/.github/GOVERNANCE.md), including roles, decision-making, RFC process, and releases. -This branch is intended **only for contributors and advanced testers**. +## FireHub Icon Support -## FireHub Icon Composer Usage (Not Recommended) +

+ + GitHub in-progress issues + + GitHub total issues + + GitHub opened pull requests +

-For internal testing only: +For help with FireHub products, please refer to the following resources: -```json -{ - "require": { - "the-firehub-project/runtime": "dev-develop" - } -} -``` -⚠️ Never use dev-develop in production. +- **General questions & discussions**: [GitHub Discussions](https://github.com/orgs/The-FireHub-Project/discussions) +- **Bug reports & issues**: [Support](https://github.com/The-FireHub-Project/Runtime/issues) +- **Documentation & guides**: [FireHub Docs](https://the-firehub-project.github.io) +- **Commercial support** (Pro/Enterprise): contact your account manager ## FireHub Icon Authors and Contributors