Skip to content

Latest commit

 

History

History
49 lines (45 loc) · 1.5 KB

README.md

File metadata and controls

49 lines (45 loc) · 1.5 KB

ObjectOrder

Share items into groups by specifying former items.

Code Climate Test Coverage Issue Count

Installation

composer require master/object-order

Example usage

    require_once __DIR__ . '/vendor/autoload.php';
    use Trzczy\Helpers\Rules;
    
    $jsonData = '[
            {
                "method":"Zbigniew",
                "input":"Herbert",
                "arg1":24,
                "arg2":"abc"
            },
            {
                "method":"Frank",
                "input":"Herbert",
                "former":[
                    {"arg2":"abc"}
                ]
            },
            {
                "method":"Edith",
                "input":"Stein",
                "former":[
                    {"method":"Frank"},
                    {"arg2":"abc"}
                ]
            },
            {
                "method":"Ernest",
                "input":"Hemingway",
                "former":[
                    {"input":"Herbert"},
                    {"method":"Edith"}
                ]
    
            }
        ]';
    $rules = new Rules();
    print_r($rules->order($jsonData));