Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from sunrise-php/release/v2.0.1
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
fenric authored Apr 17, 2022
2 parents a8d1b0e + ac98377 commit 1b8267a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@ jobs:
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --no-suggest --prefer-source
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php72:
docker:
- image: circleci/php:7.2-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --no-suggest --prefer-source
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php73:
docker:
- image: circleci/php:7.3-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --no-suggest --prefer-source
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php74:
docker:
- image: circleci/php:7.4-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --no-suggest --prefer-source
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php80:
docker:
- image: circleci/php:8.0-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --no-suggest --prefer-source
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
workflows:
version: 2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/phpbench.json
/phpcs.xml
/phpunit.xml
/psalm.xml
/vendor/
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## HTTP factory for PHP 7.1+ based on PSR-17
# HTTP factory for PHP 7.1+ based on PSR-17

[![Build Status](https://circleci.com/gh/sunrise-php/http-factory.svg?style=shield)](https://circleci.com/gh/sunrise-php/http-factory)
[![Code Coverage](https://scrutinizer-ci.com/g/sunrise-php/http-factory/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-factory/?branch=master)
Expand Down Expand Up @@ -28,11 +28,7 @@ use Sunrise\Http\Factory\UriFactory;
// just use PSR-17 methods...
```

#### HTTP headers as objects

* https://github.com/sunrise-php/http-header-kit

#### Based on the following packages
## Based on the following packages

* https://github.com/sunrise-php/http-message
* https://github.com/sunrise-php/http-server-request
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{
"name": "sunrise/http-factory",
"homepage": "https://github.com/sunrise-php/http-factory",
"description": "Sunrise // HTTP factory for PHP 7.1+ based on PSR-17",
"description": "HTTP factory for PHP 7.1+ based on PSR-17",
"license": "MIT",
"keywords": [
"fenric",
"sunrise",
"http",
"http-factory",
"factory",
"psr-7",
"psr-17",
"php7",
"php8"
],
"authors": [
{
"name": "Anatoly Fenric",
"email": "anatoly@fenric.ru",
"homepage": "https://anatoly.fenric.ru/"
"email": "afenric@gmail.com",
"homepage": "https://github.com/fenric"
}
],
"provide": {
"psr/http-factory-implementation": "1.0"
},
"require": {
"php": "^7.1|^8.0",
"sunrise/http-message": "^2.0",
Expand All @@ -30,9 +34,6 @@
"phpunit/phpunit": "7.5.20|9.5.0",
"sunrise/coding-standard": "1.0.0"
},
"provide": {
"psr/http-factory-implementation": "1.0"
},
"autoload": {
"psr-4": {
"Sunrise\\Http\\Factory\\": "src/"
Expand All @@ -41,6 +42,7 @@
"scripts": {
"test": [
"phpcs",
"psalm",
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
],
"build": [
Expand Down
7 changes: 5 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Sunrise.HttpFactory">
<testsuite name="sunrise/http-factory">
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand Down
14 changes: 14 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
24 changes: 6 additions & 18 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,58 +30,46 @@ class FactoryTest extends TestCase
*/
public function testRequestFactory() : void
{
$factory = new RequestFactory();

$this->assertInstanceOf(RequestFactoryInterface::class, $factory);
$this->assertInstanceOf(RequestFactoryInterface::class, new RequestFactory());
}

/**
* @return void
*/
public function testResponseFactory() : void
{
$factory = new ResponseFactory();

$this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
$this->assertInstanceOf(ResponseFactoryInterface::class, new ResponseFactory());
}

/**
* @return void
*/
public function testServerRequestFactory() : void
{
$factory = new ServerRequestFactory();

$this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
$this->assertInstanceOf(ServerRequestFactoryInterface::class, new ServerRequestFactory());
}

/**
* @return void
*/
public function testStreamFactory() : void
{
$factory = new StreamFactory();

$this->assertInstanceOf(StreamFactoryInterface::class, $factory);
$this->assertInstanceOf(StreamFactoryInterface::class, new StreamFactory());
}

/**
* @return void
*/
public function testUploadedFileFactory() : void
{
$factory = new UploadedFileFactory();

$this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
$this->assertInstanceOf(UploadedFileFactoryInterface::class, new UploadedFileFactory());
}

/**
* @return void
*/
public function testUriFactory() : void
{
$factory = new UriFactory();

$this->assertInstanceOf(UriFactoryInterface::class, $factory);
$this->assertInstanceOf(UriFactoryInterface::class, new UriFactory());
}
}

0 comments on commit 1b8267a

Please sign in to comment.