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

Release v2.0.0 #4

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
798f652
Remove old vagrant dev environment
hollodotme Jan 26, 2022
0e96c87
Remove travis-CI config
hollodotme Jan 26, 2022
ed3509c
Update license dates
hollodotme Jan 26, 2022
0d00b4b
Remove tooly, update php requirement, add security advisories
hollodotme Jan 26, 2022
ca2cf72
Remove composer lockfile
hollodotme Jan 26, 2022
705c7e6
Add local docker-compose development environment
hollodotme Jan 26, 2022
36fe0db
Remove old build/test configs
hollodotme Jan 26, 2022
1c1f9ad
Switch docker image to PHP 8.0
hollodotme Jan 27, 2022
ebc347b
Remove obsolete tools
hollodotme Jan 27, 2022
f581ca1
Add PHPStan config
hollodotme Jan 27, 2022
66c94ab
Adapt make file
hollodotme Jan 27, 2022
01a5dd3
Update ignored files according new dev environment
hollodotme Jan 27, 2022
9055399
Update contribution information
hollodotme Jan 27, 2022
3abd9b8
Rename exceptions & inherit from SPL exceptions
hollodotme Jan 27, 2022
4e1625d
Rename and refine interfaces
hollodotme Jan 27, 2022
184932f
Move and refine feedbacks
hollodotme Jan 27, 2022
1ce0a46
Refine security token
hollodotme Jan 27, 2022
4f74bc5
Refine Form ID
hollodotme Jan 27, 2022
4c4ff63
Refine Form
hollodotme Jan 27, 2022
8b1f8c1
Update changelog & documentation
hollodotme Jan 27, 2022
07f7aea
Add GitHub actions workflow for QA
hollodotme Jan 27, 2022
e802ff8
Reduce installed extensions
hollodotme Jan 27, 2022
c2c2e49
Add GitHub actions badge
hollodotme Jan 27, 2022
b79d372
Fix visibility of private constructors
hollodotme Jan 27, 2022
9a5b975
Fix return type of named constructors
hollodotme Jan 27, 2022
dd494e1
Fix inheritance of feedback and form ID
hollodotme Jan 27, 2022
a494ea5
Fix changelog
hollodotme Jan 28, 2022
1fad3c8
Add method to compare form ID instances with each other
hollodotme Feb 3, 2022
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
8 changes: 8 additions & 0 deletions .docker/development/php/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM php:8.0-cli-alpine AS builder

RUN set -ex && apk update && apk upgrade --available

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN set -ex && install-php-extensions json-stable xdebug-stable

FROM builder AS console
37 changes: 37 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @contributors

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
# *.js @js-owner

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
# *.go [email protected]

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
# /build/logs/ @doctocat

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
# docs/* [email protected]

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
# apps/ @octocat

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
# /docs/ @doctocat
44 changes: 29 additions & 15 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,53 @@ We accept contributions via pull requests on [GitHub](http://github.com/icehawk/

## Issues

- Please report issues here on [GitHub](http://github.com/icehawk/icehawk/forms)
- Please report issues here on [GitHub](http://github.com/icehawk/forms)

## Pull Requests

- **Add tests!** - Your patch will not be accepted if it does not have tests.

- **Document any change in behaviour** - Make sure the documentation in `README.md` and the `CHANGELOG.md` is kept up-to-date.

- **Consider our release cycle** - We follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **Consider our release cycle** - We follow [SemVer v2.0.0](http://semver.org). Randomly breaking public APIs is not an option.

- **Create topic branches** - Do not ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, please send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

---

## Running tests
## Install development environment

```bash
$ php vendor/bin/phpunit.phar -c build/
```
### What you need

This includes a code coverage report in HTML and Clover XML.
* [docker](https://docs.docker.com/get-docker/)
* [docker-compose](https://docs.docker.com/compose/install/)
* [GNU make](https://www.gnu.org/software/make/)

## Analyze code
### Install development environment

```bash
$ php vendor/bin/phpmetrics.phar --report-html=build/logs/phpmetrics src/
```
* Clone repository
```bash
git clone https://github.com/icehawk/forms
```

## Create API documentation
* Run `make install-dev`

```bash
$ php vendor/bin/phpdox.phar -f build/phpdox.xml
```
### Update development environment

* Run `make update`
* This updates:
* Docker image builds
* PHAR tools via PHIVE
* composer dependencies

### Run tests

* Run `make tests`
* This executes:
* PHP linting
* PHPStan
* PHPUnit incl. coverage report to `tests/clover.xml`
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
2.
3.

## Specifications

- Package version:
- Platform/OS:
- Subsystem:

## Further comments
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Fixes #`<issue-number>`

## Proposed Changes

-
-
-

## Further comments
69 changes: 69 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: QA

on:
push:
branches:
- master
- development
- "v1.x-*"
- "feature/*"
- "issue/*"
tags:
- 'v*.*.*'
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install tools via PHIVE
run: make install-tools

- name: Check for PHP parse errors
run: make phplint

- name: Composer install
run: make composer-install-dev

- name: Run PHPStan
run: make phpstan

- name: Run PHPUnit
run: make phpunit

- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: clover-report
path: tests/clover.xml

release:
runs-on: ubuntu-latest
needs:
- run-tests
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Extract version
id: data
run: |
# Strip git ref prefix from version
RELEASE_VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && RELEASE_VERSION=$(echo $RELEASE_VERSION | sed -e 's/^v//')

echo $RELEASE_VERSION
echo "##[set-output name=version;]$RELEASE_VERSION"

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Version ${{ steps.data.outputs.version }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 8 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
.idea

# vagrant
.vagrant/
vagrant

# composer
vendor/

# locally generated docs
build/api/
build/phpdox/
build/logs/
/.idea
/.tools/*
/vendor/
/composer.lock
/tests/.coverage-cache
/tests/clover.xml
/tests/.phpunit.result.cache
!.gitkeep
6 changes: 6 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^9.5.13" installed="9.5.13" location="./.tools/phpunit.phar" copy="true"/>
<phar name="phpstan" version="^1.4.2" installed="1.4.2" location="./.tools/phpstan.phar" copy="true"/>
<phar name="composer" version="^2.2.5" installed="2.2.5" location="./.tools/composer.phar" copy="true"/>
</phive>
1 change: 1 addition & 0 deletions .tools/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Keep this directory
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

Loading