Skip to content

Commit 82ffd0a

Browse files
committed
intial commit
0 parents  commit 82ffd0a

21 files changed

+454
-0
lines changed

.github/.kodiak.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .kodiak.toml
2+
version = 1
3+
4+
[merge]
5+
method = "squash"
6+
delete_branch_on_merge = true
7+
dont_wait_on_status_checks = ["WIP"] # handle github.com/apps/wip
8+
# label to use to enable Kodiak to merge a PR
9+
automerge_label = "automerge" # default: "automerge"
10+
# require that the automerge label be set for Kodiak to merge a PR. if you
11+
# disable this Kodiak will immediately attempt to merge every PR you create
12+
require_automerge_label = true
13+
14+
[merge.message]
15+
title = "pull_request_title"
16+
body = "empty"
17+
include_coauthors = true
18+
include_pr_number = true
19+
strip_html_comments = true # remove html comments to auto remove PR templates

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [staabm]

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot config reference
2+
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: composer
7+
directory: /
8+
versioning-strategy: increase
9+
schedule:
10+
interval: weekly
11+
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: weekly

.github/workflows/static-analysis.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
phpstan:
12+
name: phpstan static code analysis
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
include:
18+
#- os: ubuntu-18.04
19+
# php-version: '7.2'
20+
- os: ubuntu-latest
21+
php-version: '7.4'
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-version }}
31+
extensions: gd, intl, pdo_mysql
32+
coverage: none # disable xdebug, pcov
33+
34+
- name: Composer install
35+
uses: ramsey/composer-install@v1
36+
with:
37+
composer-options: '--ansi --prefer-dist'
38+
39+
- name: Run phpstan analysis
40+
run: vendor/bin/phpstan analyse --ansi

.github/workflows/unit-tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
phpunit:
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
include:
17+
#- os: ubuntu-18.04
18+
# php-version: '7.2'
19+
- os: ubuntu-latest
20+
php-version: '7.4'
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php-version }}
30+
extensions: gd, intl, pdo_mysql
31+
coverage: none # disable xdebug, pcov
32+
33+
- name: Composer install
34+
uses: ramsey/composer-install@v1
35+
with:
36+
composer-options: '--ansi --prefer-dist'
37+
38+
- name: Setup Problem Matchers for PHPUnit
39+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
40+
41+
- name: Run phpunit
42+
run: vendor/bin/phpunit --colors=always

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor/
2+
/tmp/
3+
/.phpunit.result.cache
4+
/composer.lock

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Analyzes phpstan baseline files

bin/phpstan-baseline-analyze.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
// Finding composer
5+
6+
$paths = [
7+
__DIR__.'/../vendor/autoload.php',
8+
__DIR__.'/../../../autoload.php',
9+
];
10+
11+
foreach ($paths as $path) {
12+
if (file_exists($path)) {
13+
include $path;
14+
break;
15+
}
16+
}
17+
18+
$app = new \staabm\PHPStanBaselineAnalysis\Application();
19+
$app->start($argv[1]);

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "staabm/phpstan-baseline-analysis",
3+
"license": "MIT",
4+
"autoload": {
5+
"classmap": ["lib/"]
6+
},
7+
"autoload-dev": {
8+
"classmap": [
9+
"tests/"
10+
]
11+
},
12+
"require": {
13+
"php": ">=7.4 || ^8.0",
14+
"nette/neon": "^3.2",
15+
"symfony/polyfill-php80": "^1.23"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "^9.5",
19+
"phpstan/phpstan": "^0.12",
20+
"symfony/var-dumper": "^5.3"
21+
},
22+
"config": {
23+
"optimize-autoloader": true,
24+
"sort-packages": true
25+
},
26+
"scripts": {
27+
"phpstan": "phpstan analyze",
28+
"phpunit": "phpunit"
29+
},
30+
"bin": [
31+
"bin/phpstan-baseline-analyze.php"
32+
]
33+
}

lib/AnalyzerResult.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace staabm\PHPStanBaselineAnalysis;
4+
5+
final class AnalyzerResult {
6+
/**
7+
* @var int
8+
*/
9+
public $overallComplexity = 0;
10+
}

0 commit comments

Comments
 (0)