[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country::getAllOptions() must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)»

Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country::getAllOptions():

Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country really inherits from Magento\Eav\Model\Entity\Attribute\Source\Table:

Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions():

The fact that PHP < 7.2 accepted this was an unintentional side-effect.

bugs.php.net/bug.php?id=75590#1512772457

My fix

Replace the line:

with the following one:

public function getAllOptions($withEmpty = true, $defaultValues = false)

See also: