From efbb638b820790df76948767ebc8cc4ddaf45c10 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 13 Aug 2018 15:38:19 -0500 Subject: [PATCH 01/80] Bumped to next dev version (3.3.2) --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8647b0c2..f3070a94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.3.2 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.3.1 - 2018-08-13 ### Added From 7d042a7c08bafec3c1655277f0a57fbb2ce82701 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 4 Mar 2019 11:54:12 +0100 Subject: [PATCH 02/80] Omit default property value if it is null --- src/Generator/PropertyGenerator.php | 6 +++++- test/Generator/PropertyGeneratorTest.php | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Generator/PropertyGenerator.php b/src/Generator/PropertyGenerator.php index 6259efc0..b5838e60 100644 --- a/src/Generator/PropertyGenerator.php +++ b/src/Generator/PropertyGenerator.php @@ -46,7 +46,11 @@ public static function fromReflection(PropertyReflection $reflectionProperty) $allDefaultProperties = $reflectionProperty->getDeclaringClass()->getDefaultProperties(); - $property->setDefaultValue($allDefaultProperties[$reflectionProperty->getName()]); + $defaultValue = $allDefaultProperties[$reflectionProperty->getName()]; + $property->setDefaultValue($defaultValue); + if ($defaultValue === null) { + $property->omitDefaultValue = true; + } if ($reflectionProperty->getDocComment() != '') { $property->setDocBlock(DocBlockGenerator::fromReflection($reflectionProperty->getDocBlock())); diff --git a/test/Generator/PropertyGeneratorTest.php b/test/Generator/PropertyGeneratorTest.php index 685c72e8..bf76903e 100644 --- a/test/Generator/PropertyGeneratorTest.php +++ b/test/Generator/PropertyGeneratorTest.php @@ -291,4 +291,15 @@ public function testOmitType() self::assertEquals(' public $foo;', $property->generate()); } + + public function testFromReflectionOmitsDefaultValueIfItIsNull() : void + { + $reflectionClass = new ClassReflection(TestAsset\TestClassWithManyProperties::class); + $propertyReflection = $reflectionClass->getProperty('fooStaticProperty'); + + $generator = PropertyGenerator::fromReflection($propertyReflection); + $code = $generator->generate(); + + $this->assertEquals(' public static $fooStaticProperty;', $code); + } } From 35f60d74ee5dc660f783c84a9bff4c131c6ed394 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 4 Mar 2019 16:56:53 +0100 Subject: [PATCH 03/80] Align the type of $docBlock with reality --- src/Generator/AbstractMemberGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generator/AbstractMemberGenerator.php b/src/Generator/AbstractMemberGenerator.php index b332da9b..9e2ef8ed 100644 --- a/src/Generator/AbstractMemberGenerator.php +++ b/src/Generator/AbstractMemberGenerator.php @@ -36,7 +36,7 @@ abstract class AbstractMemberGenerator extends AbstractGenerator /**#@-*/ /** - * @var DocBlockGenerator + * @var DocBlockGenerator|null */ protected $docBlock; @@ -237,7 +237,7 @@ public function setDocBlock($docBlock) } /** - * @return DocBlockGenerator + * @return DocBlockGenerator|null */ public function getDocBlock() { From acadc3c1b766f4d2cbe7f2285930ad1f3402c4ac Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 4 Mar 2019 16:57:35 +0100 Subject: [PATCH 04/80] Add removeDocBlock() to AbstractMemberGenerator --- src/Generator/AbstractMemberGenerator.php | 5 +++++ test/Generator/AbstractMemberGeneratorTest.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/Generator/AbstractMemberGenerator.php b/src/Generator/AbstractMemberGenerator.php index 9e2ef8ed..afcbefea 100644 --- a/src/Generator/AbstractMemberGenerator.php +++ b/src/Generator/AbstractMemberGenerator.php @@ -236,6 +236,11 @@ public function setDocBlock($docBlock) return $this; } + public function removeDocBlock(): void + { + $this->docBlock = null; + } + /** * @return DocBlockGenerator|null */ diff --git a/test/Generator/AbstractMemberGeneratorTest.php b/test/Generator/AbstractMemberGeneratorTest.php index e1c5829d..bd1adc31 100644 --- a/test/Generator/AbstractMemberGeneratorTest.php +++ b/test/Generator/AbstractMemberGeneratorTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\TestCase; use Zend\Code\Generator\AbstractMemberGenerator; +use Zend\Code\Generator\DocBlockGenerator; use Zend\Code\Generator\Exception\InvalidArgumentException; class AbstractMemberGeneratorTest extends TestCase @@ -43,4 +44,21 @@ public function testSetDocBlockThrowsExceptionWithInvalidType() $this->expectException(InvalidArgumentException::class); $this->fixture->setDocBlock(new \stdClass()); } + + public function testRemoveDocBlock(): void + { + $this->fixture->setDocBlock(new DocBlockGenerator()); + + $this->fixture->removeDocBlock(); + + $this->assertNull($this->fixture->getDocBlock()); + } + + public function testRemoveDocBlockIsIdempotent(): void + { + $this->fixture->removeDocBlock(); + $this->fixture->removeDocBlock(); + + $this->assertNull($this->fixture->getDocBlock()); + } } From 9a10b3bfc7712d57464f570761a28b8a25a80b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 10:40:59 +0200 Subject: [PATCH 05/80] Add ability to define declare statements This adds the ability to configure declare() statements at the top of generated files. It is only possible to generate valid declare statements as stated in php documentation https://www.php.net/manual/en/control-structures.declare.php Solves #102 --- src/Declare_.php | 115 ++++++++++++++++++++++++ src/Generator/FileGenerator.php | 53 +++++++++++ test/Generator/FileGeneratorTest.php | 128 +++++++++++++++++++++++++++ 3 files changed, 296 insertions(+) create mode 100644 src/Declare_.php diff --git a/src/Declare_.php b/src/Declare_.php new file mode 100644 index 00000000..cddf2fc8 --- /dev/null +++ b/src/Declare_.php @@ -0,0 +1,115 @@ + 'integer', + self::STRICT_TYPES => 'integer', + self::ENCODING => 'string' + ]; + + /** + * @var string + */ + protected $directive; + + /** + * @var int|string + */ + protected $value; + + private function __construct(string $directive, $value) + { + $this->directive = $directive; + $this->value = $value; + } + + /** + * @return string + */ + public function getDirective(): string + { + return $this->directive; + } + + /** + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * @param int $value + * @return Declare_ + */ + public static function ticks(int $value): Declare_ + { + return new self(self::TICKS, $value); + } + + /** + * @param int $value + * @return Declare_ + */ + public static function strictTypes(int $value): Declare_ + { + return new self(self::STRICT_TYPES, $value); + } + + /** + * @param string $value + * @return Declare_ + */ + public static function encoding(string $value): Declare_ + { + return new self(self::ENCODING, $value); + } + + public static function fromArray(array $config): Declare_ + { + $directive = array_key_first($config); + $value = $config[$directive]; + + if (! array_key_exists($directive, self::ALLOWED)) { + throw new InvalidArgumentException( + sprintf( + 'Declare directive must be on of: %s.', + implode(', ', array_keys(self::ALLOWED)) + ) + ); + } + + if (gettype($value) !== self::ALLOWED[$directive]) { + throw new InvalidArgumentException( + sprintf( + 'Declare value invalid. Expected %s got %s.', + self::ALLOWED[$directive], + gettype($value) + ) + ); + } + + $method = str_replace('_', '', lcfirst(ucwords($directive, '_'))); + return self::{$method}($value); + } + + /** + * @return string + */ + public function getStatement(): string + { + $value = is_string($this->value) ? '\'' . $this->value . '\'' : $this->value; + + return sprintf('declare(%s=%s);', $this->directive, $value); + } +} diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php index 8253b603..ff2a0acf 100644 --- a/src/Generator/FileGenerator.php +++ b/src/Generator/FileGenerator.php @@ -9,6 +9,8 @@ namespace Zend\Code\Generator; +use Zend\Code\Declare_; +use Zend\Code\Exception\InvalidArgumentException; use Zend\Code\Reflection\Exception as ReflectionException; use Zend\Code\Reflection\FileReflection; @@ -72,6 +74,11 @@ class FileGenerator extends AbstractGenerator */ protected $body; + /** + * @var Declare_[] + */ + protected $declares = []; + /** * Passes $options to {@link setOptions()}. * @@ -166,6 +173,11 @@ public static function fromArray(array $values) case 'requiredfiles': $fileGenerator->setRequiredFiles($value); break; + case 'declares': + $fileGenerator->setDeclares(array_map(function ($directive, $value) { + return Declare_::fromArray([$directive => $value]); + }, array_keys($value), $value)); + break; default: if (property_exists($fileGenerator, $name)) { $fileGenerator->{$name} = $value; @@ -408,6 +420,25 @@ public function getBody() return $this->body; } + public function setDeclares(array $declares) + { + foreach ($declares as $declare) { + if (! $declare instanceof Declare_) { + throw new InvalidArgumentException(sprintf( + '%s is expecting an array of %s\Declare objects', + __METHOD__, + __NAMESPACE__ + )); + } + + if (! array_key_exists($declare->getDirective(), $this->declares)) { + $this->declares[$declare->getDirective()] = $declare; + } + } + + return $this; + } + /** * @return bool */ @@ -491,6 +522,28 @@ public function generate() } } + // declares, if any + if ($this->declares) { + $declareStatements = ''; + + foreach ($this->declares as $declare) { + $declareStatements .= $declare->getStatement() . self::LINE_FEED; + } + + if (preg_match('#/\* Zend_Code_Generator_FileGenerator-DeclaresMarker \*/#m', $output)) { + $output = preg_replace( + '#/\* Zend_Code_Generator_FileGenerator-DeclaresMarker \*/#m', + $declareStatements, + $output, + 1 + ); + } else { + $output .= $declareStatements; + } + + $output .= self::LINE_FEED; + } + // process required files // @todo marker replacement for required files $requiredFiles = $this->getRequiredFiles(); diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index f2ec0bc9..6b97ca0b 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -10,6 +10,8 @@ namespace ZendTest\Code\Generator; use PHPUnit\Framework\TestCase; +use Zend\Code\Declare_; +use Zend\Code\Exception\InvalidArgumentException; use Zend\Code\Generator\ClassGenerator; use Zend\Code\Generator\FileGenerator; use Zend\Code\Reflection\FileReflection; @@ -413,4 +415,130 @@ public function added() $actual = file_get_contents(sys_get_temp_dir() . '/result_class.php'); self::assertEquals($expected, $actual); } + + public function testSingleDeclareStatement(): void + { + $generator = FileGenerator::fromArray([ + 'declares' => [ + 'strict_types' => 1 + ], + 'class' => [ + 'name' => 'SampleClass' + ], + ]); + $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); + $generator->write(); + + $expected = <<assertEquals($expected, $actual); + } + + public function testMultiDeclareStatements(): void + { + $generator = FileGenerator::fromArray([ + 'declares' => [ + 'strict_types' => 1, + 'ticks' => 2 + ], + 'class' => [ + 'name' => 'SampleClass' + ], + ]); + $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); + $generator->write(); + + $expected = <<assertEquals($expected, $actual); + } + + public function testDeclareUnknownDirectiveShouldRaiseException(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Declare directive must be on of: tick, strict_types, encoding.'); + + FileGenerator::fromArray([ + 'declares' => [ + 'fubar' => 1 + ], + 'class' => [ + 'name' => 'SampleClass' + ], + ]); + } + + public function testDeclareWrongTypeShouldRaiseException(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Declare value invalid. Expected integer got string.'); + + FileGenerator::fromArray([ + 'declares' => [ + 'strict_types' => 'wrong type' + ], + 'class' => [ + 'name' => 'SampleClass' + ], + ]); + } + + public function testDeclareDuplicatesShouldOnlyGenerateOne(): void + { + $generator = FileGenerator::fromArray([ + 'class' => [ + 'name' => 'SampleClass' + ], + ]); + $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); + $generator->setDeclares([ + Declare_::strictTypes(1), + Declare_::strictTypes(2) + ]); + $generator->write(); + + $expected = <<assertEquals($expected, $actual); + } } From 06bc7b7ea766e01d66c2341abf74a5bcc544147f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 10:47:13 +0200 Subject: [PATCH 06/80] Use php7.1 compliant functionality --- src/Declare_.php | 2 +- test/Generator/FileGeneratorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Declare_.php b/src/Declare_.php index cddf2fc8..89808b6b 100644 --- a/src/Declare_.php +++ b/src/Declare_.php @@ -77,7 +77,7 @@ public static function encoding(string $value): Declare_ public static function fromArray(array $config): Declare_ { - $directive = array_key_first($config); + $directive = key($config); $value = $config[$directive]; if (! array_key_exists($directive, self::ALLOWED)) { diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index 6b97ca0b..b6188a4d 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -483,7 +483,7 @@ class SampleClass public function testDeclareUnknownDirectiveShouldRaiseException(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Declare directive must be on of: tick, strict_types, encoding.'); + $this->expectExceptionMessage('Declare directive must be on of: ticks, strict_types, encoding.'); FileGenerator::fromArray([ 'declares' => [ From 1a82658f8914ab62a6c073a1ed32f163e1710a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 10:50:16 +0200 Subject: [PATCH 07/80] Rename class to match codesniffer rules --- src/{Declare_.php => DeclareStatement.php} | 16 ++++++++-------- src/Generator/FileGenerator.php | 8 ++++---- test/Generator/FileGeneratorTest.php | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/{Declare_.php => DeclareStatement.php} (85%) diff --git a/src/Declare_.php b/src/DeclareStatement.php similarity index 85% rename from src/Declare_.php rename to src/DeclareStatement.php index 89808b6b..073be7fb 100644 --- a/src/Declare_.php +++ b/src/DeclareStatement.php @@ -4,7 +4,7 @@ use Zend\Code\Exception\InvalidArgumentException; -class Declare_ +class DeclareStatement { public const TICKS = 'ticks'; public const STRICT_TYPES = 'strict_types'; @@ -50,32 +50,32 @@ public function getValue() /** * @param int $value - * @return Declare_ + * @return DeclareStatement */ - public static function ticks(int $value): Declare_ + public static function ticks(int $value): DeclareStatement { return new self(self::TICKS, $value); } /** * @param int $value - * @return Declare_ + * @return DeclareStatement */ - public static function strictTypes(int $value): Declare_ + public static function strictTypes(int $value): DeclareStatement { return new self(self::STRICT_TYPES, $value); } /** * @param string $value - * @return Declare_ + * @return DeclareStatement */ - public static function encoding(string $value): Declare_ + public static function encoding(string $value): DeclareStatement { return new self(self::ENCODING, $value); } - public static function fromArray(array $config): Declare_ + public static function fromArray(array $config): DeclareStatement { $directive = key($config); $value = $config[$directive]; diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php index ff2a0acf..1cef3167 100644 --- a/src/Generator/FileGenerator.php +++ b/src/Generator/FileGenerator.php @@ -9,7 +9,7 @@ namespace Zend\Code\Generator; -use Zend\Code\Declare_; +use Zend\Code\DeclareStatement; use Zend\Code\Exception\InvalidArgumentException; use Zend\Code\Reflection\Exception as ReflectionException; use Zend\Code\Reflection\FileReflection; @@ -75,7 +75,7 @@ class FileGenerator extends AbstractGenerator protected $body; /** - * @var Declare_[] + * @var DeclareStatement[] */ protected $declares = []; @@ -175,7 +175,7 @@ public static function fromArray(array $values) break; case 'declares': $fileGenerator->setDeclares(array_map(function ($directive, $value) { - return Declare_::fromArray([$directive => $value]); + return DeclareStatement::fromArray([$directive => $value]); }, array_keys($value), $value)); break; default: @@ -423,7 +423,7 @@ public function getBody() public function setDeclares(array $declares) { foreach ($declares as $declare) { - if (! $declare instanceof Declare_) { + if (! $declare instanceof DeclareStatement) { throw new InvalidArgumentException(sprintf( '%s is expecting an array of %s\Declare objects', __METHOD__, diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index b6188a4d..17e14c6f 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -10,7 +10,7 @@ namespace ZendTest\Code\Generator; use PHPUnit\Framework\TestCase; -use Zend\Code\Declare_; +use Zend\Code\DeclareStatement; use Zend\Code\Exception\InvalidArgumentException; use Zend\Code\Generator\ClassGenerator; use Zend\Code\Generator\FileGenerator; @@ -519,8 +519,8 @@ public function testDeclareDuplicatesShouldOnlyGenerateOne(): void ]); $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); $generator->setDeclares([ - Declare_::strictTypes(1), - Declare_::strictTypes(2) + DeclareStatement::strictTypes(1), + DeclareStatement::strictTypes(2) ]); $generator->write(); From 423e4c6c6c7741ba4b016889a4acf6f21e187e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 11:27:10 +0200 Subject: [PATCH 08/80] Code linting --- src/DeclareStatement.php | 19 ++++++++++--------- src/Generator/FileGenerator.php | 6 +++--- test/Generator/FileGeneratorTest.php | 18 +++++++++--------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/DeclareStatement.php b/src/DeclareStatement.php index 073be7fb..5bdb670a 100644 --- a/src/DeclareStatement.php +++ b/src/DeclareStatement.php @@ -13,7 +13,7 @@ class DeclareStatement private const ALLOWED = [ self::TICKS => 'integer', self::STRICT_TYPES => 'integer', - self::ENCODING => 'string' + self::ENCODING => 'string', ]; /** @@ -50,37 +50,37 @@ public function getValue() /** * @param int $value - * @return DeclareStatement + * @return self */ - public static function ticks(int $value): DeclareStatement + public static function ticks(int $value): self { return new self(self::TICKS, $value); } /** * @param int $value - * @return DeclareStatement + * @return self */ - public static function strictTypes(int $value): DeclareStatement + public static function strictTypes(int $value): self { return new self(self::STRICT_TYPES, $value); } /** * @param string $value - * @return DeclareStatement + * @return self */ - public static function encoding(string $value): DeclareStatement + public static function encoding(string $value): self { return new self(self::ENCODING, $value); } - public static function fromArray(array $config): DeclareStatement + public static function fromArray(array $config): self { $directive = key($config); $value = $config[$directive]; - if (! array_key_exists($directive, self::ALLOWED)) { + if (! isset(self::ALLOWED[$directive])) { throw new InvalidArgumentException( sprintf( 'Declare directive must be on of: %s.', @@ -100,6 +100,7 @@ public static function fromArray(array $config): DeclareStatement } $method = str_replace('_', '', lcfirst(ucwords($directive, '_'))); + return self::{$method}($value); } diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php index 1cef3167..73af4cab 100644 --- a/src/Generator/FileGenerator.php +++ b/src/Generator/FileGenerator.php @@ -174,7 +174,7 @@ public static function fromArray(array $values) $fileGenerator->setRequiredFiles($value); break; case 'declares': - $fileGenerator->setDeclares(array_map(function ($directive, $value) { + $fileGenerator->setDeclares(array_map(static function ($directive, $value) { return DeclareStatement::fromArray([$directive => $value]); }, array_keys($value), $value)); break; @@ -425,9 +425,9 @@ public function setDeclares(array $declares) foreach ($declares as $declare) { if (! $declare instanceof DeclareStatement) { throw new InvalidArgumentException(sprintf( - '%s is expecting an array of %s\Declare objects', + '%s is expecting an array of %s objects', __METHOD__, - __NAMESPACE__ + DeclareStatement::class )); } diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index 17e14c6f..98c8f05e 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -420,10 +420,10 @@ public function testSingleDeclareStatement(): void { $generator = FileGenerator::fromArray([ 'declares' => [ - 'strict_types' => 1 + 'strict_types' => 1, ], 'class' => [ - 'name' => 'SampleClass' + 'name' => 'SampleClass', ], ]); $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); @@ -452,10 +452,10 @@ public function testMultiDeclareStatements(): void $generator = FileGenerator::fromArray([ 'declares' => [ 'strict_types' => 1, - 'ticks' => 2 + 'ticks' => 2, ], 'class' => [ - 'name' => 'SampleClass' + 'name' => 'SampleClass', ], ]); $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); @@ -487,10 +487,10 @@ public function testDeclareUnknownDirectiveShouldRaiseException(): void FileGenerator::fromArray([ 'declares' => [ - 'fubar' => 1 + 'fubar' => 1, ], 'class' => [ - 'name' => 'SampleClass' + 'name' => 'SampleClass', ], ]); } @@ -502,10 +502,10 @@ public function testDeclareWrongTypeShouldRaiseException(): void FileGenerator::fromArray([ 'declares' => [ - 'strict_types' => 'wrong type' + 'strict_types' => 'wrong type', ], 'class' => [ - 'name' => 'SampleClass' + 'name' => 'SampleClass', ], ]); } @@ -514,7 +514,7 @@ public function testDeclareDuplicatesShouldOnlyGenerateOne(): void { $generator = FileGenerator::fromArray([ 'class' => [ - 'name' => 'SampleClass' + 'name' => 'SampleClass', ], ]); $generator->setFilename(sys_get_temp_dir() . '/result_file.php'); From bfd0c485ba84b334d61bcf27d25e1c96efd5220e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 11:31:30 +0200 Subject: [PATCH 09/80] Improve test coverage --- test/Generator/FileGeneratorTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index 98c8f05e..fab3fdc9 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -541,4 +541,13 @@ class SampleClass $actual = file_get_contents(sys_get_temp_dir() . '/result_file.php'); $this->assertEquals($expected, $actual); } + + public function testWrongDeclareTypeShouldRaiseException(): void + { + $generator = new FileGenerator(); + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('setDeclares is expecting an array of Zend\\Code\\DeclareStatement objects'); + $generator->setDeclares([new \stdClass()]); + } } From 3e25e05bd6fba9af659c6a611a4dc644e8ce2aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 17:32:32 +0200 Subject: [PATCH 10/80] Fix grammar and typo --- src/DeclareStatement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DeclareStatement.php b/src/DeclareStatement.php index 5bdb670a..1d8e21c2 100644 --- a/src/DeclareStatement.php +++ b/src/DeclareStatement.php @@ -83,7 +83,7 @@ public static function fromArray(array $config): self if (! isset(self::ALLOWED[$directive])) { throw new InvalidArgumentException( sprintf( - 'Declare directive must be on of: %s.', + 'Declare directive must be one of: %s.', implode(', ', array_keys(self::ALLOWED)) ) ); @@ -92,7 +92,7 @@ public static function fromArray(array $config): self if (gettype($value) !== self::ALLOWED[$directive]) { throw new InvalidArgumentException( sprintf( - 'Declare value invalid. Expected %s got %s.', + 'Declare value invalid. Expected %s, got %s.', self::ALLOWED[$directive], gettype($value) ) From 6918deee0ab6e36ae1f550489404e8ee9f8b6147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 17:54:47 +0200 Subject: [PATCH 11/80] Fix tests after typo --- test/Generator/FileGeneratorTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index fab3fdc9..c75747e2 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -483,7 +483,7 @@ class SampleClass public function testDeclareUnknownDirectiveShouldRaiseException(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Declare directive must be on of: ticks, strict_types, encoding.'); + $this->expectExceptionMessage('Declare directive must be one of: ticks, strict_types, encoding.'); FileGenerator::fromArray([ 'declares' => [ @@ -498,7 +498,7 @@ public function testDeclareUnknownDirectiveShouldRaiseException(): void public function testDeclareWrongTypeShouldRaiseException(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Declare value invalid. Expected integer got string.'); + $this->expectExceptionMessage('Declare value invalid. Expected integer, got string.'); FileGenerator::fromArray([ 'declares' => [ From 64c25af9c85a58b2867a68b151029677fd0e5d74 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 27 Aug 2019 23:22:18 +0100 Subject: [PATCH 12/80] Fix: replace curly offset access brace with square brackets As of PHP 7.4: the array and string offset access syntax using curly braces is deprecated. --- src/NameInformation.php | 4 ++-- src/Scanner/Util.php | 4 ++-- test/Generator/FileGeneratorTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NameInformation.php b/src/NameInformation.php index 8c096642..bea84ac6 100644 --- a/src/NameInformation.php +++ b/src/NameInformation.php @@ -141,11 +141,11 @@ public function getUses() */ public function resolveName($name) { - if ($this->namespace && ! $this->uses && strlen($name) > 0 && $name{0} != '\\') { + if ($this->namespace && ! $this->uses && strlen($name) > 0 && $name[0] != '\\') { return $this->namespace . '\\' . $name; } - if (! $this->uses || strlen($name) <= 0 || $name{0} == '\\') { + if (! $this->uses || strlen($name) <= 0 || $name[0] == '\\') { return ltrim($name, '\\'); } diff --git a/src/Scanner/Util.php b/src/Scanner/Util.php index 764060c2..b1d4ad39 100644 --- a/src/Scanner/Util.php +++ b/src/Scanner/Util.php @@ -48,13 +48,13 @@ public static function resolveImports(&$value, $key = null, stdClass $data = nul )); } - if ($data->namespace && ! $data->uses && strlen($value) > 0 && $value{0} != '\\') { + if ($data->namespace && ! $data->uses && strlen($value) > 0 && $value[0] != '\\') { $value = $data->namespace . '\\' . $value; return; } - if (! $data->uses || strlen($value) <= 0 || $value{0} == '\\') { + if (! $data->uses || strlen($value) <= 0 || $value[0] == '\\') { $value = ltrim($value, '\\'); return; diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index f2ec0bc9..cce6530b 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -184,7 +184,7 @@ public function testFileLineEndingsAreAlwaysLineFeed() $targetLength = strlen('require_once \'SampleClass.php\';'); self::assertEquals($targetLength, strlen($lines[2])); - self::assertEquals(';', $lines[2]{$targetLength - 1}); + self::assertEquals(';', $lines[2][$targetLength - 1]); } /** From e52eb296ebfa5139c9e1e696888e64c26a79374a Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:36:42 +0000 Subject: [PATCH 13/80] Renamed directory with documentation: doc -> docs --- .gitignore | 2 +- CHANGELOG.md | 2 +- {doc => docs}/book/generator/bookdown.json | 0 {doc => docs}/book/generator/examples.md | 0 {doc => docs}/book/generator/intro.md | 0 {doc => docs}/book/generator/reference.md | 0 {doc => docs}/book/index.html | 0 {doc => docs}/book/index.md | 0 {doc => docs}/book/migration.md | 0 mkdocs.yml | 4 ++-- 10 files changed, 4 insertions(+), 4 deletions(-) rename {doc => docs}/book/generator/bookdown.json (100%) rename {doc => docs}/book/generator/examples.md (100%) rename {doc => docs}/book/generator/intro.md (100%) rename {doc => docs}/book/generator/reference.md (100%) rename {doc => docs}/book/index.html (100%) rename {doc => docs}/book/index.md (100%) rename {doc => docs}/book/migration.md (100%) diff --git a/.gitignore b/.gitignore index 10650b55..b614f92d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ .*.sw* .*.un~ nbproject -doc/html/ +docs/html/ tmp/ zf-mkdoc-theme/ clover.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index f3070a94..278802f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -305,7 +305,7 @@ All notable changes to this project will be documented in this file, in reverse the non-existent package `Exception` class when an invalid visibility is provided. This section refers to breaking changes: please refer to -[doc/book/migration.md](doc/book/migration.md) for migration instructions. +[docs/book/migration.md](docs/book/migration.md) for migration instructions. - Types `string`, `int`, `float`, `bool` passed to `Zend\Code\Generator\ParameterGenerator#setType()` are no longer ignored in generated code [#30](https://github.com/zendframework/zend-code/pull/30) diff --git a/doc/book/generator/bookdown.json b/docs/book/generator/bookdown.json similarity index 100% rename from doc/book/generator/bookdown.json rename to docs/book/generator/bookdown.json diff --git a/doc/book/generator/examples.md b/docs/book/generator/examples.md similarity index 100% rename from doc/book/generator/examples.md rename to docs/book/generator/examples.md diff --git a/doc/book/generator/intro.md b/docs/book/generator/intro.md similarity index 100% rename from doc/book/generator/intro.md rename to docs/book/generator/intro.md diff --git a/doc/book/generator/reference.md b/docs/book/generator/reference.md similarity index 100% rename from doc/book/generator/reference.md rename to docs/book/generator/reference.md diff --git a/doc/book/index.html b/docs/book/index.html similarity index 100% rename from doc/book/index.html rename to docs/book/index.html diff --git a/doc/book/index.md b/docs/book/index.md similarity index 100% rename from doc/book/index.md rename to docs/book/index.md diff --git a/doc/book/migration.md b/docs/book/migration.md similarity index 100% rename from doc/book/migration.md rename to docs/book/migration.md diff --git a/mkdocs.yml b/mkdocs.yml index 143a7530..0b473a18 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ -docs_dir: doc/book -site_dir: doc/html +docs_dir: docs/book +site_dir: docs/html pages: - index.md - "Code Generation": From 78c9cd742da920fbd61ff0bc238be0e011cca2a4 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:37:58 +0000 Subject: [PATCH 14/80] Moved support files into docs directory and added SUPPORT.md --- CONDUCT.md => docs/CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md => docs/CONTRIBUTING.md | 50 ++++--------------------- docs/SUPPORT.md | 25 +++++++++++++ 3 files changed, 34 insertions(+), 43 deletions(-) rename CONDUCT.md => docs/CODE_OF_CONDUCT.md (96%) rename CONTRIBUTING.md => docs/CONTRIBUTING.md (70%) create mode 100644 docs/SUPPORT.md diff --git a/CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 96% rename from CONDUCT.md rename to docs/CODE_OF_CONDUCT.md index c663d2be..02fafcd1 100644 --- a/CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ # Contributor Code of Conduct -The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com) +This project adheres to [The Code Manifesto](http://codemanifesto.com) as its guidelines for contributor interactions. ## The Code Manifesto diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 70% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 97abf69c..14accb7e 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -2,37 +2,16 @@ ## RESOURCES -If you wish to contribute to Zend Framework, please be sure to +If you wish to contribute to this project, please be sure to read/subscribe to the following resources: - - [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards) - - [Contributor's Guide](http://framework.zend.com/participate/contributor-guide) - - ZF Contributor's mailing list: - Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html - Subscribe: zf-contributors-subscribe@lists.zend.com - - ZF Contributor's IRC channel: - #zftalk.dev on Freenode.net + - [Coding Standards](https://github.com/zendframework/zend-coding-standard) + - [Forums](https://discourse.zendframework.com/c/contributors) + - [Slack](https://zendframework-slack.herokuapp.com) + - [Code of Conduct](CODE_OF_CONDUCT.md) -If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-code/issues/new). - -## Reporting Potential Security Issues - -If you have encountered a potential security vulnerability, please **DO NOT** report it on the public -issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead. -We will work with you to verify the vulnerability and patch it as soon as possible. - -When reporting issues, please provide the following information: - -- Component(s) affected -- A description indicating how to reproduce the issue -- A summary of the security vulnerability and impact - -We request that you contact us via the email address above and give the project -contributors a chance to resolve the vulnerability and issue a new release prior -to any public exposure; this helps protect users and provides them with a chance -to upgrade and/or update in order to protect their applications. - -For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc). +If you are working on new features or refactoring +[create a proposal](https://github.com/zendframework/zend-code/issues/new). ## RUNNING TESTS @@ -177,15 +156,7 @@ To send a pull request, you have two options. If using GitHub, you can do the pull request from there. Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user/organization -"zendframework" as the recipient. - -If using your own repository - or even if using GitHub - you can use `git -format-patch` to create a patchset for us to apply; in fact, this is -**recommended** for security-related patches. If you use `format-patch`, please -send the patches as attachments to: - -- zf-devteam@zend.com for patches without security implications -- zf-security@zend.com for security patches +"zendframework" (or whatever the upstream organization is) as the recipient. #### What branch to issue the pull request against? @@ -216,8 +187,3 @@ repository, we suggest doing some cleanup of these branches. ```console $ git push {username} : ``` - - -## Conduct - -Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project. diff --git a/docs/SUPPORT.md b/docs/SUPPORT.md new file mode 100644 index 00000000..535c48f1 --- /dev/null +++ b/docs/SUPPORT.md @@ -0,0 +1,25 @@ +# Getting Support + +Zend Framework offers three support channels: + +- For real-time questions, use our + [Slack](https://zendframework-slack.herokuapp.com) +- For detailed questions (e.g., those requiring examples) use our + [forums](https://discourse.zendframework.com/c/questions/components) +- To report issues, use this repository's + [issue tracker](https://github.com/zendframework/zend-code/issues/new) + +**DO NOT** use the issue tracker to ask questions; use Slack or the forums for +that. Questions posed to the issue tracker will be closed. + +When reporting an issue, please include the following details: + +- A narrative description of what you are trying to accomplish. +- The minimum code necessary to reproduce the issue. +- The expected results of exercising that code. +- The actual results received. + +We may ask for additional details: what version of the library you are using, +and what PHP version was used to reproduce the issue. + +You may also submit a failing test case as a pull request. From bb8d2409226b7c298226cff31e094e2741688308 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:40:42 +0000 Subject: [PATCH 15/80] Updated .gitattributes --- .gitattributes | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitattributes b/.gitattributes index f88eeea1..6669e716 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,10 @@ +/docs export-ignore /test export-ignore -/vendor export-ignore -.coveralls.yml export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.travis.yml export-ignore -phpcs.xml.dist export-ignore -phpunit.xml.dist export-ignore +/.coveralls.yml export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/composer.lock export-ignore +/mkdocs.yml export-ignore +/phpcs.xml export-ignore +/phpunit.xml.dist export-ignore From 5dddb345799354b4c8b1151e9a98b0d92936265a Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:40:53 +0000 Subject: [PATCH 16/80] Updated PHPUnit configuration --- phpunit.xml.dist | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f21d91f1..8c3363ab 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,21 @@ - + ./test + - - ./src + + ./src - - From dacd9634743baf32af00b7b8846e69e9a3a03eed Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:41:22 +0000 Subject: [PATCH 17/80] Updated .gitignore - removed all IDE/OS specific files/dirs --- .gitignore | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index b614f92d..9e685001 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,7 @@ -.buildpath -.DS_Store -.idea -.project -.settings/ -.*.sw* -.*.un~ -nbproject docs/html/ -tmp/ +vendor/ zf-mkdoc-theme/ clover.xml coveralls-upload.json phpunit.xml -vendor +zf-mkdoc-theme.tgz From dd9949fbad75ab99107b91cd279e471c847baf8e Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:46:08 +0000 Subject: [PATCH 18/80] Updated Travis CI configuration - removed building docs in travis - added PHP 7.2 builds and removed nightly builds - removed updating composer (self-update), done by travis itself --- .travis.yml | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index c318a9a0..16de1b87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,27 +2,15 @@ sudo: false language: php -branches: - except: - - /^release-\d+\.\d+\.\d+.*$/ - - /^ghgfk-.*$/ - cache: directories: - $HOME/.composer/cache - - $HOME/.local - - zf-mkdoc-theme env: global: - COMPOSER_ARGS="--no-interaction" - COVERAGE_DEPS="satooshi/php-coveralls" - TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT=true - - SITE_URL="https://zendframework.github.io/zend-code" - - GH_USER_NAME="Matthew Weier O'Phinney" - - GH_USER_EMAIL="matthew@weierophinney.net" - - GH_REF="github.com/zendframework/zend-code.git" - - secure: "qgUppUW+xiQunsc07EvrYK7q9j4ewsYzN2ggxxFGaF694gkZ5V29Tb9W2qCkKEdMo6vE+X65P/lOoJceyavPm39/Ka/0V461qIiYX2ZcBVFI/eeVnpwLmU/E5YHn6fFNbiwFX0o4cJdVyTrSspMTXSuiQy+9bLSevDYmbpknR476nmsF8FRGdG6GMFx0XklF1QkoERSfy+FGlqp3VYOJZ2MH7eLhXQyGBKv471kyfmyyInUMVoDN9R8mjJ4Sxyt2qaQ5661DuWRXLaWEBaNOvfZ4++jJFipPLyqIEcE2GqTl9LH3suIBd0NAfHGgdakMJuBZfW3WA/OQ208qm+++qajnI30cxKiGkFoAR2plK9P5+09JAzbivglpEIEtq9a58/I1ahjy9+4sqJYyfxUC07o+REUleJl/ojO6QQ3JI/UUBbPSa3d78Sw9i8LUmLimiYEYQK9zwO1ZdKwJYCKaiYdYS8H0IwGci9t+MqlrllMG5M6f2HRkF1Ph05sWah8QwsGrJ7yiSiILaDHn7wFNvUiN3uw09W9AotQ0AEBzdM6U6CngDPVWKHI9L1d7+txuOLwGt6j8NKHWlgA1P9rMkeMGn2+46b5AlCkUxg6cVCA8ZLpr3a5WLK2F7qTHACtP9tckEb4G3vQjM79f6Nlpewcuc7p7uHWK5Y4UkojRN+U=" matrix: include: @@ -32,47 +20,37 @@ matrix: - php: 7.1 env: - DEPS=locked - - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)" - - PATH="$HOME/.local/bin:$PATH" + - CS_CHECK=true - TEST_COVERAGE=true - - CHECK_CS=true - php: 7.1 env: - DEPS=latest - - php: nightly + - php: 7.2 env: - DEPS=lowest - - php: nightly + - php: 7.2 env: - DEPS=locked - - php: nightly + - php: 7.2 env: - DEPS=latest - allow_failures: - - php: nightly - -notifications: - email: false before_install: - - travis_retry composer self-update - - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || true ; fi + - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi install: + - travis_retry composer install $COMPOSER_ARGS - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi - - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update $COMPOSER_ARGS --prefer-lowest --prefer-stable ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi - - travis_retry composer install $COMPOSER_ARGS - - stty cols 120 - - COLUMNS=120 composer show + - stty cols 120 && composer show script: - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - - if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi - - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then travis_retry curl -sSL https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh | bash ; fi + - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi -after_success: - - if [[ $DEPLOY_DOCS == "true" ]]; then ./zf-mkdoc-theme/deploy.sh ; fi +notifications: + email: false From b0d56f712c761404236b1322e9a4aa2a12c9cb31 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:46:56 +0000 Subject: [PATCH 19/80] Updated year in LICENSE.md and mkdocs.yml --- LICENSE.md | 12 ++++++------ mkdocs.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 25501b09..3846b8c2 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,16 +1,16 @@ -Copyright (c) 2005-2016, Zend Technologies USA, Inc. +Copyright (c) 2005-2017, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +- Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. - Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this diff --git a/mkdocs.yml b/mkdocs.yml index 0b473a18..8df854ea 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,4 +10,4 @@ pages: site_name: zend-code site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code' repo_url: 'https://github.com/zendframework/zend-code' -copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2017 Zend Technologies USA Inc.' From 12c5d7a969d5c6108130af148f4df86d3484140e Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 31 Oct 2017 21:48:59 +0000 Subject: [PATCH 20/80] Removed Makefile --- Makefile | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 4726b079..00000000 --- a/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# zend-expressive Makefile -# -# Primary purpose is for generating the mkdocs.yml from the bookdown.json -# sources. -# -# Configurable variables: -# - BOOKDOWN2MKDOCS - specify the path to the executable; defaults to -# ./vendor/bin/bookdown2mkdocs -# -# Available targets: -# - mkdocs - regenerate mkdocs.yml -# - all - synonym for mkdocs target - -BOOKDOWN2MKDOCS?=$(CURDIR)/vendor/bin/bookdown2mkdocs.php - -.PHONY : all mkdocs bookdown2mkdocs - -all : mkdocs - -mkdocs : - @echo "Generating mkdocs.yml from bookdown.json..." - -$(BOOKDOWN2MKDOCS) convert --site-name=zend-code --repo-url=https://github.com/zendframework/zend-code --copyright-url=http://www.zend.com/ --copyright-author="Zend Technologies USA Inc." - @echo "[DONE] Generating mkdocs.yml from bookdown.json" From 45b3e01293e25cdc3e6050b35b239973622192a9 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:09:05 +0100 Subject: [PATCH 21/80] Updated composer skeleton --- composer.json | 37 ++-- composer.lock | 483 +++++++++++++++++++++++++++++--------------------- 2 files changed, 304 insertions(+), 216 deletions(-) diff --git a/composer.json b/composer.json index d6d3b389..2362e5be 100644 --- a/composer.json +++ b/composer.json @@ -3,14 +3,17 @@ "description": "provides facilities to generate arbitrary code using an object oriented interface", "license": "BSD-3-Clause", "keywords": [ - "zf2", + "zf", + "zendframework", "code" ], - "homepage": "https://github.com/zendframework/zend-code", - "autoload": { - "psr-4": { - "Zend\\Code\\": "src/" - } + "support": { + "docs": "https://docs.zendframework.com/zend-code/", + "issues": "https://github.com/zendframework/zend-code/issues", + "source": "https://github.com/zendframework/zend-code", + "rss": "https://github.com/zendframework/zend-code/releases.atom", + "slack": "https://zendframework-slack.herokuapp.com", + "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { "php": "^7.1", @@ -27,12 +30,9 @@ "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", "zendframework/zend-stdlib": "Zend\\Stdlib component" }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "branch-alias": { - "dev-master": "3.3.x-dev", - "dev-develop": "3.4.x-dev" + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" } }, "autoload-dev": { @@ -40,15 +40,24 @@ "ZendTest\\Code\\": "test/" } }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev", + "dev-develop": "3.4.x-dev" + } + }, "scripts": { "check": [ "@cs-check", "@test" ], - "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "upload-coverage": "coveralls -v" } } diff --git a/composer.lock b/composer.lock index 99bf3589..fa61b405 100644 --- a/composer.lock +++ b/composer.lock @@ -1,23 +1,23 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ee05e51bd6b0f8d1d75da29bef50387", + "content-hash": "52cab2a1b58fc368a2e8d56aad2b2643", "packages": [ { "name": "zendframework/zend-eventmanager", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ "require-dev": { "athletic/athletic": "^0.1", "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^6.0.7 || ^5.7.14", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-stdlib": "^2.7.3 || ^3.0" }, @@ -58,22 +58,22 @@ "events", "zf2" ], - "time": "2017-07-11T19:17:22+00:00" + "time": "2018-04-25T15:33:34+00:00" } ], "packages-dev": [ { "name": "doctrine/annotations", - "version": "v1.5.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f" + "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5beebb01b025c94e93686b7a0ed3edae81fe3e7f", - "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", "shasum": "" }, "require": { @@ -82,12 +82,12 @@ }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7.5@dev" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -100,6 +100,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -108,10 +112,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -128,31 +128,33 @@ "docblock", "parser" ], - "time": "2017-07-22T10:58:02+00:00" + "time": "2019-08-08T18:11:40+00:00" }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "a2c590166b2133a4633738648b6b064edae0814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", + "reference": "a2c590166b2133a4633738648b6b064edae0814a", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { @@ -177,30 +179,33 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2019-03-17T17:37:11+00:00" }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -208,8 +213,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -230,47 +235,56 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.1", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -278,7 +292,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "phar-io/manifest", @@ -384,16 +398,16 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -434,33 +448,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.0", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -479,7 +499,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-07-15T11:38:20+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -530,38 +550,38 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -589,45 +609,44 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2019-06-13T12:50:23+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.2.1", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/dc421f9ca5082a0c0cb04afb171c765f79add85b", - "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", "php": "^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", - "sebastian/version": "^2.0", + "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.5", "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.3" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -642,8 +661,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", @@ -653,20 +672,20 @@ "testing", "xunit" ], - "time": "2017-04-21T08:03:57+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -700,7 +719,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -781,8 +800,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "Utility class for timing", @@ -794,29 +813,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -839,20 +858,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "6.2.3", + "version": "6.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fa5711d0559fc4b64deba0702be52d41434cbcb7" + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa5711d0559fc4b64deba0702be52d41434cbcb7", - "reference": "fa5711d0559fc4b64deba0702be52d41434cbcb7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", "shasum": "" }, "require": { @@ -861,24 +880,24 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.3", + "myclabs/deep-copy": "^1.6.1", "phar-io/manifest": "^1.0.1", "phar-io/version": "^1.0", "php": "^7.0", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2", - "phpunit/php-file-iterator": "^1.4", - "phpunit/php-text-template": "^1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^4.0", - "sebastian/comparator": "^2.0", - "sebastian/diff": "^1.4.3 || ^2.0", - "sebastian/environment": "^3.0.2", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", - "sebastian/global-state": "^1.1 || ^2.0", - "sebastian/object-enumerator": "^3.0.2", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0" + "sebastian/version": "^2.0.1" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2", @@ -897,7 +916,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -912,8 +931,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "The PHP Unit Testing framework.", @@ -923,33 +942,33 @@ "testing", "xunit" ], - "time": "2017-07-03T15:54:24+00:00" + "time": "2019-02-01T05:22:47+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.2", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4", - "reference": "d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", + "doctrine/instantiator": "^1.0.5", "php": "^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^3.0" + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" }, "conflict": { "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -957,7 +976,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -972,7 +991,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -982,7 +1001,8 @@ "mock", "xunit" ], - "time": "2017-06-30T08:15:21+00:00" + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1031,30 +1051,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.1", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "875bd7cdcb5f49e9bcea732538767937abbed51d" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/875bd7cdcb5f49e9bcea732538767937abbed51d", - "reference": "875bd7cdcb5f49e9bcea732538767937abbed51d", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { "php": "^7.0", - "sebastian/diff": "^2.0", - "sebastian/exporter": "^3.0" + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1085,26 +1105,26 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-07-11T16:29:53+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.x-dev", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "abcc70409ddfb310a8cb41ef0c2e857425438cf4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/abcc70409ddfb310a8cb41ef0c2e857425438cf4", - "reference": "abcc70409ddfb310a8cb41ef0c2e857425438cf4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { @@ -1143,7 +1163,7 @@ "keywords": [ "diff" ], - "time": "2017-12-14T11:32:19+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", @@ -1197,16 +1217,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "06a9a5947f47b3029d76118eb5c22802e5869687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687", + "reference": "06a9a5947f47b3029d76118eb5c22802e5869687", "shasum": "" }, "require": { @@ -1233,6 +1253,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1241,17 +1265,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -1260,7 +1280,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2019-08-11T12:43:14+00:00" }, { "name": "sebastian/global-state", @@ -1315,21 +1335,21 @@ }, { "name": "sebastian/object-enumerator", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/31dd3379d16446c5d86dec32ab1ad1f378581ad8", - "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { "php": "^7.0", - "sebastian/object-reflector": "^1.0", + "sebastian/object-reflector": "^1.1.1", "sebastian/recursion-context": "^3.0" }, "require-dev": { @@ -1358,7 +1378,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-03-12T15:17:29+00:00" + "time": "2017-08-03T12:35:26+00:00" }, { "name": "sebastian/object-reflector", @@ -1545,16 +1565,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", "shasum": "" }, "require": { @@ -1619,20 +1639,78 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", "shasum": "" }, "require": { @@ -1654,33 +1732,33 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-06-13T22:48:21+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", "extra": { @@ -1709,7 +1787,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2019-08-24T08:43:50+00:00" }, { "name": "zendframework/zend-coding-standard", @@ -1742,31 +1820,31 @@ }, { "name": "zendframework/zend-stdlib", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + "reference": "66536006722aff9e62d1b331025089b7ec71c065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.6.2" + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -1778,18 +1856,19 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "SPL extensions, array utilities, error handlers, and more", "keywords": [ + "ZendFramework", "stdlib", - "zf2" + "zf" ], - "time": "2016-09-13T14:38:50+00:00" + "time": "2018-08-28T21:34:05+00:00" } ], "aliases": [], - "minimum-stability": "dev", + "minimum-stability": "stable", "stability-flags": [], - "prefer-stable": true, + "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "^7.1" From 4697b7c18094b50628eb09cdafd93601e2f90e0e Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 8 Nov 2017 11:50:26 +0000 Subject: [PATCH 22/80] Removed empty line in LICENSE.md See LICENSE.md template in maintainers repository --- LICENSE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 3846b8c2..63df4102 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,4 @@ Copyright (c) 2005-2017, Zend Technologies USA, Inc. - All rights reserved. Redistribution and use in source and binary forms, with or without modification, From e6fc5efdde03e7328766b333282edd7ff360b0ed Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 8 Nov 2017 11:50:38 +0000 Subject: [PATCH 23/80] Updated link to coverage results --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 795e3b62..74370770 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # zend-code [![Build Status](https://secure.travis-ci.org/zendframework/zend-code.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-code) -[![Coverage Status](https://coveralls.io/repos/zendframework/zend-code/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-code?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-code/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-code?branch=master) `Zend\Code\Generator` provides facilities to generate arbitrary code using an object-oriented interface, both to create new code as well as to update existing From 5147d0273366f928dd99a43db8995b15790ce15c Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 8 Nov 2017 11:51:09 +0000 Subject: [PATCH 24/80] Added ISSUE and PULL_REQUEST templates --- docs/ISSUE_TEMPLATE.md | 19 +++++++++++++++++++ docs/PULL_REQUEST_TEMPLATE.md | 25 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 docs/ISSUE_TEMPLATE.md create mode 100644 docs/PULL_REQUEST_TEMPLATE.md diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..6f3c89fd --- /dev/null +++ b/docs/ISSUE_TEMPLATE.md @@ -0,0 +1,19 @@ + - [ ] I was not able to find an [open](https://github.com/zendframework/zend-code/issues?q=is%3Aopen) or [closed](https://github.com/zendframework/zend-code/issues?q=is%3Aclosed) issue matching what I'm seeing. + - [ ] This is not a question. (Questions should be asked on [slack](https://zendframework.slack.com/) ([Signup for Slack here](https://zendframework-slack.herokuapp.com/)) or our [forums](https://discourse.zendframework.com/).) + +Provide a narrative description of what you are trying to accomplish. + +### Code to reproduce the issue + + + +```php +``` + +### Expected results + + + +### Actual results + + diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..f00d90c0 --- /dev/null +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +Provide a narrative description of what you are trying to accomplish: + +- [ ] Are you fixing a bug? + - [ ] Detail how the bug is invoked currently. + - [ ] Detail the original, incorrect behavior. + - [ ] Detail the new, expected behavior. + - [ ] Base your feature on the `master` branch, and submit against that branch. + - [ ] Add a regression test that demonstrates the bug, and proves the fix. + - [ ] Add a `CHANGELOG.md` entry for the fix. + +- [ ] Are you creating a new feature? + - [ ] Why is the new feature needed? What purpose does it serve? + - [ ] How will users use the new feature? + - [ ] Base your feature on the `develop` branch, and submit against that branch. + - [ ] Add only one feature per pull request; split multiple features over multiple pull requests + - [ ] Add tests for the new feature. + - [ ] Add documentation for the new feature. + - [ ] Add a `CHANGELOG.md` entry for the new feature. + +- [ ] Is this related to quality assurance? + + +- [ ] Is this related to documentation? + + From ea32e67cd16a8be0bc1fb8ba206e98f9525014f5 Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 8 Nov 2017 11:51:19 +0000 Subject: [PATCH 25/80] Updated repository description --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2362e5be..b445404a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "zendframework/zend-code", - "description": "provides facilities to generate arbitrary code using an object oriented interface", + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation.", "license": "BSD-3-Clause", "keywords": [ "zf", From a9564adc70add92c05b629bf65fe16fcca6a6b5f Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 22 Nov 2017 09:00:29 +0000 Subject: [PATCH 26/80] Updated .gitattributes and .gitignore - natsort --- .gitattributes | 4 ++-- .gitignore | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6669e716..16d8d293 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,10 @@ -/docs export-ignore -/test export-ignore /.coveralls.yml export-ignore /.gitattributes export-ignore /.gitignore export-ignore /.travis.yml export-ignore /composer.lock export-ignore +/docs/ export-ignore /mkdocs.yml export-ignore /phpcs.xml export-ignore /phpunit.xml.dist export-ignore +/test/ export-ignore diff --git a/.gitignore b/.gitignore index 9e685001..245087af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -docs/html/ -vendor/ -zf-mkdoc-theme/ -clover.xml -coveralls-upload.json -phpunit.xml -zf-mkdoc-theme.tgz +/clover.xml +/coveralls-upload.json +/docs/html/ +/phpunit.xml +/vendor/ +/zf-mkdoc-theme.tgz +/zf-mkdoc-theme/ From ace216c21ed4c3e0b3fa45578f10f6d18ce1037e Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 22 Nov 2017 09:00:54 +0000 Subject: [PATCH 27/80] Removed empty lines at the end of the line in the docs --- docs/book/generator/examples.md | 2 +- docs/book/generator/reference.md | 4 ++-- docs/book/index.html | 2 +- docs/book/migration.md | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/book/generator/examples.md b/docs/book/generator/examples.md index 8b8451ef..8ca11131 100644 --- a/docs/book/generator/examples.md +++ b/docs/book/generator/examples.md @@ -328,7 +328,7 @@ You can add *PHP* code to an existing *PHP* file using the code generator. To do first do reflection on it. The static method `fromReflectedFileName()` allows you to do this. ```php -$generator = Zend\Code\Generator\FileGenerator::fromReflectedFileName($path); +$generator = Zend\Code\Generator\FileGenerator::fromReflectedFileName($path); $generator->setBody("\$foo->bar();"); file_put_contents($path, $generator->generate()); ``` diff --git a/docs/book/generator/reference.md b/docs/book/generator/reference.md index c5a81718..17509445 100644 --- a/docs/book/generator/reference.md +++ b/docs/book/generator/reference.md @@ -103,8 +103,8 @@ class Zend\Code\Generator\ClassGenerator extends Zend\Code\Generator\AbstractGen public function addConstants(Array $properties) public function addConstant($property) public function getConstants() - public function getConstant($propertyName) - public function removeConstant($constantName) + public function getConstant($propertyName) + public function removeConstant($constantName) public function setDocblock(Zend\Code\Generator\DocBlockGenerator $docblock) public function getDocblock() public function setName($name) diff --git a/docs/book/index.html b/docs/book/index.html index d19038a8..dcd014f8 100644 --- a/docs/book/index.html +++ b/docs/book/index.html @@ -1,7 +1,7 @@

zend-code

- +

Extensions to the PHP Reflection API, static code scanning, and code generation.

$ composer require zendframework/zend-code
diff --git a/docs/book/migration.md b/docs/book/migration.md index 7f4b12c7..d73ee037 100644 --- a/docs/book/migration.md +++ b/docs/book/migration.md @@ -2,7 +2,7 @@ ## `string`, `int`, `float`, `bool` are no longer ignored -In 2.x, a `Zend\Code\Generator\ParameterGenerator` with name `foo` and type +In 2.x, a `Zend\Code\Generator\ParameterGenerator` with name `foo` and type `string`, `int`, `float` or `bool` simply generated code `"$foo"`: ```php @@ -16,7 +16,7 @@ echo $generator->generate(); // "$foo" In 3.x, this code will instead produce `"string $foo"`. If you generate code that should run in PHP 5.x, it is advisable to strip `string`, `int`, `float` and `bool` from type definitions passed to -`Zend\Code\ParameterGenerator` instances. The quickest way is to set the +`Zend\Code\ParameterGenerator` instances. The quickest way is to set the type to `null`, if it matches any of these scalar types: ```php @@ -36,10 +36,10 @@ was renamed to `Zend\Code\Reflection\ParameterReflection#detectType()`. If you relied on `Zend\Code\Reflection\ParameterReflection#getType()`, you can simply replace the method calls in your code. - + ## DocBlock types ignored by `ParameterGenerator::fromReflection()` -As a direct consequence of the previous change, calls to +As a direct consequence of the previous change, calls to `Zend\Code\Generator\ParameterGenerator::fromReflection()` will not mirror the type hints read from a method's DocBlock. @@ -63,7 +63,7 @@ $methodGenerator = \Zend\Code\Generator\MethodGenerator::fromReflection( var_dump($methodGenerator->getParameters()[0]->getType()); ``` -In version 2.x, this code produces `"string"`, in version 3.x it returns `null`. If you +In version 2.x, this code produces `"string"`, in version 3.x it returns `null`. If you need to rely on the types in the annotations, please use `Zend\Code\Reflection\ParameterReflection#detectType()` instead, and build a `MethodGenerator` instance manually. From 0a6fddb5b32fe90fe1fa9981532d5f8eb093a8c1 Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 22 Nov 2017 09:01:10 +0000 Subject: [PATCH 28/80] Updated copyright year range in mkdocs.yml to match LICENSE.md --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 8df854ea..40c17806 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,4 +10,4 @@ pages: site_name: zend-code site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code' repo_url: 'https://github.com/zendframework/zend-code' -copyright: 'Copyright (c) 2017 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2005-2017 Zend Technologies USA Inc.' From 4ad8caf01613029ecd6fa13dd46fbdcfd4773194 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 14 Dec 2017 09:20:38 +0000 Subject: [PATCH 29/80] Updated to php-coveralls/php-coveralls With version 2 package has been renamed from "satooshi/php-coveralls" to "php-coveralls/php-coveralls", and the script has been renamed from "coveralls" to "php-coveralls" --- .travis.yml | 4 ++-- composer.json | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16de1b87..58a7a9dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ cache: env: global: - COMPOSER_ARGS="--no-interaction" - - COVERAGE_DEPS="satooshi/php-coveralls" + - COVERAGE_DEPS="php-coveralls/php-coveralls" - TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT=true matrix: @@ -50,7 +50,7 @@ script: - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi notifications: email: false diff --git a/composer.json b/composer.json index b445404a..7109800c 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,6 @@ "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", - "upload-coverage": "coveralls -v" + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" } } From ab2af76a44fa9f4359d831f2f2c1b95dde3d20b6 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 12 Apr 2018 10:43:51 +0100 Subject: [PATCH 30/80] Updated copyright year range in LICENSE.md and mkdocs.yml --- LICENSE.md | 2 +- mkdocs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 63df4102..d44ab5dc 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2005-2017, Zend Technologies USA, Inc. +Copyright (c) 2005-2018, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/mkdocs.yml b/mkdocs.yml index 40c17806..24191ba1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,4 +10,4 @@ pages: site_name: zend-code site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code' repo_url: 'https://github.com/zendframework/zend-code' -copyright: 'Copyright (c) 2005-2017 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' From c32677314f042454a104e23f1be86b42976d197e Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 12 Apr 2018 10:44:33 +0100 Subject: [PATCH 31/80] Added travis_retry on uploading coverage to coveralls in Travis CI config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 58a7a9dc..6493cae4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ script: - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi notifications: email: false From fcc1b9c4daef6a305fb63afb1cfff8553f45a138 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 12 Apr 2018 10:44:47 +0100 Subject: [PATCH 32/80] Updated link to https in mkdocs.yml --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 24191ba1..364fc2a6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,4 +10,4 @@ pages: site_name: zend-code site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code' repo_url: 'https://github.com/zendframework/zend-code' -copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' From e26918ed5296f63b29c623d5c81ff181cc246a61 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:14:43 +0100 Subject: [PATCH 33/80] PHPUnit update --- composer.json | 10 +- composer.lock | 302 +++++++++++++++++++++----------------------------- 2 files changed, 131 insertions(+), 181 deletions(-) diff --git a/composer.json b/composer.json index 7109800c..4f587c62 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "zendframework/zend-code", - "description": "Extensions to the PHP Reflection API, static code scanning, and code generation.", + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", "license": "BSD-3-Clause", "keywords": [ "zf", @@ -21,10 +21,10 @@ }, "require-dev": { "ext-phar": "*", - "doctrine/annotations": "~1.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0", - "phpunit/phpunit": "^6.2.3", - "zendframework/zend-coding-standard": "^1.0.0" + "doctrine/annotations": "^1.0", + "phpunit/phpunit": "^7.5.15", + "zendframework/zend-coding-standard": "^1.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" }, "suggest": { "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", diff --git a/composer.lock b/composer.lock index fa61b405..0ed24d5f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "52cab2a1b58fc368a2e8d56aad2b2643", + "content-hash": "cbeac7ed5f22643b36977305e4f1d876", "packages": [ { "name": "zendframework/zend-eventmanager", @@ -296,22 +296,22 @@ }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -332,35 +332,35 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" }, { "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpeople.de" }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpunit.de" } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -379,22 +379,22 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" }, { "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpeople.de" }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpunit.de" } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -613,40 +613,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -672,29 +672,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -709,8 +712,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", @@ -719,7 +722,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -764,28 +767,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -801,7 +804,7 @@ { "name": "Sebastian Bergmann", "role": "lead", - "email": "sb@sebastian-bergmann.de" + "email": "sebastian@phpunit.de" } ], "description": "Utility class for timing", @@ -809,33 +812,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-06-07T04:22:29+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a", + "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -858,57 +861,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2019-07-25T05:29:42+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.14", + "version": "7.5.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + "reference": "d79c053d972856b8b941bb233e39dc521a5093f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d79c053d972856b8b941bb233e39dc521a5093f0", + "reference": "d79c053d972856b8b941bb233e39dc521a5093f0", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -916,7 +919,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -942,67 +945,7 @@ "testing", "xunit" ], - "time": "2019-02-01T05:22:47+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2018-08-09T05:50:03+00:00" + "time": "2019-08-21T07:05:16+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1051,30 +994,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1111,32 +1054,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1161,34 +1105,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1213,7 +1163,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2019-05-05T09:05:15+00:00" }, { "name": "sebastian/exporter", @@ -1480,25 +1430,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1518,7 +1468,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", From f9e38904b0be695af5e80746019b213c4f1b6dee Mon Sep 17 00:00:00 2001 From: webimpress Date: Fri, 13 Apr 2018 08:00:29 +0100 Subject: [PATCH 34/80] Use "chat" instead of "slack" --- composer.json | 2 +- docs/CONTRIBUTING.md | 2 +- docs/ISSUE_TEMPLATE.md | 2 +- docs/SUPPORT.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 4f587c62..bfd067b4 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "issues": "https://github.com/zendframework/zend-code/issues", "source": "https://github.com/zendframework/zend-code", "rss": "https://github.com/zendframework/zend-code/releases.atom", - "slack": "https://zendframework-slack.herokuapp.com", + "chat": "https://zendframework-slack.herokuapp.com", "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 14accb7e..da62d507 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -7,7 +7,7 @@ read/subscribe to the following resources: - [Coding Standards](https://github.com/zendframework/zend-coding-standard) - [Forums](https://discourse.zendframework.com/c/contributors) - - [Slack](https://zendframework-slack.herokuapp.com) + - [Chat](https://zendframework-slack.herokuapp.com) - [Code of Conduct](CODE_OF_CONDUCT.md) If you are working on new features or refactoring diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md index 6f3c89fd..6d87b4a6 100644 --- a/docs/ISSUE_TEMPLATE.md +++ b/docs/ISSUE_TEMPLATE.md @@ -1,5 +1,5 @@ - [ ] I was not able to find an [open](https://github.com/zendframework/zend-code/issues?q=is%3Aopen) or [closed](https://github.com/zendframework/zend-code/issues?q=is%3Aclosed) issue matching what I'm seeing. - - [ ] This is not a question. (Questions should be asked on [slack](https://zendframework.slack.com/) ([Signup for Slack here](https://zendframework-slack.herokuapp.com/)) or our [forums](https://discourse.zendframework.com/).) + - [ ] This is not a question. (Questions should be asked on [chat](https://zendframework.slack.com/) ([Signup here](https://zendframework-slack.herokuapp.com/)) or our [forums](https://discourse.zendframework.com/).) Provide a narrative description of what you are trying to accomplish. diff --git a/docs/SUPPORT.md b/docs/SUPPORT.md index 535c48f1..807ec595 100644 --- a/docs/SUPPORT.md +++ b/docs/SUPPORT.md @@ -3,13 +3,13 @@ Zend Framework offers three support channels: - For real-time questions, use our - [Slack](https://zendframework-slack.herokuapp.com) + [chat](https://zendframework-slack.herokuapp.com) - For detailed questions (e.g., those requiring examples) use our [forums](https://discourse.zendframework.com/c/questions/components) - To report issues, use this repository's [issue tracker](https://github.com/zendframework/zend-code/issues/new) -**DO NOT** use the issue tracker to ask questions; use Slack or the forums for +**DO NOT** use the issue tracker to ask questions; use chat or the forums for that. Questions posed to the issue tracker will be closed. When reporting an issue, please include the following details: From e1f014c3d5a2c4388d7f1734d70b0c77d8f14746 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:17:54 +0100 Subject: [PATCH 35/80] Remove unused docs/book/index.html --- docs/book/index.html | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 docs/book/index.html diff --git a/docs/book/index.html b/docs/book/index.html deleted file mode 100644 index dcd014f8..00000000 --- a/docs/book/index.html +++ /dev/null @@ -1,10 +0,0 @@ -
-
-

zend-code

- -

Extensions to the PHP Reflection API, static code scanning, and code generation.

- -
$ composer require zendframework/zend-code
-
-
- From 02450b6ff5db0ebc64b34e43c5f4f371c5ded4ac Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:18:07 +0100 Subject: [PATCH 36/80] Update copyright year in LICENSE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index d44ab5dc..4bc22a4a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2005-2018, Zend Technologies USA, Inc. +Copyright (c) 2005-2019, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, From 63be4d9d26807ea7ec312787a10dc7e5dc39ec45 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:18:47 +0100 Subject: [PATCH 37/80] Update docs configuration - description - remove copyright - page link titles --- mkdocs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 364fc2a6..3e9ec7f6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,13 +1,12 @@ docs_dir: docs/book site_dir: docs/html pages: - - index.md + - Home: index.md - "Code Generation": - - Intro: generator/intro.md + - Introduction: generator/intro.md - Examples: generator/examples.md - Reference: generator/reference.md - Migration: migration.md site_name: zend-code -site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code' +site_description: 'Extensions to the PHP Reflection API, static code scanning, and code generation' repo_url: 'https://github.com/zendframework/zend-code' -copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' From 54968c54d8773760a32e078cfc0df61340f7d81b Mon Sep 17 00:00:00 2001 From: webimpress Date: Mon, 15 Oct 2018 09:01:44 +0100 Subject: [PATCH 38/80] Added PHP 7.3 support Updated Travis CI configuration to run all tests on PHP 7.3 with lowest/locked/latest dependencies --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6493cae4..ce671705 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,15 @@ matrix: - php: 7.2 env: - DEPS=latest + - php: 7.3 + env: + - DEPS=lowest + - php: 7.3 + env: + - DEPS=locked + - php: 7.3 + env: + - DEPS=latest before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi From e8408c9a7b5e6f98b4f17d28f5620be65814b989 Mon Sep 17 00:00:00 2001 From: hxss Date: Tue, 23 Oct 2018 13:07:25 +0300 Subject: [PATCH 39/80] recursively set indentations for child arrays --- src/Generator/ValueGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Generator/ValueGenerator.php b/src/Generator/ValueGenerator.php index 3c7b4c3b..d0c6b69f 100644 --- a/src/Generator/ValueGenerator.php +++ b/src/Generator/ValueGenerator.php @@ -361,6 +361,7 @@ public function generate() } $curValue = new self($curValue, $newType, self::OUTPUT_MULTIPLE_LINE, $this->getConstants()); + $curValue->setIndentation($this->indentation); } } From f7006d712676a0aec1a045a979bd87ae192274f7 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 23 Oct 2018 15:14:28 +0300 Subject: [PATCH 40/80] added test for recursively set indentations --- test/Generator/ValueGeneratorTest.php | 98 +++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index c9e04c90..37634897 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -225,6 +225,87 @@ public function complexArray() return $this->generateArrayData($longOutput, $value); } + /** + * Data provider for testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes test + * + * @return array + */ + public function complexArrayWCustomIndent() + { + $value = [ + '5bcf08a0a5d20' => [ + '5bcf08a0a5d65' => [ + '5bcf08a0a5d9f' => [ + '5bcf08a0a5dd8' => [ + '5bcf08a0a5e11' => [ + '5bcf08a0a5e4f' => '5bcf08a0a5e8c', + '5bcf08a0a5eca' => '5bcf08a0a5f05', + '5bcf08a0a5f43' => '5bcf08a0a5f7f', + '5bcf08a0a5fbd' => '5bcf08a0a5ff8', + ], + ], + '5bcf08a0a603a' => [], + '5bcf08a0a6062' => '5bcf08a0a609f', + '5bcf08a0a60dc' => [ + '5bcf08a0a611b' => '5bcf08a0a6158', + '5bcf08a0a6197' => [ + '5bcf08a0a61d7' => '5bcf08a0a6212', + '5bcf08a0a6250' => '5bcf08a0a628c', + '5bcf08a0a62cb' => '5bcf08a0a6306', + ], + '5bcf08a0a6345' => [ + '5bcf08a0a637e' => '5bcf08a0a63b4', + '5bcf08a0a63ee' => '5bcf08a0a642a', + ], + '5bcf08a0a6449' => '5bcf08a0a6485', + ], + ], + ], '5bcf08a0a64c8' => '5bcf08a0a6540', + '5bcf08a0a657f' => '5bcf08a0a65bf', + ], + ]; + + $longOutput = << array( + '5bcf08a0a5d65' => array( + '5bcf08a0a5d9f' => array( + '5bcf08a0a5dd8' => array( + '5bcf08a0a5e11' => array( + '5bcf08a0a5e4f' => '5bcf08a0a5e8c', + '5bcf08a0a5eca' => '5bcf08a0a5f05', + '5bcf08a0a5f43' => '5bcf08a0a5f7f', + '5bcf08a0a5fbd' => '5bcf08a0a5ff8', + ), + ), + '5bcf08a0a603a' => array( + + ), + '5bcf08a0a6062' => '5bcf08a0a609f', + '5bcf08a0a60dc' => array( + '5bcf08a0a611b' => '5bcf08a0a6158', + '5bcf08a0a6197' => array( + '5bcf08a0a61d7' => '5bcf08a0a6212', + '5bcf08a0a6250' => '5bcf08a0a628c', + '5bcf08a0a62cb' => '5bcf08a0a6306', + ), + '5bcf08a0a6345' => array( + '5bcf08a0a637e' => '5bcf08a0a63b4', + '5bcf08a0a63ee' => '5bcf08a0a642a', + ), + '5bcf08a0a6449' => '5bcf08a0a6485', + ), + ), + ), + '5bcf08a0a64c8' => '5bcf08a0a6540', + '5bcf08a0a657f' => '5bcf08a0a65bf', + ), +) +EOS; + + return $this->generateArrayData($longOutput, $value); + } + /** * Data provider for testPropertyDefaultValueCanHandleArrayWithUnsortedKeys test * @@ -338,6 +419,23 @@ public function testPropertyDefaultValueCanHandleComplexArrayOfTypes($type, arra self::assertEquals($expected, $valueGenerator->generate()); } + /** + * @dataProvider complexArrayWCustomIndent + * + * @param string $type + * @param array $value + * @param string $expected + */ + public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes($type, array $value, $expected) + { + $valueGenerator = new ValueGenerator(); + $valueGenerator->setType($type); + $valueGenerator->setValue($value); + $valueGenerator->setIndentation("\t"); + + self::assertEquals($expected, $valueGenerator->generate()); + } + /** * @group 6023 * From d39783e6330b49f8b796875deabc35fde150e4b7 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 23 Oct 2018 15:38:56 +0300 Subject: [PATCH 41/80] fix test style --- test/Generator/ValueGeneratorTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 37634897..880c6a2d 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -227,10 +227,8 @@ public function complexArray() /** * Data provider for testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes test - * - * @return array */ - public function complexArrayWCustomIndent() + public function complexArrayWCustomIndent(): array { $value = [ '5bcf08a0a5d20' => [ @@ -421,12 +419,8 @@ public function testPropertyDefaultValueCanHandleComplexArrayOfTypes($type, arra /** * @dataProvider complexArrayWCustomIndent - * - * @param string $type - * @param array $value - * @param string $expected */ - public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes($type, array $value, $expected) + public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes(string $type, array $value, string $expected) { $valueGenerator = new ValueGenerator(); $valueGenerator->setType($type); From eed93584a518e25c15491897a69ae13792ef2dad Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 23 Oct 2018 15:50:03 +0300 Subject: [PATCH 42/80] fix test style [2] (forgot :void) --- test/Generator/ValueGeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 880c6a2d..2abbb728 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -420,7 +420,7 @@ public function testPropertyDefaultValueCanHandleComplexArrayOfTypes($type, arra /** * @dataProvider complexArrayWCustomIndent */ - public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes(string $type, array $value, string $expected) + public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes(string $type, array $value, string $expected): void { $valueGenerator = new ValueGenerator(); $valueGenerator->setType($type); From 641e63170988c476a554d8da23e6c36ab52ef6f8 Mon Sep 17 00:00:00 2001 From: hxss Date: Wed, 24 Oct 2018 02:55:22 +0500 Subject: [PATCH 43/80] fix whitespace in test standard --- test/Generator/ValueGeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 2abbb728..9a6df369 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -277,7 +277,7 @@ public function complexArrayWCustomIndent(): array ), ), '5bcf08a0a603a' => array( - + ), '5bcf08a0a6062' => '5bcf08a0a609f', '5bcf08a0a60dc' => array( From 8cca78e54460698bc23352f72e1697d5ea7db38a Mon Sep 17 00:00:00 2001 From: hxss Date: Wed, 24 Oct 2018 03:10:38 +0500 Subject: [PATCH 44/80] fix indents --- test/Generator/ValueGeneratorTest.php | 64 +++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 9a6df369..f62f32ca 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -230,38 +230,38 @@ public function complexArray() */ public function complexArrayWCustomIndent(): array { - $value = [ - '5bcf08a0a5d20' => [ - '5bcf08a0a5d65' => [ - '5bcf08a0a5d9f' => [ - '5bcf08a0a5dd8' => [ - '5bcf08a0a5e11' => [ - '5bcf08a0a5e4f' => '5bcf08a0a5e8c', - '5bcf08a0a5eca' => '5bcf08a0a5f05', - '5bcf08a0a5f43' => '5bcf08a0a5f7f', - '5bcf08a0a5fbd' => '5bcf08a0a5ff8', - ], - ], - '5bcf08a0a603a' => [], - '5bcf08a0a6062' => '5bcf08a0a609f', - '5bcf08a0a60dc' => [ - '5bcf08a0a611b' => '5bcf08a0a6158', - '5bcf08a0a6197' => [ - '5bcf08a0a61d7' => '5bcf08a0a6212', - '5bcf08a0a6250' => '5bcf08a0a628c', - '5bcf08a0a62cb' => '5bcf08a0a6306', - ], - '5bcf08a0a6345' => [ - '5bcf08a0a637e' => '5bcf08a0a63b4', - '5bcf08a0a63ee' => '5bcf08a0a642a', - ], - '5bcf08a0a6449' => '5bcf08a0a6485', - ], - ], - ], '5bcf08a0a64c8' => '5bcf08a0a6540', - '5bcf08a0a657f' => '5bcf08a0a65bf', - ], - ]; + $value = [ + '5bcf08a0a5d20' => [ + '5bcf08a0a5d65' => [ + '5bcf08a0a5d9f' => [ + '5bcf08a0a5dd8' => [ + '5bcf08a0a5e11' => [ + '5bcf08a0a5e4f' => '5bcf08a0a5e8c', + '5bcf08a0a5eca' => '5bcf08a0a5f05', + '5bcf08a0a5f43' => '5bcf08a0a5f7f', + '5bcf08a0a5fbd' => '5bcf08a0a5ff8', + ], + ], + '5bcf08a0a603a' => [], + '5bcf08a0a6062' => '5bcf08a0a609f', + '5bcf08a0a60dc' => [ + '5bcf08a0a611b' => '5bcf08a0a6158', + '5bcf08a0a6197' => [ + '5bcf08a0a61d7' => '5bcf08a0a6212', + '5bcf08a0a6250' => '5bcf08a0a628c', + '5bcf08a0a62cb' => '5bcf08a0a6306', + ], + '5bcf08a0a6345' => [ + '5bcf08a0a637e' => '5bcf08a0a63b4', + '5bcf08a0a63ee' => '5bcf08a0a642a', + ], + '5bcf08a0a6449' => '5bcf08a0a6485', + ], + ], + ], '5bcf08a0a64c8' => '5bcf08a0a6540', + '5bcf08a0a657f' => '5bcf08a0a65bf', + ], + ]; $longOutput = << Date: Wed, 24 Oct 2018 03:20:37 +0500 Subject: [PATCH 45/80] fix line length --- test/Generator/ValueGeneratorTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index f62f32ca..c97bc611 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -420,7 +420,11 @@ public function testPropertyDefaultValueCanHandleComplexArrayOfTypes($type, arra /** * @dataProvider complexArrayWCustomIndent */ - public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes(string $type, array $value, string $expected): void + public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfTypes( + string $type, + array $value, + string $expected + ): void { $valueGenerator = new ValueGenerator(); $valueGenerator->setType($type); From b3541e329e9516e8f29be894b32d02fcc8a7173f Mon Sep 17 00:00:00 2001 From: hxss Date: Wed, 24 Oct 2018 03:25:23 +0500 Subject: [PATCH 46/80] fix brackets positions --- test/Generator/ValueGeneratorTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index c97bc611..fd28a53e 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -424,8 +424,7 @@ public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfType string $type, array $value, string $expected - ): void - { + ): void { $valueGenerator = new ValueGenerator(); $valueGenerator->setType($type); $valueGenerator->setValue($value); From f74f79c43d0ad47365e5a5b59d7f6d20e409a3de Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:45:42 +0100 Subject: [PATCH 47/80] Adds CHANGELOG entry for #164 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 278802f9..ccfc7d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#164](https://github.com/zendframework/zend-code/pull/164) fixes indentation in multi-level arrays generated by `ValueGenerator`. ## 3.3.1 - 2018-08-13 From b4e2b1b8dcef748551ca7f529a858eed9bf58dbf Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 29 Aug 2019 22:54:56 +0100 Subject: [PATCH 48/80] Adds CHANGELOG entry for #171 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccfc7d34..0b394fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed +- [#171](https://github.com/zendframework/zend-code/pull/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. + - [#164](https://github.com/zendframework/zend-code/pull/164) fixes indentation in multi-level arrays generated by `ValueGenerator`. ## 3.3.1 - 2018-08-13 From da1e205aee7f57972144f26c3b090c123ec3124d Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 31 Aug 2019 15:13:12 +0100 Subject: [PATCH 49/80] Adds CHANGELOG entry for #162 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b394fb3..b06e2753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file, in reverse ### Added -- Nothing. +- [#162](https://github.com/zendframework/zend-code/pull/162) adds support for PHP 7.3. ### Changed From 31592740058bb134a89735423c62768f12aa7eb5 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 31 Aug 2019 15:13:48 +0100 Subject: [PATCH 50/80] release: 3.3.2 readiness --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b06e2753..6693e2d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.3.2 - TBD +## 3.3.2 - 2019-08-31 ### Added From 7ddf14410504ca980a421a24a66182dc852a3780 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 2 Sep 2019 08:12:46 +0200 Subject: [PATCH 51/80] fix Trying to access array offset on value of type nul (7.4) --- src/Scanner/MethodScanner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scanner/MethodScanner.php b/src/Scanner/MethodScanner.php index 36542028..4eaa01c4 100644 --- a/src/Scanner/MethodScanner.php +++ b/src/Scanner/MethodScanner.php @@ -452,7 +452,7 @@ protected function scan() $tokenType = null; $tokenContent = $token; $tokenLine = $tokenLine + substr_count( - $lastTokenArray[1], + $lastTokenArray[1] ?? null, "\n" ); // adjust token line by last known newline count } else { From 1ef1efdce9a8836aafea6706ff0f8bdfe2f232b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Sun, 1 Sep 2019 04:41:45 -1000 Subject: [PATCH 52/80] Compatibility with recent PHPUnit (8) --- test/Annotation/AnnotationManagerTest.php | 2 +- test/Annotation/DoctrineAnnotationParserTest.php | 2 +- test/Annotation/GenericAnnotationParserTest.php | 2 +- test/Generator/AbstractMemberGeneratorTest.php | 2 +- test/Generator/DocBlock/Tag/AuthorTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/GenericTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/LicenseTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/MethodTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ParamTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/PropertyTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ReturnTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ThrowsTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/TypableTagTest.php | 4 ++-- test/Generator/DocBlockGeneratorTest.php | 2 +- test/Generator/TraitGeneratorTest.php | 2 +- test/Generic/Prototype/PrototypeClassFactoryTest.php | 4 ++-- test/Reflection/DocBlock/Tag/AuthorTagTest.php | 2 +- test/Reflection/DocBlock/Tag/LicenseTagTest.php | 2 +- test/Scanner/CachingFileScannerTest.php | 2 +- test/Scanner/ClassScannerTest.php | 2 +- 20 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/Annotation/AnnotationManagerTest.php b/test/Annotation/AnnotationManagerTest.php index ae2f5937..a65d4af9 100644 --- a/test/Annotation/AnnotationManagerTest.php +++ b/test/Annotation/AnnotationManagerTest.php @@ -18,7 +18,7 @@ class AnnotationManagerTest extends TestCase { - public function setUp() + public function setUp(): void { if (! getenv('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')) { $this->markTestSkipped( diff --git a/test/Annotation/DoctrineAnnotationParserTest.php b/test/Annotation/DoctrineAnnotationParserTest.php index 1f5ab2c4..202e468d 100644 --- a/test/Annotation/DoctrineAnnotationParserTest.php +++ b/test/Annotation/DoctrineAnnotationParserTest.php @@ -23,7 +23,7 @@ class DoctrineAnnotationParserTest extends TestCase */ private $parser; - public function setUp() + public function setUp(): void { if (! getenv('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')) { $this->markTestSkipped( diff --git a/test/Annotation/GenericAnnotationParserTest.php b/test/Annotation/GenericAnnotationParserTest.php index 22d7c551..fc174086 100644 --- a/test/Annotation/GenericAnnotationParserTest.php +++ b/test/Annotation/GenericAnnotationParserTest.php @@ -23,7 +23,7 @@ class GenericAnnotationParserTest extends TestCase */ private $parser; - public function setUp() + public function setUp(): void { $this->parser = new Annotation\Parser\GenericAnnotationParser(); } diff --git a/test/Generator/AbstractMemberGeneratorTest.php b/test/Generator/AbstractMemberGeneratorTest.php index e1c5829d..34640731 100644 --- a/test/Generator/AbstractMemberGeneratorTest.php +++ b/test/Generator/AbstractMemberGeneratorTest.php @@ -20,7 +20,7 @@ class AbstractMemberGeneratorTest extends TestCase */ private $fixture; - protected function setUp() + protected function setUp(): void { $this->fixture = $this->getMockForAbstractClass(AbstractMemberGenerator::class); } diff --git a/test/Generator/DocBlock/Tag/AuthorTagTest.php b/test/Generator/DocBlock/Tag/AuthorTagTest.php index d1ad2f33..280d1e5a 100644 --- a/test/Generator/DocBlock/Tag/AuthorTagTest.php +++ b/test/Generator/DocBlock/Tag/AuthorTagTest.php @@ -30,14 +30,14 @@ class AuthorTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new AuthorTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/GenericTagTest.php b/test/Generator/DocBlock/Tag/GenericTagTest.php index 35dc06ba..35e408f3 100644 --- a/test/Generator/DocBlock/Tag/GenericTagTest.php +++ b/test/Generator/DocBlock/Tag/GenericTagTest.php @@ -30,14 +30,14 @@ class GenericTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new GenericTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/LicenseTagTest.php b/test/Generator/DocBlock/Tag/LicenseTagTest.php index bca09b07..b40c4991 100644 --- a/test/Generator/DocBlock/Tag/LicenseTagTest.php +++ b/test/Generator/DocBlock/Tag/LicenseTagTest.php @@ -30,14 +30,14 @@ class LicenseTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new LicenseTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/MethodTagTest.php b/test/Generator/DocBlock/Tag/MethodTagTest.php index d22f7545..76af80f4 100644 --- a/test/Generator/DocBlock/Tag/MethodTagTest.php +++ b/test/Generator/DocBlock/Tag/MethodTagTest.php @@ -30,14 +30,14 @@ class MethodTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new MethodTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ParamTagTest.php b/test/Generator/DocBlock/Tag/ParamTagTest.php index 324e59dd..e6cb4e90 100644 --- a/test/Generator/DocBlock/Tag/ParamTagTest.php +++ b/test/Generator/DocBlock/Tag/ParamTagTest.php @@ -30,14 +30,14 @@ class ParamTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new ParamTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/PropertyTagTest.php b/test/Generator/DocBlock/Tag/PropertyTagTest.php index df2f0286..20f646b2 100644 --- a/test/Generator/DocBlock/Tag/PropertyTagTest.php +++ b/test/Generator/DocBlock/Tag/PropertyTagTest.php @@ -30,14 +30,14 @@ class PropertyTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new PropertyTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ReturnTagTest.php b/test/Generator/DocBlock/Tag/ReturnTagTest.php index 30ce6c28..92324b08 100644 --- a/test/Generator/DocBlock/Tag/ReturnTagTest.php +++ b/test/Generator/DocBlock/Tag/ReturnTagTest.php @@ -30,14 +30,14 @@ class ReturnTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new ReturnTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ThrowsTagTest.php b/test/Generator/DocBlock/Tag/ThrowsTagTest.php index ec145e47..2018c28d 100644 --- a/test/Generator/DocBlock/Tag/ThrowsTagTest.php +++ b/test/Generator/DocBlock/Tag/ThrowsTagTest.php @@ -30,14 +30,14 @@ class ThrowsTagTest extends TestCase */ protected $tagmanager; - public function setUp() + public function setUp(): void { $this->tag = new ThrowsTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/TypableTagTest.php b/test/Generator/DocBlock/Tag/TypableTagTest.php index a3224e3b..4ad0e24c 100644 --- a/test/Generator/DocBlock/Tag/TypableTagTest.php +++ b/test/Generator/DocBlock/Tag/TypableTagTest.php @@ -23,12 +23,12 @@ class TypableTagTest extends TestCase */ protected $tag; - public function setUp() + public function setUp(): void { $this->tag = new TypeableTag(); } - public function tearDown() + public function tearDown(): void { $this->tag = null; } diff --git a/test/Generator/DocBlockGeneratorTest.php b/test/Generator/DocBlockGeneratorTest.php index c89053b7..fd0a56e9 100644 --- a/test/Generator/DocBlockGeneratorTest.php +++ b/test/Generator/DocBlockGeneratorTest.php @@ -34,7 +34,7 @@ class DocBlockGeneratorTest extends TestCase */ protected $reflectionDocBlockGenerator; - protected function setUp() + protected function setUp(): void { $this->docBlockGenerator = $this->docBlockGenerator = new DocBlockGenerator(); $reflectionDocBlock = new DocBlockReflection( diff --git a/test/Generator/TraitGeneratorTest.php b/test/Generator/TraitGeneratorTest.php index a838585f..2be51480 100644 --- a/test/Generator/TraitGeneratorTest.php +++ b/test/Generator/TraitGeneratorTest.php @@ -26,7 +26,7 @@ */ class TraitGeneratorTest extends TestCase { - public function setUp() + public function setUp(): void { } diff --git a/test/Generic/Prototype/PrototypeClassFactoryTest.php b/test/Generic/Prototype/PrototypeClassFactoryTest.php index 19fb3039..57713ee1 100644 --- a/test/Generic/Prototype/PrototypeClassFactoryTest.php +++ b/test/Generic/Prototype/PrototypeClassFactoryTest.php @@ -25,12 +25,12 @@ class PrototypeClassFactoryTest extends TestCase */ protected $prototypeFactory; - public function setUp() + public function setUp(): void { $this->prototypeFactory = new PrototypeClassFactory(); } - public function tearDown() + public function tearDown(): void { $this->prototypeFactory = null; } diff --git a/test/Reflection/DocBlock/Tag/AuthorTagTest.php b/test/Reflection/DocBlock/Tag/AuthorTagTest.php index 4f60e6ed..93a7bcda 100644 --- a/test/Reflection/DocBlock/Tag/AuthorTagTest.php +++ b/test/Reflection/DocBlock/Tag/AuthorTagTest.php @@ -23,7 +23,7 @@ class AuthorTagTest extends TestCase */ protected $tag; - public function setUp() + public function setUp(): void { $this->tag = new AuthorTag(); } diff --git a/test/Reflection/DocBlock/Tag/LicenseTagTest.php b/test/Reflection/DocBlock/Tag/LicenseTagTest.php index de37b543..dad95d53 100644 --- a/test/Reflection/DocBlock/Tag/LicenseTagTest.php +++ b/test/Reflection/DocBlock/Tag/LicenseTagTest.php @@ -23,7 +23,7 @@ class LicenseTagTest extends TestCase */ protected $tag; - public function setUp() + public function setUp(): void { $this->tag = new LicenseTag(); } diff --git a/test/Scanner/CachingFileScannerTest.php b/test/Scanner/CachingFileScannerTest.php index 33abc9bc..89b732f3 100644 --- a/test/Scanner/CachingFileScannerTest.php +++ b/test/Scanner/CachingFileScannerTest.php @@ -18,7 +18,7 @@ class CachingFileScannerTest extends TestCase { - protected function setUp() + protected function setUp(): void { CachingFileScanner::clearCache(); } diff --git a/test/Scanner/ClassScannerTest.php b/test/Scanner/ClassScannerTest.php index bb255c0d..d25ef34f 100644 --- a/test/Scanner/ClassScannerTest.php +++ b/test/Scanner/ClassScannerTest.php @@ -38,7 +38,7 @@ class ClassScannerTest extends TestCase { protected $manager; - public function setUp() + public function setUp(): void { $this->manager = new Annotation\AnnotationManager(); From 2f5c432643ff5930687b9e64c5d8cf0093885421 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 09:46:50 +0100 Subject: [PATCH 53/80] Allow PHPUnit 8 in composer.json --- .gitignore | 1 + .travis.yml | 6 ++- composer.json | 2 +- composer.lock | 114 +++++++++++++++++++++++++------------------------- 4 files changed, 62 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index 245087af..1bcb3fc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.phpunit.result.cache /clover.xml /coveralls-upload.json /docs/html/ diff --git a/.travis.yml b/.travis.yml index ce671705..dca06ea5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ matrix: - php: 7.1 env: - DEPS=locked + - LEGACY_DEPS="phpunit/phpunit" - CS_CHECK=true - TEST_COVERAGE=true - php: 7.1 @@ -48,9 +49,10 @@ before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi install: - - travis_retry composer install $COMPOSER_ARGS + - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs + - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi - - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update $COMPOSER_ARGS --prefer-lowest --prefer-stable ; fi - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi - stty cols 120 && composer show diff --git a/composer.json b/composer.json index bfd067b4..ae5dbcd3 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require-dev": { "ext-phar": "*", "doctrine/annotations": "^1.0", - "phpunit/phpunit": "^7.5.15", + "phpunit/phpunit": "^7.5.16 || ^8.4", "zendframework/zend-coding-standard": "^1.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, diff --git a/composer.lock b/composer.lock index 0ed24d5f..2b47f658 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cbeac7ed5f22643b36977305e4f1d876", + "content-hash": "1c58445b752bbe7c59a9e3c0a6966031", "packages": [ { "name": "zendframework/zend-eventmanager", @@ -398,35 +398,33 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -448,30 +446,30 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", + "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, @@ -499,41 +497,40 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2019-09-12T14:27:41+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -546,26 +543,27 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -609,7 +607,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -661,8 +659,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", @@ -816,16 +814,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { @@ -861,20 +859,20 @@ "keywords": [ "tokenizer" ], - "time": "2019-07-25T05:29:42+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "7.5.15", + "version": "7.5.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0" + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d79c053d972856b8b941bb233e39dc521a5093f0", - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", "shasum": "" }, "require": { @@ -934,8 +932,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "The PHP Unit Testing framework.", @@ -945,7 +943,7 @@ "testing", "xunit" ], - "time": "2019-08-21T07:05:16+00:00" + "time": "2019-09-14T09:08:39+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1167,16 +1165,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.1", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { @@ -1230,7 +1228,7 @@ "export", "exporter" ], - "time": "2019-08-11T12:43:14+00:00" + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/global-state", From d470762fd07974892b6e9221bd14ca9b0a1db40e Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 09:48:54 +0100 Subject: [PATCH 54/80] Use protected setUp/tearDown --- test/Annotation/AnnotationManagerTest.php | 2 +- test/Annotation/DoctrineAnnotationParserTest.php | 2 +- test/Annotation/GenericAnnotationParserTest.php | 2 +- test/Generator/AbstractMemberGeneratorTest.php | 2 +- test/Generator/DocBlock/Tag/AuthorTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/GenericTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/LicenseTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/MethodTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ParamTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/PropertyTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ReturnTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/ThrowsTagTest.php | 4 ++-- test/Generator/DocBlock/Tag/TypableTagTest.php | 4 ++-- test/Generator/DocBlockGeneratorTest.php | 2 +- test/Generator/TraitGeneratorTest.php | 2 +- test/Generator/ValueGeneratorTest.php | 2 +- test/Generic/Prototype/PrototypeClassFactoryTest.php | 4 ++-- test/Reflection/DocBlock/Tag/AuthorTagTest.php | 2 +- test/Reflection/DocBlock/Tag/LicenseTagTest.php | 2 +- test/Scanner/CachingFileScannerTest.php | 2 +- test/Scanner/ClassScannerTest.php | 2 +- 21 files changed, 31 insertions(+), 31 deletions(-) diff --git a/test/Annotation/AnnotationManagerTest.php b/test/Annotation/AnnotationManagerTest.php index a65d4af9..7ef24232 100644 --- a/test/Annotation/AnnotationManagerTest.php +++ b/test/Annotation/AnnotationManagerTest.php @@ -18,7 +18,7 @@ class AnnotationManagerTest extends TestCase { - public function setUp(): void + protected function setUp() : void { if (! getenv('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')) { $this->markTestSkipped( diff --git a/test/Annotation/DoctrineAnnotationParserTest.php b/test/Annotation/DoctrineAnnotationParserTest.php index 202e468d..147629a9 100644 --- a/test/Annotation/DoctrineAnnotationParserTest.php +++ b/test/Annotation/DoctrineAnnotationParserTest.php @@ -23,7 +23,7 @@ class DoctrineAnnotationParserTest extends TestCase */ private $parser; - public function setUp(): void + protected function setUp() : void { if (! getenv('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')) { $this->markTestSkipped( diff --git a/test/Annotation/GenericAnnotationParserTest.php b/test/Annotation/GenericAnnotationParserTest.php index fc174086..ba7bf601 100644 --- a/test/Annotation/GenericAnnotationParserTest.php +++ b/test/Annotation/GenericAnnotationParserTest.php @@ -23,7 +23,7 @@ class GenericAnnotationParserTest extends TestCase */ private $parser; - public function setUp(): void + protected function setUp() : void { $this->parser = new Annotation\Parser\GenericAnnotationParser(); } diff --git a/test/Generator/AbstractMemberGeneratorTest.php b/test/Generator/AbstractMemberGeneratorTest.php index 34640731..d7796c0a 100644 --- a/test/Generator/AbstractMemberGeneratorTest.php +++ b/test/Generator/AbstractMemberGeneratorTest.php @@ -20,7 +20,7 @@ class AbstractMemberGeneratorTest extends TestCase */ private $fixture; - protected function setUp(): void + protected function setUp() : void { $this->fixture = $this->getMockForAbstractClass(AbstractMemberGenerator::class); } diff --git a/test/Generator/DocBlock/Tag/AuthorTagTest.php b/test/Generator/DocBlock/Tag/AuthorTagTest.php index 280d1e5a..e020fe0b 100644 --- a/test/Generator/DocBlock/Tag/AuthorTagTest.php +++ b/test/Generator/DocBlock/Tag/AuthorTagTest.php @@ -30,14 +30,14 @@ class AuthorTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new AuthorTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/GenericTagTest.php b/test/Generator/DocBlock/Tag/GenericTagTest.php index 35e408f3..6b18241c 100644 --- a/test/Generator/DocBlock/Tag/GenericTagTest.php +++ b/test/Generator/DocBlock/Tag/GenericTagTest.php @@ -30,14 +30,14 @@ class GenericTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new GenericTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/LicenseTagTest.php b/test/Generator/DocBlock/Tag/LicenseTagTest.php index b40c4991..fabe90b5 100644 --- a/test/Generator/DocBlock/Tag/LicenseTagTest.php +++ b/test/Generator/DocBlock/Tag/LicenseTagTest.php @@ -30,14 +30,14 @@ class LicenseTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new LicenseTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/MethodTagTest.php b/test/Generator/DocBlock/Tag/MethodTagTest.php index 76af80f4..5d4d5a4a 100644 --- a/test/Generator/DocBlock/Tag/MethodTagTest.php +++ b/test/Generator/DocBlock/Tag/MethodTagTest.php @@ -30,14 +30,14 @@ class MethodTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new MethodTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ParamTagTest.php b/test/Generator/DocBlock/Tag/ParamTagTest.php index e6cb4e90..d4e730bf 100644 --- a/test/Generator/DocBlock/Tag/ParamTagTest.php +++ b/test/Generator/DocBlock/Tag/ParamTagTest.php @@ -30,14 +30,14 @@ class ParamTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new ParamTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/PropertyTagTest.php b/test/Generator/DocBlock/Tag/PropertyTagTest.php index 20f646b2..709159ed 100644 --- a/test/Generator/DocBlock/Tag/PropertyTagTest.php +++ b/test/Generator/DocBlock/Tag/PropertyTagTest.php @@ -30,14 +30,14 @@ class PropertyTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new PropertyTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ReturnTagTest.php b/test/Generator/DocBlock/Tag/ReturnTagTest.php index 92324b08..a03fea9d 100644 --- a/test/Generator/DocBlock/Tag/ReturnTagTest.php +++ b/test/Generator/DocBlock/Tag/ReturnTagTest.php @@ -30,14 +30,14 @@ class ReturnTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new ReturnTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/ThrowsTagTest.php b/test/Generator/DocBlock/Tag/ThrowsTagTest.php index 2018c28d..8674ef2e 100644 --- a/test/Generator/DocBlock/Tag/ThrowsTagTest.php +++ b/test/Generator/DocBlock/Tag/ThrowsTagTest.php @@ -30,14 +30,14 @@ class ThrowsTagTest extends TestCase */ protected $tagmanager; - public function setUp(): void + protected function setUp() : void { $this->tag = new ThrowsTag(); $this->tagmanager = new TagManager(); $this->tagmanager->initializeDefaultTags(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; $this->tagmanager = null; diff --git a/test/Generator/DocBlock/Tag/TypableTagTest.php b/test/Generator/DocBlock/Tag/TypableTagTest.php index 4ad0e24c..5f8f06ed 100644 --- a/test/Generator/DocBlock/Tag/TypableTagTest.php +++ b/test/Generator/DocBlock/Tag/TypableTagTest.php @@ -23,12 +23,12 @@ class TypableTagTest extends TestCase */ protected $tag; - public function setUp(): void + protected function setUp() : void { $this->tag = new TypeableTag(); } - public function tearDown(): void + protected function tearDown() : void { $this->tag = null; } diff --git a/test/Generator/DocBlockGeneratorTest.php b/test/Generator/DocBlockGeneratorTest.php index fd0a56e9..ec15d054 100644 --- a/test/Generator/DocBlockGeneratorTest.php +++ b/test/Generator/DocBlockGeneratorTest.php @@ -34,7 +34,7 @@ class DocBlockGeneratorTest extends TestCase */ protected $reflectionDocBlockGenerator; - protected function setUp(): void + protected function setUp() : void { $this->docBlockGenerator = $this->docBlockGenerator = new DocBlockGenerator(); $reflectionDocBlock = new DocBlockReflection( diff --git a/test/Generator/TraitGeneratorTest.php b/test/Generator/TraitGeneratorTest.php index 2be51480..54be663f 100644 --- a/test/Generator/TraitGeneratorTest.php +++ b/test/Generator/TraitGeneratorTest.php @@ -26,7 +26,7 @@ */ class TraitGeneratorTest extends TestCase { - public function setUp(): void + protected function setUp() : void { } diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index fd28a53e..0b0a4c53 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -424,7 +424,7 @@ public function testPropertyDefaultValueCanHandleComplexArrayWCustomIndentOfType string $type, array $value, string $expected - ): void { + ) : void { $valueGenerator = new ValueGenerator(); $valueGenerator->setType($type); $valueGenerator->setValue($value); diff --git a/test/Generic/Prototype/PrototypeClassFactoryTest.php b/test/Generic/Prototype/PrototypeClassFactoryTest.php index 57713ee1..2abf7543 100644 --- a/test/Generic/Prototype/PrototypeClassFactoryTest.php +++ b/test/Generic/Prototype/PrototypeClassFactoryTest.php @@ -25,12 +25,12 @@ class PrototypeClassFactoryTest extends TestCase */ protected $prototypeFactory; - public function setUp(): void + protected function setUp() : void { $this->prototypeFactory = new PrototypeClassFactory(); } - public function tearDown(): void + protected function tearDown() : void { $this->prototypeFactory = null; } diff --git a/test/Reflection/DocBlock/Tag/AuthorTagTest.php b/test/Reflection/DocBlock/Tag/AuthorTagTest.php index 93a7bcda..35ede89f 100644 --- a/test/Reflection/DocBlock/Tag/AuthorTagTest.php +++ b/test/Reflection/DocBlock/Tag/AuthorTagTest.php @@ -23,7 +23,7 @@ class AuthorTagTest extends TestCase */ protected $tag; - public function setUp(): void + protected function setUp() : void { $this->tag = new AuthorTag(); } diff --git a/test/Reflection/DocBlock/Tag/LicenseTagTest.php b/test/Reflection/DocBlock/Tag/LicenseTagTest.php index dad95d53..2cd93acb 100644 --- a/test/Reflection/DocBlock/Tag/LicenseTagTest.php +++ b/test/Reflection/DocBlock/Tag/LicenseTagTest.php @@ -23,7 +23,7 @@ class LicenseTagTest extends TestCase */ protected $tag; - public function setUp(): void + protected function setUp() : void { $this->tag = new LicenseTag(); } diff --git a/test/Scanner/CachingFileScannerTest.php b/test/Scanner/CachingFileScannerTest.php index 89b732f3..701c6de0 100644 --- a/test/Scanner/CachingFileScannerTest.php +++ b/test/Scanner/CachingFileScannerTest.php @@ -18,7 +18,7 @@ class CachingFileScannerTest extends TestCase { - protected function setUp(): void + protected function setUp() : void { CachingFileScanner::clearCache(); } diff --git a/test/Scanner/ClassScannerTest.php b/test/Scanner/ClassScannerTest.php index d25ef34f..c5cd52ec 100644 --- a/test/Scanner/ClassScannerTest.php +++ b/test/Scanner/ClassScannerTest.php @@ -38,7 +38,7 @@ class ClassScannerTest extends TestCase { protected $manager; - public function setUp(): void + protected function setUp() : void { $this->manager = new Annotation\AnnotationManager(); From 65f6c2fb53edcb7548123a18a92100d8cd854473 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 09:49:26 +0100 Subject: [PATCH 55/80] Better assertions assertIsArray instead of assertInternalType --- test/Generator/PropertyGeneratorTest.php | 2 +- test/Reflection/ClassReflectionTest.php | 4 ++-- test/Scanner/ClassScannerTest.php | 4 ++-- test/Scanner/MethodScannerTest.php | 2 +- test/Scanner/TokenArrayScannerTest.php | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/Generator/PropertyGeneratorTest.php b/test/Generator/PropertyGeneratorTest.php index 685c72e8..8190f07b 100644 --- a/test/Generator/PropertyGeneratorTest.php +++ b/test/Generator/PropertyGeneratorTest.php @@ -262,7 +262,7 @@ public function testPropertyDocBlockWillLoadFromReflection() : void $docBlock = $cgProp->getDocBlock(); self::assertInstanceOf(DocBlockGenerator::class, $docBlock); $tags = $docBlock->getTags(); - self::assertInternalType('array', $tags); + self::assertIsArray($tags); self::assertCount(1, $tags); $tag = array_shift($tags); self::assertInstanceOf(VarTag::class, $tag); diff --git a/test/Reflection/ClassReflectionTest.php b/test/Reflection/ClassReflectionTest.php index 0f084487..7bca0730 100644 --- a/test/Reflection/ClassReflectionTest.php +++ b/test/Reflection/ClassReflectionTest.php @@ -203,13 +203,13 @@ public function testGetTraits() $reflectionClass = new ClassReflection(TestAsset\TestTraitClass4::class); $traitsArray = $reflectionClass->getTraits(); - self::assertInternalType('array', $traitsArray); + self::assertIsArray($traitsArray); self::assertCount(1, $traitsArray); self::assertInstanceOf(ClassReflection::class, $traitsArray[0]); $reflectionClass = new ClassReflection(TestAsset\TestSampleClass::class); $traitsArray = $reflectionClass->getTraits(); - self::assertInternalType('array', $traitsArray); + self::assertIsArray($traitsArray); self::assertCount(0, $traitsArray); } } diff --git a/test/Scanner/ClassScannerTest.php b/test/Scanner/ClassScannerTest.php index c5cd52ec..5d1876e9 100644 --- a/test/Scanner/ClassScannerTest.php +++ b/test/Scanner/ClassScannerTest.php @@ -63,7 +63,7 @@ public function testClassScannerHasClassInformation() self::assertContains('A\B\C\D\Blarg', $interfaces); self::assertContains('ZendTest\Code\TestAsset\Local\SubClass', $interfaces); $methods = $class->getMethodNames(); - self::assertInternalType('array', $methods); + self::assertIsArray($methods); self::assertContains('fooBarBaz', $methods); } @@ -71,7 +71,7 @@ public function testClassScannerHasConstant() { $file = new FileScanner(__DIR__ . '/../TestAsset/FooClass.php'); $class = $file->getClass(FooClass::class); - self::assertInternalType('array', $class->getConstantNames()); + self::assertIsArray($class->getConstantNames()); self::assertContains('FOO', $class->getConstantNames()); } diff --git a/test/Scanner/MethodScannerTest.php b/test/Scanner/MethodScannerTest.php index 07c4ddab..0efba5b0 100644 --- a/test/Scanner/MethodScannerTest.php +++ b/test/Scanner/MethodScannerTest.php @@ -39,7 +39,7 @@ public function testMethodScannerReturnsParameters() $class = $file->getClass(BarClass::class); $method = $class->getMethod('three'); $parameters = $method->getParameters(); - self::assertInternalType('array', $parameters); + self::assertIsArray($parameters); } public function testMethodScannerReturnsParameterScanner() diff --git a/test/Scanner/TokenArrayScannerTest.php b/test/Scanner/TokenArrayScannerTest.php index d92a198d..f013b692 100644 --- a/test/Scanner/TokenArrayScannerTest.php +++ b/test/Scanner/TokenArrayScannerTest.php @@ -28,7 +28,7 @@ public function testScannerReturnsNamespaces() )); self::assertTrue($tokenScanner->hasNamespace('ZendTest\Code\TestAsset')); $namespaces = $tokenScanner->getNamespaces(); - self::assertInternalType('array', $namespaces); + self::assertIsArray($namespaces); self::assertContains('ZendTest\Code\TestAsset', $namespaces); } @@ -38,7 +38,7 @@ public function testScannerReturnsNamespacesInNotNamespacedClasses() file_get_contents(__DIR__ . '/../TestAsset/FooBarClass.php') )); $uses = $tokenScanner->getUses(); - self::assertInternalType('array', $uses); + self::assertIsArray($uses); $foundUses = []; foreach ($uses as $use) { $foundUses[] = $use['use']; @@ -52,7 +52,7 @@ public function testScannerReturnsClassNames() file_get_contents(__DIR__ . '/../TestAsset/FooClass.php') )); $classes = $tokenScanner->getClassNames(); - self::assertInternalType('array', $classes); + self::assertIsArray($classes); self::assertContains(FooClass::class, $classes); } @@ -65,7 +65,7 @@ public function testScannerReturnsClassNamesForTraits() file_get_contents(__DIR__ . '/../TestAsset/FooTrait.php') )); $classes = $tokenScanner->getClassNames(); - self::assertInternalType('array', $classes); + self::assertIsArray($classes); self::assertContains(FooTrait::class, $classes); } @@ -75,7 +75,7 @@ public function testScannerReturnsFunctions() file_get_contents(__DIR__ . '/../TestAsset/functions.php') )); $functions = $tokenScanner->getFunctionNames(); - self::assertInternalType('array', $functions); + self::assertIsArray($functions); self::assertContains('ZendTest\Code\TestAsset\foo_bar', $functions); } @@ -85,7 +85,7 @@ public function testScannerReturnsClassScanner() file_get_contents(__DIR__ . '/../TestAsset/FooClass.php') )); $classes = $tokenScanner->getClasses(); - self::assertInternalType('array', $classes); + self::assertIsArray($classes); foreach ($classes as $class) { self::assertInstanceOf(ClassScanner::class, $class); } From b3bda63e45138ef723127100817daf6abed852f6 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 09:52:49 +0100 Subject: [PATCH 56/80] Mocking improvements --- test/Generic/Prototype/PrototypeClassFactoryTest.php | 2 +- test/Reflection/ClassReflectionTest.php | 5 ++--- test/Reflection/MethodReflectionTest.php | 5 ++--- test/Reflection/PropertyReflectionTest.php | 5 ++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/test/Generic/Prototype/PrototypeClassFactoryTest.php b/test/Generic/Prototype/PrototypeClassFactoryTest.php index 2abf7543..90bc3e15 100644 --- a/test/Generic/Prototype/PrototypeClassFactoryTest.php +++ b/test/Generic/Prototype/PrototypeClassFactoryTest.php @@ -56,7 +56,7 @@ public function testSetNameOnGenericIsCalledOnce() $mockProto = $this->getMockBuilder(PrototypeGenericClass::class) ->setMethods(['setName']) ->getMock(); - $mockProto->expects($this->once())->method('setName')->will($this->returnValue('notexist')); + $mockProto->expects($this->once())->method('setName')->willReturn('notexist'); $this->prototypeFactory->setGenericPrototype($mockProto); $this->prototypeFactory->getClonedPrototype('notexist'); } diff --git a/test/Reflection/ClassReflectionTest.php b/test/Reflection/ClassReflectionTest.php index 7bca0730..5d6030f2 100644 --- a/test/Reflection/ClassReflectionTest.php +++ b/test/Reflection/ClassReflectionTest.php @@ -172,9 +172,8 @@ public function testGetAnnotationsWithNoNameInformations() $reflectionClass->setFileScanner($fileScanner); - $fileScanner->expects($this->any()) - ->method('getClassNameInformation') - ->will($this->returnValue(false)); + $fileScanner->method('getClassNameInformation') + ->willReturn(false); self::assertFalse($reflectionClass->getAnnotations($annotationManager)); } diff --git a/test/Reflection/MethodReflectionTest.php b/test/Reflection/MethodReflectionTest.php index 3b47032a..ddfb7834 100644 --- a/test/Reflection/MethodReflectionTest.php +++ b/test/Reflection/MethodReflectionTest.php @@ -312,9 +312,8 @@ public function testGetAnnotationsWithNoNameInformations() $reflectionMethod->setFileScanner($fileScanner); - $fileScanner->expects($this->any()) - ->method('getClassNameInformation') - ->will($this->returnValue(false)); + $fileScanner->method('getClassNameInformation') + ->willReturn(false); self::assertFalse($reflectionMethod->getAnnotations($annotationManager)); } diff --git a/test/Reflection/PropertyReflectionTest.php b/test/Reflection/PropertyReflectionTest.php index 912b8477..707cf7f2 100644 --- a/test/Reflection/PropertyReflectionTest.php +++ b/test/Reflection/PropertyReflectionTest.php @@ -73,9 +73,8 @@ public function testGetAnnotationsWithNoNameInformations() $reflectionProperty->setFileScanner($fileScanner); - $fileScanner->expects($this->any()) - ->method('getClassNameInformation') - ->will($this->returnValue(false)); + $fileScanner->method('getClassNameInformation') + ->willReturn(false); self::assertFalse($reflectionProperty->getAnnotations($annotationManager)); } From 6dbebd5de09707898210418df64498a59c533818 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 10:14:34 +0100 Subject: [PATCH 57/80] Use non-deprecated assertions --- test/Generator/ClassGeneratorTest.php | 48 +++++++++++------------ test/Generator/FileGeneratorTest.php | 26 ++++++------ test/Generator/InterfaceGeneratorTest.php | 4 +- test/Generator/MethodGeneratorTest.php | 2 +- test/Generator/TraitGeneratorTest.php | 28 ++++++------- test/Reflection/ClassReflectionTest.php | 2 +- test/Reflection/FileReflectionTest.php | 4 +- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/test/Generator/ClassGeneratorTest.php b/test/Generator/ClassGeneratorTest.php index 1363aa58..5fa3b4e3 100644 --- a/test/Generator/ClassGeneratorTest.php +++ b/test/Generator/ClassGeneratorTest.php @@ -295,7 +295,7 @@ public function testClassFromReflectionThatImplementsInterfaces() $expectedClassDef = 'class ClassWithInterface' . ' implements OneInterface' . ', TwoInterface'; - self::assertContains($expectedClassDef, $code); + self::assertStringContainsString($expectedClassDef, $code); } /** @@ -313,7 +313,7 @@ public function testClassFromReflectionDiscardParentImplementedInterfaces() $expectedClassDef = 'class NewClassWithInterface' . ' extends ClassWithInterface' . ' implements ThreeInterface'; - self::assertContains($expectedClassDef, $code); + self::assertStringContainsString($expectedClassDef, $code); } /** @@ -411,7 +411,7 @@ public function testPassingANamespacedClassnameShouldGenerateANamespaceDeclarati $classGeneratorClass = new ClassGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('namespace My\Namespaced;', $received, $received); + self::assertStringContainsString('namespace My\Namespaced;', $received, $received); } /** @@ -422,7 +422,7 @@ public function testPassingANamespacedClassnameShouldGenerateAClassnameWithoutIt $classGeneratorClass = new ClassGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('class FunClass', $received, $received); + self::assertStringContainsString('class FunClass', $received, $received); } public function testHasUse() @@ -478,8 +478,8 @@ public function testAddUses() $classGenerator->addUse('My\Second\Use\Class', 'MyAlias'); $generated = $classGenerator->generate(); - self::assertContains('use My\First\Use\Class;', $generated); - self::assertContains('use My\Second\Use\Class as MyAlias;', $generated); + self::assertStringContainsString('use My\First\Use\Class;', $generated); + self::assertStringContainsString('use My\Second\Use\Class as MyAlias;', $generated); } /** @@ -495,7 +495,7 @@ public function testAddOneUseTwiceOnlyAddsOne() self::assertCount(1, $classGenerator->getUses()); - self::assertContains('use My\First\Use\Class;', $generated); + self::assertStringContainsString('use My\First\Use\Class;', $generated); } /** @@ -511,7 +511,7 @@ public function testAddOneUseWithAliasTwiceOnlyAddsOne() self::assertCount(1, $classGenerator->getUses()); - self::assertContains('use My\First\Use\Class as MyAlias;', $generated); + self::assertStringContainsString('use My\First\Use\Class as MyAlias;', $generated); } public function testCreateFromArrayWithDocBlockFromArray() @@ -543,12 +543,12 @@ public function testExtendedClassProperies() $reflClass = new ClassReflection(TestAsset\ExtendedClassWithProperties::class); $classGenerator = ClassGenerator::fromReflection($reflClass); $code = $classGenerator->generate(); - self::assertContains('publicExtendedClassProperty', $code); - self::assertContains('protectedExtendedClassProperty', $code); - self::assertContains('privateExtendedClassProperty', $code); - self::assertNotContains('publicClassProperty', $code); - self::assertNotContains('protectedClassProperty', $code); - self::assertNotContains('privateClassProperty', $code); + self::assertStringContainsString('publicExtendedClassProperty', $code); + self::assertStringContainsString('protectedExtendedClassProperty', $code); + self::assertStringContainsString('privateExtendedClassProperty', $code); + self::assertStringNotContainsString('publicClassProperty', $code); + self::assertStringNotContainsString('protectedClassProperty', $code); + self::assertStringNotContainsString('privateClassProperty', $code); } public function testHasMethodInsensitive() @@ -1185,7 +1185,7 @@ public function testCorrectExtendNames() $classGenerator->setNamespaceName('SomeNamespace'); $classGenerator->addUse(NameInformation::class); $classGenerator->setExtendedClass(NameInformation::class); - self::assertContains('class ClassName extends NameInformation', $classGenerator->generate()); + self::assertStringContainsString('class ClassName extends NameInformation', $classGenerator->generate()); } /** @@ -1197,7 +1197,7 @@ public function testCorrectlyExtendsFullyQualifiedParentClass() $classGenerator->setName('ClassName'); $classGenerator->setNamespaceName('SomeNamespace'); $classGenerator->setExtendedClass('DateTime'); - self::assertContains('class ClassName extends \DateTime', $classGenerator->generate()); + self::assertStringContainsString('class ClassName extends \DateTime', $classGenerator->generate()); } /** @@ -1208,7 +1208,7 @@ public function testCorrectlyExtendsRelativeParentClass() $classGenerator = new ClassGenerator(); $classGenerator->setName('ClassName'); $classGenerator->setExtendedClass('DateTime'); - self::assertContains('class ClassName extends DateTime', $classGenerator->generate()); + self::assertStringContainsString('class ClassName extends DateTime', $classGenerator->generate()); } /** @@ -1220,12 +1220,12 @@ public function testCorrectExtendNamesFromGlobalNamespace() $classGenerator->setName('ClassName'); $classGenerator->setNamespaceName('SomeNamespace'); $classGenerator->setExtendedClass(DateTime::class); - self::assertContains('class ClassName extends \DateTime', $classGenerator->generate()); + self::assertStringContainsString('class ClassName extends \DateTime', $classGenerator->generate()); $classGenerator = new ClassGenerator(); $classGenerator->setName('ClassName'); $classGenerator->setExtendedClass(DateTime::class); - self::assertContains('class ClassName extends DateTime', $classGenerator->generate()); + self::assertStringContainsString('class ClassName extends DateTime', $classGenerator->generate()); } public function testCorrectlyExtendsProvidedAliasIfUseAliasExists() @@ -1236,7 +1236,7 @@ public function testCorrectlyExtendsProvidedAliasIfUseAliasExists() $classGenerator->addUse('Foo\\Bar', 'BarAlias'); $classGenerator->setExtendedClass('BarAlias'); $generated = $classGenerator->generate(); - self::assertContains('class ClassName extends BarAlias', $generated); + self::assertStringContainsString('class ClassName extends BarAlias', $generated); } public function testCorrectlyExtendsProvidedNamespaceAliasIfUseAliasExistsForNamespace() @@ -1247,7 +1247,7 @@ public function testCorrectlyExtendsProvidedNamespaceAliasIfUseAliasExistsForNam $classGenerator->addUse('Foo\\Bar', 'BarAlias'); $classGenerator->setExtendedClass('BarAlias\\FooBar'); $generated = $classGenerator->generate(); - self::assertContains('class ClassName extends BarAlias\\FooBar', $generated); + self::assertStringContainsString('class ClassName extends BarAlias\\FooBar', $generated); } public function testCorrectlyExtendsAliasOfProvidedFQCNIfUseAliasExists() @@ -1258,7 +1258,7 @@ public function testCorrectlyExtendsAliasOfProvidedFQCNIfUseAliasExists() $classGenerator->addUse('Foo\\Bar', 'BarAlias'); $classGenerator->setExtendedClass('Foo\\Bar'); $generated = $classGenerator->generate(); - self::assertContains('class ClassName extends BarAlias', $generated); + self::assertStringContainsString('class ClassName extends BarAlias', $generated); } public function testCorrectlyExtendsWithNamespaceAliasOfProvidedFQCNIfUseAliasExistsForNamespace() @@ -1269,7 +1269,7 @@ public function testCorrectlyExtendsWithNamespaceAliasOfProvidedFQCNIfUseAliasEx $classGenerator->addUse('Foo\\Bar', 'BarAlias'); $classGenerator->setExtendedClass('Foo\\Bar\\FooBar'); $generated = $classGenerator->generate(); - self::assertContains('class ClassName extends BarAlias\\FooBar', $generated); + self::assertStringContainsString('class ClassName extends BarAlias\\FooBar', $generated); } public function testCorrectImplementNames() @@ -1285,6 +1285,6 @@ public function testCorrectImplementNames() ]); $expected = 'class ClassName implements ClassInterface, GeneratorInterface, \Iteratable'; - self::assertContains($expected, $classGenerator->generate()); + self::assertStringContainsString($expected, $classGenerator->generate()); } } diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index cce6530b..61904648 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -198,8 +198,8 @@ public function testGeneratesUseStatements() ['use' => 'Your\Bar', 'as' => 'bar'], ]); $generated = $file->generate(); - self::assertContains('use My\\Baz;', $generated); - self::assertContains('use Your\\Bar as bar;', $generated); + self::assertStringContainsString('use My\\Baz;', $generated); + self::assertStringContainsString('use Your\\Bar as bar;', $generated); } public function testGeneratesNamespaceStatements() @@ -207,7 +207,7 @@ public function testGeneratesNamespaceStatements() $file = new FileGenerator(); $file->setNamespace('Foo\Bar'); $generated = $file->generate(); - self::assertContains('namespace Foo\\Bar', $generated, $generated); + self::assertStringContainsString('namespace Foo\\Bar', $generated, $generated); } public function testSetUseDoesntGenerateMultipleIdenticalUseStatements() @@ -238,8 +238,8 @@ public function testSetUseAllowsMultipleAliasedUseStatements() ['use' => 'Your\Bar', 'as' => 'bar2'], ]); $generated = $file->generate(); - self::assertContains('use Your\\Bar as bar;', $generated); - self::assertContains('use Your\\Bar as bar2;', $generated); + self::assertStringContainsString('use Your\\Bar as bar;', $generated); + self::assertStringContainsString('use Your\\Bar as bar2;', $generated); } public function testSetUsesWithArrays() @@ -250,8 +250,8 @@ public function testSetUsesWithArrays() ['use' => 'My\\Baz', 'as' => 'FooBaz'], ]); $generated = $file->generate(); - self::assertContains('use My\\Baz as FooBaz;', $generated); - self::assertContains('use Your\\Bar as bar;', $generated); + self::assertStringContainsString('use My\\Baz as FooBaz;', $generated); + self::assertStringContainsString('use Your\\Bar as bar;', $generated); } public function testSetUsesWithString() @@ -263,9 +263,9 @@ public function testSetUsesWithString() ['use' => 'Another\\Baz', 'as' => 'Baz2'], ]); $generated = $file->generate(); - self::assertContains('use My\\Baz;', $generated); - self::assertContains('use Your\\Bar;', $generated); - self::assertContains('use Another\\Baz as Baz2;', $generated); + self::assertStringContainsString('use My\\Baz;', $generated); + self::assertStringContainsString('use Your\\Bar;', $generated); + self::assertStringContainsString('use Another\\Baz as Baz2;', $generated); } public function testSetUsesWithGetUses() @@ -279,9 +279,9 @@ public function testSetUsesWithGetUses() $file->setUses($uses); $file->setUses($file->getUses()); $generated = $file->generate(); - self::assertContains('use My\\Baz;', $generated); - self::assertContains('use Your\\Bar;', $generated); - self::assertContains('use Another\\Baz as Baz2;', $generated); + self::assertStringContainsString('use My\\Baz;', $generated); + self::assertStringContainsString('use Your\\Bar;', $generated); + self::assertStringContainsString('use Another\\Baz as Baz2;', $generated); } public function testCreateFromArrayWithClassInstance() diff --git a/test/Generator/InterfaceGeneratorTest.php b/test/Generator/InterfaceGeneratorTest.php index 15c57fb9..8294291f 100644 --- a/test/Generator/InterfaceGeneratorTest.php +++ b/test/Generator/InterfaceGeneratorTest.php @@ -183,7 +183,7 @@ public function testPassingANamespacedClassnameShouldGenerateANamespaceDeclarati $classGeneratorClass = new InterfaceGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('namespace My\Namespaced;', $received, $received); + self::assertStringContainsString('namespace My\Namespaced;', $received, $received); } /** @@ -194,7 +194,7 @@ public function testPassingANamespacedClassnameShouldGenerateAClassnameWithoutIt $classGeneratorClass = new InterfaceGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('interface FunClass', $received, $received); + self::assertStringContainsString('interface FunClass', $received, $received); } public function testCreateFromArrayWithDocBlockFromArray() diff --git a/test/Generator/MethodGeneratorTest.php b/test/Generator/MethodGeneratorTest.php index 0411a49f..2c5d16f6 100644 --- a/test/Generator/MethodGeneratorTest.php +++ b/test/Generator/MethodGeneratorTest.php @@ -247,7 +247,7 @@ public function testDefaultValueGenerationDoesNotIncludeTrailingSemicolon() $method->setParameter($param); $generated = $method->generate(); - self::assertContains('array $options = [])', $generated); + self::assertStringContainsString('array $options = [])', $generated); } public function testCreateFromArray() diff --git a/test/Generator/TraitGeneratorTest.php b/test/Generator/TraitGeneratorTest.php index 54be663f..c73c7a38 100644 --- a/test/Generator/TraitGeneratorTest.php +++ b/test/Generator/TraitGeneratorTest.php @@ -236,7 +236,7 @@ public function testClassFromReflectionThatImplementsInterfaces() $code = $classGenerator->generate(); $expectedClassDef = 'trait ClassWithInterface'; - self::assertContains($expectedClassDef, $code); + self::assertStringContainsString($expectedClassDef, $code); } /** @@ -252,7 +252,7 @@ public function testClassFromReflectionDiscardParentImplementedInterfaces() $code = $classGenerator->generate(); $expectedClassDef = 'trait NewClassWithInterface'; - self::assertContains($expectedClassDef, $code); + self::assertStringContainsString($expectedClassDef, $code); } /** @@ -350,7 +350,7 @@ public function testPassingANamespacedClassnameShouldGenerateANamespaceDeclarati $classGeneratorClass = new TraitGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('namespace My\Namespaced;', $received, $received); + self::assertStringContainsString('namespace My\Namespaced;', $received, $received); } /** @@ -361,7 +361,7 @@ public function testPassingANamespacedClassnameShouldGenerateAClassnameWithoutIt $classGeneratorClass = new TraitGenerator(); $classGeneratorClass->setName('My\Namespaced\FunClass'); $received = $classGeneratorClass->generate(); - self::assertContains('trait FunClass', $received, $received); + self::assertStringContainsString('trait FunClass', $received, $received); } /** @@ -375,8 +375,8 @@ public function testAddUses() $classGenerator->addUse('My\Second\Use\Class', 'MyAlias'); $generated = $classGenerator->generate(); - self::assertContains('use My\First\Use\Class;', $generated); - self::assertContains('use My\Second\Use\Class as MyAlias;', $generated); + self::assertStringContainsString('use My\First\Use\Class;', $generated); + self::assertStringContainsString('use My\Second\Use\Class as MyAlias;', $generated); } /** @@ -392,7 +392,7 @@ public function testAddOneUseTwiceOnlyAddsOne() self::assertCount(1, $classGenerator->getUses()); - self::assertContains('use My\First\Use\Class;', $generated); + self::assertStringContainsString('use My\First\Use\Class;', $generated); } /** @@ -408,7 +408,7 @@ public function testAddOneUseWithAliasTwiceOnlyAddsOne() self::assertCount(1, $classGenerator->getUses()); - self::assertContains('use My\First\Use\Class as MyAlias;', $generated); + self::assertStringContainsString('use My\First\Use\Class as MyAlias;', $generated); } public function testCreateFromArrayWithDocBlockFromArray() @@ -440,12 +440,12 @@ public function testExtendedClassProperies() $reflClass = new ClassReflection(TestAsset\ExtendedClassWithProperties::class); $classGenerator = TraitGenerator::fromReflection($reflClass); $code = $classGenerator->generate(); - self::assertContains('publicExtendedClassProperty', $code); - self::assertContains('protectedExtendedClassProperty', $code); - self::assertContains('privateExtendedClassProperty', $code); - self::assertNotContains('publicClassProperty', $code); - self::assertNotContains('protectedClassProperty', $code); - self::assertNotContains('privateClassProperty', $code); + self::assertStringContainsString('publicExtendedClassProperty', $code); + self::assertStringContainsString('protectedExtendedClassProperty', $code); + self::assertStringContainsString('privateExtendedClassProperty', $code); + self::assertStringNotContainsString('publicClassProperty', $code); + self::assertStringNotContainsString('protectedClassProperty', $code); + self::assertStringNotContainsString('privateClassProperty', $code); } public function testHasMethodInsensitive() diff --git a/test/Reflection/ClassReflectionTest.php b/test/Reflection/ClassReflectionTest.php index 5d6030f2..1964953b 100644 --- a/test/Reflection/ClassReflectionTest.php +++ b/test/Reflection/ClassReflectionTest.php @@ -153,7 +153,7 @@ public function testStartLine() public function testGetDeclaringFileReturnsFilename() { $reflectionClass = new ClassReflection(TestAsset\TestSampleClass2::class); - self::assertContains('TestSampleClass2.php', $reflectionClass->getDeclaringFile()->getFileName()); + self::assertStringContainsString('TestSampleClass2.php', $reflectionClass->getDeclaringFile()->getFileName()); } public function testGetAnnotationsWithNoNameInformations() diff --git a/test/Reflection/FileReflectionTest.php b/test/Reflection/FileReflectionTest.php index 66907f1e..87ad4af5 100644 --- a/test/Reflection/FileReflectionTest.php +++ b/test/Reflection/FileReflectionTest.php @@ -194,7 +194,7 @@ public function testFileReflectionShouldNotRaiseNoticesWhenReflectingClosures() { require_once __DIR__ . '/TestAsset/issue-70.php'; $r = new FileReflection(__DIR__ . '/TestAsset/issue-70.php'); - self::assertContains('spl_autoload_register', $r->getContents()); - self::assertContains('function ()', $r->getContents()); + self::assertStringContainsString('spl_autoload_register', $r->getContents()); + self::assertStringContainsString('function ()', $r->getContents()); } } From 9c1ee6f2ffa3a7f1772b311a5d533d9e90e25b16 Mon Sep 17 00:00:00 2001 From: webimpress Date: Wed, 19 Jun 2019 12:25:01 +0100 Subject: [PATCH 58/80] Feature: constant visibility As we support already only PHP 7.1+ we can define visibility for constants. --- src/Generator/PropertyGenerator.php | 3 +-- test/Generator/ClassGeneratorTest.php | 2 +- test/Generator/InterfaceGeneratorTest.php | 4 ++-- test/Generator/PropertyGeneratorTest.php | 21 ++++++++++++++++-- test/Generator/ValueGeneratorTest.php | 27 +++++++++++++---------- test/TestAsset/BarClass.php | 4 ++-- test/TestAsset/FooClass.php | 4 ++-- test/TestAsset/FooInterface.php | 4 ++-- 8 files changed, 44 insertions(+), 25 deletions(-) diff --git a/src/Generator/PropertyGenerator.php b/src/Generator/PropertyGenerator.php index 6259efc0..75eada2b 100644 --- a/src/Generator/PropertyGenerator.php +++ b/src/Generator/PropertyGenerator.php @@ -157,7 +157,6 @@ public function __construct($name = null, $defaultValue = null, $flags = self::F public function setConst($const) { if ($const) { - $this->removeFlag(self::FLAG_PUBLIC | self::FLAG_PRIVATE | self::FLAG_PROTECTED); $this->setFlags(self::FLAG_CONSTANT); } else { $this->removeFlag(self::FLAG_CONSTANT); @@ -227,7 +226,7 @@ public function generate() $this->name )); } - $output .= $this->indentation . 'const ' . $name . ' = ' + $output .= $this->indentation . $this->getVisibility() . ' const ' . $name . ' = ' . ($defaultValue !== null ? $defaultValue->generate() : 'null;'); return $output; diff --git a/test/Generator/ClassGeneratorTest.php b/test/Generator/ClassGeneratorTest.php index 5fa3b4e3..ea0ff6c6 100644 --- a/test/Generator/ClassGeneratorTest.php +++ b/test/Generator/ClassGeneratorTest.php @@ -802,7 +802,7 @@ public function testClassCanBeGeneratedWithConstantAndPropertyWithSameName() class TestSampleSingleClass { - const fooProperty = 'duplicate'; + public const fooProperty = 'duplicate'; public $fooProperty = true; diff --git a/test/Generator/InterfaceGeneratorTest.php b/test/Generator/InterfaceGeneratorTest.php index 8294291f..0b9c3eea 100644 --- a/test/Generator/InterfaceGeneratorTest.php +++ b/test/Generator/InterfaceGeneratorTest.php @@ -152,9 +152,9 @@ public function testCodeGenerationShouldTakeIntoAccountNamespacesFromReflection( interface FooInterface { - const BAR = 5; + public const BAR = 5; - const FOO = 5; + public const FOO = 5; public function fooBarBaz(); diff --git a/test/Generator/PropertyGeneratorTest.php b/test/Generator/PropertyGeneratorTest.php index 8190f07b..2a9d9785 100644 --- a/test/Generator/PropertyGeneratorTest.php +++ b/test/Generator/PropertyGeneratorTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Code\Generator; +use Generator; use PHPUnit\Framework\TestCase; use Zend\Code\Generator\DocBlock\Tag\VarTag; use Zend\Code\Generator\DocBlockGenerator; @@ -126,10 +127,26 @@ public function testPropertyMultilineValue() : void self::assertEquals($expectedSource, $targetSource); } + public function visibility() : Generator + { + yield 'public' => [PropertyGenerator::FLAG_PUBLIC, 'public']; + yield 'protected' => [PropertyGenerator::FLAG_PROTECTED, 'protected']; + yield 'private' => [PropertyGenerator::FLAG_PRIVATE, 'private']; + } + + /** + * @dataProvider visibility + */ + public function testPropertyCanProduceConstatWithVisibility(int $flag, string $visibility) : void + { + $codeGenProperty = new PropertyGenerator('FOO', 'bar', [PropertyGenerator::FLAG_CONSTANT, $flag]); + self::assertSame(' ' . $visibility . ' const FOO = \'bar\';', $codeGenProperty->generate()); + } + public function testPropertyCanProduceContstantModifier() : void { $codeGenProperty = new PropertyGenerator('someVal', 'some string value', PropertyGenerator::FLAG_CONSTANT); - self::assertEquals(' const someVal = \'some string value\';', $codeGenProperty->generate()); + self::assertEquals(' public const someVal = \'some string value\';', $codeGenProperty->generate()); } /** @@ -139,7 +156,7 @@ public function testPropertyCanProduceContstantModifierWithSetter() : void { $codeGenProperty = new PropertyGenerator('someVal', 'some string value'); $codeGenProperty->setConst(true); - self::assertEquals(' const someVal = \'some string value\';', $codeGenProperty->generate()); + self::assertEquals(' public const someVal = \'some string value\';', $codeGenProperty->generate()); } public function testPropertyCanProduceStaticModifier() : void diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 0b0a4c53..13551b1f 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -92,7 +92,7 @@ public function validConstantTypes() return [ [ new PropertyValueGenerator([], PropertyValueGenerator::TYPE_ARRAY, ValueGenerator::OUTPUT_SINGLE_LINE), - ' const FOO = [];', + ' public const FOO = [];', ], [ new PropertyValueGenerator( @@ -100,7 +100,7 @@ public function validConstantTypes() PropertyValueGenerator::TYPE_ARRAY_LONG, ValueGenerator::OUTPUT_SINGLE_LINE ), - ' const FOO = array();', + ' public const FOO = array();', ], [ new PropertyValueGenerator( @@ -108,17 +108,20 @@ public function validConstantTypes() PropertyValueGenerator::TYPE_ARRAY_SHORT, ValueGenerator::OUTPUT_SINGLE_LINE ), - ' const FOO = [];', + ' public const FOO = [];', + ], + [new PropertyValueGenerator(true, PropertyValueGenerator::TYPE_BOOL), ' public const FOO = true;'], + [new PropertyValueGenerator(true, PropertyValueGenerator::TYPE_BOOLEAN), ' public const FOO = true;'], + [new PropertyValueGenerator(1, PropertyValueGenerator::TYPE_INT), ' public const FOO = 1;'], + [new PropertyValueGenerator(1, PropertyValueGenerator::TYPE_INTEGER), ' public const FOO = 1;'], + [new PropertyValueGenerator(0.1, PropertyValueGenerator::TYPE_DOUBLE), ' public const FOO = 0.1;'], + [new PropertyValueGenerator(0.1, PropertyValueGenerator::TYPE_FLOAT), ' public const FOO = 0.1;'], + [new PropertyValueGenerator('bar', PropertyValueGenerator::TYPE_STRING), " public const FOO = 'bar';"], + [new PropertyValueGenerator(null, PropertyValueGenerator::TYPE_NULL), ' public const FOO = null;'], + [ + new PropertyValueGenerator('PHP_EOL', PropertyValueGenerator::TYPE_CONSTANT), + ' public const FOO = PHP_EOL;', ], - [new PropertyValueGenerator(true, PropertyValueGenerator::TYPE_BOOL), ' const FOO = true;'], - [new PropertyValueGenerator(true, PropertyValueGenerator::TYPE_BOOLEAN), ' const FOO = true;'], - [new PropertyValueGenerator(1, PropertyValueGenerator::TYPE_INT), ' const FOO = 1;'], - [new PropertyValueGenerator(1, PropertyValueGenerator::TYPE_INTEGER), ' const FOO = 1;'], - [new PropertyValueGenerator(0.1, PropertyValueGenerator::TYPE_DOUBLE), ' const FOO = 0.1;'], - [new PropertyValueGenerator(0.1, PropertyValueGenerator::TYPE_FLOAT), ' const FOO = 0.1;'], - [new PropertyValueGenerator('bar', PropertyValueGenerator::TYPE_STRING), " const FOO = 'bar';"], - [new PropertyValueGenerator(null, PropertyValueGenerator::TYPE_NULL), ' const FOO = null;'], - [new PropertyValueGenerator('PHP_EOL', PropertyValueGenerator::TYPE_CONSTANT), ' const FOO = PHP_EOL;'], ]; } diff --git a/test/TestAsset/BarClass.php b/test/TestAsset/BarClass.php index c56d8deb..92a17693 100644 --- a/test/TestAsset/BarClass.php +++ b/test/TestAsset/BarClass.php @@ -9,8 +9,8 @@ abstract class BarClass { - const BAR = 5; - const FOO = self::BAR; + public const BAR = 5; + public const FOO = self::BAR; protected static $bar = 'value'; diff --git a/test/TestAsset/FooClass.php b/test/TestAsset/FooClass.php index ae9ef826..723f5700 100644 --- a/test/TestAsset/FooClass.php +++ b/test/TestAsset/FooClass.php @@ -10,8 +10,8 @@ abstract class FooClass implements \ArrayAccess, E\Blarg, Local\SubClass { - const BAR = 5; - const FOO = self::BAR; + public const BAR = 5; + public const FOO = self::BAR; /** * Constant comment diff --git a/test/TestAsset/FooInterface.php b/test/TestAsset/FooInterface.php index 10f081b9..c9e52c31 100644 --- a/test/TestAsset/FooInterface.php +++ b/test/TestAsset/FooInterface.php @@ -11,8 +11,8 @@ interface FooInterface extends \ArrayAccess { - const BAR = 5; - const FOO = self::BAR; + public const BAR = 5; + public const FOO = self::BAR; public function fooBarBaz(); From e59d7b337d5eabd1bfcec86462e5ccde04a4ac46 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:26:11 +0100 Subject: [PATCH 59/80] Adds CHANGELOG entry for #170 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6693e2d6..d3572176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.4.0 - TBD + +### Added + +- [#170](https://github.com/zendframework/zend-code/pull/170) adds class constant visibility modifiers support. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.3.2 - 2019-08-31 ### Added From 2e3f3bf4215a8d43db99080ae0c1704a59c61d20 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:31:55 +0100 Subject: [PATCH 60/80] Adds CHANGELOG entry for #166 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3572176..c547871b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse ### Changed -- Nothing. +- [#166](https://github.com/zendframework/zend-code/pull/166) changes omitting default property value if it is null. ### Deprecated From ce1af338c3cabe72c27b8d23451e2834dbcd27ce Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:35:52 +0100 Subject: [PATCH 61/80] Adds CHANGELOG entry for #167 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c547871b..d0b6ab9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file, in reverse - [#170](https://github.com/zendframework/zend-code/pull/170) adds class constant visibility modifiers support. +- [#167](https://github.com/zendframework/zend-code/pull/167) adds the ability to remove doc block of a member. + ### Changed - [#166](https://github.com/zendframework/zend-code/pull/166) changes omitting default property value if it is null. From 3743c263c8f57bacb4494441f133b330c050579b Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:38:45 +0100 Subject: [PATCH 62/80] Adds CHANGELOG entry for #169 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b6ab9b..cf69a8b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file, in reverse - [#170](https://github.com/zendframework/zend-code/pull/170) adds class constant visibility modifiers support. +- [#169](https://github.com/zendframework/zend-code/pull/169) adds the ability to define declare statements. + - [#167](https://github.com/zendframework/zend-code/pull/167) adds the ability to remove doc block of a member. ### Changed From 266332358b2a84fac63ad38f9d9e41a7da2c06b1 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:55:29 +0100 Subject: [PATCH 63/80] Use empty string as default value, if variable is null If ensuers us that there will be no error when we introduce strict_types --- src/Scanner/ClassScanner.php | 2 +- src/Scanner/MethodScanner.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scanner/ClassScanner.php b/src/Scanner/ClassScanner.php index ba734e30..91e6e7c1 100644 --- a/src/Scanner/ClassScanner.php +++ b/src/Scanner/ClassScanner.php @@ -913,7 +913,7 @@ protected function scan() $tokenType = null; $tokenContent = $token; $tokenLine = $tokenLine + substr_count( - $lastTokenArray[1], + $lastTokenArray[1] ?? '', "\n" ); // adjust token line by last known newline count } else { diff --git a/src/Scanner/MethodScanner.php b/src/Scanner/MethodScanner.php index 4eaa01c4..6725e70c 100644 --- a/src/Scanner/MethodScanner.php +++ b/src/Scanner/MethodScanner.php @@ -452,7 +452,7 @@ protected function scan() $tokenType = null; $tokenContent = $token; $tokenLine = $tokenLine + substr_count( - $lastTokenArray[1] ?? null, + $lastTokenArray[1] ?? '', "\n" ); // adjust token line by last known newline count } else { From 4b56f5daa294cce68272b65ffac962abf7831f69 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:56:08 +0100 Subject: [PATCH 64/80] Formatting improvements --- src/Scanner/ClassScanner.php | 4 ++-- src/Scanner/MethodScanner.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Scanner/ClassScanner.php b/src/Scanner/ClassScanner.php index 91e6e7c1..af4da112 100644 --- a/src/Scanner/ClassScanner.php +++ b/src/Scanner/ClassScanner.php @@ -912,13 +912,13 @@ protected function scan() if (is_string($token)) { $tokenType = null; $tokenContent = $token; - $tokenLine = $tokenLine + substr_count( + $tokenLine += substr_count( $lastTokenArray[1] ?? '', "\n" ); // adjust token line by last known newline count } else { $lastTokenArray = $token; - list($tokenType, $tokenContent, $tokenLine) = $token; + [$tokenType, $tokenContent, $tokenLine] = $token; } return $tokenIndex; diff --git a/src/Scanner/MethodScanner.php b/src/Scanner/MethodScanner.php index 6725e70c..e0796666 100644 --- a/src/Scanner/MethodScanner.php +++ b/src/Scanner/MethodScanner.php @@ -451,12 +451,13 @@ protected function scan() if (is_string($token)) { $tokenType = null; $tokenContent = $token; - $tokenLine = $tokenLine + substr_count( + $tokenLine += substr_count( $lastTokenArray[1] ?? '', "\n" ); // adjust token line by last known newline count } else { - list($tokenType, $tokenContent, $tokenLine) = $token; + $lastTokenArray = $token; + [$tokenType, $tokenContent, $tokenLine] = $token; } return $tokenIndex; From bdcaaa685c3bf9e90f1905c4fdb5b1e6d36b098d Mon Sep 17 00:00:00 2001 From: webimpress Date: Sat, 5 Oct 2019 23:57:00 +0100 Subject: [PATCH 65/80] Adds CHANGELOG entry for #172 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf69a8b1..5b89a148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#172](https://github.com/zendframework/zend-code/pull/172) fixes PHP 7.4 compatibility. ## 3.3.2 - 2019-08-31 From 1818fdb252facdd336e95e83869b888ab7508145 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sun, 6 Oct 2019 00:14:15 +0100 Subject: [PATCH 66/80] release: 3.4.0 readiness - set release date in CHANGELOG.md - update branch-aliases in composer.json - dev-master => 3.4.x-dev - dev-develop => 3.5.x-dev --- CHANGELOG.md | 2 +- composer.json | 4 ++-- composer.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b89a148..9f6b4401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.4.0 - TBD +## 3.4.0 - 2019-10-06 ### Added diff --git a/composer.json b/composer.json index ae5dbcd3..cb500dd7 100644 --- a/composer.json +++ b/composer.json @@ -45,8 +45,8 @@ }, "extra": { "branch-alias": { - "dev-master": "3.3.x-dev", - "dev-develop": "3.4.x-dev" + "dev-master": "3.4.x-dev", + "dev-develop": "3.5.x-dev" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 2b47f658..f8704b47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1c58445b752bbe7c59a9e3c0a6966031", + "content-hash": "f2c03c65d6f54baad76ea3e07d1ba234", "packages": [ { "name": "zendframework/zend-eventmanager", From a277be91693d7f0ef660212839fb5317b1e94314 Mon Sep 17 00:00:00 2001 From: webimpress Date: Sun, 6 Oct 2019 00:27:24 +0100 Subject: [PATCH 67/80] Bumped to next dev version (3.4.1) --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f6b4401..7118d56e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.4.1 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.4.0 - 2019-10-06 ### Added From 6a666cb8755d4033039edf39587c7da5537ea074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 09:31:56 +0000 Subject: [PATCH 68/80] Fix exception message in ValueGenerator for invalid values When resource provided we should throw exception that this type cannot be used, but we tried to get_class on resource, what is invalid. --- src/Generator/ValueGenerator.php | 7 ++++--- test/Generator/ValueGeneratorTest.php | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/Generator/ValueGenerator.php b/src/Generator/ValueGenerator.php index d0c6b69f..41243461 100644 --- a/src/Generator/ValueGenerator.php +++ b/src/Generator/ValueGenerator.php @@ -437,9 +437,10 @@ public function generate() break; case self::TYPE_OTHER: default: - throw new Exception\RuntimeException( - sprintf('Type "%s" is unknown or cannot be used as property default value.', get_class($value)) - ); + throw new Exception\RuntimeException(sprintf( + 'Type "%s" is unknown or cannot be used as property default value.', + is_object($value) ? get_class($value) : gettype($value) + )); } return $output; diff --git a/test/Generator/ValueGeneratorTest.php b/test/Generator/ValueGeneratorTest.php index 13551b1f..c33d521d 100644 --- a/test/Generator/ValueGeneratorTest.php +++ b/test/Generator/ValueGeneratorTest.php @@ -11,8 +11,11 @@ use ArrayAccess; use ArrayObject as SplArrayObject; +use DateTime; +use Generator; use PHPUnit\Framework\TestCase; use Zend\Code\Exception\InvalidArgumentException; +use Zend\Code\Exception\RuntimeException; use Zend\Code\Generator\PropertyGenerator; use Zend\Code\Generator\PropertyValueGenerator; use Zend\Code\Generator\ValueGenerator; @@ -462,4 +465,24 @@ public function getEscapedParameters() ["\\'", "\\\\\\'"], ]; } + + public function invalidValue() : Generator + { + yield 'object' => [new DateTime(), DateTime::class]; + yield 'resource' => [fopen('php://input', 'r'), 'resource']; + } + + /** + * @dataProvider invalidValue + * + * @param mixed $value + */ + public function testExceptionInvalidValue($value, string $type) : void + { + $valueGenerator = new ValueGenerator($value); + + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Type "'.$type.'" is unknown or cannot be used'); + $valueGenerator->generate(); + } } From cb866009892f86cabd70816a79cb31c03386c7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 18:20:20 +0000 Subject: [PATCH 69/80] Add missing function import: is_object --- src/Generator/ValueGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Generator/ValueGenerator.php b/src/Generator/ValueGenerator.php index 41243461..28d1fa42 100644 --- a/src/Generator/ValueGenerator.php +++ b/src/Generator/ValueGenerator.php @@ -25,6 +25,7 @@ use function in_array; use function is_array; use function is_int; +use function is_object; use function max; use function sprintf; use function str_repeat; From 8db5b4e812186295185aa89ced9aa719b4d5848c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 18:20:29 +0000 Subject: [PATCH 70/80] Adds CHANGELOG entry for #179 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7118d56e..4dd21347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#179](https://github.com/zendframework/zend-code/pull/179) fixes exception message when invalid value provided in `Zend\Code\Generator\ValueGenerator`. ## 3.4.0 - 2019-10-06 From cf397adf1b62d094e14141ce80629ddeffe05e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 18:31:52 +0000 Subject: [PATCH 71/80] Adds PHP 7.4 builds, updted Travis CI configuration Set conflict with prophecy version prior to 1.9.0 as it is not compatible with PHP 7.4. --- .travis.yml | 12 ++- composer.json | 3 + composer.lock | 266 +++++++++++++++++++++++++++++--------------------- 3 files changed, 170 insertions(+), 111 deletions(-) diff --git a/.travis.yml b/.travis.yml index dca06ea5..4517a822 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -sudo: false - language: php cache: @@ -13,6 +11,7 @@ env: - TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT=true matrix: + fast_finish: true include: - php: 7.1 env: @@ -44,6 +43,15 @@ matrix: - php: 7.3 env: - DEPS=latest + - php: 7.4 + env: + - DEPS=lowest + - php: 7.4 + env: + - DEPS=locked + - php: 7.4 + env: + - DEPS=latest before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi diff --git a/composer.json b/composer.json index cb500dd7..6c4946e1 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,9 @@ "zendframework/zend-coding-standard": "^1.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, "suggest": { "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", "zendframework/zend-stdlib": "Zend\\Stdlib component" diff --git a/composer.lock b/composer.lock index f8704b47..a55e8d9f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2c03c65d6f54baad76ea3e07d1ba234", + "content-hash": "f80f736d22dca29742b946771a130310", "packages": [ { "name": "zendframework/zend-eventmanager", @@ -64,16 +64,16 @@ "packages-dev": [ { "name": "doctrine/annotations", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", "shasum": "" }, "require": { @@ -82,7 +82,7 @@ }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5@dev" + "phpunit/phpunit": "^7.5" }, "type": "library", "extra": { @@ -128,20 +128,20 @@ "docblock", "parser" ], - "time": "2019-08-08T18:11:40+00:00" + "time": "2019-10-01T18:55:10+00:00" }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -184,32 +184,34 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -222,14 +224,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -244,7 +246,7 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "myclabs/deep-copy", @@ -332,18 +334,18 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" }, { "name": "Sebastian Heuer", - "role": "Developer", - "email": "sebastian@phpeople.de" + "email": "sebastian@phpeople.de", + "role": "Developer" }, { "name": "Sebastian Bergmann", - "role": "Developer", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", @@ -379,18 +381,18 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" }, { "name": "Sebastian Heuer", - "role": "Developer", - "email": "sebastian@phpeople.de" + "email": "sebastian@phpeople.de", + "role": "Developer" }, { "name": "Sebastian Bergmann", - "role": "Developer", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], "description": "Library for handling version information and constraints", @@ -611,40 +613,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^3.1.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -670,7 +672,7 @@ "testing", "xunit" ], - "time": "2018-10-31T16:06:48+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -710,8 +712,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", @@ -801,8 +803,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Utility class for timing", @@ -863,53 +865,52 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.16", + "version": "8.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" + "reference": "3ee1c1fd6fc264480c25b6fb8285edefe1702dab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3ee1c1fd6fc264480c25b6fb8285edefe1702dab", + "reference": "3ee1c1fd6fc264480c25b6fb8285edefe1702dab", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.2.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -917,7 +918,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -943,7 +944,7 @@ "testing", "xunit" ], - "time": "2019-09-14T09:08:39+00:00" + "time": "2019-12-06T05:41:38+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1112,16 +1113,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -1161,7 +1162,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -1232,23 +1233,26 @@ }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -1256,7 +1260,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1279,7 +1283,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2019-02-01T05:30:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -1468,6 +1472,52 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2018-10-04T04:07:39+00:00" }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -1591,16 +1641,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -1612,7 +1662,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -1645,7 +1695,7 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "theseer/tokenizer", @@ -1680,8 +1730,8 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", @@ -1689,31 +1739,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -1735,7 +1783,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" }, { "name": "zendframework/zend-coding-standard", From 1874ed97e895e7b183f0b7979fa9b5c4ab148501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 18:46:18 +0000 Subject: [PATCH 72/80] Update LEGACY_DEPS in Travis CI configuration --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4517a822..48c07c52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: - php: 7.1 env: - DEPS=locked - - LEGACY_DEPS="phpunit/phpunit" + - LEGACY_DEPS="doctrine/annotations phpunit/phpunit" - CS_CHECK=true - TEST_COVERAGE=true - php: 7.1 From 63e5df0f9d4a6d704b497bd1297b1cdd335f5a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 18:46:26 +0000 Subject: [PATCH 73/80] PHP 7.4 compatibility fix --- src/Reflection/ParameterReflection.php | 2 +- test/Reflection/ParameterReflectionTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Reflection/ParameterReflection.php b/src/Reflection/ParameterReflection.php index 5c953e35..7a53bbf2 100644 --- a/src/Reflection/ParameterReflection.php +++ b/src/Reflection/ParameterReflection.php @@ -81,7 +81,7 @@ public function detectType() && ($type = $this->getType()) && $type->isBuiltin() ) { - return (string) $type; + return $type->getName(); } // can be dropped when dropping PHP7 support: diff --git a/test/Reflection/ParameterReflectionTest.php b/test/Reflection/ParameterReflectionTest.php index 064490a3..0aa59062 100644 --- a/test/Reflection/ParameterReflectionTest.php +++ b/test/Reflection/ParameterReflectionTest.php @@ -104,7 +104,7 @@ public function testGetType($className, $methodName, $parameterName, $expectedTy $type = $reflection->getType(); self::assertInstanceOf(\ReflectionType::class, $type); - self::assertSame($expectedType, (string) $type); + self::assertSame($expectedType, $type->getName()); } /** From 8e9b20bc0b9e85af98811717b17e98283802b390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 19:05:46 +0000 Subject: [PATCH 74/80] Update dev dependency - doctrine/annotations to ^1.7 for PHP 7.4 compatibility --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6c4946e1..8b94b969 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require-dev": { "ext-phar": "*", - "doctrine/annotations": "^1.0", + "doctrine/annotations": "^1.7", "phpunit/phpunit": "^7.5.16 || ^8.4", "zendframework/zend-coding-standard": "^1.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" diff --git a/composer.lock b/composer.lock index a55e8d9f..46a93673 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f80f736d22dca29742b946771a130310", + "content-hash": "91e711e5e9df76a672333ceba0aa2fa0", "packages": [ { "name": "zendframework/zend-eventmanager", From 5575bb6b391a0ce046500ef4799eb647e0827dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 19:12:47 +0000 Subject: [PATCH 75/80] Adds CHANGELOG entries for #180 --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dd21347..7cc3849d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file, in reverse ### Added -- Nothing. +- [#180](https://github.com/zendframework/zend-code/pull/180) adds support for PHP 7.4. ### Changed @@ -24,6 +24,8 @@ All notable changes to this project will be documented in this file, in reverse - [#179](https://github.com/zendframework/zend-code/pull/179) fixes exception message when invalid value provided in `Zend\Code\Generator\ValueGenerator`. +- [#180](https://github.com/zendframework/zend-code/pull/190) fixes PHP 7.4 compatibility. + ## 3.4.0 - 2019-10-06 ### Added From 54d80d50572201554c31726c02b3b75371b7522a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 19:20:52 +0000 Subject: [PATCH 76/80] release: 3.4.1 readiness - set release date in CHANGELOG.md - update branch aliases in composer.json: add branch alias for dev-4.0 --- CHANGELOG.md | 2 +- composer.json | 3 ++- composer.lock | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc3849d..cde7e18e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.4.1 - TBD +## 3.4.1 - 2019-12-10 ### Added diff --git a/composer.json b/composer.json index 8b94b969..0d165218 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,8 @@ "extra": { "branch-alias": { "dev-master": "3.4.x-dev", - "dev-develop": "3.5.x-dev" + "dev-develop": "3.5.x-dev", + "dev-dev-4.0": "4.0.x-dev" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 46a93673..27eb34d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "91e711e5e9df76a672333ceba0aa2fa0", + "content-hash": "19b802ccaf8f069c8d62e3e589500bad", "packages": [ { "name": "zendframework/zend-eventmanager", From 86db463b4dad38a07b662c6f52d149e89836b81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 19:33:52 +0000 Subject: [PATCH 77/80] Fixes link in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cde7e18e..14613ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ All notable changes to this project will be documented in this file, in reverse - [#179](https://github.com/zendframework/zend-code/pull/179) fixes exception message when invalid value provided in `Zend\Code\Generator\ValueGenerator`. -- [#180](https://github.com/zendframework/zend-code/pull/190) fixes PHP 7.4 compatibility. +- [#180](https://github.com/zendframework/zend-code/pull/180) fixes PHP 7.4 compatibility. ## 3.4.0 - 2019-10-06 From 2a1f17ec0bfbb35930099b0070a52bde9fed884c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 10 Dec 2019 19:34:48 +0000 Subject: [PATCH 78/80] Bumped to next dev version (3.4.2) --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14613ad4..7c806a76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.4.2 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.4.1 - 2019-12-10 ### Added From 855ab70bb7f27682b0fe0f1a590459ca8138e18a Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 31 Dec 2019 15:14:24 -0600 Subject: [PATCH 79/80] Marking package as abandoned --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 74370770..3a8bb55c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # zend-code +> ## Repository abandoned 2019-12-31 +> +> This repository has moved to laminas/laminas-code. + [![Build Status](https://secure.travis-ci.org/zendframework/zend-code.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-code) [![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-code/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-code?branch=master) @@ -11,4 +15,4 @@ tasks: JavaScript, configuration files, apache vhosts, etc. - File issues at https://github.com/zendframework/zend-code/issues - Documentation is at https://docs.zendframework.com/zend-code/ -- Migration documentation from v2 to v3 is at https://docs.zendframework.com/zend-code/migration/ +- Migration documentation from v2 to v3 is at https://docs.zendframework.com/zend-code/migration/ \ No newline at end of file From d5a7131b5695ffdddca6b3ae76ba7e42777d3778 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 20 Jan 2020 12:07:03 -0600 Subject: [PATCH 80/80] Link to new repository --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a8bb55c..f5a37def 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > ## Repository abandoned 2019-12-31 > -> This repository has moved to laminas/laminas-code. +> This repository has moved to [laminas/laminas-code](https://github.com/laminas/laminas-code). [![Build Status](https://secure.travis-ci.org/zendframework/zend-code.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-code) [![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-code/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-code?branch=master) @@ -15,4 +15,4 @@ tasks: JavaScript, configuration files, apache vhosts, etc. - File issues at https://github.com/zendframework/zend-code/issues - Documentation is at https://docs.zendframework.com/zend-code/ -- Migration documentation from v2 to v3 is at https://docs.zendframework.com/zend-code/migration/ \ No newline at end of file +- Migration documentation from v2 to v3 is at https://docs.zendframework.com/zend-code/migration/