https://github.com/signpostmarv/php-traceverbal-expressions
Proof-of-concept for a traceable wrapper to PHPVerbalExpressions for eliminating the need to hand-write JSON for verbal-expressions-tests
https://github.com/signpostmarv/php-traceverbal-expressions
Last synced: over 1 year ago
JSON representation
Proof-of-concept for a traceable wrapper to PHPVerbalExpressions for eliminating the need to hand-write JSON for verbal-expressions-tests
- Host: GitHub
- URL: https://github.com/signpostmarv/php-traceverbal-expressions
- Owner: SignpostMarv
- License: mit
- Created: 2016-02-12T21:15:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-12T21:16:24.000Z (over 10 years ago)
- Last Synced: 2025-01-03T16:25:58.961Z (over 1 year ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Proof-of-concept for a traceable wrapper to [PHPVerbalExpressions](
https://github.com/VerbalExpressions/PHPVerbalExpressions
)
for eliminating the need to hand-write JSON for [verbal-expressions-tests](
https://github.com/SignpostMarv/Verbal-Expressions-Tests
)
# Example
Expected output, ```bool(true)```
```php
use TraceverbalExpressions\PHPTraceverbalExpressions\VerbalExpressions;
$foo = new VerbalExpressions;
$foo->startOfLine()->then('foo')->anyOf('abc')->multiple('')->endOfLine();
$bar = json_encode($foo);
$baz = new VerbalExpressions($bar);
var_dump($bar === json_encode($baz));
```