- Update all repository URLs to git.marketally.com - Remove GitHub Actions workflows (not compatible with Gitea) - Update documentation links in README, CONTRIBUTING, and CHANGELOG
3.4 KiB
3.4 KiB
Contributing to Ubiquity SpaceTime PHP
Thank you for your interest in contributing to Ubiquity SpaceTime PHP! This document provides guidelines and instructions for contributing.
Code of Conduct
By participating in this project, you agree to abide by our code of conduct: be respectful, inclusive, and considerate of others.
How to Contribute
Reporting Issues
- Check if the issue already exists in the issue tracker
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce (if applicable)
- Expected vs actual behavior
- PHP version and environment details
Submitting Pull Requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes following our coding standards
- Add/update tests as needed
- Update documentation if applicable
- Commit with descriptive messages
- Push to your fork
- Submit a pull request
Development Setup
# Clone your fork
git clone https://git.marketally.com/YOUR_USERNAME/sqrtspace-php.git
cd sqrtspace-php
# Install dependencies
composer install
# Run tests
vendor/bin/phpunit
# Run tests with coverage
vendor/bin/phpunit --coverage-html coverage
Coding Standards
PHP Standards
- Follow PSR-12 coding style
- Use PHP 8.1+ features appropriately
- Add type declarations for all parameters and return types
- Use strict types (
declare(strict_types=1);)
Code Style
<?php
declare(strict_types=1);
namespace Ubiquity\SpaceTime\Example;
use Ubiquity\SpaceTime\SomeClass;
/**
* Class description
*/
class ExampleClass
{
private string $property;
public function __construct(string $property)
{
$this->property = $property;
}
/**
* Method description
*
* @throws \Exception When something goes wrong
*/
public function doSomething(int $param): array
{
// Implementation
return [];
}
}
Testing Guidelines
- Write tests for all new features
- Maintain or improve code coverage
- Use descriptive test method names
- Follow AAA pattern (Arrange, Act, Assert)
public function testFeatureWorksCorrectly(): void
{
// Arrange
$instance = new TestedClass();
// Act
$result = $instance->doSomething();
// Assert
$this->assertEquals('expected', $result);
}
Documentation
- Update README.md for new features
- Add PHPDoc blocks for all public methods
- Include usage examples for complex features
- Update CHANGELOG.md following Keep a Changelog
Performance Considerations
Since SpaceTime focuses on memory efficiency:
- Always consider memory usage in your implementations
- Benchmark memory usage and performance for new features
- Document any trade-offs between memory and speed
- Follow the √n principle where applicable
Pull Request Process
- Ensure all tests pass
- Update documentation
- Add entry to CHANGELOG.md
- Request review from maintainers
- Address feedback promptly
- Squash commits if requested
Release Process
Releases are managed by maintainers following semantic versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes
Questions?
Feel free to:
- Open an issue for questions
- Join our discussions
- Contact maintainers
Thank you for contributing!