Skip to content

Commit fd27cc1

Browse files
committed
Init repo
0 parents  commit fd27cc1

15 files changed

+414
-0
lines changed

.docheader

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* @see https://github.com/open-code-modeling/php-filter for the canonical source repository
3+
* @copyright https://github.com/open-code-modeling/php-filter/blob/master/COPYRIGHT.md
4+
* @license https://github.com/open-code-modeling/php-filter/blob/master/LICENSE.md MIT License
5+
*/

.github/workflows/integration.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Testing PHP Filter
2+
on: [push, pull_request]
3+
4+
jobs:
5+
tests:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
php-version:
10+
- "7.4"
11+
os: [ubuntu-latest]
12+
experimental: [false]
13+
include:
14+
- php-version: "8.0"
15+
os: ubuntu-latest
16+
experimental: true
17+
runs-on: ${{ matrix.os }}
18+
name: PHP ${{ matrix.php-version }} Test on ${{ matrix.os }}
19+
continue-on-error: ${{ matrix.experimental }}
20+
steps:
21+
- name: "Checkout"
22+
uses: actions/checkout@v2
23+
24+
- name: "Install PHP"
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: "${{ matrix.php-version }}"
28+
coverage: xdebug
29+
30+
- name: Get composer cache directory
31+
id: composercache
32+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33+
34+
- name: Cache composer dependencies
35+
uses: actions/cache@v2
36+
with:
37+
path: ${{ steps.composercache.outputs.dir }}
38+
# Use composer.json for key, if composer.lock is not committed.
39+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
41+
restore-keys: ${{ runner.os }}-composer-
42+
43+
- name: Install Composer dependencies
44+
run: |
45+
composer install --no-progress --prefer-dist --optimize-autoloader
46+
47+
- name: Run Tests
48+
run: php vendor/bin/phpunit --coverage-text
49+
50+
coding-standard:
51+
name: Coding Standard
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Setup PHP
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: '7.4'
61+
62+
- name: Get composer cache directory
63+
id: composercache
64+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
65+
66+
- name: Cache composer dependencies
67+
uses: actions/cache@v2
68+
with:
69+
path: ${{ steps.composercache.outputs.dir }}
70+
# Use composer.json for key, if composer.lock is not committed.
71+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
72+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
73+
restore-keys: ${{ runner.os }}-composer-
74+
75+
- name: Install dependencies
76+
run: composer install --no-progress --prefer-dist --optimize-autoloader
77+
78+
- name: PHP CodeSniffer
79+
run: composer cs
80+
81+
static-analysis:
82+
name: Static Analysis
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v2
87+
88+
- name: Setup PHP
89+
uses: shivammathur/setup-php@v2
90+
with:
91+
php-version: '7.4'
92+
93+
- name: Get composer cache directory
94+
id: composercache
95+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
96+
97+
- name: Cache composer dependencies
98+
uses: actions/cache@v2
99+
with:
100+
path: ${{ steps.composercache.outputs.dir }}
101+
# Use composer.json for key, if composer.lock is not committed.
102+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
103+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
104+
restore-keys: ${{ runner.os }}-composer-
105+
106+
- name: Install dependencies
107+
run: composer install --no-progress --prefer-dist --optimize-autoloader
108+
109+
- name: Static Analysis using PHPStan
110+
run: composer analyse
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Alternate workflow example.
2+
# This one is identical to the one in release-on-milestone.yml, with one change:
3+
# the Release step uses the ORGANIZATION_ADMIN_TOKEN instead, to allow it to
4+
# trigger a release workflow event. This is useful if you have other actions
5+
# that intercept that event.
6+
7+
name: "Automatic Releases"
8+
9+
on:
10+
milestone:
11+
types:
12+
- "closed"
13+
14+
jobs:
15+
release:
16+
name: "GIT tag, release & create merge-up PR"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v2"
22+
23+
- name: "Release"
24+
uses: "laminas/automatic-releases@v1"
25+
with:
26+
command-name: "laminas:automatic-releases:release"
27+
env:
28+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
29+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
30+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
31+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
32+
33+
- name: "Create Merge-Up Pull Request"
34+
uses: "laminas/automatic-releases@v1"
35+
with:
36+
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
37+
env:
38+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
39+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
40+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
41+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
42+
43+
- name: "Create and/or Switch to new Release Branch"
44+
uses: "laminas/automatic-releases@v1"
45+
with:
46+
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
47+
env:
48+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
49+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
50+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
51+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
52+
53+
- name: "Bump Changelog Version On Originating Release Branch"
54+
uses: "laminas/automatic-releases@v1"
55+
with:
56+
command-name: "laminas:automatic-releases:bump-changelog"
57+
env:
58+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
59+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
60+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
61+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
62+
63+
- name: "Create new milestones"
64+
uses: "laminas/automatic-releases@v1"
65+
with:
66+
command-name: "laminas:automatic-releases:create-milestones"
67+
env:
68+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
69+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
70+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
71+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.env
2+
app.env
3+
.phpunit.result.cache
4+
build/*
5+
vendor/
6+
composer.lock
7+
.idea
8+
.php_cs.cache

.php_cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$config = new Prooph\CS\Config\Prooph();
4+
$config->getFinder()->in(__DIR__);
5+
6+
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
7+
8+
$config->setCacheFile($cacheDir . '/.php_cs.cache');
9+
10+
return $config;

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4+
5+
## 0.1.0 - TBD
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- Nothing.
14+
15+
### Deprecated
16+
17+
- Nothing.
18+
19+
### Removed
20+
21+
- Nothing.
22+
23+
### Fixed
24+
25+
- Nothing.

COPYRIGHT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2020 Sandro Keil

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2020 Sandro Keil
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# PHP Filter
2+
3+
Common PHP filters for code generation.
4+
5+
## Installation
6+
7+
```bash
8+
$ composer require open-code-modeling/php-filter --dev
9+
```

composer.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "open-code-modeling/php-filter",
3+
"description": "Common PHP filters for code generation",
4+
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"php",
8+
"json",
9+
"schema",
10+
"code",
11+
"generation"
12+
],
13+
"authors": [
14+
{
15+
"name": "Sandro Keil",
16+
"homepage": "https://sandro-keil.de",
17+
"role": "maintainer"
18+
}
19+
],
20+
"support": {
21+
"issues": "https://github.com/open-code-modeling/php-filter/issues",
22+
"source": "https://github.com/open-code-modeling/php-filter"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"OpenCodeModeling\\Filter\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"OpenCodeModelingTest\\Filter\\": "tests/"
32+
}
33+
},
34+
"require": {
35+
"php": "^7.4 || ^8.0"
36+
},
37+
"require-dev": {
38+
"jangregor/phpstan-prophecy": "^0.8.0",
39+
"laminas/laminas-filter": "^2.9",
40+
"phpspec/prophecy-phpunit": "^2.0",
41+
"phpstan/phpstan": "^0.12.33",
42+
"phpstan/phpstan-strict-rules": "^0.12.4",
43+
"phpunit/phpunit": "^9.2.6",
44+
"prooph/php-cs-fixer-config": "^0.3",
45+
"roave/security-advisories": "dev-master",
46+
"squizlabs/php_codesniffer": "^3.4"
47+
},
48+
"suggest": {
49+
"laminas/laminas-filter": "If you want to use the FilterFactory"
50+
},
51+
"minimum-stability": "dev",
52+
"prefer-stable": true,
53+
"scripts": {
54+
"check": [
55+
"@cs",
56+
"@test",
57+
"@analyse"
58+
],
59+
"cs": "php-cs-fixer fix src -v --diff --dry-run",
60+
"cs-fix": "php-cs-fixer fix src -v --diff",
61+
"test": "vendor/bin/phpunit",
62+
"analyse": "php vendor/bin/phpstan.phar analyse --no-interaction"
63+
},
64+
"config": {
65+
"sort-packages": true,
66+
"platform": {
67+
}
68+
},
69+
"archive": {
70+
"exclude": [
71+
"build",
72+
"phpunit.xml*",
73+
"tests"
74+
]
75+
}
76+
}

0 commit comments

Comments
 (0)