Code Duplication    Length = 14-14 lines in 2 locations

src/Render.php 2 locations

@@ 106-119 (lines=14) @@
103
        return $string;
104
    }
105
106
    protected function generateAttributes(): string
107
    {
108
        $string = '';
109
110
        foreach ($this->element->attributes as $key => $value) {
111
            if (is_null($value) || (is_bool($value) && $value === false)) {
112
                continue;
113
            }
114
115
            $string .= ' ' . $key . '="' . (is_bool($value) ? $key : $value) . '"';
116
        }
117
118
        return $string;
119
    }
120
121
    protected function generateParts(): string
122
    {
@@ 121-134 (lines=14) @@
118
        return $string;
119
    }
120
121
    protected function generateParts(): string
122
    {
123
        $attributes = '';
124
125
        foreach ($this->element->parts as $key => $value) {
126
            if (empty($value) || (is_bool($value) && $value === false)) {
127
                continue;
128
            }
129
130
            $attributes .= ' ' . $key . '="' . (is_bool($value) ? $key : $value) . '"';
131
        }
132
133
        return $attributes;
134
    }
135
}