Releases: Roave/BetterReflection
3.2.0
This release introduces PHP 7.3 support, reduces the exported package size,
and improves the overall code quality of the package through updated coding
style conventions.
Total issues resolved: 6
- 440: Test failures under PHP 7.3 thanks to @Majkl578
- 450: PHP_Parser v4 introduces a
string
type declaration on a parameter, breaking PHP 7.1 installations thanks to @Ocramius - 451: Remove .idea from .gitignore thanks to @Majkl578
- 452: Upgrade to Doctrine CS 5.0 thanks to @Majkl578
- 453: export-ignores, appveyor.yml -> .appveyor.yml thanks to @Majkl578
- 455: PHP 7.3 stub and PHP-Parser compatibility thanks to @paxal
3.1.1
This release fixes an incompatibility between ext-reflection
and roave/better-reflection
in which ReflectionClass#getConstructor()
led to an exception rather than a null
return value in case of
constructors being missing.
Total issues resolved: 1
3.1.0
This release hardens the AutoloadSourceLocator
to allow for multiple PSR-4
paths to be crawled for class existence.
Also, it is now possible to alter reflection instances to set the function/method
docBlocks while monkey-patching code.
Total issues resolved: 7
- 384:
AutoloadSourceLocator
uses the wrong directory thanks to @oqq - 425: Better exception messages and assertions for unrecognized class constant fetch expressions thanks to @Ocramius
- 431: #430 Add ability to specify doc comment for the functions thanks to @funivan
- 433: Fixed error on anonymous classes with interfaces thanks to @prisis
- 435: Return of the PHPStan thanks to @kukulich
- 436: Updated to PHPStan 0.10.1 thanks to @kukulich
- 437: Fixing AutoloadSourceLocator when multiple PSR-0/4 directories are possible thanks to @moufmouf
3.0.0
This release improves the performance and reliability of the library, which is now
fully working with PHP 7.2 and newer nikic/php-parser
releases.
Some BC breaks had to be performed:
- 389: Throw
ReflectionException
when a property is not found thanks to @muglug - 391: Adapter method
ReflectionClass#getProperty()
throw an exception when a property doesn't exist thanks to @kukulich - 415: Improved
ReflectionType
API so that a target reflection class can directly be retrieved, removed existing named constructor thanks to @Ocramius
Total issues resolved: 23
- 381: rename
$myMethod
to$myParameter
as expected bygetParameter('myParameter')
thanks to @tobemedia - 382: [TYPO\ Minimal grammar correction in Exception message thanks to @afoeder
- 389: Throw
ReflectionException
when a property is not found thanks to @muglug - 391: Adapter method
ReflectionClass#getProperty()
throw an exception when a property doesn't exist thanks to @kukulich - 392: Disallow build failures on PHP 7.2 thanks to @kukulich
- 393: Updated to
doctrine/coding-standard
2.0 thanks to @kukulich - 394: Fix issues found by static analysis thanks to @muglug
- 395: Updated to
doctrine/coding-standard
2.1 thanks to @kukulich - 400: Updated PHPUnit and PHPStan dependencies thanks to @kukulich
- 403: Use HTTPS instead of HTTP when referencing external documentation thanks to @carusogabriel
- 404: Account for case insensitivity thanks to @theofidry
- 405: Corrected typos in variable names and docblocks thanks to @ntzm
- 406: Remove useless
final
keyword from theprivate
methodReflectionFunctionAbstract#loadStaticParser()
thanks to @ntzm - 410: Updated to
nikic/PHP-Parser
4.x thanks to @kukulich - 411:
ReflectionClass#isInstantiable()
should reportfalse
forprivate
constructors thanks to @UFOMelkor - 412:
ReflectionClass::isInstantiable()
now reportsfalse
in case of inaccessible constructors thanks to @kukulich - 415: Improved
ReflectionType
API so that a target reflection class can directly be retrieved, removed existing named constructor thanks to @Ocramius - 418: Updated to
doctrine/coding-standard
4.0 thanks to @kukulich - 420: Tidied docs and simply removed weasel words thanks to @GeeH
- 421: PHP 7.2 build is failing thanks to @asgrim
- 422: Corrected build failures caused by
ext/date-time
upgrades in PHP 7.2 thanks to @kukulich - 423: Add
vimeo/psalm
to the build and fixed detected static analysis issues that were detected by it thanks to @muglug - 424: Fixed build failure caused by incorrectly formatted inline IDE hints thanks to @kukulich
2.0.2
Total issues resolved: 2
2.0.1
This release fixes constraint incompatibilities with PHP 7.1.0, newer PHP 7.1.11 UConverter
API
and a type error raised when attempting to fetch the AST nodes of an interface's method.
Total issues resolved: 5
- 372: Added missing parent::setUp() in tests thanks to @kukulich
- 376: Incorrect PHP version constraint thanks to @nikic
- 377: composer: allow PHP 7.1 thanks to @TomasVotruba
- 379: Return empty ast for interface method body thanks to @codeliner
- 380: #379
UConverter#getAliases($name)
is not an optional parameter anymore as per latest PHP releases thanks to @Ocramius
2.0.0
This major release is a massive rework of the internal implementation details
of BetterReflection.
Improvements
Version 2.0.0 provides a massive performance boost when using the
new Roave\BetterReflection\BetterReflection
kernel as an entry point
for using the library.
The minimum supported PHP version is now 7.1.0
, which allows for
a much cleaner API definition: we added nullable hints to our own
API wherever applicable.
The compatibility with the ext-reflection
API is also almost complete, excluding some scenarios that would
forcefully require class autoloading.
Among the many new implemented features, we now support:
- Property/Method accessors
- Start/End line analysis for defined symbols
- PHP 7.1 nullable types
- PHP 7.1
iterable
type declarations - PHP 7.2
object
type declarations - PHP 7.1
const
visibility support - Monkey-patching classes on the fly via hijacked autoloader
- Immediate/inherited constants/methods/properties lookup
- PHP 4.x constructor detection
- Constant expression value resolution
- Closure reflection
- Anonymous class reflection
- Internal class parameter default value reflection (through stubs)
- Retrieving AST nodes for each reflection
BC Breaks
Most of the generally used API was not touched, but a lot of internal
components were completely rewritten to address design and performance
issues. Please make sure that you read
the upgrade notes.
Total issues resolved: 138
- 14: Implement accessors without instantiating thanks to @asgrim
- 20: Validate identifier name in Identifier value object thanks to @asgrim
- 68: Add getColumn everywhere to complement getStartLine/getEndLine thanks to @asgrim
- 94: Improve
__toString()
functionality internally thanks to @asgrim - 98: Find a way to decrease complexity of compileBinaryOperator method thanks to @asgrim
- 103: ReflectionClass getMethods() and getProperties() do not filter thanks to @asgrim
- 131: Make Better Reflection faster thanks to @asgrim
- 152:
ClosureSourceLocator#locateIdentifiersByType()
- investigate implementation thanks to @asgrim - 169: Investigate upgrading to
phpdocumentor/reflection-docblock 3.1
thanks to @asgrim - 202: Review PHP 7.1 feature: nullable types thanks to @asgrim
- 204: Review PHP 7.1 feature: Class constant visibility modifiers thanks to @asgrim
- 205: Autoload interruption for dynamic monkey patching thanks to @asgrim
- 216: Autoload interruption for monkey patching thanks to @asgrim
- 217: Update our code for API changes in PHP-Parser thanks to @asgrim
- 218: Upgrade phpdocumentor reflection docblock thanks to @asgrim
- 219: Check compatibility with PHP 7.2 thanks to @asgrim
- 220: Fixed issues found by static analysis thanks to @ondrejmirtes
- 221: Upgrade minimum version to PHP 7.0 thanks to @asgrim
- 223: Add vendor prefix to namespaces thanks to @asgrim
- 225: Fixed function reflector doc thanks to @dantleech
- 226: Require minimum of PHP 7, enabling tests on PHP 7.1 thanks to @asgrim
- 227: Prefix namespaces with Roave thanks to @asgrim
- 228: Implement internal parsing of closures thanks to @asgrim
- 229: getDocBlockTypes() causes error when no docblock is present thanks to @dantleech
- 231: Inherited properties not returned by getProperties thanks to @dantleech
- 235:
LocatedSource#__construct()
should accept empty string as $source thanks to @asgrim - 236: Fix exception being thrown in AutoloadSourceLocator thanks to @asgrim
- 238: LocatedSource now allows empty strings as source code thanks to @asgrim
- 240: ReflectionParameter doesn't resolve parameter type
self
thanks to @malukenho - 241: Fix
self
andparent
hinted ReflectionParameter class reference thanks to @malukenho - 242: Support for the PHP 7.1
iterable
type thanks to @Ocramius - 243:
ReflectionType#__toString()
should NOT prepend backslashes to class/interface types thanks to @Ocramius - 244: Fix for #243:
ReflectionType
(string)
cast should not prepend backslash to class and interface types thanks to @Ocramius - 246: Fixed class constant value fetch when constant is declared in parent thanks to @janlanger
- 250: Types with no doc block thanks to @marcosh
- 251: Retrieve all functions in SourceLocator scope thanks to @marcosh
- 252: get all functions available in SourceLocator scope thanks to @marcosh
- 253: Usage: fix DirectoriesSourceLocator usage thanks to @TomasVotruba
- 254: README: drop unstable dependencies reference thanks to @TomasVotruba
- 255: create ReflectionParameter from closure thanks to @marcosh
- 256: create reflection parameter from closure thanks to @marcosh
- 257: Possible unused code path thanks to @asgrim
- 258: PHP 7.1 updates thanks to @asgrim
- 259: [Docs] Usage: drop SingleDirectorySourceLocator thanks to @TomasVotruba
- 260: [Docs] Usage - add FunctionReflector getAllFunctions() example thanks to @TomasVotruba
- 263: Support PHP4-style constructors? thanks to @asgrim
- 264: ReflectionMethod::isDestructor is case insensitive thanks to @asgrim
- 266: get file name of unlocated source could be null thanks to @marcosh
- 267: Testing that class constant visibility works thanks to @asgrim
- 268: Ensure locateFunctionByName returns ?string always thanks to @asgrim
- 269: Added case insensitivity to isConstructor and isDestructor methods thanks to @asgrim
- 271: getProperties returns inherited properties thanks to @marcosh
- 272: Added test cases for ?nullable and iterable types in PHP 7.1 thanks to @asgrim
- 273: [docs] example2.php - flip fallen space from the bottom thanks to @TomasVotruba
- 274: [failing-test] Namespaced Trait fails to be resolved thanks to @TomasVotruba
- 275: Filter get methods and properties thanks to @marcosh
- 277: [demo] add getAllClasses() examples, ref #276 thanks to @TomasVotruba
- 278: object immediate properties includes runtime properties thanks to @marcosh
- 279: Reflect on instances of anonymous classes thanks to @marcosh
- 280: [NodeCompiler] add support for
__DIR__
thanks to @TomasVotruba - 281: [PHP7.1] ::getReflectionConstant() and ::getReflectionConstants() support thanks to @POPSuL
- 282: [PHP 7.1] Add support for ReflectionClassConstant (#281) thanks to @POPSuL
- 284: fixed improper docblock retrieval thanks to @vlastavesely
- [285: FindReflectionOnLine cannot be...
1.2.0
This release introduces two new source locator classes, which are very helpful if you analyze directory trees that are not controlled by your autoloader:
BetterReflection\SourceLocator\Type\FileIteratorSourceLocator
, which, given
an iterator of.php
files, will be able to find classes, functions, and so
on in that set.BetterReflection\SourceLocator\Type\DirectoriesSourceLocator
, which, given
a set of directories, will allow reflecting.php
files in those directories.
Total issues resolved: 1
1.1.0
Summary of new features:
- Ability to modify function, method and class structure (basic monkey patching)
- Ability to replace the body of a function or method
- Updated documentation
- PHP 7 compatibility
- Some PHP 7.1 compatibility (more features will come in a future version!)
- Implemented ::class constant resolution
FindReflectionOnLine
helper (look up code unit by filename and line number)- Various other improvements and bugfixes
Total issues resolved: 39
- 35: Investigate PHP 7 compatibility
- 134: Add methods to modify reflections
- 141: Method body replacement
- 155: Write .phpt test suite
- 161: Review & improve documentation
- 162: Ability to add/remove type declarations and return type declarations
- 164: Support parameter type and return type declarations in PHP 7
- 165: Fix coding standards with fix-cs.sh script
- 168: Implemented ::class constant resolution
- 171: Update dependencies
- 174: Correct use statements in documentation
- 175: Drastically improved quality of library
- 176: PHP 7 types support
- 177: Docs and phpdoc fixes for PHP 7 types
- 178: Look up code unit by filename and line number
- 180: Set/remove PHP 7 types
- 181: Added FindReflectionOnLine helper utility
- 183: Fixed broken monkey patching example
- 184: Add demo tests to Travis build
- 185: Use prefer-dist in travis now (see composer/composer#4884)
- 187: ReflectionClass modifications
- 188: New phpt suite
- 189: Call to a member function isInterface() on null
- 190: ReflectionClass expected, null given
- 191: Call to a member function getInterfacesHierarchy() on null
- 192: Need to report which files are unparseable.
- 193: Throw exceptions when ClassReflector cannot locate identifiers
- 194: Rethrow any exception encountered whilst finding reflections
- 195: Any way to get fully qualified class names in AST
- 196: Added addParameter and removeParameter methods
- 197: Added ReflectionProperty::setVisibility method
- 198: Add ReflectionFunctionAbstract->getReturnStatementAst()
- 199: Fix unit test broken by PhpParser 2.1.0 change
- 203: Review PHP 7.1 feature: void return type
- 206: Added ReflectionFunctionAbstract::getReturnStatementsAst() method
- 207: Updates to documentation from BR presentation at DPC
- 208: Replaced fabpot/php-cs-fixer with friendsofphp/php-cs-fixer
- 209: Added test for
void
return type for PHP 7.1 - 210: Fixed docblock for AbstractSourceLocator
1.0.1
Total issues resolved: 1