Download the PHP package event4u/data-helpers without Composer
On this page you can find all versions of the php package event4u/data-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download event4u/data-helpers
More information about event4u/data-helpers
Files in event4u/data-helpers
Package data-helpers
Short Description Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.
License proprietary
Informations about the package data-helpers
Data Helpers
Framework-agnostic PHP library with deep framework integration โ get the power of framework-specific solutions without the lock-in.
Transform complex data structures, create type-safe DTOs and simplify data operations with expressive syntax. Works standalone in Pure PHP or with deep integration for Laravel and Symfony. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and utility helpers (MathHelper, EnvHelper, etc.).
๐ฏ Framework-Agnostic + Deep Integration โข Pure PHP with zero dependencies โข Optional Laravel & Symfony integration โข No framework lock-in
๐ Full Documentation โข Getting Started โข API Reference
๐ Support the Development - Help us build better tools for the PHP community
๐ก Why Data Helpers?
๐ฏ Stop Writing Nested Loops
๐ Key Benefits
- ๐ฏ Framework-Agnostic + Deep Integration - Pure PHP with zero dependencies, optional deep Laravel/Symfony integration
-
Type-Safe - PHPStan Level 9 compliant with 4700+ tests
- Fast - SimpleDto with #[UltraFast] is up to 12.5x faster than Other Serializer
- Zero Dependencies - No required dependencies, optional framework integrations
- No Framework Lock-In - Use framework features without being tied to a framework
- No-Code Mapping - Store templates in database, create with drag-and-drop editors
๐ฆ Installation
Requirements: PHP 8.2+
Framework support (all optional):
- ๐ด Laravel 9+ - Collections, Eloquent Models
- โซ Symfony/Doctrine 6+ - Collections, Entities
- ๐ง Standalone PHP - Works out of the box
๐ Installation Guide โข Configuration
๐ Framework Integration
The best of both worlds: Use Data Helpers as a standalone library in pure PHP, or leverage deep framework integration for Laravel and Symfony โ without framework lock-in.
๐ฏ Framework-Agnostic Core
Zero dependencies required. Works out of the box with:
- โ Pure PHP - Arrays, objects, JSON, XML
- โ Any Framework - No framework-specific code required
- โ Portable - Move between frameworks without code changes
๐ Optional Deep Integration
When you need it: Add framework-specific features without changing your core code.
Laravel Integration (Optional)
Symfony Integration (Optional)
๐ก Key Integration Features
| Feature | Pure PHP | Laravel | Symfony |
|---|---|---|---|
| DTOs & Validation | โ | โ | โ |
| Controller Injection | โ | โ Auto | โ Auto |
| Request Validation | โ Manual | โ Auto | โ Auto |
| Model/Entity Mapping | โ Plain Objects | โ Eloquent | โ Doctrine |
| Framework Attributes | โ | โ Auth/Can/Role | โ Granted/Role |
| Code Generation | โ | โ Artisan | โ Console |
| TypeScript Export | โ | โ | โ |
The Power: Get framework-specific features when you need them, without framework dependencies in your core code.
๐ Laravel Integration Guide โข Symfony Integration Guide
โก Core Components
The heart of this library: Data mapping and DTOs for transforming and structuring data, plus powerful data manipulation tools.
1๏ธโฃ DataAccessor - Read & Transform Data
Access deeply nested data with dot notation, wildcards, and powerful transformation methods:
๐ DataAccessor Documentation
2๏ธโฃ DataCollection - Type-Safe Collections
Framework-independent collection class with fluent API. Uses DataAccessor for reading, DataMutator for writing, and DataFilter for SQL-like querying:
๐ DataCollection Documentation
3๏ธโฃ DataMutator - Modify Nested Data
Safely modify nested structures:
๐ DataMutator Documentation
4๏ธโฃ DataFilter - Query Data
Filter and query data with SQL-like API:
5๏ธโฃ SimpleDto - Immutable Dtos
Create type-safe, immutable Data Transfer Objects with automatic type casting and multi-format serialization (JSON, XML, YAML, CSV):
Plain PHP Object Integration
SimpleDto seamlessly integrates with plain PHP objects (like Zend Framework models or any plain PHP classes):
Also works with getters/setters:
๐ Example Code
6๏ธโฃ LiteDto - Ultra-Fast Dtos
Create ultra-fast, minimalistic DTOs with essential features:
Performance: LiteDto is 7.6x faster than SimpleDto Normal (~2.3ฮผs vs ~18.5ฮผs)
3๏ธโฃ DataMapper - Transform Data
Map between different data structures with templates. Supports multi-format output (JSON, XML, YAML, CSV):
๐ก No-Code Data Mapping: Templates can be stored in a database and created with a drag-and-drop editor - perfect for import wizards, API integrations and ETL pipelines without writing code!
โ ๏ธ XML Files: When loading XML files with sourceFile(), the root element name is preserved. Always include it in your paths: '{{ company.name }}' for <company><name>...</name></company>.
7๏ธโฃ Utility Helpers - Common Data Operations
Simplify common data operations with specialized helper classes:
Available Helpers:
- MathHelper - Precision math operations using bcmath (add, subtract, multiply, divide, modulo, powerOf, squareRoot, compare, min, max, sum, average, product, time conversions)
- EnvHelper - Type-safe environment variable access with framework detection (get, has, string, integer, float, boolean, array)
- ConfigHelper - Singleton configuration manager with framework detection and dot notation (getInstance, get, getBoolean, getInteger, getFloat, getString, getArray, has, set, reset)
- DotPathHelper - Dot notation path utilities with wildcard support (segments, buildPrefix, isWildcard, containsWildcard)
- ObjectHelper - Deep object cloning with recursion control (copy)
๐ฏ Advanced Features
No-Code Data Mapping
Store templates in database and create mappings without programming:
Perfect for:
- ๐ฅ Import Wizards - Let users map CSV/Excel columns to your data model
- ๐ API Integration - Configure API mappings without code changes
- ๐ข Multi-Tenant Systems - Each tenant can have custom data mappings
- ๐ Dynamic ETL - Build data transformation pipelines visually
- ๐ Form Builders - Map form submissions to different data structures
๐ Template-Based Mapping Guide
Complex Nested Mapping
Map complex nested structures to Eloquent Models or Doctrine Entities:
- โ Automatic Relation Detection
- โ Type Casting (string โ int/float/bool)
- โ Snake_case โ camelCase conversion
- โ Nested Wildcards
Pipeline API
Transform data with composable filters:
Template Expressions
Use Twig-like expressions with 18+ built-in filters:
๐ Template Expressions
Query Builder
Laravel-style fluent interface for building queries:
๐ Query Builder Documentation
๐ Documentation
Comprehensive documentation with guides, examples and API reference is available at:
๐ event4u-app.github.io/data-helpers
The documentation includes:
- ๐ Getting Started Guides - Installation, configuration and quick start tutorials
- ๐ง Main Classes - Detailed guides for DataAccessor, DataMutator, DataMapper and DataFilter
- ๐ฏ SimpleDto - Type-safe Dtos with validation, casting and collections
- โก LiteDto - Ultra-fast, minimalistic Dtos (7.6x faster than SimpleDto)
- ๐ Advanced Features - Template expressions, query builder, pipelines and reverse mapping
- ๐ Framework Integration - Laravel, Symfony and Doctrine integration guides
- ๐ก 90+ Code Examples - Runnable examples for every feature
- ๐ Performance Benchmarks - Optimization tips and benchmark results
- ๐ Complete API Reference - Full API documentation for all classes and methods
๐งช Testing & Quality
- โ 4700+ tests with comprehensive coverage
- โ PHPStan Level 9 - Highest static analysis level
- โ 100% type coverage - All methods fully typed
- โ Continuous Integration - Automated testing across PHP 8.2, 8.3, 8.4
๐ Contributing Guide โข Development Setup
โก Performance
All operations are highly optimized:
- Simple access: ~0.0ฮผs
- Nested access: ~0.4ฮผs
- Wildcards: ~1ฮผs
- SimpleDto #[UltraFast] is up to 12.5x faster than Other Serializer
๐ Performance Benchmarks โข Optimization Tips
๐ค Contributing
Contributions are welcome! Please see the Contributing Guide for details.
๐ Sponsoring
This package is part of the event4u ecosystem - a comprehensive event management platform. Your sponsorship helps us:
- ๐ Develop event4u - The next-generation event management app
- ๐ฆ Maintain open-source packages - Like this Data Helpers library
- ๐ง Build new tools - More packages and utilities for the PHP community
- ๐ Improve documentation - Better guides and examples
- ๐ Fix bugs faster - Dedicated time for maintenance and support
Support the Development
Every contribution, no matter how small, makes a difference and is greatly appreciated! ๐
๐ License
MIT License. See LICENSE for details.
๐ Show Your Support
If this package helps you, please consider:
- โญ Giving it a star on GitHub
- ๐ Sponsoring the development
- ๐ข Sharing it with others
All versions of data-helpers with dependencies
composer-plugin-api Version ^2.0
ext-simplexml Version *