Created
December 1, 2015 18:41
-
-
Save pmjones/5356d2550eb33208f146 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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