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

Restored parent::save() on a few classes (fixing PHPStan) ref #3988 #4021

Merged
merged 5 commits into from
May 30, 2024

Conversation

fballiano
Copy link
Contributor

@fballiano fballiano commented May 29, 2024

@fballiano fballiano changed the title Restored parent::save on a few classes with phpstan-ignore, ref #3988 Restored parent::save() on a few classes with phpstan-ignore, ref #3988 May 29, 2024
@github-actions github-actions bot added Component: Catalog Relates to Mage_Catalog Component: Downloadable Relates to Mage_Downloadable Component: Bundle Relates to Mage_Bundle labels May 29, 2024
@F1Red5
Copy link
Contributor

F1Red5 commented May 29, 2024

@fballiano thank you.

I got feedback from our developer. He tried a bit to get rid of this warning. He wrote the error is gone when he replaced @return Mage_Catalog_Model_Product_Type_Abstract with @return $this in Mage_Catalog_Model_Product_Type_Abstract. Can you verify this?

@fballiano
Copy link
Contributor Author

@F1Red5 I didn't understand

@F1Red5
Copy link
Contributor

F1Red5 commented May 29, 2024

In Mage_Catalog_Model_Product_Type_Abstract

/**
 * Save type related data
 *
 * @param Mage_Catalog_Model_Product $product
 * @return $this <- he changed that line
 */
public function save($product = null)
{
    /* custom code */
    return $this;
}

@fballiano
Copy link
Contributor Author

@F1Red5 they changed a comment and fixed a problem?

@F1Red5
Copy link
Contributor

F1Red5 commented May 29, 2024

He sent me this link: https://phpstan.org/r/f830ef1d-d81a-46fb-8ae1-2a5902672020

I'll ask him for more information tomorrow.

@fballiano
Copy link
Contributor Author

tell them to test this PR because I can't understand these messages

@F1Red5
Copy link
Contributor

F1Red5 commented May 29, 2024

Okay. Thank you.

@F1Red5
Copy link
Contributor

F1Red5 commented May 29, 2024

I cant explain, but I have tested the linked code and changed @return A to @return $this and the error is gone.

@fballiano
Copy link
Contributor Author

it should be exactly what this PR does, please test this one so that, if it fixes the problem, we can merge it

@fballiano fballiano changed the title Restored parent::save() on a few classes with phpstan-ignore, ref #3988 Restored parent::save() on a few classes (fixing PHPStan) ref #3988 May 29, 2024
@F1Red5
Copy link
Contributor

F1Red5 commented May 30, 2024

👍

@fballiano fballiano merged commit ed34c76 into OpenMage:main May 30, 2024
17 checks passed
@fballiano
Copy link
Contributor Author

do you people need a .1 release for this?

@fballiano fballiano deleted the phpstan11-2 branch May 30, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bundle Relates to Mage_Bundle Component: Catalog Relates to Mage_Catalog Component: Downloadable Relates to Mage_Downloadable PHPStorm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants