Code Monkey home page Code Monkey logo

antidot-framework's Introduction

Antidot Framework

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status Maintainability

This package contains core components to make Antidot Framework work.

  • PSR-15 Middleware
  • Router
  • Server
  • Error Handlers

Requirements

v2.x.x

  • PHP >= 8.1

v1.x.x

  • PHP >= 7.4.0

Installation

composer require antidot-fw/framework

Usage

Take a look at Getting Started Guide in our Docs Site.

antidot-framework's People

Contributors

dependabot[bot] avatar kpicaza avatar peter279k avatar pksunkara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

antidot-framework's Issues

PHP 8.1 support

We will check the compatibility of every dependency, and make a list with the ones that have any issues, then we will try to help other maintainers to get up to date on the packages. Also, we have to check if we are using something at the library level that causes issues between the lowest and highest versions supported.

Error Creating response in nginx

Describe the bug

When $_SERVER variable has a non-string value Zend Diactoros REsponse factory throws an invalid argument exception.

Prepare mutation testing analysis

Is your feature request related to a problem? Please describe.
We need to know if our test suite really protect us from bad changes

Allow passing psalm at level 1

Is your feature request related to a problem? Please describe.
Making a psalm check at level 1 shows 31 errors.

Describe the solution you'd like
Having 0 type errors will give better stability to the framework library.

Antidot\Application\Http\Application interface should be mixed $middleware

Describe the bug
The $middleware parameter should be multiple types.

To Reproduce
Steps to reproduce the behavior:

  1. Running composer create-project antidot-fw/antidot-framework-starter project-name command.
  2. Opening the ./router/routes.php file.
  3. Looking at following comments on ./router/routes.php file:
/**
 * Setup routes with a single request method:
 *
 * $app->get('/', App\Handler\HomePageHandler::class, 'home');
 * $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create');
 * $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put');
 * $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch');
 * $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete');
 *
 * Or with multiple request methods:
 *
 * $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact');
 */
**Expected behavior**
The `$app->get` method can allow array or string type for second parameter (`$middleware`).

But above method only allows the `array` type for `$middleware` parameter.

** Result behavior**
App\Application\Http\Handler\ApiPage

<?php
class ApiPage implements RequestHandlerInterface { }
<?php
class ApiPage implements RequestHandlerInterface
Expected type 'array'. Found 'string'.

And the error log is as follows:

[Tue Jan 19 19:27:41 2021] 127.0.0.1:54546 [500]: GET /api - Uncaught TypeError: Argument 2 passed to Antidot\Application\Http\WebServerApplication::get() must be of the type array, string given, called in /data/cloud-printer-api/router/routes.php on line 26 and defined in /data/cloud-printer-api/vendor/antidot-fw/framework/src/Application/Http/WebServerApplication.php:43
Stack trace:
#0 /data/cloud-printer-api/router/routes.php(26): Antidot\Application\Http\WebServerApplication->get()
#1 /data/cloud-printer-api/public/index.php(26): {closure}()
#2 /data/cloud-printer-api/public/index.php(28): {closure}()
#3 {main}
  thrown in /data/cloud-printer-api/vendor/antidot-fw/framework/src/Application/Http/WebServerApplication.php on line 43

Additional context
N/A

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.