• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHP-DI / PHP-DI / 1672
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: php8
DEFAULT BRANCH: master
Ran 11 Jun 2017 07:34PM UTC
Jobs 1
Files 63
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1672

push

travis-ci

mnapoli
Compile factories

Factory definitions are now dumped into the compiled container!

This follows #494 where all definitions but factories, decorators and wildcards were compiled. Decorators and wildcards are still not compiled.

Compiling factories means also compiling closures. That was actually much more doable than I thought, I've used [Roave/BetterReflection](https://github.com/Roave/BetterReflection) (thanks asgrim and ocramius!)

The main downside of the whole pull request is the number of dependencies that BetterReflection brings:

  - Installing symfony/polyfill-util (v1.4.0) Loading from cache
  - Installing symfony/polyfill-php56 (v1.4.0) Loading from cache
  - Installing nikic/php-parser (v2.1.1) Loading from cache
  - Installing jeremeamia/superclosure (2.3.0) Loading from cache
  - Installing zendframework/zend-eventmanager (3.1.0) Loading from cache
  - Installing zendframework/zend-code (3.1.0) Loading from cache
  - Installing phpdocumentor/reflection-common (1.0) Loading from cache
  - Installing phpdocumentor/type-resolver (0.2.1) Loading from cache
  - Installing phpdocumentor/reflection-docblock (2.0.5) Loading from cache
  - Installing roave/better-reflection (1.2.0) Loading from cache

Maybe we could get on with superclosure only. Or else make compiling closures optional (only compile them if BetterReflection is installed…). Also I've seen that there is a v2.0 of BetterReflection in development [but it requires 7.1](https://github.com/Roave/BetterReflection#changes-in-br-20), I have no idea for how long the v1 will be supported (e.g. will it support PHP 7.2). PHP-DI could upgrade to 7.1 at the end of this year but that's not for sure yet.

Performance improvements: -20% on the factory.php benchmark, [profile](https://blackfire.io/profiles/compare/6692ca3e-521a-49df-96c6-1bf9833c8209/graph), which is very good for a micro-benchmark IMO. I'll test all that in larger scenarios for the complete 6.0 release but it's safe to say this P... (continued)

48 of 48 new or added lines in 4 files covered. (100.0%)

1235 of 1298 relevant lines covered (95.15%)

56.0 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
src/CompiledContainer.php

Uncovered Existing Lines

Lines Coverage ∆ File
3
100.0
src/Compiler.php
4
100.0
src/ContainerBuilder.php
Jobs
ID Job ID Ran Files Coverage
2 1672.2 11 Jun 2017 07:33PM UTC 0
95.15
Travis Job 1672.2
Source Files on build 1672
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1672
  • 3f36c6f3 on github
  • Prev Build on compile-factories (#1670)
  • Next Build on compile-factories (#1676)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc