Skip to content

Commit b6fa3b1

Browse files
committed
adding linter
1 parent bf5ed1e commit b6fa3b1

7 files changed

Lines changed: 217 additions & 4 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PHP CodeSniffer Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
- release-features
9+
10+
jobs:
11+
lint_and_format:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v4
17+
18+
# Setup PHP Environment
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.3' # Use your required PHP version
23+
extensions: mbstring, pdo_mysql # Add extensions your project needs
24+
tools: composer # Ensure Composer is available
25+
26+
# Install PHPCS (using Composer dependency)
27+
- name: Install Dependencies
28+
run: composer install --no-interaction --prefer-dist
29+
30+
# Run the CodeSniffer Check
31+
# Note: We use the `vendor/bin/phpcs` command.
32+
# The `--ignore=vendor` flag is the key to excluding that folder.
33+
- name: Run PHP CodeSniffer
34+
run: vendor/bin/phpcs --standard=PSR12 --ignore=vendor,node_modules --warning-severity=0 .
35+
36+
# Optional: Auto-Fix and Check for Diff (Recommended)
37+
# This step ensures your code isn't just flagged, but fails if it wasn't fixed.
38+
- name: Run Code Fixer and Check Diff
39+
run: |
40+
vendor/bin/phpcbf --standard=PSR12 --ignore=vendor,node_modules .
41+
git diff --exit-code

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor
22
.env
3-
.ftpquota
3+
.ftpquota
4+
.DS_Store

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"require-dev": {
3-
"phpunit/phpunit": "^12.4"
3+
"phpunit/phpunit": "^12.4",
4+
"squizlabs/php_codesniffer": "^4.0"
5+
},
6+
"scripts": {
7+
"lint:php": "vendor/bin/phpcs --standard=PSR12 --ignore=vendor,node_modules .",
8+
"lint-fix:php": "vendor/bin/phpcbf --standard=PSR12 --ignore=vendor,node_modules ."
49
}
5-
}
10+
}

composer.lock

Lines changed: 80 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
parameters:
2+
excludePaths:
3+
- vendor
4+
level: 6
5+
type_coverage:
6+
return: 95
7+
param: 95
8+
property: 95
9+
constant: 95
10+
treatPhpDocTypesAsCertain: false

public/index.php

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>theplayground.ws - Under Construction</title>
8+
<style>
9+
/* Minimal CSS for clarity and readability */
10+
body {
11+
font-family: Arial, sans-serif;
12+
line-height: 1.6;
13+
margin: 0;
14+
padding: 0;
15+
background-color: #f4f4f4;
16+
color: #333;
17+
text-align: center;
18+
}
19+
20+
.container {
21+
width: 90%;
22+
max-width: 600px;
23+
margin: 100px auto;
24+
padding: 30px;
25+
background: #fff;
26+
border-radius: 8px;
27+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
28+
}
29+
30+
h1 {
31+
color: #2c3e50;
32+
font-size: 2em;
33+
margin-bottom: 0.5em;
34+
}
35+
36+
p {
37+
margin-bottom: 1.5em;
38+
}
39+
40+
.tag {
41+
display: inline-block;
42+
padding: 5px 10px;
43+
margin: 5px;
44+
background: #e74c3c;
45+
color: white;
46+
border-radius: 4px;
47+
font-size: 0.9em;
48+
font-weight: bold;
49+
}
50+
</style>
51+
</head>
52+
53+
<body>
54+
55+
<div class="container">
56+
<h1>Under Construction</h1>
57+
<p>
58+
You’ve reached <strong>theplayground.ws</strong>. I'm currently rebuilding this site to host my updated <strong>portfolio</strong>.
59+
</p>
60+
<p>
61+
The new site will show my work, thinking, and technical range. It will run on <strong>PHP</strong> and include a small
62+
<strong>CMS</strong> for easy content updates.
63+
</p>
64+
<p>
65+
Check back soon for the finished portfolio. Thanks for your patience.
66+
</p>
67+
<div>
68+
<span class="tag">PHP</span>
69+
<span class="tag">CMS</span>
70+
<span class="tag">Portfolio</span>
71+
<span class="tag">Under Development</span>
72+
</div>
73+
</div>
74+
75+
</body>
76+
77+
</html>

0 commit comments

Comments
 (0)