Code Duplication    Length = 11-16 lines in 2 locations

lib/Metadata.php 1 location

@@ 91-101 (lines=11) @@
88
     *
89
     * @return array
90
     */
91
    public function getFieldMapping($name)
92
    {
93
        if (!isset($this->fieldMappings[$name])) {
94
            throw new \InvalidArgumentException(sprintf(
95
                'Field mapping "%s" not known in metadata for document type "%s". Known mappings: "%s"',
96
                $name, $this->alias, implode('", "', array_keys($this->fieldMappings))
97
            ));
98
        }
99
100
        return $this->fieldMappings[$name];
101
    }
102
103
    /**
104
     * @return string

lib/PathSegmentRegistry.php 1 location

@@ 46-61 (lines=16) @@
43
     *
44
     * @return string The path segment
45
     */
46
    public function getPathSegment($name)
47
    {
48
        if (!isset($this->pathSegments[$name])) {
49
            throw new \InvalidArgumentException(
50
                sprintf(
51
                    'Unknown path segment "%s". Known path segments: "%s"',
52
                    $name,
53
                    implode('", "', array_keys($this->pathSegments))
54
                )
55
            );
56
        }
57
58
        $name = $this->pathSegments[$name];
59
60
        return $name;
61
    }
62
}
63