Skip to content

Commit 9c8ecb6

Browse files
Avoid extending class that has been already extended in classCreatedHook (#32)
1 parent 2f562e4 commit 9c8ecb6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.2.26] - 2020-06-16
8+
9+
### Fixed
10+
- `PhpClass` setExtends if getExtends is null in `PhpBuilder`.
11+
712
## [0.2.25] - 2020-01-10
813

914
### Added

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "swaggest/php-code-builder",
2+
"name": "blackstark123/php-code-builder",
33
"type": "library",
44
"description": "Swaggest JSON-schema enabled PHP code builder",
55
"keywords": ["library"],

src/JsonSchema/PhpBuilder.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ private function makeClass($schema, $path)
138138
if ($this->classCreatedHook !== null) {
139139
$this->classCreatedHook->process($class, $path, $schema);
140140
}
141-
$class->setExtends(Palette::classStructureClass());
141+
if (is_null($class->getExtends())) {
142+
$class->setExtends(Palette::classStructureClass());
143+
}
142144

143145
$setupProperties = new PhpFunction('setUpProperties');
144146
$setupProperties

0 commit comments

Comments
 (0)