2017 © Pedro Peláez
 

library amatch

Validation and matching for associative arrays

image

kivagant/amatch

Validation and matching for associative arrays

  • Saturday, June 6, 2015
  • by KIVagant
  • Repository
  • 8 Watchers
  • 16 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

AMatch

Validate associative arrays, (*1)

Habrahabr examlpes:, (*2)

  • Part 1: http://habrahabr.ru/post/149114/
  • Part 2: http://habrahabr.ru/post/150039/

See examples in folder 'examples'., (*3)

This is short demo for usage:, (*4)

~~~PHP $params_bad = array( 'doc_id' => -4, 'subject_id' => null, 'parent_id' => 30, 'data' => array( 'flag' => 'booom', 'from_topic' => array(), 'old_property' => true, ), 'wtf_param' => 'exploit', ); $match = AMatch::runMatch($params_bad) ->doc_id(0, 'subject_id(0, '!=') // Array value != zero ->subject_id('', '!float') // Array value is not float ->author_name(AMatch::OPTIONAL, 'string') // String type or not defined ->author_name('Guest') // Array value equal 'Guest' ->parent_id(AMatch::OPTIONAL, 'int') // Int type or not defined ->parent_id(0, 'parent_id(array(32, 33), 'in_left_array') // Array value exists in this array ->data('', 'array') // Type of array value is 'array' ->data('', '!empty') // Array value not empty ->data('old_property', '!key_exists') // Array does not have this key ->data('experiment', 'in_array') // In array value must be another array with value 'experiment' ->title() // This key must exist ; if ($match->stopMatch()) { echo 'Victory!'; } else { var_export($match->matchComments()); } ?>, (*5)

The Versions

06/06 2015

2.1.x-dev

2.1.9999999.9999999-dev

Validation and matching for associative arrays

  Sources   Download

MIT

The Requires

  • ext-mbstring *
  • php ^5.4.0

 

by Eugene Glotov

06/06 2015

dev-master

9999999-dev

Validation and matching for associative arrays

  Sources   Download

MIT

The Requires

  • ext-mbstring *
  • php ^5.4.0

 

by Eugene Glotov

01/09 2014

1.0.x-dev

1.0.9999999.9999999-dev

Validation and matching for associative arrays

  Sources   Download

MIT

by Евгений Глотов

01/09 2014

2.0

2.0.0.0

Validation and matching for associative arrays

  Sources   Download

MIT

by Евгений Глотов