- Add jedarden/pdftract Composer package (sdk/php/) - Implement Client.php with proc_open subprocess execution - Add PSR-3 LoggerInterface integration (defaults to NullLogger) - Add 9 contract methods: extract, extractText, extractMarkdown, extractStream, search, getMetadata, hash, classify, verifyReceipt - Add readonly model classes: Document, Page, Metadata, Fingerprint, Classification, Match, Receipt - Add exception classes: PdftractException base + 8 subclasses - Add PHPUnit conformance test suite - Add phpunit.xml configuration - Add composer.json with jedarden/pdftract package name - Add .ci/argo-workflows/pdftract-php-publish.yaml (Packagist auto-discovery from git tags) Also includes Ruby SDK scaffold from parallel workflow. Closes pdftract-2m3gl
26 lines
674 B
PHP
26 lines
674 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Jedarden\Pdftract\Models;
|
|
|
|
/**
|
|
* Readonly match model
|
|
*
|
|
* Simple readonly representation of a content match within a document
|
|
*/
|
|
class Match
|
|
{
|
|
/**
|
|
* @param int $page Page number where the match was found (1-based)
|
|
* @param string $context Text context surrounding the match
|
|
* @param int $startIndex Starting character index of the match
|
|
* @param int $endIndex Ending character index of the match
|
|
*/
|
|
public function __construct(
|
|
public readonly int $page,
|
|
public readonly string $context,
|
|
public readonly int $startIndex,
|
|
public readonly int $endIndex
|
|
) {}
|
|
}
|