Skip to content

Commit 0618b80

Browse files
authored
feat: php version bump to 8.2 (#5)
* chore: php version bump to 8.2 * chore: bump travis php version to 8.2 * style: added space between type * style: removed redundant comments * refactor: added type for uri * style: removed redundant comment * style: removed redundant comment * refactor: maxBufferLength is now readonly * refactor: removed redundant imports * refactor: renamed getUnpackedMiddleware -> unpackMiddleware * refactor: server property is now readonly * refactor: factory property is now readonly * refactor: removed redundant non-capturing group * refactor: added back non-capturing group * refactor: added return type to createUploadedFileFromSpec() * style: removed unnecessary curly braces in string * refactor: replaced substr with str_ends_with * refactor: updated parseCookieHeader regex pattern * chore: added suggestion for ext-fileinfo extension * style: unwrap unnecessary curly braces in strings * refactor: removed redundant default argument * refactor: renamed getFileAsStream -> createStreamFromFile * refactor: removed unused imports * refactor: added method return types * refactor: remove unused import * refactor: made request property readonly * refactor: add throws tag in method comment * style: add trailing comma to import list * refactor: replaced substr with str_ends_with * chore: travis ci php 8.2 support * chore: updated travis ci config * chore: update copyright year * chore: add github actions * fix: updated property * chore: bump phpunit version + add extensions * fix: removed json ext requirement * fix: updated phpunit version number * fix: pin composer version to 2.5.5 * fix: allow composer.lock * fix: added testsuite * chore: update ci workflow * chore: update ci workflow * fix: bash script path * fix: file path * chore: update text * fix: bash script step * fix: updated phpunit step * chore: updated file permissions * fix: added php version * fix: removed quotes * fix: switch to containerized builds * fix: add php 8.2 support * chore: update code coverage * chore: added coverage file support * chore: remove code cov * fix: docker container clean-up * chore: removed .travis.yml + updated badges * chore: update psr interfaces * docs: update copyright notice to present * chore: updated ci script * chore: updated ci script * chore: updated dev dependency * chore: removed outdated line * docs: updated return type in docblock * refactor: removed ServerRequestBuilder::fromSapi * docs: updated php version in prerequisites * refactor: removed unnecessary non-caputring group in regex * refactor: renamed getDecoratedCallableMiddleware -> createDecoratedCallableMiddleware * refactor: renamed getDecoratedMiddleware -> createDecoratedMiddleware * refactor: removed unused dependency * refactor: renamed getPreferredMediaParser -> createPreferredMediaParser * refactor: removed redundant dependency * refactor: added typehints * docs: removed redundant docblocks * refactor: removed unused dependency * refactor: updated Container typehints * refactor: added typehint + updated docblock * refactor: removed redundant test * refactor: added missing type * refactor: removed private methods and created parser + normalizer classes * refactor: moved media parsers into folder + updated namespace * refactor: moved Parser\ServerRequest -> Http\Parser * refactor: moved Parser\Media -> Http\Parser * refactor: added newline * refactor: moved Test\Parser -> Test\Http\Parser * test: added tests for UploadedFilesNormalizer * refactor: renamed CookieHeaderParser -> HttpCookieParser * test: added tests for HttpCookieParser * test: added test for UriParser * chore: directive to not run workflow in certain scenarios * chore: add coverage * chore: run on push * docs: added coverage badge * chore: add branch name * chore: remove branch env var * chore: replaced php-http/message-factory with psr/http-factory * chore: updated composer.lock file * feat: added registerControllers method for adding attriubte-based routes * feat: added Route class * refactor: created attribute router trait + split AbstractRouter * docs: updated readme
1 parent fe33a60 commit 0618b80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4920
-870
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
/.gitattributes export-ignore
55
/.gitignore export-ignore
6-
/.travis.yml export-ignore
76
/phpunit.xml export-ignore
87
/phpstan.neon export-ignore
9-
/test export-ignore
8+
/test export-ignore

.github/scripts/run-phpunit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
composer test-report

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Setup PHP
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: "8.2"
15+
- name: Install dependencies
16+
uses: php-actions/composer@v6
17+
with:
18+
version: 2.5.5
19+
20+
- name: Test & Coverage
21+
uses: paambaati/codeclimate-action@v4.0.0
22+
env:
23+
CC_TEST_REPORTER_ID: a053ec039e0f1be4176cff6646fe1e9fe4d410a828e30d925ff7db04cb459ef6
24+
with:
25+
coverageCommand: ./.github/scripts/run-phpunit.sh
26+
coverageLocations: coverage.xml:clover
27+
debug: true
28+
29+
- name: Clean up GitHub workspace
30+
uses: docker://ubuntu:latest
31+
with:
32+
args: find /github/workspace/. -name . -o -prune -exec rm -rf -- {} +

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
/.idea
33
.DS_Store
44
*.cache
5-
composer.lock
6-
clover.xml
5+
clover.xml

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# License
22

3-
### Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
3+
### Copyright (c) 2017-2023 Daniyal Hamid (https://designcise.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[![codecov](https://codecov.io/gh/designcise/bitframe/branch/master/graph/badge.svg?token=7V77L5P3AX)](https://codecov.io/gh/designcise/bitframe)
2-
[![Build Status](https://travis-ci.com/designcise/bitframe.svg?branch=master)](https://travis-ci.com/designcise/bitframe)
1+
[![CI](https://github.com/designcise/bitframe/actions/workflows/ci.yml/badge.svg)](https://github.com/designcise/bitframe/actions/workflows/ci.yml)
2+
[![Maintainability](https://api.codeclimate.com/v1/badges/b326e89aefecd26e60b8/maintainability)](https://codeclimate.com/github/designcise/bitframe/maintainability)
3+
[![Test Coverage](https://api.codeclimate.com/v1/badges/b326e89aefecd26e60b8/test_coverage)](https://codeclimate.com/github/designcise/bitframe/test_coverage)
34

45
# BitFrame PHP Microframework
56

@@ -12,6 +13,11 @@ A highly customizable PSR-15 / PSR-7 compatible middleware-based microframework
1213
6. Non-intrusive;
1314
7. Customizable, modular and easy-to-scale.
1415

16+
## Prerequisites
17+
18+
1. PHP 8.2+;
19+
2. Server with URL Rewriting (such as Apache, Nginx, etc.).
20+
1521
## How to Get Started?
1622

1723
You can get started in a few simple steps:
@@ -20,12 +26,7 @@ You can get started in a few simple steps:
2026
2. Install `composer` dependencies;
2127
3. Create your first "Hello World" app.
2228

23-
Also, please note the following prerequisites:
24-
25-
### Prerequisites
26-
27-
1. PHP 8.1+;
28-
2. Server with URL Rewriting (such as Apache, Nginx, etc.).
29+
For a complete example, have a look at the [simple dockerized boilerplate](https://github.com/designcise/bitframe-boilerplate).
2930

3031
### 1. Setup Your Environment
3132

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=8.1",
13+
"php": ">=8.2",
1414
"ext-json": "*",
1515
"psr/container": "^2.0",
16-
"psr/http-message": "^1.0",
17-
"php-http/message-factory": "^1.0",
16+
"psr/http-message": "^2.0",
17+
"psr/http-factory": "^1.0",
1818
"psr/http-server-middleware": "^1.0"
1919
},
2020
"require-dev": {
2121
"phpunit/phpunit": "^9.5",
2222
"mockery/mockery": "^1.3",
2323
"squizlabs/php_codesniffer": "3.*",
2424
"phpmd/phpmd": "@stable",
25-
"phpstan/phpstan": "*"
25+
"phpstan/phpstan": "*",
26+
"nyholm/psr7": "^1.8"
2627
},
2728
"suggest": {
29+
"ext-fileinfo": "For supporting embedded files when using BitFrame\\Http\\Message\\FileResponse",
2830
"ext-libxml": "For out-of-the-box XML support, please install libxml extension",
2931
"ext-simplexml": "For out-of-the-box XML support, please install simplexml extension",
3032
"nyholm/psr7": "Add PSR-7 / PSR-17 based HTTP Messaging support for your App",
@@ -35,7 +37,8 @@
3537
"style-fix": "vendor/bin/phpcbf --standard=PSR12 src",
3638
"check": "vendor/bin/phpstan analyse src --level=5 -c phpstan.neon",
3739
"md": "vendor/bin/phpmd src text cleancode,unusedcode,codesize,design,naming",
38-
"test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe"
40+
"test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe",
41+
"test-report": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe --coverage-clover=coverage.xml"
3942
},
4043
"autoload": {
4144
"psr-4": {

0 commit comments

Comments
 (0)