Code Duplication    Length = 18-18 lines in 2 locations

src/Metas/MetaBase.php 2 locations

@@ 60-77 (lines=18) @@
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function addMeta($name, $content)
61
    {
62
        if (is_array($content)) {
63
            $content = array_map(function ($content) use ($name) {
64
                return static::getHtmlMeta($name, $content);
65
            }, array_filter($content));
66
67
            if (empty($content)) {
68
                return;
69
            }
70
        } elseif (!empty($content)) {
71
            $content = static::getHtmlMeta($name, $content);
72
        } else {
73
            return;
74
        }
75
76
        $this[$name] = $content;
77
    }
78
79
    /**
80
     * {@inheritdoc}
@@ 82-99 (lines=18) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function addLink($rel, $href)
83
    {
84
        if (is_array($href)) {
85
            $href = array_map(function ($href) use ($rel) {
86
                return static::getHtmlLink($rel, $href);
87
            }, array_filter($href));
88
89
            if (empty($href)) {
90
                return;
91
            }
92
        } elseif (!empty($href)) {
93
            $href = static::getHtmlLink($rel, $href);
94
        } else {
95
            return;
96
        }
97
98
        $this[$rel] = $href;
99
    }
100
101
    /**
102
     * Adds an array of metas.