Skip to content

matteosister/patch-manager

Repository files navigation

Patch Manager

PHP Version Scrutinizer Code Quality Code Coverage Build Status Packagist Version Packagist Downloads

A php library to manage PATCH requests in a standardized (and elegant) way

Be careful!!!

From version 0.3 namespace will change from PatchManager\... to Cypress\PatchManager\...

Install

Install with composer

composer require cypresslab/patch-manager

The idea for this library comes from this blog post: Please. Don't Patch Like An Idiot. by William Durand

It lets you patch resources in an expressive way

PATCH /users/1

{ "op": "data", "property": "username", "value": "new username" }

And let you patch entire collections with multiple operations

PATCH /books

[{ "op": "set_as_read" }, { "op": "return_to_library", "address": "221 B Baker St, London, England"}]

it includes also a Symfony bundle

Still interested? Head over to the wiki... for documentation

Useful commands for development

  • composer format: runs php-cs-fixer
  • composer analyse: runs phpstan for static analysis
  • composer test: runs phpunit