zendframework/zend-code
Abandoned; use laminas/laminas-code. Extensions to the PHP Reflection API, static code scanning, and code generation
3.4.1
84M downloads/mo
#1743 most downloaded on Packagist
zendframework/zend-code
What this package is like to depend on
Last release 7 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 13 months
Rarely documented
notes for 17 of 79 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
79 releases · first in 2012
0 releases in the last 12 months
see the full history below
Release timeline
61 releases · Oct 2012 to Dec 2019Releases
latest 60 of 79-
3.4.110 Dec 2019Release notes
Open source →Release notes
Open source → -
3.4.005 Oct 2019Release notes
Open source →Added
-
#170 adds class constant visibility modifiers support.
-
#169 adds the ability to define declare statements.
-
#167 adds the ability to remove doc block of a member.
Changed
- #166 changes omitting default property value if it is null.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #172 fixes PHP 7.4 compatibility.
Release notes
Open source →Added
-
#170 adds class constant visibility modifiers support.
-
#169 adds the ability to define declare statements.
-
#167 adds the ability to remove doc block of a member.
Changed
- #166 changes omitting default property value if it is null.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #172 fixes PHP 7.4 compatibility.
-
-
3.3.231 Aug 2019Release notes
Open source →Release notes
Open source → -
3.3.113 Aug 2018Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#158 updates several
switchcases to usebreakinstead ofcontinue
in order to prevent issues under the upcoming PHP 7.3 release. -
#147 fixes the regular expression used for
@varannotations to
allow omission of the variable name. -
#146 updates all
@returnannotations to reflect the correct types returned by each method. -
#144 fixes the class generator such that it now resolves
setExtendedClass()arguments to aliases provided to the generator. -
#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. -
#140 updates the
MethodScanner::setVisibility()method to raise
a package-specificInvalidArgumentExceptioninstead of the non-existent
packageExceptionclass when an invalid visibility is provided.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#158 updates several
switchcases to usebreakinstead ofcontinuein order to prevent issues under the upcoming PHP 7.3 release. -
#147 fixes the regular expression used for
@varannotations to allow omission of the variable name. -
#146 updates all
@returnannotations to reflect the correct types returned by each method. -
#144 fixes the class generator such that it now resolves
setExtendedClass()arguments to aliases provided to the generator. -
#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 appropriateT_(PUBLIC|PROTECTED|PRIVATE)token values, which are integers. -
#140 updates the
MethodScanner::setVisibility()method to raise a package-specificInvalidArgumentExceptioninstead of the non-existent packageExceptionclass when an invalid visibility is provided.
-
3.3.020 Oct 2017Release notes
Open source →3.3.0 - 2017-10-20
Added
- #131 added the
ability to omit a parameter type declaration - #132 added a
lightweightMethodGenerator::copyMethodSignature()constructor that
only copies the method declaration with no body nor docblock. - #134 short array
notation is now used by default for generated array values - #136 added the
ability to specify anomitdefaultvaluekey when using
ParameterGenerator::fromArray()
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #130 Updated
links to the documentation - #133 The default
value of aParameterGeneratoris always aValueGenerator
Total issues resolved: 6
- 130: Updated links to the docs thanks to @webimpress
- 131: Add omit property value type thanks to @janvernieuwe
- 132: Add MethodGenerator::copyMethodSignature without body and phpdoc thanks to @Tobion
- 133: Default value of ParameterGenerator is always a ValueGenerator thanks to @Tobion
- 134: use short array syntax by default with param type array thanks to @Tobion
- 136: Add omitdefaultvalue to fromArray options thanks to @janvernieuwe
Release notes
Open source →Added
- #131 added the ability to omit a parameter type declaration
- #132 added a
lightweight
MethodGenerator::copyMethodSignature()constructor that only copies the method declaration with no body nor docblock. - #134 short array notation is now used by default for generated array values
- #136 added the
ability to specify an
omitdefaultvaluekey when usingParameterGenerator::fromArray()
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #131 added the
-
3.2.023 Jul 2017Release notes
Open source →3.2.0 - 2017-07-23
Added
- #112
#110 Introduced
support for the PHP7.2objecttype-hint - #41 Added
VarTag
support to the docblock generators and reflectors: allows generating
and parsing@vartags. - #113 Added
PHP7.2to the build matrix - #114 Increased
minimum supported PHP version to^7.1.0 - #114 Upgraded
PHPUnit dependency to^6.2.2 - #121 Imported
global functions viausestatements (experimenting with OpCache
OPCODE inlining optimisations)
Deprecated
- Nothing.
Removed
Fixed
- #101 avoid
callingisInternalPhpTypetwice in theTypeGenerator - #115 Replaced
assertions in the test suite with their static counterparts where
applicable - #120
#109
#100 Applied
ZendFramework coding standard to the library code - #119 Corrected
test suite errors caused by mismatching parameter order - #106
- #107 Minor
typing error corrections in documentation and error messages
Total issues resolved: 16
- 41: Add @var tag support in dockblocks thanks to @red-led
- 100: New coding standard thanks to @Koopzington
- 101: Don't call isInternalPhpType() twice in TypeGenerator thanks to @danez
- 106: Minor spelling fixes thanks to @ka7
- 107: Fixed typo thanks to @dverkade
- 109: Feature - extended CS sniffs thanks to @webimpress
- 110: Add support for PHP 7.2's
objecttype hint thanks to @Ocramius - 112: Introduce PHP7.2
objecttype hint thanks to @shulard - 113: Drop hhvm build, added PHP 7.2 (nightly) build thanks to @webimpress
- 114: Bumped PHP to 7.1 and updated PHPUnit to ^6.2.2 thanks to @webimpress
- 115: Changed all assertions to self::assert instead of $this->... thanks to @webimpress
- 118: Fixed travis configuration - removed hhvm in condition thanks to @webimpress
- 119: Fixes in tests - changed order of params thanks to @webimpress
- 120: Rebased #100 - New coding standard thanks to @webimpress
- 121: Import PHP internal functions thanks to @webimpress
- 122: Remove IRC notifications in travis configuration thanks to @webimpress
Release notes
Open source →Added
- #112
#110 Introduced
support for the PHP
7.2objecttype-hint - #41 Added
VarTagsupport to the docblock generators and reflectors: allows generating and parsing@vartags. - #113 Added
PHP
7.2to the build matrix - #114 Increased
minimum supported PHP version to
^7.1.0 - #114 Upgraded
PHPUnit dependency to
^6.2.2 - #121 Imported
global functions via
usestatements (experimenting with OpCache OPCODE inlining optimisations)
Deprecated
- Nothing.
Removed
Fixed
- #101 avoid
calling
isInternalPhpTypetwice in theTypeGenerator - #115 Replaced assertions in the test suite with their static counterparts where applicable
- #120 #109 #100 Applied ZendFramework coding standard to the library code
- #119 Corrected test suite errors caused by mismatching parameter order
- #106
- #107 Minor typing error corrections in documentation and error messages
- #112
-
3.1.024 Oct 2016Release notes
Open source →Added
- #87 support for
PHP 7.1'svoidreturn type declaration. - #87 support for
PHP 7.1's nullable type declarations. - #87 support for
PHP 7.1'siterabletype declaration. - #62 added
Zend\Code\Generator\MethodGenerator#getReturnType()accessor. - #68
#26 added mutators
to allow removing/checking for existence of methods, properties, constants,
parameters and type declarations across all the code generator API. - #65 continuous
integration testing now checks locked, newest and oldest dependency
sets.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
Total issues resolved: 5
Release notes
Open source →Added
- #87 support for
PHP 7.1's
voidreturn type declaration. - #87 support for PHP 7.1's nullable type declarations.
- #87 support for
PHP 7.1's
iterabletype declaration. - #62 added
Zend\Code\Generator\MethodGenerator#getReturnType()accessor. - #68 #26 added mutators to allow removing/checking for existence of methods, properties, constants, parameters and type declarations across all the code generator API.
- #65 continuous integration testing now checks locked, newest and oldest dependency sets.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
- #87 support for
-
3.0.524 Oct 2016Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #92 corrected
Zend\Code\Scanner\ClassScannerto detect multiple interface inheritance. - #95 corrected
Zend\Code\Generator\ParameterGeneratorto allow copying parameter signatures for non-optional parameters that are still nullable via a default= nullvalue. - #94 corrected
Zend\Code\Generator\ValueGeneratorso that class constants can now be generated with arrays as default value (supported since PHP 5.6).
-
3.0.430 Jun 2016 -
3.0.327 Jun 2016Release notes
Open source →Added
- #66 publishes the documentation to https://docs.zendframework.com/zend-code/.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #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.
- #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.
- #72 fixes an issue
within the
TokenArrayScannerwhen scanning closures.
-
3.0.220 Apr 2016Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #52 updates several
dependency constraints:
- zend-stdlib now allows either the 2.7 or 3.0 series, as the APIs consumed by zend-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 zend-code token scanner unusable.
- #46 updates all
generators to use
\nfor line endings in generated code, vsPHP_EOL, ensuring cross-platform consistency.
-
3.0.126 Jan 2016 -
3.0.013 Jan 2016Release notes
Open source →Changed
- #140 updates the
MethodScanner::setVisibility()method to raise a package-specificInvalidArgumentExceptioninstead of the non-existent packageExceptionclass 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,boolpassed toZend\Code\Generator\ParameterGenerator#setType()are no longer ignored in generated code #30 - Types declared in DocBlocks are now ignored when creating a
Zend\Code\Generator\ParameterGeneratorviaZend\Code\Generator\ParameterGenerator::fromReflection(). #30 - Type strings are now validated: passing an invalid type to any method in the generator API
may lead to a
Zend\Code\Generator\InvalidArgumentExceptionbeing thrown. #30 Zend\Code\Generator\ParameterGenerator::$simplewas removed. #30Zend\Code\Generator\ParameterGenerator#$typeis now anull|Zend\Code\Generator\TypeGenerator: was astringbefore. #30Zend\Code\Generatortype-hints are now always prefixed with the namespace separator\. #30Zend\Code\Reflection\ParameterReflection#getType()was renamed toZend\Code\Reflection\ParameterReflection#detectType()in order to not override the inheritedReflectionParameter#getType(), introduced in PHP 7. #30
Added
- PHP 7 return type hints generation support via
Zend\Code\Generator\MethodGenerator#setReturnType(). #30 - PHP 7 scalar type hints generation support via
Zend\Code\Generator\ParameterGenerator#setType()andZend\Code\Generator\ParameterGenerator#getType(). #30 - PHP 5.6 variadic arguments support via
Zend\Code\Generator\ParameterGenerator#setVariadic()andZend\Code\Generator\ParameterGenerator#getVariadic(). #30 - Generation of methods returning by reference is supported via
Zend\Code\Generator\ParameterGenerator#setReturnsReference(). #30
Deprecated
- Nothing.
Removed
Zend\Code\ParameterGenerator::$simplewas removed. #30
Fixed
- Nothing.
- #140 updates the
-
2.6.320 Apr 2016Nothing published for this version
-
2.6.205 Jan 2016Release notes
Open source → -
2.6.124 Nov 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #25 changes the
doctrine/commonsuggestion/dev-dependency to the more specificdoctrine/annotationspackage (which is what is actually consumed).
-
2.6.018 Nov 2015Release notes
Open source →Added
- #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 toValueGenerator::TYPE_ARRAY_SHORTinstead of usingTYPE_ARRAY. Additionally, you can useTYPE_ARRAY_LONGinstead ofTYPE_ARRAY; the two constants are synonyms. - #11 adds the ability to
generate interfaces via the new class
Zend\Code\Generator\InterfaceGenerator.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #20 updates
the zend-eventmanager dependency to
^2.6|^3.0, and changes its internal usage to use thetriggerEventUntil()signature.
- #12 adds the ability to
generate arrays using either long/standard syntax (
-
2.5.318 Nov 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- #10 removes a development dependency on zendframework/zend-version.
- #23 removes a
requirement on zendframework/zend-stdlib. This results in a slight change in
Zend\Code\Generator\ValueGenerator:setConstants()andgetConstants()can now receive/emit either an SPLArrayObjectorZend\Stdlib\ArrayObject. Since these are functionally equivalent, however, you will experience no change in behavior.
Fixed
- Nothing.
-
2.5.221 Jul 2015Nothing published for this version
-
2.5.103 Jun 2015Nothing published for this version
-
2.5.003 Jun 2015Nothing published for this version
-
2.4.1311 May 2015Nothing published for this version
-
2.4.12no dateNothing published for this version
-
2.4.11no dateNothing published for this version
-
2.4.10no dateNothing published for this version
-
2.4.9no dateNothing published for this version
-
2.4.8no dateNothing published for this version
-
2.4.7no dateNothing published for this version
-
2.4.6no dateNothing published for this version
-
2.4.5no dateNothing published for this version
-
2.4.4no dateNothing published for this version
-
2.4.3no dateNothing published for this version
-
2.4.2no dateNothing published for this version
-
2.4.107 May 2015Nothing published for this version
-
2.4.031 Mar 2015Nothing published for this version
-
2.3.912 Mar 2015Nothing published for this version
-
2.3.8no dateNothing published for this version
-
2.3.7no dateNothing published for this version
-
2.3.612 Mar 2015Nothing published for this version
-
2.3.518 Feb 2015Nothing published for this version
-
2.3.414 Jan 2015Nothing published for this version
-
2.3.316 Sep 2014Nothing published for this version
-
2.3.212 Aug 2014Nothing published for this version
-
2.3.115 Apr 2014Nothing published for this version
-
2.3.012 Mar 2014Nothing published for this version
-
2.2.1006 Mar 2014Nothing published for this version
-
2.2.9no dateNothing published for this version
-
2.2.8no dateNothing published for this version
-
2.2.7no dateNothing published for this version
-
2.2.6no dateNothing published for this version
-
2.2.531 Oct 2013Nothing published for this version
-
2.2.426 Aug 2013Nothing published for this version
-
2.2.321 Aug 2013Nothing published for this version
-
2.2.224 Jul 2013Nothing published for this version
-
2.2.112 Jun 2013Nothing published for this version
-
2.2.015 May 2013Nothing published for this version
-
2.1.617 Apr 2013Nothing published for this version
-
2.1.5no dateNothing published for this version
-
2.1.413 Mar 2013Nothing published for this version
-
2.1.321 Feb 2013Nothing published for this version