Skip to content

Commit 928b311

Browse files
committed
Merge branch 'feature/unit-tests' into feature/data-transfer-objects
2 parents 9875f84 + d8c2267 commit 928b311

29 files changed

+559
-291
lines changed

.github/workflows/unit-tests.yml renamed to .github/workflows/php-test.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,34 @@ on:
44
push:
55
branches:
66
- trunk
7+
- 'feature/**'
8+
- 'release/**'
9+
# Only run if PHP-related files changed.
10+
paths:
11+
- '.github/workflows/php-test.yml'
12+
- '**.php'
13+
- 'phpunit.xml.dist'
14+
- 'composer.json'
15+
- 'composer.lock'
716
pull_request:
17+
# Only run if PHP-related files changed.
18+
paths:
19+
- '.github/workflows/php-test.yml'
20+
- '**.php'
21+
- 'phpunit.xml.dist'
22+
- 'composer.json'
23+
- 'composer.lock'
24+
types:
25+
- opened
26+
- reopened
27+
- synchronize
828

929
jobs:
1030
test:
1131
runs-on: ubuntu-latest
1232
strategy:
1333
matrix:
14-
php-version: ['7.4', '8.4']
34+
php-version: ['7.4', '8.0', '8.4']
1535

1636
steps:
1737
- uses: actions/checkout@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ vendor/
1919

2020
.claude/
2121
CLAUDE.md
22+
.cursor/
23+
GEMINI.md
2224

2325
############
2426
## PHPUnit
2527
############
2628

27-
.phpunit.cache/
29+
.phpunit.cache/

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,49 @@ The following naming conventions must be followed for consistency and autoloadin
1818
- File names are the same as the class, trait, and interface name for PSR-4 autoloading.
1919
- Classes, interfaces, and traits, and namespaces are not prefixed with `Ai`, exluding the root namespace.
2020

21+
## Documentation standards
22+
23+
All code must be properly documented with PHPDoc blocks following these standards:
24+
25+
### General rules
26+
- All descriptions must end with a period.
27+
- Use `@since n.e.x.t` for new code (will be replaced with actual version on release).
28+
- Place `@since` tags below the description and above `@param` tags, with blank comment lines around it.
29+
30+
### Method documentation
31+
- Method descriptions must start with a third-person verb (e.g., "Creates", "Returns", "Checks").
32+
- Exceptions: Constructors and magic methods may use different phrasing.
33+
- All `@return` annotations must include a description.
34+
35+
### Interface implementations
36+
- Use `{@inheritDoc}` instead of duplicating descriptions when implementing interface methods.
37+
- Only provide a unique description if it adds value beyond the interface documentation.
38+
39+
### Example
40+
```php
41+
/**
42+
* Class for handling user authentication requests.
43+
*
44+
* @since n.e.x.t
45+
*/
46+
class AuthHandler
47+
{
48+
/**
49+
* Validates user credentials against the database.
50+
*
51+
* @since n.e.x.t
52+
*
53+
* @param string $username The username to validate.
54+
* @param string $password The password to validate.
55+
* @return bool True if credentials are valid, false otherwise.
56+
*/
57+
public function validate(string $username, string $password): bool
58+
{
59+
// Implementation
60+
}
61+
}
62+
```
63+
2164
## PHP Compatibility
2265

2366
All code must be backward compatible with PHP 7.4, which is the minimum required PHP version for this project.

phpunit.xml.dist

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,5 @@
2323
<include>
2424
<directory suffix=".php">src</directory>
2525
</include>
26-
<exclude>
27-
<file>src/DummyForAnalysis.php</file>
28-
</exclude>
2926
</coverage>
30-
</phpunit>
27+
</phpunit>

0 commit comments

Comments
 (0)