Code Duplication    Length = 11-11 lines in 2 locations

src/app/Balloon.App.Convert/AttributeDecorator.php 1 location

@@ 62-72 (lines=11) @@
59
     *
60
     * @return array
61
     */
62
    public function decorate(array $slave, array $attributes = []): array
63
    {
64
        $requested = $attributes;
65
        $attrs = $this->getAttributes($slave);
66
67
        if (0 === count($requested)) {
68
            return $this->translateAttributes($slave, $attrs);
69
        }
70
71
        return $this->translateAttributes($slave, array_intersect_key($attrs, array_flip($requested)));
72
    }
73
74
    /**
75
     * Add decorator.

src/app/Balloon.App.Notification/AttributeDecorator.php 1 location

@@ 62-72 (lines=11) @@
59
     *
60
     * @return array
61
     */
62
    public function decorate(array $message, array $attributes = []): array
63
    {
64
        $requested = $attributes;
65
        $attrs = $this->getAttributes($message);
66
67
        if (0 === count($requested)) {
68
            return $this->translateAttributes($message, $attrs);
69
        }
70
71
        return $this->translateAttributes($message, array_intersect_key($attrs, array_flip($requested)));
72
    }
73
74
    /**
75
     * Add decorator.