Code Duplication    Length = 15-15 lines in 2 locations

core/services/assets/AssetCollection.php 2 locations

@@ 70-84 (lines=15) @@
67
     * @return array
68
     * @since $VID:$
69
     */
70
    protected function getAssetsOfType($type)
71
    {
72
        $files = array();
73
        $this->rewind();
74
        while ($this->valid()) {
75
            /** @var \EventEspresso\core\domain\values\assets\Asset $asset */
76
            $asset = $this->current();
77
            if ($asset->type() === $type) {
78
                $files[ $asset->handle() ] = $asset;
79
            }
80
            $this->next();
81
        }
82
        $this->rewind();
83
        return $files;
84
    }
85
86
87
    /**
@@ 91-105 (lines=15) @@
88
     * @return JavascriptAsset[]
89
     * @since $VID:$
90
     */
91
    public function getJavascriptAssetsWithData()
92
    {
93
        $files = array();
94
        $this->rewind();
95
        while ($this->valid()) {
96
            /** @var \EventEspresso\core\domain\values\assets\JavascriptAsset $asset */
97
            $asset = $this->current();
98
            if ($asset->type() === Asset::TYPE_JS && $asset->hasLocalizedData()) {
99
                $files[ $asset->handle() ] = $asset;
100
            }
101
            $this->next();
102
        }
103
        $this->rewind();
104
        return $files;
105
    }
106
}
107