Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,37 @@ jobs:
- name: Run tests
run: go test -v ./...

test-php:
name: Test PHP SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/php-sdk
steps:
- uses: actions/checkout@v4

- name: Set up PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, fileinfo, dom, xml, mbstring, curl
coverage: none

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

- name: Run PHPStan
run: composer phpstan

- name: Check code style
run: composer cs-fix -- --dry-run --diff

test-java:
name: Test Java SDK
runs-on: ubuntu-latest
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/claude-code-review.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/publish-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish PHP SDK

on:
release:
types: [created]

jobs:
validate:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'php-sdk-v')
defaults:
run:
working-directory: packages/php-sdk
steps:
- uses: actions/checkout@v4

- name: Set up PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, fileinfo, dom, xml, mbstring, curl
coverage: none

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

- name: Run PHPStan
run: composer phpstan

- name: Check code style
run: composer cs-fix -- --dry-run --diff

notify-packagist:
needs: validate
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'php-sdk-v')
steps:
- name: Notify Packagist
run: |
echo "✅ PHP SDK validated and ready"
echo "📦 Packagist will automatically detect the new tag and publish the package"
echo "🔗 Check status at: https://packagist.org/packages/turbodocx/sdk"
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Comprehensive SDKs, detailed documentation, and responsive support. Ship faster
|:---------|:--------|:--------|:-----|
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/typescript/typescript-original.svg" width="20"/> **JavaScript/TypeScript** | [@turbodocx/sdk](./packages/js-sdk) | `npm install @turbodocx/sdk` | [View →](./packages/js-sdk#readme) |
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg" width="20"/> **Python** | [turbodocx-sdk](./packages/py-sdk) | `pip install turbodocx-sdk` | [View →](./packages/py-sdk#readme) |
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" width="20"/> **PHP** | [turbodocx/sdk](./packages/php-sdk) | `composer require turbodocx/sdk` | [View →](./packages/php-sdk#readme) |
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/go/go-original.svg" width="20"/> **Go** | [turbodocx-sdk](./packages/go-sdk) | `go get github.com/turbodocx/sdk` | [View →](./packages/go-sdk#readme) |
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg" width="20"/> **Java** | [com.turbodocx:sdk](./packages/java-sdk) | [Maven Central](https://search.maven.org/artifact/com.turbodocx/sdk) | [View →](./packages/java-sdk#readme) |

Expand All @@ -68,9 +69,13 @@ Comprehensive SDKs, detailed documentation, and responsive support. Ship faster
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/ruby/ruby-original.svg" width="20"/> **Ruby** | 🚧 In Progress |
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/powershell/powershell-original.svg" width="20"/> **PowerShell** | 🚧 In Progress |

> 🔌 **Low-code?** Check out our [n8n community node](https://www.npmjs.com/package/@turbodocx/n8n-nodes-turbodocx) for no-code/low-code workflows!
>
> 📝 **Microsoft Word?** Get [TurboDocx Writer](https://appsource.microsoft.com/en-us/product/office/WA200007397) from the Microsoft AppSource marketplace!
## 🌐 Explore the TurboDocx Ecosystem

| Package | Links | Description |
|---------|-------|-------------|
| @turbodocx/html-to-docx | [![npm](https://img.shields.io/npm/v/@turbodocx/html-to-docx?logo=npm&logoColor=white&label=npm)](https://www.npmjs.com/package/@turbodocx/html-to-docx) [![GitHub](https://img.shields.io/github/stars/turbodocx/html-to-docx?style=social)](https://github.com/turbodocx/html-to-docx) | Convert HTML to DOCX with the fastest JavaScript library |
| n8n-nodes-turbodocx | [![npm](https://img.shields.io/npm/v/@turbodocx/n8n-nodes-turbodocx?logo=npm&logoColor=white&label=npm)](https://www.npmjs.com/package/@turbodocx/n8n-nodes-turbodocx) [![GitHub](https://img.shields.io/github/stars/turbodocx/n8n-nodes-turbodocx?style=social)](https://github.com/turbodocx/n8n-nodes-turbodocx) | n8n community node for TurboDocx API & TurboSign |
| TurboDocx Writer | [![AppSource](https://img.shields.io/badge/Microsoft-AppSource-blue?logo=microsoft)](https://appsource.microsoft.com/en-us/product/office/WA200007397) | Official Microsoft Word add-in for document automation |

---

Expand Down Expand Up @@ -114,6 +119,14 @@ go get github.com/turbodocx/sdk
```
</details>

<details>
<summary><strong>PHP</strong></summary>

```bash
composer require turbodocx/sdk
```
</details>

<details>
<summary><strong>Java</strong></summary>

Expand Down Expand Up @@ -291,6 +304,7 @@ await TurboSign.resend(documentId, ['recipient-uuid']);
|:----|:----------------|
| JavaScript/TypeScript | Node.js 16+ |
| Python | Python 3.9+ |
| PHP | PHP 8.1+ |
| Go | Go 1.21+ |
| Java | Java 11+ |

Expand Down Expand Up @@ -322,30 +336,24 @@ We're looking for community maintainers for each SDK. Interested? [Open an issue

<table>
<tr>
<td align="center" width="25%">
<td align="center" width="33%">
<a href="https://docs.turbodocx.com">
<img src="https://cdn-icons-png.flaticon.com/512/2991/2991112.png" width="40"/><br/>
<strong>Documentation</strong>
</a>
</td>
<td align="center" width="25%">
<td align="center" width="33%">
<a href="https://discord.gg/NYKwz4BcpX">
<img src="https://cdn-icons-png.flaticon.com/512/5968/5968756.png" width="40"/><br/>
<strong>Discord</strong>
</a>
</td>
<td align="center" width="25%">
<td align="center" width="33%">
<a href="https://github.com/TurboDocx/SDK/issues">
<img src="https://cdn-icons-png.flaticon.com/512/733/733553.png" width="40"/><br/>
<strong>GitHub Issues</strong>
</a>
</td>
<td align="center" width="25%">
<a href="mailto:[email protected]">
<img src="https://cdn-icons-png.flaticon.com/512/732/732200.png" width="40"/><br/>
<strong>Email</strong>
</a>
</td>
</tr>
</table>

Expand Down
29 changes: 29 additions & 0 deletions packages/php-sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Composer
/vendor/
composer.lock

# PHPUnit
/coverage/
.phpunit.result.cache

# PHPStan
/phpstan.result

# PHP CS Fixer
.php-cs-fixer.cache

# IDE
.idea/
.vscode/
*.swp
*.swo
*~
.DS_Store

# Build
/build/
/dist/

# Environment
.env
.env.local
30 changes: 30 additions & 0 deletions packages/php-sdk/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

return (new Config())
->setParallelConfig(ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually
->setRiskyAllowed(false)
->setRules([
'@auto' => true
])
// 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
->setFinder(
(new Finder())
// 💡 root folder to check
->in(__DIR__)
// 💡 additional files, eg bin entry file
// ->append([__DIR__.'/bin-entry-file'])
// 💡 folders to exclude, if any
// ->exclude([/* ... */])
// 💡 path patterns to exclude, if any
// ->notPath([/* ... */])
// 💡 extra configs
// ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode
// ->ignoreVCS(true) // true by default
)
;
51 changes: 51 additions & 0 deletions packages/php-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2026-01-17

### Added
- Initial PHP SDK implementation with TypeScript-equivalent strong typing
- TurboSign module with 8 methods for digital signatures
- Support for coordinate-based and template anchor-based field positioning
- Strong typing with PHP 8.1+ enums and typed properties
- Comprehensive exception hierarchy for error handling (6 exception types)
- Automatic file type detection using magic bytes (PDF/DOCX/PPTX)
- PHPStan level 8 static analysis support (zero errors)
- PSR-4 autoloading and PSR-12 code formatting
- Industry-standard dependencies (Guzzle 7.8, PHPUnit 10.5)

### Features
- `TurboSign::configure()` - Configure SDK with API credentials
- `TurboSign::sendSignature()` - Send signature request and immediately send emails
- `TurboSign::createSignatureReviewLink()` - Create review link without sending emails
- `TurboSign::getStatus()` - Get document status
- `TurboSign::download()` - Download signed document
- `TurboSign::void()` - Void a document
- `TurboSign::resend()` - Resend signature request emails
- `TurboSign::getAuditTrail()` - Get audit trail for a document

### Type System
- 4 backed enums: `SignatureFieldType`, `DocumentStatus`, `RecipientStatus`, `FieldPlacement`
- 10 immutable DTOs: `Recipient`, `Field`, `TemplateConfig`, Request/Response classes
- 6 custom exceptions with typed properties

### Testing & Quality
- 31 unit tests with 82 assertions (100% passing)
- PHPStan level 8 static analysis (0 errors)
- PSR-12 code formatting compliance
- Comprehensive test coverage for all core components

### Documentation
- Complete README with API reference and examples
- 3 working example files (simple, basic, advanced)
- PHPDoc annotations for all classes and methods
- TypeScript → PHP equivalents mapping

[Unreleased]: https://github.com/TurboDocx/SDK/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/TurboDocx/SDK/releases/tag/v0.1.0
21 changes: 21 additions & 0 deletions packages/php-sdk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 TurboDocx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading