Coder Social home page Coder Social logo

consolidare's Introduction

Build Status

Consolidare

This tool tries to make merging multiple "things" of any type easy and automated in an (hopefully) less opinionated fashion.

Install

composer require tohmua/consolidare

Use

$merge = new Consolidare\Merge();

$merge->data('{"id": 10}');
$merge->data(['name' => 'foo', 'email' => 'bar']);
$merge->data(['email' => '[email protected]']);

$result = $merge->merge(Consolidare\MergeStrategy\MergeStrategyFactory::basic());

$result->retrieve(new Consolidare\ReturnType\Type\ToArray);
// ['id' => 10, 'name' => 'foo', 'email' => '[email protected]']

Wiki

More info is available in the Wiki

Tests

To run: composer test

The code coverage report can be found in tests/_output however this is git ignored but it will be generated automatically for you when you run the test suite.

consolidare's People

Contributors

tohmua avatar rmjjjt avatar

Stargazers

Aaron J. Lang avatar

Watchers

 avatar Aaron J. Lang avatar

consolidare's Issues

Multi Dimensional Arrays

This is not something I have considered at all. It needs some though as to how best to handle this inside the project. This needs to be scoped out before any work is done, so suggestions are welcome!

Doc Blocks

So... yea... I didn't add any. Probably should get round to this at some point.

Return Types

At the moment we always return a PHP array.

We handle multiple types of input but not output. You can merge two JSON objects but get a PHP array out. This doesn't seem right.

Implementing something that allows you to return specific formats or add your own custom ones could be a good idea. By default, something like PHP Array, JSON, and maybe a generic object hydrator? But make extensible via the Open/Closed principle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.