Code Duplication    Length = 16-17 lines in 2 locations

src/HtmlTag.php 2 locations

@@ 82-98 (lines=17) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public static function comment(
83
        $content = null,
84
        $comment_factory_classname = null
85
    ) {
86
        $static = new static();
87
88
        $comment_factory_classname = null == $comment_factory_classname ?
89
            $static->comment_factory_classname :
90
            $comment_factory_classname;
91
92
        /** @var \drupol\htmltag\Tag\CommentFactory $comment_factory_classname */
93
        $comment_factory_classname = (new \ReflectionClass($comment_factory_classname))->newInstance();
94
95
        return $comment_factory_classname::build(
96
            $content
97
        );
98
    }
99
100
    /**
101
     * {@inheritdoc}
@@ 130-145 (lines=16) @@
127
    /**
128
     * {@inheritdoc}
129
     */
130
    public static function attribute(
131
        $name,
132
        $value,
133
        $attribute_factory_classname = null
134
    ) {
135
        $static = new static();
136
137
        $attribute_factory_classname = null == $attribute_factory_classname ?
138
            $static->attribute_factory_classname :
139
            $attribute_factory_classname;
140
141
        /** @var \drupol\htmltag\Attribute\AttributeFactoryInterface $attribute_factory_classname */
142
        $attribute_factory_classname = (new \ReflectionClass($attribute_factory_classname))->newInstance();
143
144
        return $attribute_factory_classname::build($name, $value);
145
    }
146
}
147