private function hookNeedsUpdate(Integration $integration, array $hook, array $payload)
    {
        if ($integration->type === 'bitbucket') {
            foreach ($payload as $item => $value) {
                if (!isset($hook[$item])) {
                    return true;
                }
                if ($item === 'events') {
                    sort($value);
                    sort($hook[$item]);
                    if ($value !== $hook[$item]) {
                        return true;
                    }
                }
                if ($hook[$item] !== $value) {
                    return true;
                }
            }

            return false;
        }

        return $this->arraysDiffer($hook, $payload);
    }