Code Duplication    Length = 12-13 lines in 2 locations

classes/Route.php 2 locations

@@ 91-103 (lines=13) @@
88
       	$this->response_is_object = false;
89
90
        // Call direct befores
91
        if ( $this->befores ) {
92
          // Reverse befores order
93
          foreach (array_reverse($this->befores) as $mw) {
94
	        	ob_start();
95
            $mw_result = call_user_func($mw->bindTo($this));
96
          	$this->response .= ob_get_clean();
97
            if ( false  === $mw_result ) {
98
            	return [''];
99
            } else if (is_a($mw_result,'View') || is_string($mw_result)) {
100
              $this->response .= (string)$mw_result;
101
          	}
102
          }
103
        }
104
105
        Event::trigger('core.route.before', $this);
106
@@ 137-148 (lines=12) @@
134
        }
135
136
        // Apply afters
137
        if ( $this->afters ) {
138
          foreach ($this->afters as $mw) {
139
	        	ob_start();
140
            $mw_result = call_user_func($mw->bindTo($this));
141
          	$this->response .= ob_get_clean();
142
            if ( false  === $mw_result ) {
143
            	return [''];
144
            } else if (is_a($mw_result,'View') || is_string($mw_result)) {
145
              $this->response .= (string)$mw_result;
146
          	}
147
          }
148
        }
149
150
        Event::trigger('core.route.after', $this);
151