Code Duplication    Length = 8-8 lines in 2 locations

src/Charcoal/Cms/Service/Loader/EventLoader.php 2 locations

@@ 94-101 (lines=8) @@
91
     *                    string.
92
     * @return CollectionLoader
93
     */
94
    public function since($date)
95
    {
96
        $date = $this->parseAsDate($date);
97
        $loader = $this->published();
98
        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]);
99
100
        return $loader;
101
    }
102
103
    /**
104
     * @param mixed $date The news date to filter
@@ 110-117 (lines=8) @@
107
     *                    string.
108
     * @return CollectionLoader
109
     */
110
    public function to($date)
111
    {
112
        $date = $this->parseAsDate($date);
113
        $loader = $this->published();
114
        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '<' ]);
115
116
        return $loader;
117
    }
118
119
    // ==========================================================================
120
    // GETTERS