Skip to content

Commit 139fc71

Browse files
committed
chore: switch to alchemy
1 parent b0e445a commit 139fc71

File tree

7 files changed

+149
-99
lines changed

7 files changed

+149
-99
lines changed

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint code
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
ref: ${{ github.head_ref }}
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.2'
21+
extensions: json, zip
22+
tools: composer:v2
23+
coverage: none
24+
25+
- name: Install PHP dependencies
26+
run: composer update --no-interaction --no-progress
27+
28+
- name: Run Linter
29+
run: composer run lint
30+
31+
- name: Commit changes
32+
uses: stefanzweifel/git-auto-commit-action@v4
33+
with:
34+
commit_message: 'chore: fix styling'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ Thumbs.db
1717

1818
# phpstorm
1919
.idea/*
20+
21+
# Alchemy
22+
.alchemy

.php_cs.dist.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

alchemy.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
app:
2+
- src
3+
4+
tests:
5+
engine: pest
6+
parallel: true
7+
paths:
8+
- tests
9+
files:
10+
- '*.test.php'
11+
coverage:
12+
processUncoveredFiles: true
13+
14+
lint:
15+
preset: PSR12
16+
rules:
17+
single_quote: true
18+
phpdoc_scalar: true
19+
no_unused_imports: true
20+
unary_operator_spaces: true
21+
binary_operator_spaces: true
22+
phpdoc_var_without_name: true
23+
trailing_comma_in_multiline: true
24+
phpdoc_single_line_var_spacing: true
25+
single_trait_insert_per_statement: true
26+
not_operator_with_successor_space: false
27+
array_syntax:
28+
syntax: short
29+
ordered_imports:
30+
sort_algorithm: alpha
31+
method_argument_space:
32+
on_multiline: ensure_fully_multiline
33+
keep_multiple_spaces_after_comma: true
34+
blank_line_before_statement:
35+
statements:
36+
- try
37+
- break
38+
- throw
39+
- return
40+
- declare
41+
- continue
42+
43+
actions:
44+
run:
45+
- lint
46+
- tests
47+
os:
48+
- macos-latest
49+
- ubuntu-latest
50+
- windows-latest
51+
php:
52+
extensions: json, zip
53+
versions:
54+
- '8.3'
55+
- '8.2'
56+
- '8.1'
57+
- '8.0'
58+
- '7.4'
59+
events:
60+
- push
61+
- pull_request

composer.json

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,53 @@
11
{
2-
"name": "leafs/session",
3-
"description": "Leaf PHP session + flash modules",
4-
"keywords": [
5-
"session",
6-
"http",
7-
"flash",
8-
"leaf",
9-
"php",
10-
"framework"
11-
],
12-
"homepage": "https://leafphp.dev/modules/session/",
13-
"type": "library",
14-
"license": "MIT",
15-
"authors": [
16-
{
17-
"name": "Michael Darko",
18-
"email": "[email protected]",
19-
"homepage": "https://mychi.netlify.app",
20-
"role": "Developer"
21-
}
22-
],
23-
"autoload": {
24-
"psr-4": {
25-
"Leaf\\": "src"
2+
"name": "leafs/session",
3+
"description": "Leaf PHP session + flash modules",
4+
"keywords": [
5+
"session",
6+
"http",
7+
"flash",
8+
"leaf",
9+
"php",
10+
"framework"
11+
],
12+
"homepage": "https://leafphp.dev/modules/session/",
13+
"type": "library",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Michael Darko",
18+
"email": "[email protected]",
19+
"homepage": "https://mychi.netlify.app",
20+
"role": "Developer"
21+
}
22+
],
23+
"autoload": {
24+
"psr-4": {
25+
"Leaf\\": "src"
26+
},
27+
"files": [
28+
"src/functions.php"
29+
]
30+
},
31+
"minimum-stability": "dev",
32+
"prefer-stable": true,
33+
"require": {
34+
"leafs/anchor": "*"
35+
},
36+
"require-dev": {
37+
"pestphp/pest": "^1.21",
38+
"friendsofphp/php-cs-fixer": "^3.0",
39+
"leafs/alchemy": "^2.2"
40+
},
41+
"scripts": {
42+
"format": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist.php --allow-risky=yes",
43+
"test": "./vendor/bin/alchemy setup --test",
44+
"alchemy": "./vendor/bin/alchemy setup",
45+
"lint": "./vendor/bin/alchemy setup --lint",
46+
"actions": "./vendor/bin/alchemy setup --actions"
2647
},
27-
"files": [
28-
"src/functions.php"
29-
]
30-
},
31-
"minimum-stability": "dev",
32-
"prefer-stable": true,
33-
"require": {
34-
"leafs/anchor": "*"
35-
},
36-
"require-dev": {
37-
"pestphp/pest": "^1.21",
38-
"friendsofphp/php-cs-fixer": "^3.0"
39-
},
40-
"scripts": {
41-
"format": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist.php --allow-risky=yes",
42-
"test": "vendor/bin/pest"
43-
},
44-
"config": {
45-
"allow-plugins": {
46-
"pestphp/pest-plugin": true
48+
"config": {
49+
"allow-plugins": {
50+
"pestphp/pest-plugin": true
51+
}
4752
}
48-
}
49-
}
53+
}

phpunit.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Http/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function get($param, $default = null, bool $sanitize = true)
5353
*
5454
* @param string $key the key to retrieve and remove the value for
5555
* @param mixed $defaultValue the default value to return if the requested value cannot be found
56-
* @param boolean $sanitize Whether to sanitize the returned value
56+
* @param bool $sanitize Whether to sanitize the returned value
5757
*
5858
* @return mixed the requested value or the default value
5959
*/

0 commit comments

Comments
 (0)