Skip to content

Call to an undefined method ... ObjectRepository::findOneByShortName(). #35

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

Closed
tlorens opened this issue Aug 6, 2018 · 5 comments
Closed

Comments

@tlorens
Copy link

tlorens commented Aug 6, 2018

Are magic methods not supported or is there some configuration option(s) I missed?

@ondrejmirtes
Copy link
Member

Nope, they are not supported right now.

@tlorens
Copy link
Author

tlorens commented Aug 6, 2018

Yeah, I found another post on it.. I'll just add it to the ignore list. .Thanks!

@tlorens tlorens closed this as completed Aug 6, 2018
jackbentley pushed a commit to jackbentley/phpstan-doctrine that referenced this issue Sep 26, 2018
@ankitpp
Copy link

ankitpp commented Jan 7, 2020

Error - Call to an undefined method object::something();

In this particular instance method was called after Instantiating an object from child class. Child class extends parent class but error was still thrown.

Parent
abstract class Duhh
{
public function something(){
Definition of Function in parent
}
}

Child
class DuhhChild extends Duhh
{

}

Use of Method In Some Controller that throws PHP Stan Error - Call to an undefined method object::something();

use DuhhChild;
class SomeController extends random
{
$something = new DuhhChild;
$something->something()
}

inorder to work around this error simple define a docBlock that explains that variable as an Instance of Child Class above the variable that you are using to Instantiate the object. Example;

use DuhhChild;
class SomeController extends random
{
/** @var DuhhChild $something */
$something = new DuhhChild;
$something->something()
}

@ondrejmirtes
Copy link
Member

@ankitpp This is completely unrelated to this issue and even to phpstan-doctrine, please open a new one in https://github.com/phpstan/phpstan/issues/new/choose

@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants