{"id":15024993,"url":"https://github.com/nejcc/php-custom-types","last_synced_at":"2026-03-09T17:38:43.451Z","repository":{"id":256277896,"uuid":"854827673","full_name":"Nejcc/php-custom-types","owner":"Nejcc","description":"Php package that provides custom data types like i8, u8, i32, u32, f32, and more.","archived":false,"fork":false,"pushed_at":"2024-09-10T06:27:25.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-14T08:40:54.556Z","etag":null,"topics":["laravel","library","mit-license","package","php8","unittest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nejcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T21:00:22.000Z","updated_at":"2024-09-10T06:27:28.000Z","dependencies_parsed_at":"2024-09-10T01:03:49.934Z","dependency_job_id":"45af86cd-87e8-46d2-9fd5-6318b97f2eac","html_url":"https://github.com/Nejcc/php-custom-types","commit_stats":null,"previous_names":["nejcc/php-custom-types"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nejcc%2Fphp-custom-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nejcc%2Fphp-custom-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nejcc%2Fphp-custom-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nejcc%2Fphp-custom-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nejcc","download_url":"https://codeload.github.com/Nejcc/php-custom-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219847633,"owners_count":16556350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","library","mit-license","package","php8","unittest"],"created_at":"2024-09-24T20:01:19.323Z","updated_at":"2026-03-09T17:38:43.375Z","avatar_url":"https://github.com/Nejcc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Custom Types\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/nejcc/php-custom-types.svg)](https://packagist.org/packages/nejcc/php-custom-types)\n[![Total Downloads](https://img.shields.io/packagist/dt/nejcc/php-custom-types.svg)](https://packagist.org/packages/nejcc/php-custom-types)\n[![License](https://img.shields.io/packagist/l/nejcc/php-custom-types.svg)](https://packagist.org/packages/nejcc/php-custom-types)\n\n**Nejcc/php-custom-types** is a Laravel package that provides custom data types like `i8`, `u8`, `i32`, `u32`, `f32`, and more. These custom types help enforce data integrity, memory efficiency, and validation constraints in your Laravel applications.\n\n## Features\n\n- **Custom Integer Types**: `i8`, `u8`, `i32`, `u32`\n- **Custom Floating Point Type**: `f32`\n- **Custom String Type**: `Utf8String`\n- **Tuple and Array Types**: `Pair`, `FixedArray`\n- **Easy Integration**: Designed to work seamlessly with Laravel.\n- **PHP 8.3 Compatibility**: Leverages the latest PHP features for performance and security.\n\n## Installation\n\nTo install the package, use Composer:\n\n```bash\ncomposer require nejcc/php-custom-types\n```\n\n## Tree\n```\nCustomTypes\n├── Scalar Types\n│   ├── Integer Types\n│   │   ├── Signed Integers\n│   │   │   ├── i8    (8-bit signed)\n│   │   │   ├── i16   (16-bit signed)\n│   │   │   ├── i32   (32-bit signed)\n│   │   │   ├── i64   (64-bit signed)\n│   │   │   └── i128  (128-bit signed)\n│   │   └── Unsigned Integers\n│   │       ├── u8    (8-bit unsigned)\n│   │       ├── u16   (16-bit unsigned)\n│   │       ├── u32   (32-bit unsigned)\n│   │       ├── u64   (64-bit unsigned)\n│   │       └── u128  (128-bit unsigned)\n│   ├── Floating-Point Types\n│   │   ├── f16       (16-bit floating-point)\n│   │   ├── f32       (32-bit floating-point)\n│   │   ├── f64       (64-bit floating-point)\n│   │   └── f128      (128-bit floating-point)\n│   ├── Character Type\n│   │   └── Char      (Single Unicode character)\n│   └── Boolean Type\n│       └── Bool      (Boolean, true or false)\n├── Compound Types\n│   ├── Tuple\n│   │   └── Tuple (Fixed-size collection of heterogeneous values)\n│   └── FixedArray\n│       └── FixedArray (Fixed-size collection of homogeneous values)\n├── String Types\n│   ├── StrSlice      (Immutable string slice)\n│   └── OwnedString   (Owned, mutable string)\n├── Collection Types\n│   ├── Vec           (Growable array type)\n│   ├── HashMap       (Key-value store)\n│   └── HashSet       (Unordered collection of unique values)\n├── Custom Types\n│   ├── Structs\n│   │   └── ExampleStruct (Custom user-defined data structures)\n│   └── Enums\n│       └── ExampleEnum (Custom enumerations)\n├── Smart Pointer Types\n│   ├── Box           (Single ownership heap allocation)\n│   ├── Rc            (Reference counted pointer)\n│   ├── RefCell       (Single-threaded interior mutability)\n│   └── Mutex         (Thread-safe interior mutability)\n└── Other Types\n    ├── Unit          (Represents an empty value or no value)\n    └── PhantomData   (Marker for unused generic type parameters)\n\n```\n\n## Usage\n\n### Custom Integer Types\n\n#### `i32` (32-bit Signed Integer)\n\n```php\nuse Nejcc\\CustomTypes\\ScalarTypes\\Integers\\Signed\\i32;\n\n$number = new i32(123456);\necho $number-\u003egetValue(); // Output: 123456\n```\n\n## Running Tests\n\nTo run the unit tests for this package, ensure that you have PHPUnit installed and run:\n\n```bash\n./vendor/bin/phpunit\n```\n\n## License\n\nThis package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnejcc%2Fphp-custom-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnejcc%2Fphp-custom-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnejcc%2Fphp-custom-types/lists"}