Skip to content

Instantly share code, notes, and snippets.

@pmjones
Created December 1, 2015 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmjones/5356d2550eb33208f146 to your computer and use it in GitHub Desktop.
Save pmjones/5356d2550eb33208f146 to your computer and use it in GitHub Desktop.
<?php
class BlogFilter
{
protected $messages = array();
public function forUpdate(BlogPost $post)
{
$this->messages = array();
if (! trim($post->title)) {
$this->messages['title'] = 'The title must not be empty.';
return false;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment