Skip to content

0.16.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@theofidry theofidry released this 30 Jan 17:42
7106c5e

Breaking Changes

  • files-whitelist has been renamed into exclude-files
  • whitelist-global-constants has been renamed into expose-global-constants
  • whitelist-global-classes has been renamed into expose-global-classes
  • whitelist-global-functions has been renamed into expose-global-functions
  • whitelist has been deprecated in favour of the exclude-* and expose-* entries and will be removed in 0.17.0

Features

  • Bump min PHP version to 7.4 (#474)
  • Improve file whitelist (renamed excluded files) performances (#445)
  • Rework the whole "whitelist" logic to split it into two concepts: exclude and expose. Excluded symbols are treated as PHP internal symbols i.e. left untouched. Exposed symbols are symbols that will remain accessible after scoping. More details in the docs and the following related PRs:
    • Allow to register internal symbols & namespaces (#493, #494, #520, #570) via the config entries exclude-{namespaces, constants, classes, functions}
    • Rename the whitelist-global-{constants, classes, functions} to expose-global-{constants, classes, functions} (#517)
    • Move from whitelist to expose-{namespaces, constants, classes, functions} (#519, #521, #522, #525, #526, #527, #553, #608)
  • Change default expose global symbols from true to false (#523)
  • Fix (some) PHP8.1 compatibility (#528)
  • Remove Composer1 support (#544, #556)
  • Add multi-const statement support (#571)
  • Rename "whitelisted files" to "excluded files" (#611)

Bugfixes

  • Fix polyfills shipped within PHP-Scoper (#481)
  • Fix prefix validation (#490)
  • Fix scoping of typed properties (#499)
  • Fix scoping of NULL (#500)
  • Fix scoping of closures return type (#524)
  • Fix doc link (#531, #385)
  • Fix regex detection (#596)
  • Restrict regex delimiters allowed (#598)

Misc

  • Various Makefile improvements (#476, #588)
  • Various code improvements:
    • Switch to the Safe API when possible (#475)
    • Leverage PHP 7.4 (#478, #491)
    • Integrate FidryConsole (#418)
    • Validate the prefix in the Configuration instead of the command (#482)
    • Refactor AddPrefixCommand (#483)
    • Make prefix non-nullable (#485)
    • Use self instead of this for PHPUnit assertions (#487)
    • Move creation of the config into a dedicated factory class (#488)
    • Move Prefix validation to the Configuration class (#489)
    • Make PHPUnit data providers static (#518)
    • Introduce ScoperFactory (#492)
    • Refactor various classes (#495, #502, #503, #504, #505, #506, #507, #508, #509, #564, #566, #569, #573, #574, #578, #580, #576, #581, #585, #586, #587, #591, #592, #594, #602, #603, #604, #552)
    • Replace PHP-Scoper name resolver by the PHP-Parser one (Part 1) (#496)
    • Introduce static utility method for reflector (#554)
    • Make methods static when possible (#558)
    • Move the prefix, patchers and whitelist out of the Scoper interface (#555)
    • Introduce a Patcher interface (#562)
    • Introduce SymbolsRegistry (#567)
    • Introduce the EnrichedReflector (#575)
    • Introduce NamespaceRegistry (#582)
    • Introduce SymbolsConfiguration (#584)
    • Introduce SymbolRegistry (singular) (#593)
  • Improve the CI (#544, #545, #546, #547, #550, #551, #560, #568)
  • Update composer config to allow plugins (#561, #605)
  • Fix Box (#590)
  • Enrich spec failure message (#599)
  • Update the doc (#610)