Add hasAttribute to ReflectionLegacyAttributenightly-2020.06.06
commit7c2f83eb5fd81dd0350549d57c54c16abb420ed5
authorMike Qian <mqian@fb.com>
Fri, 5 Jun 2020 23:12:28 +0000 (5 16:12 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 5 Jun 2020 23:15:34 +0000 (5 16:15 -0700)
tree224c952917cc1d3dcbe52f8e01d57381859edaa6
parentea207449bc639f6729ba083cfb7bd84ae8f9ff2b
Add hasAttribute to ReflectionLegacyAttribute

Summary: Doing `$reflector->getAttribute('Foo') !== null` is clunky for checking if a function is annotated with a particular user attribute. Introduce a dedicated API for this.

Reviewed By: DavidSnider

Differential Revision: D21900590

fbshipit-source-id: f04a2bf7d019b31bf393e357076b09afb99f76fb
hphp/hack/test/emitter/user-attrs.php
hphp/runtime/ext/reflection/ext_reflection-classes.php
hphp/test/quick/attributes_on_parameters.php
hphp/test/slow/attributes/legacy_reflection.php
hphp/test/slow/attributes/legacy_reflection.php.expectf
hphp/test/slow/reflection/ReflectionProperty_getAttribute.php
hphp/test/slow/reflection/ReflectionProperty_getAttribute.php.expect
hphp/test/slow/reflection/ReflectionTypeAliasAttrs.php
hphp/test/slow/reflection/ReflectionTypeAliasAttrs.php.expect