Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
public function message_count($msg_type = '', $reverse = false) { /* ** returns the number of messages in the queue ** if $msg_type is defined, it returns the number of messages of the class $msg_type */ if (empty($msg_type)) { return count($this->messages); } else { $msg_count = 0; foreach($this->messages as $msg) { if (strtolower($msg_type) == strtolower(get_class($msg)) && !$reverse) { $msg_count++; } if (strtolower($msg_type) != strtolower(get_class($msg)) && $reverse) { $msg_count++; } } return $msg_count; } }
This paste will be private.
From the Design Piracy series on my blog: