Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitattributes
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
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
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
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
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).
Comment thread
hakeemRash marked this conversation as resolved.
- 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
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
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.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
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
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
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)
16 changes: 16 additions & 0 deletions .github/dependabot.yml
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"
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [main]
pull_request:

Comment thread
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
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
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
54 changes: 54 additions & 0 deletions .gitignore
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
*~
16 changes: 16 additions & 0 deletions CHANGELOG.md
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.
Loading
Loading