Code Duplication    Length = 8-13 lines in 2 locations

src/PhpQueryObject.php 2 locations

@@ 3331-3338 (lines=8) @@
3328
                    @$node->setAttribute($a, $value);
3329
                    $this->attrEvents($a, $oldAttr, $oldValue, $node);
3330
                }
3331
            } else if ($attr == '*') {
3332
                // jQuery difference
3333
                $return = array();
3334
                foreach ($node->attributes as $n => $v)
3335
                    $return[$n] = $v->value;
3336
                return $return;
3337
            } else
3338
                return $node->hasAttribute($attr) ? $node->getAttribute($attr) : null;
3339
        }
3340
        return is_null($value) ? '' : $this;
3341
    }
@@ 3388-3400 (lines=13) @@
3385
            //				$value	= mb_convert_encoding($value, 'UTF-8', 'HTML-ENTITIES');
3386
        }
3387
        foreach ($this->stack(1) as $node) {
3388
            if (!is_null($code)) {
3389
                //				$attrNode = $this->DOM->createAttribute($attr);
3390
                $node->setAttribute($attr, $value);
3391
                //				$attrNode->value = $value;
3392
                //				$node->appendChild($attrNode);
3393
            } else if ($attr == '*') {
3394
                // jQuery diff
3395
                $return = array();
3396
                foreach ($node->attributes as $n => $v)
3397
                    $return[$n] = $v->value;
3398
                return $return;
3399
            } else
3400
                return $node->getAttribute($attr);
3401
        }
3402
        return $this;
3403
    }