1
foreach ($statusCollection as $statusModel)
        {
            if ($statusModel->getId() == substr($status, strpos($status, '_') + 1))
            {
                // this is it!
                $this->_frameworkRegistry = $om->get('Magento\Framework\Registry');
                
            }
        }
1
  • You need change your code Commented Jun 8, 2022 at 10:46

1 Answer 1

1

This error means that your might have logical mistake in your code.

Function strpos returns int|false.

See details about this warning in official documentation:

Warning: on may return Boolean false, but may also return a non-Boolean value which evaluates to false. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

This means that you need to check result of strpos like !== false before using result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.