Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-12T21:16:24.000Z (almost 9 years ago)
- Last Synced: 2024-05-02T01:15:13.542Z (8 months 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));
```