summaryrefslogtreecommitdiff
path: root/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php
blob: de7d907c8e6717da9519b958bb584eee85db48b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

declare(strict_types=1);

namespace OpenTracing;

use DomainException;

/**
 * Thrown when a reference has more than one parent in the SpanOptions
 */
final class InvalidReferencesSetException extends DomainException
{
    /**
     * @param string $message
     * @return InvalidReferencesSetException
     */
    public static function create(string $message): InvalidReferencesSetException
    {
        return new self($message);
    }

    /**
     * @return InvalidReferencesSetException
     */
    public static function forMoreThanOneParent(): InvalidReferencesSetException
    {
        return new self('Span can not have more than one parent, either one as child_of or either one as follows_from');
    }
}