Skip to content

Commit 5862042

Browse files
authored
Sdk update (#72)
* Updated Dependencies and Fix Security Vulnerabilities * added Changelog * updated changelog and removed travis.yml
1 parent f0b1ccb commit 5862042

6 files changed

Lines changed: 3145 additions & 538 deletions

File tree

.travis.yml

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

CHANGELOG.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- PHP version requirement: `>=7.4` now specified in composer.json
12+
- Multi-version PHP testing: Verified compatibility with PHP 8.1, 8.2, 8.3, 8.4, and 8.5
13+
14+
### Changed
15+
- **PHPUnit**: Updated from 3.7.* (2012) to ^9.5 (9.6.34)
16+
- Modern test framework with PHP 7.4+ support
17+
- Improved error reporting and assertions
18+
- Better code coverage tools
19+
- **Faker**: Replaced abandoned `fzaninotto/faker` 1.4.* with `fakerphp/faker` ^1.9 (1.24.1)
20+
- Active maintenance and security updates
21+
- PHP 8.0+ compatibility
22+
- Same API, drop-in replacement
23+
- **Intervention Image**: Updated from 2.0.* to ^2.7 (2.7.2)
24+
- Bug fixes and PHP 8.0+ compatibility improvements
25+
- Better memory management
26+
- **PHP Coveralls**: Replaced `satooshi/php-coveralls` dev-travis-fix with `php-coveralls/php-coveralls` ^2.5 (2.9.1)
27+
- Official maintained version
28+
- Modern CI/CD integration
29+
- No longer requires custom fork repository
30+
- **PHPUnit Configuration**: Updated phpunit.xml to PHPUnit 9+ format
31+
- Removed deprecated `syntaxCheck` attribute
32+
- Removed deprecated `testSuiteLoaderClass` attribute
33+
- Changed `<filter><whitelist>` to `<coverage><include>` syntax
34+
- **Test Base Class**: Updated from `PHPUnit_Framework_TestCase` to namespaced `PHPUnit\Framework\TestCase`
35+
- Added return type declarations to `setUp(): void` and `tearDown(): void`
36+
37+
### Removed
38+
- Custom VCS repository for php-coveralls fork (no longer needed)
39+
- Deprecated PHPUnit configuration options
40+
- PHPUnit 3.7 legacy class name references
41+
- `.travis.yml` is now obsolete (replaced by GitHub Actions)
42+
43+
### Security
44+
-**All security vulnerabilities resolved**: `composer audit` returns 0 vulnerabilities
45+
- Updated all dependencies from 2012-2014 versions to modern, actively maintained releases
46+
- Replaced abandoned packages with secure alternatives
47+
- All dependencies now receive regular security updates
48+
49+
### Breaking Changes
50+
- **Minimum PHP version is now 7.4** (previously unspecified)
51+
- Projects using PHP 7.3 or lower must upgrade
52+
- **PHPUnit 9 compatibility required**
53+
- Test classes must extend `PHPUnit\Framework\TestCase` (not `PHPUnit_Framework_TestCase`)
54+
- `setUp()` and `tearDown()` methods require `void` return type
55+
- Custom phpunit.xml files may need syntax updates
56+
- **Faker namespace change**
57+
- If you directly instantiate Faker, use `Faker\Factory::create()` from `fakerphp/faker`
58+
- API is identical, but package name changed
59+
60+
### Deprecated
61+
- `assertEqualXMLStructure()` is deprecated in PHPUnit 9 and will be removed in PHPUnit 10
62+
- Affects `GedcomxFileTests::testXMLSerialization`
63+
- Tests still pass but emit warnings
64+
65+
### Testing
66+
Verified compatibility across multiple PHP versions:
67+
- ✅ PHP 8.1.34 - 6 tests, 23 assertions - PASSED
68+
- ✅ PHP 8.2.30 - 6 tests, 23 assertions - PASSED
69+
- ✅ PHP 8.3.30 - 6 tests, 23 assertions - PASSED
70+
- ✅ PHP 8.4.20 - 6 tests, 23 assertions - PASSED
71+
- ✅ PHP 8.5.5 - 6 tests, 23 assertions - PASSED
72+
73+
**Automated CI Testing** (GitHub Actions):
74+
Continuous integration tests run automatically on PHP 7.4, 8.0, 8.1, 8.2, and 8.3 to prevent regressions.
75+
76+
Note: PHP 7.4 and 8.0 are end-of-life. While CI tests these versions for compatibility verification, production use of PHP 8.1+ is recommended for security updates.
77+
78+
### Migration Guide
79+
80+
#### For Library Users
81+
If you're using gedcomx-php as a dependency:
82+
83+
1. **Update your PHP version**:
84+
```bash
85+
php --version # Must be 7.4 or higher
86+
```
87+
88+
2. **Update the package**:
89+
```bash
90+
composer update gedcomx/gedcomx-php
91+
```
92+
93+
3. **No code changes required** - The API remains unchanged
94+
95+
#### For Contributors/Developers
96+
97+
1. **Update PHP if needed**:
98+
```bash
99+
php --version # Recommended: 8.1+
100+
```
101+
102+
2. **Install dependencies**:
103+
```bash
104+
rm -rf vendor composer.lock
105+
composer install
106+
```
107+
108+
3. **Run tests**:
109+
```bash
110+
vendor/bin/phpunit
111+
```
112+
113+
4. **Update test classes if extending ApiTestCase**:
114+
```php
115+
// Old (PHPUnit 3.7)
116+
class MyTest extends \PHPUnit_Framework_TestCase {
117+
public function setUp() { }
118+
}
119+
120+
// New (PHPUnit 9+)
121+
class MyTest extends \PHPUnit\Framework\TestCase {
122+
protected function setUp(): void { }
123+
}
124+
```
125+
126+
### Known Issues
127+
- PHP 8.1+ emits deprecation notices about return type declarations in `Gedcomx\Util\Collection`
128+
- These are warnings, not errors
129+
- Tests pass successfully
130+
- Will be addressed in a future update

composer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414
"support": {
1515
"issues": "https://github.com/FamilySearch/gedcomx-php/issues"
1616
},
17+
"require": {
18+
"php": ">=7.4"
19+
},
1720
"require-dev": {
18-
"phpunit/phpunit": "3.7.*",
19-
"fzaninotto/faker": "1.4.*",
20-
"intervention/image": "2.0.*",
21-
"satooshi/php-coveralls": "dev-travis-fix"
21+
"phpunit/phpunit": "^9.5",
22+
"fakerphp/faker": "^1.9",
23+
"intervention/image": "^2.7",
24+
"php-coveralls/php-coveralls": "^2.5"
2225
},
23-
"repositories": [
24-
{
25-
"type": "vcs",
26-
"url": "https://github.com/york-solutions/php-coveralls"
27-
}
28-
],
2926
"autoload": {
3027
"psr-4": {
3128
"Gedcomx\\": "src/"

0 commit comments

Comments
 (0)