phpDocumentor

phpDocumentor/ReflectionCommon

PHP MIT Dev Tools
9.1k stars
21 forks
slow
GitHub

9.1k

Stars

21

Forks

3

Open issues

13

Contributors

2.2.0 27 Jun 2020

AI Analysis

ReflectionCommon is a PHP library providing shared reflection interfaces and utilities for the phpDocumentor ecosystem and related projects. It serves as a foundational component for tools that need to analyze and introspect PHP code structures, making it most valuable for developers building documentation generators, static analysis tools, and code inspection utilities rather than general-purpose PHP applications.

Dev Tools Library Discovery value: 3/10
Documentation 6/10
Activity 8/10
Community 7/10
Code quality 8/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

php-reflection code-analysis documentation-generation static-analysis php-introspection
Actively maintained MIT licensed Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
2w ago

PHP reflection interface library powering documentation and static analysis toolchains

ReflectionCommon provides a set of shared interfaces and value objects representing PHP code elements (classes, functions, constants, etc.) used across the phpDocumentor ecosystem. It acts as a foundational contract layer so that tools like ReflectionDocBlock and TypeResolver can interoperate without circular dependencies. Its primary audience is PHP library and framework authors building static analysis, documentation generation, or code introspection tools. With over 9,000 stars and deep Packagist integration, it is a widely pulled-in transitive dependency rather than a tool developers consciously choose.

Origin

Created in May 2015 as part of splitting phpDocumentor's monolithic codebase into composable packages. It establishes shared abstractions that sibling packages depend on, following a dependency inversion pattern common in mature PHP ecosystems.

Growth

Stars accumulated primarily because this package is a transitive dependency of phpDocumentor components used by Composer-based PHP projects everywhere. Direct developer interest is minimal; growth mirrors adoption of phpDocumentor, PHPStan, and similar tools that pull it in indirectly. The 1 star/week rate as of mid-2026 reflects a mature, stable dependency rather than an actively hyped project.

In production

Packagist download counts for phpDocumentor/reflection-common are in the hundreds of millions, making it one of the most-installed PHP packages by volume. It is a required dependency of phpDocumentor/ReflectionDocBlock and phpDocumentor/TypeResolver, which are themselves pulled in by tools like PHPStan, Psalm, and many Symfony/Laravel packages. Real-world adoption is extensive and verifiable via Packagist.

Code analysis
Architecture

Appears to be a small, interface-only or near-interface-only library defining common reflection contracts (Fqsen, Element, etc.). Likely contains value objects and marker interfaces with minimal logic — a deliberate design to keep it as a stable, low-churn contract surface.

Tests

README badges reference both Coveralls and Scrutinizer coverage, suggesting automated coverage tracking is in place. Scrutinizer quality badge is present. Actual coverage percentage is not stated in the README excerpt.

Maintenance

Last push was November 2025, approximately 7 months before the evaluation date. For a stable interface library this cadence is appropriate — frequent changes would be a red flag, not a green one. CI via GitHub Actions QA workflow is active. Maintenance appears healthy and intentionally conservative.

Honest verdict

ADOPT IF: you are building a PHP static analysis, documentation, or code introspection tool and want to interoperate with the phpDocumentor ecosystem. AVOID IF: you need runtime reflection with execution context or are building something outside the PHP documentation/analysis toolchain space — this library will not help you. MONITOR IF: you depend on phpDocumentor or TypeResolver and need to track potential breaking changes to shared interfaces across major version bumps.

Independent dimensions

Mainstream potential

3/10

Technical importance

6/10

Adoption evidence

9/10

Risks
  • As a pure interface contract library, any breaking change to its interfaces cascades across all dependent packages simultaneously, making major version bumps potentially disruptive.
  • The phpDocumentor organization controls the roadmap; if organizational priorities shift, maintenance could slow despite the wide transitive usage.
  • Because it is almost exclusively a transitive dependency, most consumers have no direct awareness of it, reducing community pressure to maintain or evolve it.
  • The README excerpt provided is nearly empty, making it difficult to assess whether documentation for direct consumers (library authors) is adequate.
  • Tight coupling within the phpDocumentor package family means that adopting one package often forces adoption of this one at a specific version, limiting flexibility.
Prediction

Likely to remain a stable, low-churn foundational dependency for the PHP static analysis and documentation ecosystem for the foreseeable future. No major growth expected — nor needed.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
81.5%
Makefile
18.5%

Information

Language
PHP
License
MIT
Last updated
8mo ago
Created
135mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

phpDocumentor

phpDocumentor/ReflectionDocBlock

ReflectionDocBlock is a PHP library that parses DocBlocks (documentation...

9.4k PHP Dev Tools
Roave

Roave/BetterReflection

Better Reflection is a static analysis-focused reflection API for PHP that...

1.2k PHP Dev Tools
phpDocumentor

phpDocumentor/phpDocumentor

phpDocumentor is a specialized documentation generator for PHP projects that...

4.3k PHP Dev Tools
sebastianbergmann

sebastianbergmann/object-reflector

This is a PHP utility library that enables deep reflection of object...

6.3k PHP Dev Tools
phpDocumentor

phpDocumentor/TypeResolver

TypeResolver is a PHP library that implements PSR-5 specification for resolving...

9.2k PHP Dev Tools
vs. alternatives
phpDocumentor/ReflectionDocBlock

A sibling package that depends on ReflectionCommon. They are complementary, not competing — ReflectionDocBlock handles doc-comment parsing while ReflectionCommon defines the structural contracts.

phpDocumentor/TypeResolver

Another sibling that consumes ReflectionCommon interfaces. Same relationship: consumer, not competitor.

sebastianbergmann/object-reflector

Solves a narrower problem (reflecting object attributes for testing). Not a substitute for ReflectionCommon's role as a shared interface layer for documentation/analysis tooling.

laminas/laminas-code

Provides richer runtime code generation and reflection capabilities. Heavier and not designed as a shared contract layer; serves different use cases than ReflectionCommon's interface-only approach.

PHP native Reflection API

The built-in PHP Reflection API is runtime-only and not easily mockable or extendable. ReflectionCommon provides interface abstractions that allow static analysis tools to model code without executing it.