Code Duplication    Length = 13-15 lines in 3 locations

lib/Metadata/BaseMetadataFactory.php 3 locations

@@ 73-85 (lines=13) @@
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function getMetadataForAlias($alias)
74
    {
75
        if (!isset($this->aliasMap[$alias])) {
76
            throw new MetadataNotFoundException(sprintf(
77
                'Metadata with alias "%s" not found, known aliases: "%s"',
78
                $alias, implode('", "', array_keys($this->aliasMap))
79
            ));
80
        }
81
82
        $map = $this->aliasMap[$alias];
83
84
        return $this->loadMetadata($map);
85
    }
86
87
    /**
88
     * {@inheritdoc}
@@ 90-102 (lines=13) @@
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function getMetadataForPhpcrType($phpcrType)
91
    {
92
        if (!isset($this->phpcrTypeMap[$phpcrType])) {
93
            throw new MetadataNotFoundException(sprintf(
94
                'Metadata with phpcrType "%s" not found, known phpcrTypes: "%s"',
95
                $phpcrType, implode('", "', array_keys($this->phpcrTypeMap))
96
            ));
97
        }
98
99
        $map = $this->phpcrTypeMap[$phpcrType];
100
101
        return $this->loadMetadata($map);
102
    }
103
104
    /**
105
     * {@inheritdoc}
@@ 125-139 (lines=15) @@
122
    /**
123
     * {@inheritdoc}
124
     */
125
    public function getMetadataForClass($class)
126
    {
127
        $class = ClassNameInflector::getUserClassName($class);
128
129
        if (!isset($this->classMap[$class])) {
130
            throw new MetadataNotFoundException(sprintf(
131
                'Metadata with class "%s" not found, known classes: "%s"',
132
                $class, implode('", "', array_keys($this->classMap))
133
            ));
134
        }
135
136
        $map = $this->classMap[$class];
137
138
        return $this->loadMetadata($map);
139
    }
140
141
    /**
142
     * {@inheritdoc}