Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated installation section

  • Loading branch information...
commit 607240513f1ef53d6dcf0de27e21b4bfd9490c72 1 parent 41fce2d
@spiechu authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 README.md
View
8 README.md
@@ -4,7 +4,11 @@ Class primarily created to find some useful purpose for `__callStatic` function
## Installation
-Nothing special here. Just make sure You have at least PHP 5.3.0 and perform `require_once('staticvalidator.php');`
+Since Validator uses namespaces, it is required to use `SplClassLoader.php` (You will find it in `tests' directory). It is standard autoloading class [more info here](http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1). You have to register Validator classes:
+
+ require_once('SplClassLoader.php');
+ $classLoader = new SplClassLoader('Spiechu\StaticValidator' , 'library');
+ $classLoader->register();
## Documentation
@@ -12,7 +16,7 @@ Static Validator's class is designed to check if given variable or table of vari
Basically every check method starts with `check` word, and then You can use separator `_` and type next condition which tested variable is supposed to meet.
-For exaple `StaticValidator::check_notNull_isInt_gt5($testedVariable);` we can translate to `!is_null($testedVariable) && is_int($testedVariable) && ($testedVariable > 5)` You can see we gain some concise and some flexibility (`gt5`).
+For exaple `Validator::check_notNull_isInt_gt5($testedVariable);` we can translate to `!is_null($testedVariable) && is_int($testedVariable) && ($testedVariable > 5)` You can see we gain some concise and some flexibility (`gt5`).
We can distinguish three main components in PHP Static Validator:
Please sign in to comment.
Something went wrong with that request. Please try again.