CHANGELOG.md 28 KB

Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

4.2.0 - 2021-04-14


Release Notes for 4.2.0

Feature release (minor)

4.2.0

  • Total issues resolved: 1
  • Total pull requests resolved: 1
  • Total contributors: 2

Enhancement

Bug,Enhancement,Help Wanted

4.1.0 - 2021-03-27


Release Notes for 4.1.0

Feature release (minor)

4.1.0

  • Total issues resolved: 0
  • Total pull requests resolved: 3
  • Total contributors: 3

Enhancement

Documentation

4.0.0 - 2020-12-30

Added

Changed

  • laminas/laminas-code#57 due to internal refactoring requiring better internal types, the minimum supported PHP version is now 7.4
  • BC BREAK laminas/laminas-code#38 changed generated class output to no longer contain excessive whitespace around contents. The structure of the generated output will still be the same, but spacing changed, which will likely lead o breakages if you are asserting/depending upon the strings produced by Laminas\Code\Generator\ClassGenerator#generate()
  • BC BREAK laminas/laminas-code#42 declare() statements will now be generated above namespace declarations: this is to be better compliant with PSR-2, but it may break downstream applications if these rely on the stability of code produced by Laminas\Code\Generator\FileGenerator#generate()

Removed

  • BC BREAK zendframwork/zend-code#153 Removed the annotation API from the library
  • BC BREAK laminas/laminas-code#39 the laminas/laminas-zendframework-bridge has been removed, and is instead to be installed optionally by consumers of the library. If you are still migrating from zendframework/zend-code, you will need to add it to your composer.json yourself, or directly use to Laminas\Code symbols.
  • BC BREAK laminas/laminas-code#58 the Scanner and Annotation components have been removed, and with it all API that interacted with it:
    • Laminas\Code\Generator\FileGeneratorRegistry has been deleted
    • Laminas\Code\Generator\FileGenerator::fromReflectedFileName() was removed
    • Laminas\Code\Generator\FileGenerator::fromReflection() was removed
    • Laminas\Code\NameInformation has been deleted
    • Laminas\Code\Reflection\ReflectionInterface was marked @internal
    • Laminas\Code\Reflection\FileReflection has been deleted
    • Laminas\Code\Generic\Prototype\PrototypeInterface was marked @internal
    • Laminas\Code\Generic\Prototype\PrototypeClassFactory was marked @internal
    • Laminas\Code\Generic\Prototype\PrototypeGenericInterface was marked @internal
    • Laminas\Code\Annotation\AnnotationInterface has been deleted
    • Laminas\Code\Annotation\Parser\GenericAnnotationParser has been deleted
    • Laminas\Code\Annotation\Parser\ParserInterface has been deleted
    • Laminas\Code\Annotation\Parser\DoctrineAnnotationParser has been deleted
    • Laminas\Code\Annotation\AnnotationManager has been deleted
    • Laminas\Code\Annotation\AnnotationCollection has been deleted
    • Laminas\Code\Scanner\ValueScanner has been deleted
    • Laminas\Code\Scanner\DirectoryScanner has been deleted
    • Laminas\Code\Scanner\DocBlockScanner#$nameInformation was removed
    • Laminas\Code\Scanner\DocBlockScanner#$annotationManager was removed
    • Laminas\Code\Scanner\DocBlockScanner#$annotations was removed
    • Laminas\Code\Scanner\DocBlockScanner#getAnnotations() was removed
    • Laminas\Code\Scanner\DocBlockScanner was marked @internal
    • Laminas\Code\Scanner\ConstantScanner has been deleted
    • Laminas\Code\Scanner\FunctionScanner has been deleted
    • Laminas\Code\Scanner\AnnotationScanner has been deleted
    • Laminas\Code\Scanner\DerivedClassScanner has been deleted
    • Laminas\Code\Scanner\ClassScanner has been deleted
    • Laminas\Code\Scanner\AggregateDirectoryScanner has been deleted
    • Laminas\Code\Scanner\TokenArrayScanner has been deleted
    • Laminas\Code\Scanner\ParameterScanner has been deleted
    • Laminas\Code\Scanner\FileScanner has been deleted
    • Laminas\Code\Scanner\PropertyScanner has been deleted
    • Laminas\Code\Scanner\CachingFileScanner has been deleted
    • Laminas\Code\Scanner\ScannerInterface has been deleted
    • Laminas\Code\Scanner\MethodScanner has been deleted
    • Laminas\Code\Scanner\Util has been deleted

Release Notes for 4.0.0

next backward compatibility break release (major)

4.0.0

  • Total issues resolved: 21
  • Total pull requests resolved: 13
  • Total contributors: 9

Enhancement

BC Break,Enhancement

Duplicate,Enhancement

Bug

Bug,Unit Test Needed

Awaiting Author Updates,BC Break

Bug,Duplicate,Won't Fix

Bug,Won't Fix

Question,Won't Fix

Enhancement,Won't Fix

BC Break,Enhancement,Question

3.5.1 - 2020-11-30

Added

Release Notes for 3.5.1

3.5.x bugfix release (patch)

3.5.1

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Enhancement

3.5.0 - 2020-11-11

Added

  • #47 adds support for PHP 8. NOTE: this simply means the code runs on PHP 8, not that it can generate code specific to PHP 8.

Release Notes for 3.5.0

next feature release (minor)

3.5.0

  • Total issues resolved: 0
  • Total pull requests resolved: 3
  • Total contributors: 3

Enhancement,hacktoberfest-accepted

Documentation

3.4.1 - 2019-12-10

Added

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

3.4.0 - 2019-10-06

Added

Changed

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

3.3.2 - 2019-08-31

Added

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#171 changes curly braces in array and string offset access to square brackets in order to prevent issues under the upcoming PHP 7.4 release.

  • zendframwork/zend-code#164 fixes indentation in multi-level arrays generated by ValueGenerator.

3.3.1 - 2018-08-13

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#158 updates several switch cases to use break instead of continue in order to prevent issues under the upcoming PHP 7.3 release.

  • zendframwork/zend-code#147 fixes the regular expression used for @var annotations to allow omission of the variable name.

  • zendframwork/zend-code#146 updates all @return annotations to reflect the correct types returned by each method.

  • zendframwork/zend-code#144 fixes the class generator such that it now resolves setExtendedClass() arguments to aliases provided to the generator.

  • zendframwork/zend-code#140 fixes MethodScanner::setVisibility() such that it no longer casts the provided visibility token to lower case; this fix is necessary, as the method is supposed to expect only the appropriate T_(PUBLIC|PROTECTED|PRIVATE) token values, which are integers.

  • zendframwork/zend-code#140 updates the MethodScanner::setVisibility() method to raise a package-specific InvalidArgumentException instead of the non-existent package Exception class when an invalid visibility is provided.

3.3.0 - 2017-10-20

Added

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

3.2.0 - 2017-07-23

Added

Deprecated

  • Nothing.

Removed

Fixed

3.1.0 - 2016-10-24

Added

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • Nothing.

3.0.5 - 2016-10-24

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#92 corrected Laminas\Code\Scanner\ClassScanner to detect multiple interface inheritance.
  • zendframwork/zend-code#95 corrected Laminas\Code\Generator\ParameterGenerator to allow copying parameter signatures for non-optional parameters that are still nullable via a default = null value.
  • zendframwork/zend-code#94 corrected Laminas\Code\Generator\ValueGenerator so that class constants can now be generated with arrays as default value (supported since PHP 5.6).

3.0.4 - 2016-06-30

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#59 fixes an issue with detection of multiple trait use statements.
  • zendframwork/zend-code#75 provides a patch to ensure that extends statements qualify the parent class based on the current namespace and/or import statements.

3.0.3 - 2016-06-27

Added

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#61 fixes an issue with how parameter typehints were generated; previously, fully-qualified class names were not being generated with the leading backslash, causing them to attempt to resolve as if they were relative to the current namespace.
  • zendframwork/zend-code#69 fixes an issue with how class names under the same namespace are generated when generating typehints, extends, and implements values; they now strip the common namespace from the class name.
  • zendframwork/zend-code#72 fixes an issue within the TokenArrayScanner when scanning closures.

3.0.2 - 2016-04-20

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#52 updates several dependency constraints:
    • laminas-stdlib now allows either the 2.7 or 3.0 series, as the APIs consumed by laminas-code are compatible across versions.
    • PHP now excludes the 7.0.5 release, as it has known issues in its tokenizer implementation that make the laminas-code token scanner unusable.
  • zendframwork/zend-code#46 updates all generators to use \n for line endings in generated code, vs PHP_EOL, ensuring cross-platform consistency.

3.0.1 - 2016-01-26

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

3.0.0 - 2016-01-13

Changed

  • zendframwork/zend-code#140 updates the MethodScanner::setVisibility() method to raise a package-specific InvalidArgumentException instead of the non-existent package Exception class when an invalid visibility is provided.

This section refers to breaking changes: please refer to docs/book/migration.md for migration instructions.

  • Types string, int, float, bool passed to Laminas\Code\Generator\ParameterGenerator#setType() are no longer ignored in generated code zendframwork/zend-code#30
  • Types declared in DocBlocks are now ignored when creating a Laminas\Code\Generator\ParameterGenerator via Laminas\Code\Generator\ParameterGenerator::fromReflection(). zendframwork/zend-code#30
  • Type strings are now validated: passing an invalid type to any method in the generator API may lead to a Laminas\Code\Generator\InvalidArgumentException being thrown. zendframwork/zend-code#30
  • Laminas\Code\Generator\ParameterGenerator::$simple was removed. zendframwork/zend-code#30
  • Laminas\Code\Generator\ParameterGenerator#$type is now a null|Laminas\Code\Generator\TypeGenerator: was a string before. zendframwork/zend-code#30
  • Laminas\Code\Generator type-hints are now always prefixed with the namespace separator \. zendframwork/zend-code#30
  • Laminas\Code\Reflection\ParameterReflection#getType() was renamed to Laminas\Code\Reflection\ParameterReflection#detectType() in order to not override the inherited ReflectionParameter#getType(), introduced in PHP 7. zendframwork/zend-code#30

Added

  • PHP 7 return type hints generation support via Laminas\Code\Generator\MethodGenerator#setReturnType(). zendframwork/zend-code#30
  • PHP 7 scalar type hints generation support via Laminas\Code\Generator\ParameterGenerator#setType() and Laminas\Code\Generator\ParameterGenerator#getType(). zendframwork/zend-code#30
  • PHP 5.6 variadic arguments support via Laminas\Code\Generator\ParameterGenerator#setVariadic() and Laminas\Code\Generator\ParameterGenerator#getVariadic(). zendframwork/zend-code#30
  • Generation of methods returning by reference is supported via Laminas\Code\Generator\ParameterGenerator#setReturnsReference(). zendframwork/zend-code#30

Deprecated

  • Nothing.

Removed

Fixed

  • Nothing.

2.6.2 - 2015-01-05

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

2.6.2 - 2015-01-05

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

2.6.1 - 2015-11-24

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#25 changes the doctrine/common suggestion/dev-dependency to the more specific doctrine/annotations package (which is what is actually consumed).

2.6.0 - 2015-11-18

Added

  • zendframwork/zend-code#12 adds the ability to generate arrays using either long/standard syntax (array(...)) or short syntax ([...]). This can be accomplished by setting the value type to ValueGenerator::TYPE_ARRAY_SHORT instead of using TYPE_ARRAY. Additionally, you can use TYPE_ARRAY_LONG instead of TYPE_ARRAY; the two constants are synonyms.
  • zendframwork/zend-code#11 adds the ability to generate interfaces via the new class Laminas\Code\Generator\InterfaceGenerator.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • zendframwork/zend-code#20 updates the laminas-eventmanager dependency to ^2.6|^3.0, and changes its internal usage to use the triggerEventUntil() signature.

2.5.3 - 2015-11-18

Added

  • Nothing.

Deprecated

  • Nothing.

Removed

  • zendframwork/zend-code#10 removes a development dependency on zendframework/zend-version.
  • zendframwork/zend-code#23 removes a requirement on laminas/laminas-stdlib. This results in a slight change in Laminas\Code\Generator\ValueGenerator: setConstants() and getConstants() can now receive/emit either an SPL ArrayObject or Laminas\Stdlib\ArrayObject. Since these are functionally equivalent, however, you will experience no change in behavior.

Fixed

  • Nothing.