GithubHelp home page GithubHelp logo

chubbyphp / chubbyphp-negotiation Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 109 KB

A simple negotiation library.

License: MIT License

PHP 100.00%
accept accept-language content-negotiation content-type-based-versioning negotiation

chubbyphp-negotiation's Introduction

petstore

CI Coverage Status Mutation testing badge

Description

A simple skeleton to build api's based on the chubbyphp-framework.

Requirements

Environment

Add the following environment variable to your system, for example within ~/.bash_aliases:

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

Docker

docker-compose up -d
docker-compose exec php bash

Urls

Pet

DBs

  • jdbc:postgresql://localhost:5432/petstore?user=root&password=root

Installation

Through Composer as chubbyphp/petstore.

composer create-project chubbyphp/petstore myproject "dev-chubbyphp"

Setup

composer setup:dev

Structure

Collection

Collections are sortable, filterable paginated lists of models.

Dto

A DTO, or Data Transfer Object, is a simple object used to transport data between software application components.

Middleware

Middleware functions can execute code, make changes to the request and response objects. Middleware can generally be added globally or on a per-route basis.

Model

Models, entities, documents what ever fits your purpose the best.

ORM

ORM Mapping definitions.

Parsing

Parses and validates data against predefined schemas, ensuring that incoming data conforms to expected structures and criteria.

Repository

Repositories get data from storages like databases, elasticsearch, redis or whereever your models are stored or cached.

RequestHandler

RequestHandler alias Controller, or Controller actions to be more precise. There is a directory with generic crud controllers. If you like the idea adapt them for your generic use case, if not drop them. I highly recommend to not extend them.

ServiceFactory

Service factories are the glue code of the dependeny injection container.

Copyright

2024 Dominik Zogg

chubbyphp-negotiation's People

Contributors

dominikzogg avatar haeber avatar mavimo avatar timesplinter avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

chubbyphp-negotiation's Issues

BC in the NegotiatorInterface

In the version 1.8.1 BC was introduced with changing the return type of the method negotiate

-    public function negotiate(Request $request);
+    public function negotiate(Request $request): ?NegotiatedValueInterface;

AcceptNegotiator.php string handling

chubbyphp-negotiation/src/AcceptNegotiator.php:98 has an unsafe explode which can throw notices if the accept header string does not contain any slash

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.