Below is my observer code: <?php class CustomerOrderCountObserver implements ObserverInterface { /** * @var customerFactory */ private $customerFactory; /** * * @param CustomerFactory $customerFactory */ public function __construct( CustomerFactory $customerFactory ) { $this->customerFactory = $customerFactory; } /** * Upgrade customer password hash when customer has logged in * * @param MagentoFrameworkEventObserver $observer * @return void */ public function execute(MagentoFrameworkEventObserver $observer)