Code Duplication    Length = 5-5 lines in 9 locations

src/Ui/ControlPanel/Component/Button/ButtonNormalizer.php 1 location

@@ 82-86 (lines=5) @@
79
             * Move all data-* keys
80
             * to attributes.
81
             */
82
            foreach ($button as $attribute => $value) {
83
                if (str_is('data-*', $attribute)) {
84
                    array_set($button, 'attributes.' . $attribute, array_pull($button, $attribute));
85
                }
86
            }
87
88
            /**
89
             * Make sure the HREF is absolute.

src/Ui/ControlPanel/Component/Navigation/NavigationNormalizer.php 1 location

@@ 54-58 (lines=5) @@
51
             * Move all data-* keys
52
             * to attributes.
53
             */
54
            foreach ($link as $attribute => $value) {
55
                if (str_is('data-*', $attribute)) {
56
                    array_set($link, 'attributes.' . $attribute, array_pull($link, $attribute));
57
                }
58
            }
59
60
            /**
61
             * Make sure the HREF and data-HREF are absolute.

src/Ui/ControlPanel/Component/Section/SectionNormalizer.php 1 location

@@ 83-87 (lines=5) @@
80
             * Move all data-* keys
81
             * to attributes.
82
             */
83
            foreach ($section as $attribute => $value) {
84
                if (str_is('data-*', $attribute)) {
85
                    array_set($section, 'attributes.' . $attribute, array_pull($section, $attribute));
86
                }
87
            }
88
89
            /**
90
             * Make sure the HREF and data-HREF are absolute.

src/Ui/Form/Component/Action/ActionNormalizer.php 1 location

@@ 98-102 (lines=5) @@
95
         * Move all data-* keys
96
         * to attributes.
97
         */
98
        foreach ($action as $attribute => $value) {
99
            if (str_is('data-*', $attribute)) {
100
                array_set($action, 'attributes.' . $attribute, array_pull($action, $attribute));
101
            }
102
        }
103
104
        /**
105
         * If the HREF is present outside of the attributes

src/Ui/Form/Component/Button/ButtonNormalizer.php 1 location

@@ 77-81 (lines=5) @@
74
         * Move all data-* keys
75
         * to attributes.
76
         */
77
        foreach ($button as $attribute => $value) {
78
            if (str_is('data-*', $attribute)) {
79
                array_set($button, 'attributes.' . $attribute, array_pull($button, $attribute));
80
            }
81
        }
82
83
        /**
84
         * Make sure the HREF is absolute.

src/Ui/Table/Component/Action/ActionNormalizer.php 1 location

@@ 96-100 (lines=5) @@
93
         * Move all data-* keys
94
         * to attributes.
95
         */
96
        foreach ($action as $attribute => $value) {
97
            if (str_is('data-*', $attribute)) {
98
                array_set($action, 'attributes.' . $attribute, array_pull($action, $attribute));
99
            }
100
        }
101
102
        /**
103
         * If the HREF is present outside of the attributes

src/Ui/Table/Component/Button/ButtonNormalizer.php 1 location

@@ 87-91 (lines=5) @@
84
         * Move all data-* keys
85
         * to attributes.
86
         */
87
        foreach ($button as $attribute => $value) {
88
            if (str_is('data-*', $attribute)) {
89
                array_set($button, 'attributes.' . $attribute, array_pull($button, $attribute));
90
            }
91
        }
92
93
        /**
94
         * Make sure the HREF is absolute.

src/Ui/Tree/Component/Button/ButtonNormalizer.php 1 location

@@ 69-73 (lines=5) @@
66
             * Move all data-* keys
67
             * to attributes.
68
             */
69
            foreach ($button as $attribute => $value) {
70
                if (str_is('data-*', $attribute)) {
71
                    array_set($button, 'attributes.' . $attribute, array_pull($button, $attribute));
72
                }
73
            }
74
75
            /**
76
             * Make sure the HREF is absolute.

src/Ui/Tree/Component/Segment/SegmentNormalizer.php 1 location

@@ 65-69 (lines=5) @@
62
             * Move all data-* keys
63
             * to attributes.
64
             */
65
            foreach ($segment as $attribute => $value) {
66
                if (str_is('data-*', $attribute)) {
67
                    array_set($segment, 'attributes.' . $attribute, array_pull($segment, $attribute));
68
                }
69
            }
70
71
            /**
72
             * If no value wrap is set