Hello,
I'm building a web app using bulletphp, and to answer some doubts I start digging into the code...
And it was a nice surprise, I really like your framework :)
Anyway, digging into the code I think I found a bug... let me explain better.
Inside the "App.php" file, at the very end of the run() method there are these lines:
// Trigger events based on HTTP request format and HTTP response code
$this->filter(array_filter(array($this->_request->format(), $response->status(), 'after')));
But the array_filter function expect 2 args (not 3) and the filter method expect the first argument to be a scalar (not an array).
Additionally, there is no need to pass the request-format and the response-status to the ´filter´ method because it will use the (already setup) $this->_request and $this->_response objects.
So, I think the code should be:
// Trigger events based on HTTP request format and HTTP response code
$this->filter('after', array($this->_request->format(), $response->status()) );
//or even
$this->filter('after');
Hello, I'm building a web app using bulletphp, and to answer some doubts I start digging into the code... And it was a nice surprise, I really like your framework :) Anyway, digging into the code I think I found a bug... let me explain better. Inside the "App.php" file, at the very end of the
run()
method there are these lines:But the
array_filter
function expect 2 args (not 3) and thefilter
method expect the first argument to be a scalar (not an array). Additionally, there is no need to pass the request-format and the response-status to the ´filter´ method because it will use the (already setup)$this->_request
and$this->_response
objects. So, I think the code should be:Please, let me know your thoughts.
Marcelo.