private function getReason(OperationInterface $operation)
    {
        if (!$this->pool) {
            return null;
        }

        $reason = $operation->getReason();
        if ($reason instanceof Rule) {
            switch ($reason->getReason()) {
                case Rule::RULE_JOB_INSTALL:
                    return 'Required by the root package: ' . $reason->getPrettyString($this->pool);
                case Rule::RULE_PACKAGE_REQUIRES:
                    return $reason->getPrettyString($this->pool);
                default:
            }
        }

        return null;
    }