PHPackages                             dschuppelius/php-common-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dschuppelius/php-common-toolkit

ActiveLibrary

dschuppelius/php-common-toolkit
===============================

Project description.

v1.5.8.2(2mo ago)2985↓50%3MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Mar 10Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/DSchuppelius/php-common-toolkit)[ Packagist](https://packagist.org/packages/dschuppelius/php-common-toolkit)[ RSS](/packages/dschuppelius-php-common-toolkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (116)Used By (3)

php-common-toolkit
==================

[](#php-common-toolkit)

General-purpose PHP utility toolkit providing platform-agnostic helpers, CSV processing, and executable wrappers.

[![PHP](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](https://php.net)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

---

Features
--------

[](#features)

- **CSV Processing**: Fluent builders and parsers for CSV documents with strict field typing
- **Executable Wrappers**: Platform-agnostic integration with external tools (ImageMagick, TIFF tools, PDF tools)
- **Helper Utilities**: Bank validation (IBAN, BIC, BLZ), currency formatting, string manipulation
- **Enum Support**: Typed enums with factory methods (CurrencyCode, CountryCode, CreditDebit, LanguageCode)
- **XML Builders**: Extended DOM document builder for structured XML generation
- **Bundesbank Data**: Auto-downloading BLZ/BIC data with expiry tracking

---

Architecture
------------

[](#architecture)

```
src/
├── Builders/           # Fluent document builders (CSV, XML)
├── Contracts/          # Abstract base classes and interfaces
├── Entities/           # Immutable domain models (CSV, Executables, XML)
├── Enums/              # Typed enums with factory methods
├── Generators/         # Code generators
├── Helper/             # Utility classes (Data, FileSystem, Shell)
├── Parsers/            # Document parsers (CSV)
└── Traits/             # Reusable traits

```

---

Requirements
------------

[](#requirements)

The following tools are required to successfully run `dschuppelius/php-common-toolkit`:

### 1. TIFF Tools

[](#1-tiff-tools)

Required for processing and handling TIFF files.

- **Windows**: [GnuWin32 TIFF Tools](https://gnuwin32.sourceforge.net/packages/tiff.htm)
- **Debian/Ubuntu**:

    ```
    apt install libtiff-tools
    ```

### 2. Xpdf

[](#2-xpdf)

Required for handling PDF files.

- **Windows**: [Xpdf Download](https://www.xpdfreader.com/download.html)
- **Debian/Ubuntu**:

    ```
    apt install xpdf
    ```

### 3. ImageMagick

[](#3-imagemagick)

For converting and processing image files.

- **Windows**: [ImageMagick Installer](https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-39-Q16-HDRI-x64-dll.exe)
- **Debian/Ubuntu**:

    ```
    apt install imagemagick-6.q16hdri
    ```

### 4. muPDF Tools

[](#4-mupdf-tools)

For processing PDF and XPS documents.

- **Debian/Ubuntu**:

    ```
    apt install mupdf-tools
    ```

### 5. QPDF

[](#5-qpdf)

For advanced PDF manipulation and processing.

- **Windows**: [QPDF Download](https://github.com/qpdf/qpdf/releases)
- **Debian/Ubuntu**:

    ```
    apt install qpdf
    ```

### Install the Toolkit into your Project

[](#install-the-toolkit-into-your-project)

The Toolkit requires a PHP version of 8.1 or higher. The recommended way to install the SDK is through [Composer](http://getcomposer.org).

```
composer require dschuppelius/php-common-toolkit
```

---

Usage Examples
--------------

[](#usage-examples)

### CSV Processing

[](#csv-processing)

```
use CommonToolkit\Builders\CSVDocumentBuilder;

$document = CSVDocumentBuilder::create()
    ->setDelimiter(';')
    ->setEnclosure('"')
    ->addHeaderLine(['Name', 'Amount', 'Date'])
    ->addDataLine(['Max Mustermann', '1000.00', '2025-01-15'])
    ->addDataLine(['John Doe', '2500.00', '2025-01-16'])
    ->build();

echo $document->toString();
```

### Bank Validation

[](#bank-validation)

```
use CommonToolkit\Helper\Data\BankHelper;

// IBAN Validation
$isValid = BankHelper::isValidIBAN('DE89370400440532013000'); // true

// BIC Validation
$isValid = BankHelper::isValidBIC('COBADEFFXXX'); // true

// Get Bank Name by BLZ
$bankName = BankHelper::getBankNameByBLZ('37040044'); // "Commerzbank"
```

### Currency Formatting

[](#currency-formatting)

```
use CommonToolkit\Helper\Data\CurrencyHelper;
use CommonToolkit\Enums\CurrencyCode;

$formatted = CurrencyHelper::format(1234.56, CurrencyCode::Euro); // "1.234,56 €"
```

### Enum Usage

[](#enum-usage)

```
use CommonToolkit\Enums\CurrencyCode;
use CommonToolkit\Enums\CountryCode;
use CommonToolkit\Enums\CreditDebit;

// Currency from Symbol
$currency = CurrencyCode::fromSymbol('€'); // CurrencyCode::Euro

// Country from Code
$country = CountryCode::fromStringValue('DE'); // CountryCode::Germany

// Credit/Debit from MT940 Code
$creditDebit = CreditDebit::fromMt940Code('C'); // CreditDebit::CREDIT
```

### Configured Helper mit CommandBuilder

[](#configured-helper-mit-commandbuilder)

Das Toolkit nutzt den `CommandBuilder` aus dem `php-config-toolkit` für elegantes Command-Building mit externen Tools:

```
use CommonToolkit\Helper\FileSystem\FileTypes\PdfFile;

// PDF-Metadaten abrufen (nutzt intern pdfinfo)
$metadata = PdfFile::getMetaData('/path/to/document.pdf');
echo $metadata['Title'];
echo $metadata['Pages'];

// Prüfen ob PDF verschlüsselt ist
if (PdfFile::isEncrypted('/path/to/document.pdf')) {
    // PDF entschlüsseln
    PdfFile::decrypt('/path/to/encrypted.pdf', '/path/to/decrypted.pdf', 'password');
}

// PDF validieren
if (PdfFile::isValid('/path/to/document.pdf')) {
    echo "PDF ist gültig!";
}
```

### Eigene Helper mit Executable-Konfiguration

[](#eigene-helper-mit-executable-konfiguration)

Erstelle eigene Helper-Klassen die externe Tools nutzen:

```
use CommonToolkit\Contracts\Abstracts\ConfiguredHelperAbstract;
use CommonToolkit\Helper\Shell;

class MyImageHelper extends ConfiguredHelperAbstract {
    protected const CONFIG_FILE = __DIR__ . '/../config/image_executables.json';

    public static function convertToJpeg(string $input, string $output): bool {
        $command = self::getConfiguredCommand('convert', [
            '[INPUT]' => $input,
            '[OUTPUT]' => $output
        ]);

        if ($command === null) {
            return false;
        }

        return Shell::executeShellCommand($command);
    }

    public static function isToolAvailable(string $toolName): bool {
        return self::isExecutableAvailable($toolName);
    }
}
```

Mit passender Konfigurationsdatei (`config/image_executables.json`):

```
{
  "shellExecutables": {
    "tiffconvert": {
      "path": "tiffconvert",
      "required": false,
      "description": "ImageMagick Converter",
      "package": "imagemagick",
      "arguments": ["[INPUT]", "-quality", "85", "[OUTPUT]"]
    }
  }
}
```

---

Executable Configuration
------------------------

[](#executable-configuration)

Das Toolkit nutzt JSON-Konfigurationsdateien für externe Tools. Die Konfiguration ermöglicht:

- **Platzhalter-Ersetzung**: `[INPUT]`, `[OUTPUT]` werden zur Laufzeit ersetzt
- **Pfad-Validierung**: Automatische Prüfung ob Tools installiert sind
- **Cross-Platform**: Unterschiedliche Pfade für Windows/Linux möglich
- **Zentrale Verwaltung**: Alle Tool-Konfigurationen an einem Ort

### Verfügbare Methoden in ConfiguredHelperAbstract

[](#verfügbare-methoden-in-configuredhelperabstract)

MethodeBeschreibung`getConfiguredCommand($name, $params)`Baut einen Shell-Befehl mit Platzhalter-Ersetzung`getConfiguredJavaCommand($name, $params)`Baut einen Java-Befehl (java -jar ...)`isExecutableAvailable($name)`Prüft ob ein Tool verfügbar ist`getExecutablePath($name)`Gibt den konfigurierten Pfad zurück`getResolvedExecutableConfig($name, $params)`Gibt die vollständige Tool-Konfiguration zurück---

License
-------

[](#license)

This project is licensed under the **MIT License**.

**Daniel Joerg Schuppelius**📧

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance88

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

115

Last Release

60d ago

Major Versions

v0.9.33 → v1.02026-01-21

PHP version history (4 changes)v0.1.0PHP ^7.4 || ^8.0

v0.8PHP &gt;=8.2 &lt;8.5

v1.5.8.1PHP &gt;=8.2 &lt;=8.5

v1.5.8.2PHP &gt;=8.1 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d648df75b8ca254b14377de6aa7c37daff5bc21e9e8742ef7687c7091c7bc94?d=identicon)[l0gtr0n](/maintainers/l0gtr0n)

---

Top Contributors

[![DSchuppelius](https://avatars.githubusercontent.com/u/19145058?v=4)](https://github.com/DSchuppelius "DSchuppelius (34 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dschuppelius-php-common-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/dschuppelius-php-common-toolkit/health.svg)](https://phpackages.com/packages/dschuppelius-php-common-toolkit)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
