diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d2c48be --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,229 @@ +# Contributing to Attributes Validation Extension + +Thank you for considering contributing to Attributes Validation Extension! This document provides guidelines for contributing to the project. + +## Table of Contents + +- [Getting Started](#getting-started) +- [Development Setup](#development-setup) +- [Running Tests](#running-tests) +- [Code Style](#code-style) +- [Pull Request Guidelines](#pull-request-guidelines) +- [Reporting Issues](#reporting-issues) + +## Getting Started + +Attributes Validation Extension is a PHP C extension that provides Pydantic-inspired data validation using PHP 8.2+ attributes and type hints. + +## Development Setup + +### Prerequisites + +- PHP 8.2 or later (8.3+ recommended for full attribute support) +- PHP development headers and tools (`phpize`, `php-config`) +- Git +- Composer +- Make +- GCC or Clang + +### Install Dependencies + +```bash +# Clone the repository +git clone https://github.com/Attributes-PHP/validation-ext.git +cd validation-ext + +# Install PHP dependencies +composer install +``` + +### Build the Extension + +```bash +# Generate configure script +phpize + +# Configure the extension +./configure --enable-attributes-validation + +# Build the extension +make + +# Install the extension (optional) +sudo make install +``` + +### Enable the Extension + +Add the following line to your `php.ini`: + +```ini +extension=attributes_validation.so +``` + +Or load it dynamically in your PHP scripts: + +```php +