# Contributing

Contributions are welcome! Here's how to get started.

## Development Setup

```bash
git clone git@github.com:inodrahq/bcs.git
cd bcs
composer install
```

## Running Tests

```bash
composer test
```

All tests must pass against the golden vectors generated by the Rust `bcs` crate.

## Static Analysis

```bash
composer analyse
```

PHPStan level 8 is enforced.

## Pull Requests

1. Fork the repository and create a branch from `main`
2. Add tests for any new functionality
3. Ensure all tests pass and PHPStan reports no errors
4. Keep commits focused and write clear commit messages
5. Open a pull request against `main`

## Code Style

- Follow PSR-12 coding standards
- Use strict types (`declare(strict_types=1)`) in all files
- Type all parameters, return types, and properties

## Adding New BCS Types

1. Create a class in `src/` implementing `BcsType`
2. Implement both `encode(Encoder)` and `static decode(Decoder)` methods
3. Add golden vector tests in `tests/` matching Rust reference output
4. Update `README.md` with usage examples

## Reporting Issues

- Use GitHub Issues for bug reports and feature requests
- For security vulnerabilities, see [SECURITY.md](SECURITY.md)
