Giter Site home page Giter Site logo

http-query-builder's Introduction

http-query-builder

Replacement of http_build_query to allow the same parameter multiple times.

Requirements

This package requires PHP 7.4 or higher.

Installation

This package can be used in any PHP project or with any framework.

You can install the package via composer:

composer require vdhicts/http-query-builder

Usage

The problem with the build-in http_build_query method is that it doesn't accept the same parameter multiple times. When you need to consume an API that uses those parameters (for example FastAPI supports it), this package comes in handy.

Getting started

use Vdhicts\HttpQueryBuilder\Builder;

$builder = (new Builder())
    ->add('filter', 'a:1')
    ->add('filter', 'b:2');
echo $builder; // filter=a%3A1&filter=b%3A2

Tests

Unit tests are available in the tests folder. Run with:

composer test

When you want a code coverage report which will be generated in the build/report folder. Run with:

composer test-coverage

Contribution

Any contribution is welcome, but it should meet the PSR-2 standard and please create one pull request per feature/bug. In exchange, you will be credited as contributor on this page.

Security

If you discover any security related issues in this or other packages of Vdhicts, please email [email protected] instead of using the issue tracker.

License

This package is open-sourced software licensed under the MIT license.

About Vdhicts

Vdhicts is the name of my personal company for which I work as freelancer. Vdhicts develops and implements IT solutions for businesses and educational institutions.

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.