I want to override public static function getCorrectFileName
method of Magento\Framework\File\Uploader
, I have check with Preference and Plugin but it is not working for me.
Anyone have idea about this ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to override public static function getCorrectFileName
method of Magento\Framework\File\Uploader
, I have check with Preference and Plugin but it is not working for me.
Anyone have idea about this ?
Overwriting a static method is impossible, because the interpreter call them using a class name directly, so no one preference could get around this logic. It is a PHP restriction, not Magento. You can create a similar module\class and use it instead of the base Magento module\class.