Skip to content

Commit

Permalink
- Implemented: boolean validator
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob committed Jun 1, 2011
1 parent f57ca0a commit 97e6371
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/classes/validator/boolean.php
@@ -0,0 +1,44 @@
<?php
/**
* phpillow CouchDB backend
*
* This file is part of phpillow.
*
* phpillow is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; version 3 of the License.
*
* phpillow is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with phpillow; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package Core
* @version $Revision$
* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPL
*/

/**
* validate boolean inputs
*
* @package Core
* @version $Revision$
* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPL
*/
class phpillowBooleanValidator extends phpillowValidator
{
/**
* Validate input as a boolean
*
* @param mixed $input
* @return bool
*/
public function validate( $input )
{
return (bool) $input;
}
}

0 comments on commit 97e6371

Please sign in to comment.