Try
/** * @param array{cookie: Cookie, cart: Cart, altern: int, newCustomer: Customer} $params * @see CustomerPersisterCore::create */ public function hookActionCustomerAccountAdd(array $params) { if (Tools::getValue('chkRecargoEquivalencia') === '1' && Validate::isLoadedObject($params['newCustomer'])) { Db::getInstance()->insert( 'esp_recargo_equivalencia_prueba', [ 'id_customer' => (int) $params['newCustomer']->id, ] ); } }