ilexn / config-object
This package is abandoned and no longer maintained.
No replacement package was suggested.
Config Object
Fund package maintenance!
iLexN
0.2.1
2021-12-03 09:06 UTC
Requires
- php: >=8.1
- nette/php-generator: ^3.6
Requires (Dev)
- infection/infection: ^0.25
- phpbench/phpbench: ^1.2
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^9.5
- rector/rector: ^0.12
- vimeo/psalm: ^4.13
This package is auto-updated.
Last update: 2023-01-05 00:07:55 UTC
README
Generator for create data value object.
Installation
composer require ilexn/config-object
Usage example
<?php declare(strict_types=1); use Example\ConfigObject\GenNameCreate; use Ilex\ConfigObject\CreateMode; use Ilex\ConfigObject\GeneratorManager; use Ilex\ConfigObject\Setting; use Ilex\ConfigObject\Tests\Fake\One; include 'vendor/autoload.php'; $setting = new class extends Setting { public function getTargetPath(): string { return __DIR__ . '/example'; } public function getTargetNamespace(): string { return 'Example\ConfigObject'; } public function getTargetClassName(): string { return 'GenNameCreate'; } public function getData(): One { return new One(); } public function allowClass(): array { return [One::class]; } }; $mode = CreateMode::each(); $generator = new \Ilex\ConfigObject\Generator(); $manager = new GeneratorManager($mode, $generator); $manager->generate($setting); $g = new GenNameCreate(); var_dump($g->getData()->getTargetPath());
Benchmark
benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
---|---|---|---|---|---|---|---|
JsonBenchmark | benchBase | 0 | 1000 | 5 | 2.417mb | 25.600μs | ±1.27% |
JsonBenchmark | benchEach | 0 | 1000 | 5 | 5.216mb | 287.363μs | ±0.73% |
JsonBenchmark | benchOnce | 0 | 1000 | 5 | 2.417mb | 5.764μs | ±2.15% |
JsonBenchmark | benchNone | 0 | 1000 | 5 | 2.417mb | 1.923μs | ±3.01% |
Todo
[ ] add general method.