Thank you for considering contributing to Swiss Ephemeris PHP FFI! I appreciate your interest in making my package better.
This project adheres to the Laravel Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed and what behavior you expected
- Include error messages and stack traces if applicable
- Include your PHP version, OS, and Swiss Ephemeris version
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List some examples of how this enhancement would be used
- Fork the repository
- Create a new branch from
mainwith a descriptive name (e.g.,feature/add-house-calculations,fix/ffi-pointer-issue) - Make your changes following my coding standards
- Write or update tests to cover your changes
- Ensure all tests pass by running
composer test - Run code style checks with
composer lint - Update documentation if necessary
- Submit a pull request with a clear description of your changes
- PHP 8.3 or higher with FFI extension enabled
- Composer
- Git
- C compiler (gcc) for building libswe.so (optional, pre-built binaries included)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Swiss-Ephemeris-PHP.git
cd Swiss-Ephemeris-PHP
# Install dependencies
composer install
# Run tests
composer test
# Run code style checks
composer lintEnsure FFI is enabled in your php.ini:
ffi.enable=preload
# or
ffi.enable=true# Run all tests
composer test
# Run tests with coverage
composer test:coverage
# Run specific test file
vendor/bin/phpunit tests/SpecificTest.phpWe use Laravel Pint for code formatting:
# Fix code style issues
composer lint
# Check code style without fixing
composer lint:checkWe use PHPStan for static analysis:
# Run PHPStan
composer phpstan- Follow PSR-12 coding standards
- Use meaningful variable and method names
- Add PHPDoc comments for public methods
- Keep methods small and focused
- Write tests for new features
- Maintain 1:1 compatibility with Swiss Ephemeris C library
This package aims for 100% 1:1 compatibility with the Swiss Ephemeris C library. When contributing:
- Do NOT change function signatures
- Do NOT add high-level abstractions to core FFI classes
- Do NOT remove or rename constants
- DO maintain exact C data types (double, int32, etc.)
- DO test against original C library behavior
This repository is licensed under AGPL-3.0-or-later.
⚠️ Commercial Use WarningIf you use my package in SaaS/web applications, you must either:
- Make your source code available under AGPL-3.0, OR
- Purchase a commercial license from Astrodienst
The Swiss Ephemeris C library upstream also has AGPL/commercial licensing - see Astrodienst for details.
Contributions to my repository are accepted under AGPL-3.0, while use or redistribution of upstream Swiss Ephemeris binaries/data must respect the upstream license.
Releases follow Semantic Versioning:
- MAJOR version for incompatible changes or Swiss Ephemeris major version updates
- MINOR version for backwards-compatible features
- PATCH version for backwards-compatible bug fixes
Feel free to open an issue for any questions or concerns.
Thank you for contributing! 🚀