-
Notifications
You must be signed in to change notification settings - Fork 0
Open-source the PhpServicePlatform HTTP layer #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ab61aa9
Open-source the PhpServicePlatform HTTP layer
hakeemRash 82ca7fc
ci: silence pre-existing PHPStan generics/null-coalesce (carried from…
hakeemRash 51a8394
ci: require PHP 8.4 (Symfony 8 needs >=8.4.1); drop 8.2/8.3 from matrix
hakeemRash c4b0a2c
release: add dev-master branch alias (1.0.x-dev) and tag-triggered Re…
hakeemRash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Keep the composer dist tarball lean — exclude dev-only files from `composer install` | ||
| /.github export-ignore | ||
| /tests export-ignore | ||
| /.gitattributes export-ignore | ||
| /.gitignore export-ignore | ||
| /phpunit.xml export-ignore | ||
| /phpstan.neon export-ignore | ||
| /CONTRIBUTING.md export-ignore | ||
| /CHANGELOG.md export-ignore | ||
| /CODE_OF_CONDUCT.md export-ignore | ||
| /SECURITY.md export-ignore | ||
| /SUPPORT.md export-ignore | ||
|
|
||
| * text=auto eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Code owners — required reviewers for every change into `main`. | ||
| # A PR needs approval from at least one of these owners (branch protection | ||
| # enforces 1 code-owner review). Authors cannot approve their own PR, so keep | ||
| # more than one owner listed. | ||
| * @hakeemRash @Alshatri @craftdevscommunity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Bug report | ||
| description: Report a defect in alfacode-team/http | ||
| labels: ["bug"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for taking the time to file a report. Please do **not** report | ||
| security issues here — see the [Security Policy](../SECURITY.md). | ||
| - type: textarea | ||
| id: what-happened | ||
| attributes: | ||
| label: What happened? | ||
| description: A clear description of the bug, including the expected vs. actual result. | ||
| placeholder: When I call Response::json(...) with ..., I get ... but expected ... | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: reproduction | ||
| attributes: | ||
| label: Steps to reproduce | ||
| description: A minimal code snippet that reproduces the problem. | ||
| render: php | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: version | ||
| attributes: | ||
| label: Package version | ||
| placeholder: "1.0.0" | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: php-version | ||
| attributes: | ||
| label: PHP version | ||
| placeholder: "8.4.0" | ||
| validations: | ||
| required: true | ||
| - type: dropdown | ||
| id: sapi | ||
| attributes: | ||
| label: Runtime | ||
| options: | ||
| - PHP-FPM / mod_php | ||
| - CLI | ||
| - OpenSwoole / Swoole | ||
| - Other | ||
| validations: | ||
| required: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| blank_issues_enabled: false | ||
| contact_links: | ||
| - name: Questions & usage help | ||
| url: https://github.com/AlfaCode-Team/http/discussions | ||
| about: Ask usage questions in Discussions instead of opening an issue. | ||
| - name: Security vulnerability | ||
| url: https://github.com/AlfaCode-Team/http/security/advisories/new | ||
| about: Report security issues privately — never in a public issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Feature request | ||
| description: Suggest an idea or improvement for alfacode-team/http | ||
| labels: ["enhancement"] | ||
| body: | ||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: What problem does this solve? | ||
| description: Describe the use case and why the current API falls short. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: proposal | ||
| attributes: | ||
| label: Proposed API | ||
| description: Sketch the method(s) / behaviour you have in mind. | ||
| render: php | ||
| validations: | ||
| required: false | ||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives considered | ||
| validations: | ||
| required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <!-- Thanks for contributing! Please fill this out so we can review quickly. --> | ||
|
|
||
| ## Summary | ||
|
|
||
| <!-- What does this PR change and why? --> | ||
|
|
||
| ## Related issue | ||
|
|
||
| <!-- e.g. Closes #123 --> | ||
|
|
||
| ## Type of change | ||
|
|
||
| - [ ] Bug fix (non-breaking change that fixes an issue) | ||
| - [ ] New feature (non-breaking change that adds functionality) | ||
| - [ ] Breaking change (fix or feature that changes existing behaviour) | ||
| - [ ] Documentation only | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] I ran `composer check` (PHPStan + PHPUnit) and it passes | ||
| - [ ] I added/updated tests for my change | ||
| - [ ] Public mutators remain immutable (return a new instance, never mutate `$this`) | ||
| - [ ] No hidden globals introduced (dependencies are passed in) | ||
| - [ ] I updated the `CHANGELOG.md` (Unreleased section) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "composer" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - "dependencies" | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| labels: | ||
| - "dependencies" | ||
| - "ci" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
|
hakeemRash marked this conversation as resolved.
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php: ['8.4'] | ||
|
|
||
| name: PHP ${{ matrix.php }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| extensions: mbstring, ctype, json, fileinfo | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Validate composer.json | ||
| run: composer validate --strict | ||
|
|
||
| - name: Install dependencies | ||
| run: composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Static analysis | ||
| run: composer analyse | ||
|
|
||
| - name: Tests | ||
| run: composer test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| name: Test | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| extensions: mbstring, ctype, json, fileinfo | ||
| coverage: none | ||
| tools: composer:v2 | ||
| - run: composer validate --strict | ||
| - run: composer update --prefer-dist --no-interaction --no-progress | ||
| - run: composer analyse | ||
| - run: composer test | ||
|
|
||
| release: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| name: Publish GitHub Release | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Create release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| gh release create "${GITHUB_REF_NAME}" \ | ||
| --title "${GITHUB_REF_NAME}" \ | ||
| --generate-notes \ | ||
| --verify-tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # ── COMPOSER ────────────────────────────────────────────────── | ||
| /vendor/ | ||
| # Library: the lock file is not committed (apps commit theirs). | ||
| composer.lock | ||
|
|
||
|
|
||
| # ── TESTING & COVERAGE ──────────────────────────────────────── | ||
| /.phpunit.cache/ | ||
| .phpunit.result.cache | ||
| /coverage/ | ||
| /coverage-html/ | ||
| coverage.xml | ||
| clover.xml | ||
| infection.log | ||
|
|
||
|
|
||
| # ── STATIC ANALYSIS & REFACTORING CACHES ────────────────────── | ||
| .php-cs-fixer.cache | ||
| /.phpstan.cache/ | ||
| /.rector/ | ||
| phpstan-results.json | ||
|
|
||
|
|
||
| # ── PROFILING & DEBUGGING (Xdebug) ──────────────────────────── | ||
| cachegrind.out.* | ||
| xdebug.log | ||
| error_log | ||
| php_errors.log | ||
|
|
||
|
|
||
| # ── BUILD ARTIFACTS ─────────────────────────────────────────── | ||
| /build/ | ||
| /dist/ | ||
| *.phar | ||
|
|
||
|
|
||
| # ── ENVIRONMENT ─────────────────────────────────────────────── | ||
| .env | ||
| .env.*.local | ||
|
|
||
|
|
||
| # ── OS & IDEs ───────────────────────────────────────────────── | ||
| .DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
| Icon | ||
| ._* | ||
| Thumbs.db | ||
| ehthumbs.db | ||
| /.idea/ | ||
| /.vscode/ | ||
| *.swp | ||
| *.swo | ||
| *~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to `alfacode-team/http` are documented here. The format is | ||
| based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project | ||
| adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
|
|
||
| - Initial extraction of the PhpServicePlatform kernel HTTP layer into a standalone, | ||
| MIT-licensed package. | ||
| - Immutable `Request` and single-type `Response` value objects. | ||
| - PSR-7 `Uri`, host-aware `SiteUri`, Accept-* `Negotiate`, HTTP `Method` enum, | ||
| `UserAgent` parser, FPM-/Swoole-safe `UploadedFile`. | ||
| - `Contracts\RequestAware` seam and `Concerns\ManagesResponse` shared accessors. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.