decodelabs / hatch
Simple code generation tools
Installs: 1 162
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.4
- decodelabs/exceptional: ^0.6.3
Requires (Dev)
- decodelabs/atlas: ^0.14
- decodelabs/phpstan-decodelabs: ^0.7.0
Conflicts
- decodelabs/atlas: <0.14
README
Simple code generation tools
Hatch provides a set of simple tools for generating PHP code.
Get news and updates on the DecodeLabs blog.
Installation
Install via Composer:
composer require decodelabs/hatch
Usage
Static arrays
Export arrays of data for reuse as config files or static loadable datastructures.
use DecodeLabs\Hatch; $code = Hatch::exportStaticArray([ 'foo' => 'bar', 'baz' => 'qux', 'quux' => [ 'corge' => 'grault', 'garply' => 12, 'fred' => [ 'plugh' => 'xyzzy', 'thud' => [1, 2, 3] ] ] ]); echo $code;
This will output:
[ 'foo' => 'bar', 'baz' => 'qux', 'quux' => [ 'corge' => 'grault', 'garply' => 12, 'fred' => [ 'plugh' => 'xyzzy', 'thud' => [1, 2, 3] ] ] ]
Licensing
Hatch is licensed under the MIT License. See LICENSE for the full license text.