Skip to content

Commit

Permalink
Merge pull request #2604 from microsoft/fix/add-parent-implements
Browse files Browse the repository at this point in the history
Add parent implements to inlined classes.
  • Loading branch information
SilasKenneth authored Apr 24, 2023
2 parents b25c7dc + ab8d07a commit f406d17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Fix issue where implements for error classes were not copied when inlining classes.
- Move the common properties to a base class and remove properties(RequestAdapter, UrlTemplate and PathParameters) for the request builders and options and headers for RequestConfig classes PHP.[2439](https://github.com/microsoft/kiota/issues/2439)
- Fix bugs with imports for PHP Generation.
- Indexers replacement are now at the same level as the original indexer. e.g `client.userById("id").messagesById("id")...` is now `client.users.withId("id").messages.withId("id")...`.
Expand Down
7 changes: 7 additions & 0 deletions src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,13 @@ parent is CodeType parentType &&
newU.Parent = currentClass;
currentClass.AddUsing(newU);
}
foreach (var implement in currentParent
.StartBlock
.Implements
.Where(pi => !currentClass.Usings.Any(ci => ci.Name.Equals(pi.Name, StringComparison.OrdinalIgnoreCase))))
{
currentClass.StartBlock.AddImplements((CodeType)implement.Clone());
}
}
}
}
Expand Down

0 comments on commit f406d17

Please sign in to comment.