-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a89eb1f
Showing
14 changed files
with
5,717 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,131 @@ | ||
name: "Code Integration Checks" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --ignore-platform-req=php" | ||
|
||
jobs: | ||
|
||
# Checks for code style issues | ||
cs-fixer: | ||
name: "Style Checks by PHPCsFixer" | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
dependencies: | ||
- "locked" | ||
php-version: | ||
- "7.4" | ||
operating-system: | ||
- "ubuntu-latest" | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "pcov" | ||
php-version: "${{ matrix.php-version }}" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2 | ||
- name: "Cache dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.composer/cache | ||
vendor | ||
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
- name: "Install highest dependencies" | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
- name: "Install locked dependencies" | ||
if: ${{ matrix.dependencies == 'locked' }} | ||
run: "composer install ${{ env.COMPOSER_FLAGS }}" | ||
- name: "Coding Standard" | ||
run: "vendor/bin/php-cs-fixer fix --dry-run -v" | ||
|
||
# This job statically analyses the code looking for errors | ||
psalm: | ||
name: "Static Analysis by Psalm" | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
dependencies: | ||
- "locked" | ||
php-version: | ||
- "7.4" | ||
operating-system: | ||
- ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "pcov" | ||
php-version: "${{ matrix.php-version }}" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2 | ||
- name: "Cache Dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.composer/cache | ||
vendor | ||
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
- name: "Install highest dependencies" | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
- name: "Install locked dependencies" | ||
if: ${{ matrix.dependencies == 'locked' }} | ||
run: "composer install ${{ env.COMPOSER_FLAGS }}" | ||
- name: "psalm" | ||
run: "vendor/bin/psalm --shepherd --stats" | ||
|
||
# This job runs the test suite of the codebase | ||
phpunit: | ||
name: "Unit Tests by PHPUnit" | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
dependencies: | ||
- "highest" | ||
- "locked" | ||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
operating-system: | ||
- "ubuntu-latest" | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "pcov" | ||
php-version: "${{ matrix.php-version }}" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2 | ||
- name: "Cache dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.composer/cache | ||
vendor | ||
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | ||
- name: "Install highest dependencies" | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
- name: "Install locked dependencies" | ||
if: ${{ matrix.dependencies == 'locked' }} | ||
run: "composer install ${{ env.COMPOSER_FLAGS }}" | ||
- name: "Tests" | ||
run: "vendor/bin/phpunit" |
This file contains 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,3 @@ | ||
vendor | ||
cache | ||
.php-cs-fixer.cache |
This file contains 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,27 @@ | ||
<?php | ||
|
||
$header = <<<EOF | ||
@project Castor Uri | ||
@link https://github.com/castor-labs/uri | ||
@package castor/uri | ||
@author Matias Navarro-Carter [email protected] | ||
@license MIT | ||
@copyright 2021 CastorLabs Ltd | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'declare_strict_types' => true, | ||
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc'], | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__.'/src') | ||
->in(__DIR__.'/tests') | ||
) | ||
; |
This file contains 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 @@ | ||
Copyright 2021 CastorLabs Ltd | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions | ||
of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains 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 @@ | ||
test: | ||
XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-text | ||
|
||
lint: | ||
vendor/bin/php-cs-fixer fix | ||
|
||
type-check: | ||
vendor/bin/psalm --stats --no-cache --show-info=true |
This file contains 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 @@ | ||
Castor Uri | ||
========== | ||
|
||
RFC 3986 compliant uri value object | ||
|
||
## Installation | ||
|
||
You can install the latest stable version with: | ||
|
||
```bash | ||
composer require castor/uri | ||
``` | ||
|
||
## Documentation | ||
|
||
Documentation is available in Markdown format [here](docs/00-intro.md). |
This file contains 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": "castor/uri", | ||
"description": "RFC 3986 compliant uri value object", | ||
"minimum-stability": "stable", | ||
"license": "MIT", | ||
"keywords": ["php", "uri", "rfc386", "php7"], | ||
"authors": [ | ||
{ | ||
"name": "Matias Navarro Carter", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"config": { | ||
"platform": { | ||
"php": "7.4" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=7.4", | ||
"castor/std": "^0.1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Castor\\Net\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Castor\\Net\\": "tests" | ||
} | ||
}, | ||
"require-dev": { | ||
"roave/security-advisories": "dev-latest", | ||
"friendsofphp/php-cs-fixer": "^3.0", | ||
"phpunit/phpunit": "^9.5", | ||
"vimeo/psalm": "^4.6" | ||
} | ||
} |
Oops, something went wrong.