Skip to content

Commit 2aff758

Browse files
committed
feat: updating template code
1 parent a77c80e commit 2aff758

File tree

7 files changed

+5377
-10
lines changed

7 files changed

+5377
-10
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
All participants of wayofdev are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with wayofdev.
4+
5+
## The Pledge
6+
7+
In the interest of fostering an open and welcoming environment, we pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
8+
9+
## The Standards
10+
11+
Examples of behaviour that contributes to creating a positive environment include:
12+
13+
* Using welcoming and inclusive language
14+
* Being respectful of differing viewpoints and experiences
15+
* Gracefully accepting constructive criticism
16+
17+
Examples of unacceptable behaviour by participants include:
18+
19+
* Trolling, insulting/derogatory comments, public or private harassment
20+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
21+
* Not being respectful to reasonable communication boundaries, such as 'leave me alone,' 'go away,' or 'I’m not discussing this with you.'
22+
* The usage of sexualised language or imagery and unwelcome sexual attention or advances
23+
* Attacking personal tastes
24+
* Other conduct which you know could reasonably be considered inappropriate in a professional setting.
25+
26+
## Enforcement
27+
28+
Violations of the Code of Conduct may be reported by sending an email to [email protected]. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.
29+
30+
We hold the right and responsibility to remove comments or other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any members for other behaviours that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
## Attribution
33+
34+
This Code of Conduct is adapted from dev.to.

.github/workflows/ci.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,45 @@ on: # yamllint disable-line rule:truthy
1111
- master
1212

1313
jobs:
14-
job_one:
15-
name: job_one
14+
integration:
15+
name: Testing on PHP ${{ matrix.php }} - ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: true
19+
matrix:
20+
os: ["ubuntu-22.04"]
21+
php: ["8.1"]
22+
steps:
23+
- name: Check out the codebase
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
extensions: dom, curl, libxml, mbstring, zip, fileinfo
31+
ini-values: error_reporting=E_ALL
32+
tools: composer:v2
33+
coverage: none
34+
35+
- name: Load cached dependencies
36+
id: cached-composer-dependencies
37+
uses: actions/cache@v3
38+
with:
39+
path: vendor
40+
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
41+
42+
- name: Install dependencies
43+
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
44+
run: composer install
45+
46+
- name: Run coding standards task
47+
run: make cs-diff
48+
49+
- name: Execute phpunit tests
50+
run: make test
51+
52+
- name: Run static analysis using phpstan
53+
run: make stan
1654

1755
...

.php-cs-fixer.dist.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,18 @@
22

33
declare(strict_types=1);
44

5+
use WayOfDev\PhpCsFixer\Config\ConfigBuilder;
6+
use WayOfDev\PhpCsFixer\Config\RuleSets\DefaultSet;
7+
8+
require_once 'vendor/autoload.php';
9+
10+
$config = ConfigBuilder::createFromRuleSet(new DefaultSet())
11+
->inDir(__DIR__ . '/src')
12+
->inDir(__DIR__ . '/tests')
13+
->addFiles([__FILE__])
14+
->getConfig()
15+
;
16+
17+
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/php-cs-fixer.cache');
18+
19+
return $config;

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ help:
4848
all: install hooks
4949
.PHONY: all
5050

51+
prepare:
52+
mkdir -p .build/php-cs-fixer
53+
.PHONY: prepare
54+
5155
# Composer
5256
# ------------------------------------------------------------------------------------
5357
install: ## Installs composer dependencies
@@ -60,11 +64,11 @@ update: ## Updates composer dependencies by running composer update command
6064

6165
# Testing
6266
# ------------------------------------------------------------------------------------
63-
cs-diff: ## Runs php-cs-fixer in dry-run mode and shows diff which will by applied
67+
cs-diff: prepare ## Runs php-cs-fixer in dry-run mode and shows diff which will by applied
6468
$(COMPOSER_RUN) cs-diff
6569
.PHONY: cs-diff
6670

67-
cs-fix: ## Fixes code to follow coding standards using php-cs-fixer
71+
cs-fix: prepare ## Fixes code to follow coding standards using php-cs-fixer
6872
$(COMPOSER_RUN) cs-fix
6973
.PHONY: cs-fix
7074

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"phpstan/phpstan-phpunit": "^1.1",
2626
"phpstan/phpstan-strict-rules": "^1.3",
2727
"phpunit/phpunit": "^9.5",
28-
"roave/security-advisories": "dev-latest"
28+
"roave/security-advisories": "dev-latest",
29+
"wayofdev/cs-fixer-config": "^1.0"
2930
},
3031
"autoload": {
3132
"psr-4": {

0 commit comments

Comments
 (0)