Skip to content

Override function? #85

@LucLaverdure

Description

@LucLaverdure

Would it be possible to have the following feature:

require 'vendor/autoload.php';

$expression = 'foo.*.baz';

$data = [
    'foo' => [
        'bar' => ['baz' => 1],
        'bam' => ['baz' => 2],
        'boo' => ['baz' => 3]
    ]
];

$override = "hello world";

JmesPath\override($expression, $override, &$data);
$data would be modified to:

$data = [
    'foo' => [
        'bar' => ['baz' => "hello world"],
        'bam' => ['baz' => "hello world"],
        'boo' => ['baz' => "hello world"]
    ]
];

It would be a great feature!

Excellent project, this is just a suggestion!

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions