Skip to content
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

[chore] Update project information #13

Merged
merged 3 commits into from
Apr 28, 2023
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
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
Expand Down Expand Up @@ -63,9 +60,6 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
Expand Down
54 changes: 26 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
# HTTP Accept
PHP Parser to deal with HTTP `Accept`, `Accept-Language`, `Accept-Encoding`, and `Accept-Charset` headers
[![Build](https://github.com/asispts/http-accept/actions/workflows/ci.yml/badge.svg)](https://github.com/asispts/http-accept/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/asispts/http-accept)](./LICENSE)

[![Build](https://github.com/pattisahusiwa/http-accept/workflows/Build/badge.svg?branch=master)](https://github.com/pattisahusiwa/http-accept/actions)
[![License](https://img.shields.io/github/license/pattisahusiwa/http-accept)](https://github.com/pattisahusiwa/http-accept/blob/master/LICENSE)
# `http-accept` parser
`http-accept` is a PHP parser designed to handle HTTP headers related to content negotiation. These headers include `Accept`, `Accept-Language`, `Accept-Encoding`, and `Content-Type`. The library provides parser classes for each of these headers, making it easy to extract the relevant information from incoming HTTP requests.

## Installation
Use [composer](https://getcomposer.org/) to install the library.
You can install this library using [composer](https://getcomposer.org/).
```bash
composer require hnet/http-accept
composer require asispts/http-accept
```

## Usage
To parse the different headers, use the corresponding parser class.

## Changelog
See [CHANGELOG.md](https://github.com/pattisahusiwa/http-accept/blob/master/CHANGELOG.md)
### Parse `Content-Type`
```php
$contentType = (new ContentTypeParser())->parse($source);
```

### Parse HTTP `Accept`
```php
$types = (new AcceptParser())->parse($source);
```

## Contributing
All form of contributions are welcome. You can [report issues](https://github.com/pattisahusiwa/http-accept/issues), fork the repo and [submit pull requests](https://github.com/pattisahusiwa/http-accept/pulls).
### Parse `Accept-Language`
```php
$languages = (new AcceptLanguageParser())->parse($source);
```

For major changes, please open an issue first to discuss what you would like to change.
### Parse `Accept-Encoding`
```php
$encodings = (new AcceptEncodingParser())->parse($source);
```

## Contributing
All forms of contributions are welcome, including bug reports, feature requests, and pull requests. If you plan to make major changes, please open an issue first to discuss what you would like to change.

## License
Released under [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0). See [LICENSE](https://github.com/pattisahusiwa/http-accept/blob/master/LICENSE) file for more details.

````txt
Copyright 2020 Asis Pattisahusiwa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
````
Released under [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0). See [LICENSE](./LICENSE) file for more details.
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "hnet/http-accept",
"description": "PHP Parser to deal with HTTP Accept, Accept-Language, Accept-Encoding, and Accept-Charset headers",
"name": "asispts/http-accept",
"description": "PHP Parser to deal with HTTP Accept, Accept-Language, Accept-Encoding, and Content-Type headers",
"keywords": [
"http",
"http accept",
"Accept",
"Accept-Language",
"Accept-Encoding",
"Accept-Charset"
"http-headers",
"http-header-parser",
"accept",
"accept-language",
"accept-encoding",
"content-type"
],
"type": "library",
"license": "Apache-2.0",
Expand Down Expand Up @@ -35,18 +35,18 @@
"HttpAccept\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"HttpAccept\\Tests\\": "tests"
}
},
"require": {
"php": ">=7.2"
"php": "^7.2|^8.0"
},
"require-dev": {
"asispts/ptscs": "^1.0",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5|^9.5"
},
"extra": {
"branch-alias": {
"dev-master": "0.2-dev"
}
}
}