Skip to content

Commit

Permalink
entity finder: skip invalid repository types (e.g. IRepository interf…
Browse files Browse the repository at this point in the history
…ace) [closes #18]
  • Loading branch information
hrach committed May 5, 2021
1 parent fe935cf commit f2e0b62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
### Added
- Added auto-completion & reference to entity properties in hasValue() method.

### Fixed
- Fixed entity type resolution for variables typed with "resolution-invalid" types (e.g. `IRepository` interface); closes #18

### Changed
- The plugin internal continuous delivery system & checks reworked.
6 changes: 3 additions & 3 deletions src/main/kotlin/org/nextras/orm/intellij/utils/OrmUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ object OrmUtils {
for (repositoryClass in repositories) {
val entityNamesMethod = repositoryClass.findMethodByName("getEntityClassNames") ?: return emptyList()
if (entityNamesMethod.lastChild !is GroupStatement) {
return emptyList()
continue
}
if ((entityNamesMethod.lastChild as GroupStatement).firstPsiChild !is PhpReturn) {
return emptyList()
continue
}
if ((entityNamesMethod.lastChild as GroupStatement).firstPsiChild!!.firstPsiChild !is ArrayCreationExpression) {
return emptyList()
continue
}

val arr = (entityNamesMethod.lastChild as GroupStatement).firstPsiChild!!.firstPsiChild as ArrayCreationExpression?
Expand Down

0 comments on commit f2e0b62

Please sign in to comment.