packagefactory/component-engine

Universal View Components for PHP

Installs: 0

Dependents: 2

Suggesters: 0

Security: 0

pkg:composer/packagefactory/component-engine

1.0.0-alpha1 2025-10-31 22:20 UTC

This package is auto-updated.

Last update: 2025-11-02 18:53:16 UTC


README

Development

For common automated development tasks, the repository contains several scripts which can be run via:

./scripts/{script-name}
script-namedescription
analyseRun static code analysis with phpstan
benchmarkRun benchmarks with phpbench
build Build LALR(1) parser files with PackageFactory.Grammar
testRun tests with phpunit

Running tests

There's a test suite for unit tests and another one for grammar tests. By default only the unit test suite is run, because the grammar test suite is quite large and only needs to be run, if there have been changes to the grammar.

If you wish to run the grammar test suite separately, you can use:

./scripts/test --testsuite grammar

If you wish to run all tests, use:

./scripts/test --testsuite all

Running Benchmarks

When developing a performance-critical feature, you can track the performance impact by first taking a benchmark snapshot before starting development:

time ./scripts/benchmark --tag=before.my_feature --retry-threshold=5 --iterations=10

The --tag parameter instructs phpbench to save the snapshot under the identifier before.my_feature.

When your feature is finished, you can run the benchmarks again, while comparing them against the snapshot:

time ./scripts/benchmark --ref=before.my_feature --retry-threshold=5 --iterations=10

The --ref parameter instructs phpbench to compare the results with the given snapshot.

phpbench will highlight significant changes in performance. You need not worry about small percentage deltas, but significant drops (like +20%) are worth having a closer look at.

License

see LICENSE