Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: red line on model by setPrefix & prefixTable #4329

Closed
totoprayogo1916 opened this issue Feb 23, 2021 · 2 comments · Fixed by #4349
Closed

Bug: red line on model by setPrefix & prefixTable #4329

totoprayogo1916 opened this issue Feb 23, 2021 · 2 comments · Fixed by #4349
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@totoprayogo1916
Copy link
Contributor

Describe the bug
Found red line on Model (setPrefix() & prefixTable() )
image

CodeIgniter 4 version
4.1.1

Context

  • OS: Windows 10
  • Web server, PHP Built in
  • PHP version 7.4.11
@totoprayogo1916 totoprayogo1916 added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 23, 2021
@MGatner
Copy link
Member

MGatner commented Feb 23, 2021

It's because Model::$db is defined as a ConnectionInterface which only has a small subset of the actual methods in BaseConnection. Unfortunately we have a number of these discrepancies between base/abstract classes and typed interfaces. Since changing an interface is a breaking change it isn't an easy fix, but in the short term we could simply declare Model::$db as ConnectionInterface|BaseConnection. @samsonasik and @paulbalandan isn't that essentially how you fixed the similar issue with ResponseInterface?

@samsonasik
Copy link
Member

Yes, on request use case, it was can't be changed in system, so change in BaseController instead, probably give a try apply BaseConnection to Base Model class ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants