OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
863 stars 438 forks source link

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

Closed fballiano closed 1 month ago

fballiano commented 1 month ago

check https://github.com/OpenMage/magento-lts/pull/3988#issuecomment-2137828337

F1Red5 commented 1 month ago

@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 commented 1 month ago

@F1Red5 I didn't understand

F1Red5 commented 1 month ago

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 commented 1 month ago

@F1Red5 they changed a comment and fixed a problem?

F1Red5 commented 1 month ago

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

I'll ask him for more information tomorrow.

fballiano commented 1 month ago

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

F1Red5 commented 1 month ago

Okay. Thank you.

F1Red5 commented 1 month ago

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

fballiano commented 1 month ago

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

F1Red5 commented 1 month ago

:+1:

fballiano commented 1 month ago

do you people need a .1 release for this?