Skip to content

olivierpicault/json-evaluator-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-evaluator-php

The PHP version of json-evaluator.

Installation

composer require olivierpicault/json-evaluator-php

Basic usage

use JsonEvaluator\Evaluate;

// Basic instance
$instance = [
    'compare'   => [
        'type'  => 'string',
        'value' => 'olivier',
    ],
    'compareTo' => [
        'type'  => 'string',
        'value' => 'stéphane',
    ],
    'operator'  => '=='
];

// Instance is expected to be type of stdClass
$instance = json_decode(json_encode($instance, 0));

// Fields is expected to be type of array
$fields = [];

$evaluator = new Evaluate();
$evaluator->evaluate($instance, $fields); // false

Tests

composer test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages