In addition to the main libraries, the Small ecosystem offers several other lightweight and powerful libraries designed to streamline various aspects of PHP development.
Each library provides targeted functionality to enhance productivity and simplify common tasks.
Small Swoole Patterns - Async Design Patterns for PHP
The Small Swoole Patterns library provides a collection of asynchronous design patterns tailored for PHP projects using OpenSwoole. These patterns facilitate efficient and scalable coding practices in asynchronous environments.
-
Async tasks
Manages asynchronous tasks and collections of tasks, with methods for handling and waiting on completion.
-
Array Map
This pattern extends the functionality of Swoole's \Coroutine\map by allowing deferred execution and easier handling of mapped arrays or collections.
-
Stack
Implements FIFO (First In, First Out) and LIFO (Last In, First Out) stack patterns for managing data.
-
State
Implements state management with options for encoding states and performing actions on state changes.
-
Observable
Implements the observer pattern to handle callbacks asynchronously.
-
Pool
Implements the pool pattern for managing asynchronous processes and connections to server resources, with support for rate control.
-
Resource
Manages access to shared resources with options for acquiring and releasing resources.
Get it on composer : small/swoole-patterns
Small Forms and Small Forms Bundle - Simplifying PHP Form Handling with Elegance and Ease
The Small Forms Bundle is a Symfony bridge for the Small Form library, designed to simplify the validation, normalization, and denormalization of API data. This package offers a straightforward alternative to Symfony’s built-in normalizer, enhancing data handling within Symfony applications.
-
Inline Forms
Create and validate forms directly within your controller actions. Define fields and validation rules on-the-fly, and handle form submissions efficiently.
-
Reusable Class Forms
Declare forms as PHP classes for reuse. Define fields and validation rules in a structured manner, then use these forms in various parts of your application.
-
Standard Objects Integration
Create forms from standard objects or DTOs, automatically parsing validation rules from class attributes. This facilitates seamless data handling and validation directly from your data models.
-
Flexible Validation Rules
Includes a comprehensive set of validation rules and modifiers as attributes, such as ValidateNotEmpty, ValidateGreaterOrEqual, and StringToDateTimeModifier, allowing for detailed and customized data reformating and validation.
Get it on composer : small/forms
And Symfony bundle : small/forms-bundle
Small Collection - PHP Collection Classes with Advanced Querying
The Small Collection library offers a set of PHP classes designed to work with collections of data, providing both array-like and object-like behavior. It includes a selector feature that allows for complex querying similar to database operations.
-
Array and Object Behavior
Collections can be used like arrays but also provide object-oriented features.
-
Collection Classes
Offers generic, numeric, and string-specific collections.
-
Selector
Enables complex querying on collections, akin to database table queries.
Get it on composer : small/collection