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

Fixed phpstan on Mage_Customer_Model_Customer #4190

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

kiatng
Copy link
Contributor

@kiatng kiatng commented Sep 11, 2024

Description (*)

Line 1419 in app\code\core\Mage\Customer\Model\Customer.php

    $region = Mage::getModel('directory/region')->loadByName($data[$prefix . 'region']);

will result in

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Mage_Directory_Model_Region::loadByName()

However, the function validateAddress() is not reference in the core. Removing it is a potential BC, but should we remove it anyway?

@github-actions github-actions bot added Component: Customer Relates to Mage_Customer phpstan labels Sep 11, 2024
@sreichel
Copy link
Contributor

sreichel commented Sep 11, 2024

It either should be US or CA, not?

                if ($field == 'country'
                    && in_array(strtolower($data[$prefix . $field]), ['US', 'CA'])
                ) {

I'd not remove any public methods.

@sreichel sreichel merged commit 6712134 into OpenMage:main Sep 17, 2024
17 checks passed
@sreichel sreichel deleted the phpstan_custormer_model branch September 17, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Customer Relates to Mage_Customer phpstan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants