Skip to content

Commit 7fc9210

Browse files
committed
Limpieza de docs.
1 parent 95824b7 commit 7fc9210

47 files changed

Lines changed: 48 additions & 609 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Esteban De La Fuente Rubio / Derafu <https://www.derafu.org>
3+
Copyright (c) 2025 Esteban De La Fuente Rubio / Derafu <https://www.derafu.dev>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,3 @@
11
# Derafu: Support - Essential PHP Utilities
22

3-
![GitHub last commit](https://img.shields.io/github/last-commit/derafu/support/main)
4-
![CI Workflow](https://github.com/derafu/support/actions/workflows/ci.yml/badge.svg?branch=main&event=push)
5-
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/derafu/support)
6-
![GitHub Issues](https://img.shields.io/github/issues-raw/derafu/support)
7-
![Total Downloads](https://poser.pugx.org/derafu/support/downloads)
8-
![Monthly Downloads](https://poser.pugx.org/derafu/support/d/monthly)
9-
10-
A collection of essential PHP utility classes that provide common functionality for string manipulation, array handling, file operations, date management, and more.
11-
12-
## Features
13-
14-
{.list-unstyled}
15-
- 🔡 String manipulation utilities.
16-
- 📚 Array handling helpers.
17-
- 📅 Date and time management.
18-
- 📂 File system operations.
19-
- 📝 CSV file handling.
20-
- 🔧 Object manipulation tools.
21-
- 🐛 Debugging utilities.
22-
- 🏭 Object factory and hydration.
23-
- 🔄 Data serialization helpers.
24-
- 🧪 Comprehensive test coverage.
25-
26-
## Why Derafu\Support?
27-
28-
This package focuses on solving specific business and data processing needs that are often overlooked by standard PHP utilities:
29-
30-
- **Business Date Handling**: Working days calculation, fiscal period management, and date ranges that understand holidays and weekends.
31-
- **Robust CSV Processing**: Consistent handling of different encodings, separators, and quote styles across systems.
32-
- **Practical Data Transformations**: Convert between different data structures (trees, tables, lists) while preserving data integrity.
33-
- **Real-world File Operations**: Safe file handling with proper error management and automatic MIME type detection.
34-
35-
If your application deals with business dates, data processing, or file management, these utilities can save you from reinventing common solutions.
36-
37-
## Installation
38-
39-
Install via Composer:
40-
41-
```bash
42-
composer require derafu/support
43-
```
44-
45-
## Usage Examples
46-
47-
### String Manipulation (Str)
48-
49-
```php
50-
use Derafu\Support\Str;
51-
52-
// Generate UUID.
53-
$uuid = Str::uuid4();
54-
55-
// Replace placeholders.
56-
$result = Str::format('Hello {{name}}!', ['name' => 'John']);
57-
58-
// Normalize strings for URLs.
59-
$slug = Str::slug('Hello World!'); // "hello-world".
60-
```
61-
62-
### Array Handling (Arr)
63-
64-
```php
65-
use Derafu\Support\Arr;
66-
67-
// Auto-cast array values.
68-
$result = Arr::cast($array);
69-
70-
// Convert array to tree structure.
71-
$tree = Arr::toTree($items, 'parent_id', 'children');
72-
```
73-
74-
### Date Management (Date)
75-
76-
```php
77-
use Derafu\Support\Date;
78-
79-
// Add working days.
80-
$newDate = Date::addWorkingDays('2024-01-15', 5, $holidays);
81-
82-
// Format date in Spanish.
83-
$formatted = Date::formatSpanish('2024-01-15'); // "Lunes, 15 de enero del 2024".
84-
85-
// Calculate periods
86-
$nextPeriod = Date::nextPeriod(202401); // 202402.
87-
```
88-
89-
### File Operations (File)
90-
91-
```php
92-
use Derafu\Support\File;
93-
94-
// Get file MIME type.
95-
$mime = File::mimetype('document.pdf');
96-
97-
// Compress directory.
98-
File::compress('/path/to/dir');
99-
100-
// Send file through browser.
101-
File::send('document.pdf');
102-
```
103-
104-
### CSV Handling (Csv)
105-
106-
```php
107-
use Derafu\Support\Csv;
108-
109-
// Read CSV file.
110-
$data = Csv::read('file.csv', ';');
111-
112-
// Generate CSV content.
113-
$csvString = Csv::generate($data);
114-
115-
// Send CSV as download.
116-
Csv::send($data, 'export.csv');
117-
```
118-
119-
### Object Manipulation (Obj)
120-
121-
```php
122-
use Derafu\Support\Obj;
123-
124-
// Fill object properties.
125-
$object = Obj::fill($instance, $data);
126-
127-
// Get public properties.
128-
$properties = Obj::getPublicProperties($instance);
129-
```
130-
131-
### Object Factory and Hydration
132-
133-
```php
134-
use Derafu\Support\Factory;
135-
use Derafu\Support\Hydrator;
136-
137-
// Create and hydrate objects.
138-
$instance = Factory::create($data, MyClass::class);
139-
140-
// Hydrate existing instance.
141-
$hydrated = Hydrator::hydrate($instance, $data);
142-
```
143-
144-
### Debug Utilities
145-
146-
```php
147-
use Derafu\Support\Debug;
148-
149-
// Inspect variable.
150-
$info = Debug::inspect($var, 'myVar');
151-
152-
// Print debug information.
153-
Debug::print($var);
154-
```
155-
156-
## Contributing
157-
158-
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
159-
160-
## License
161-
162-
This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
3+
Please refer to the [documentation](https://www.derafu.dev/docs/core/support) for more information.

app/bootstrap.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

assets/css/app.css

Lines changed: 0 additions & 8 deletions
This file was deleted.

assets/img/.empty

Whitespace-only changes.

assets/js/app.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/images.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

composer.json

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"name": "derafu/support",
33
"description": "Derafu: Support - Essential PHP Utilities.",
44
"type": "library",
5-
"homepage": "https://derafu.org/support",
5+
"homepage": "https://www.derafu.dev/docs/core/support",
66
"license": "MIT",
77
"authors": [
88
{
99
"name": "Esteban De La Fuente Rubio / Derafu",
10-
"homepage": "https://www.derafu.org"
10+
"homepage": "https://www.derafu.dev"
1111
}
1212
],
1313
"support": {
@@ -35,8 +35,7 @@
3535
"league/csv": "^9.21",
3636
"nesbot/carbon": "^3.8",
3737
"symfony/mime": "^7.2",
38-
"maennchen/zipstream-php": "^3.1",
39-
"derafu/foundation": "dev-main"
38+
"maennchen/zipstream-php": "^3.1"
4039
},
4140
"scripts": {
4241
"docs": "php tools/phpdocumentor run --config=phpdoc.xml",
@@ -45,19 +44,8 @@
4544
"phpcs": "vendor/bin/php-cs-fixer fix -v --dry-run --diff --config=php-cs-fixer.php",
4645
"phpstan": "vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=1G",
4746
"phpstan-export": "vendor/bin/phpstan analyse --configuration=phpstan.neon --level 9 --generate-baseline",
48-
"build": "npm run build",
49-
"post-install-cmd": [
50-
"Derafu\\Foundation\\Installer::copyFiles"
51-
],
52-
"post-update-cmd": [
53-
"Derafu\\Foundation\\Installer::copyFiles"
54-
]
47+
"build": "npm run build"
5548
},
5649
"minimum-stability": "dev",
57-
"prefer-stable": true,
58-
"config": {
59-
"allow-plugins": {
60-
"composer/installers": true
61-
}
62-
}
50+
"prefer-stable": true
6351
}

config/routes.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

config/services.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)