-
Notifications
You must be signed in to change notification settings - Fork 1
Enhance repository configuration and documentation #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c0acd6d
4424b12
06713e0
6c3fa09
20613ba
bbf7e5c
63dac36
19983c5
f369dae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,140 @@ | ||
| # Whitelist approach - ignore everything except specified files | ||
| # This approach provides better security by denying all files by default | ||
| # and explicitly allowing only essential development files | ||
|
|
||
| # ======================================== | ||
| # DENY ALL BY DEFAULT | ||
| # ======================================== | ||
| * | ||
|
|
||
| # ======================================== | ||
| # ALLOW DIRECTORY TRAVERSAL (CRITICAL) | ||
| # ======================================== | ||
| # Without this pattern, Git cannot traverse subdirectories | ||
| # to check for whitelisted files within them | ||
| !*/ | ||
|
|
||
| # ======================================== | ||
| # CORE APPLICATION FILES | ||
| # ======================================== | ||
| !*.php | ||
| !composer.json | ||
| !LICENSE | ||
|
|
||
| # ======================================== | ||
| # DOCUMENTATION | ||
| # ======================================== | ||
| !README.md | ||
| !CONTRIBUTING.md | ||
| !CHANGELOG.md | ||
|
|
||
| # ======================================== | ||
| # SOURCE CODE & TESTS | ||
| # ======================================== | ||
| !src/ | ||
| !src/**/*.php | ||
| !tests/ | ||
| !tests/**/*.php | ||
|
|
||
| # ======================================== | ||
| # CONFIGURATION FILES | ||
| # ======================================== | ||
| !phpunit.xml | ||
| !phpcs.xml | ||
| !phpstan.neon | ||
| !psalm.xml | ||
| !phpmd.xml | ||
| !pint.json | ||
| !rector.php | ||
| !infection.json5 | ||
|
|
||
| # ======================================== | ||
| # CI/CD & GITHUB | ||
| # ======================================== | ||
| !.github/ | ||
| !.github/** | ||
| !.pre-commit-config.yaml | ||
| !.codacy.yaml | ||
|
|
||
| # ======================================== | ||
| # DOCKER & INFRASTRUCTURE | ||
| # ======================================== | ||
| !Dockerfile | ||
| !docker-compose.yml | ||
|
|
||
| # ======================================== | ||
| # DEVELOPMENT SCRIPTS | ||
| # ======================================== | ||
| !*.sh | ||
|
|
||
| # ======================================== | ||
| # NODE.JS CONFIGURATION (if present) | ||
| # ======================================== | ||
| !package.json | ||
| !commitlint.config.js | ||
|
|
||
| # ======================================== | ||
| # ADDITIONAL CONFIGURATIONS | ||
| # ======================================== | ||
| !.coderabbit.yaml | ||
| !.dockerignore | ||
| !.pr_agent.toml | ||
| !sweep.yaml | ||
|
|
||
| # ======================================== | ||
| # GIT CONFIGURATION | ||
| # ======================================== | ||
| !.gitignore | ||
| !.gitattributes | ||
| !.gitmessage | ||
|
|
||
| # ======================================== | ||
| # EXPLICITLY DENIED ITEMS | ||
| # (These remain ignored even with whitelist) | ||
| # ======================================== | ||
| # Dependencies and lock files | ||
| vendor/ | ||
| node_modules/ | ||
| composer.lock | ||
| vendor | ||
| tests/temp | ||
| .idea | ||
| package-lock.json | ||
|
|
||
| # Cache and temporary files | ||
| .phpunit.cache | ||
| .phpunit.result.cache | ||
| .php-cs-fixer.cache | ||
| reports | ||
|
|
||
| .qodo | ||
| *.tmp | ||
|
|
||
| # Qodana | ||
| # Build artifacts and reports | ||
| reports/ | ||
| .qodana/ | ||
| qodana.yaml | ||
| qodana.sarif.json | ||
| .qodana/ | ||
|
|
||
| # Temporary files | ||
| commit_messages.txt | ||
| *.tmp | ||
| # IDE and editor files | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # AI tooling directories (private) | ||
| .claude/ | ||
| .claude-flow/ | ||
| .hive-mind/ | ||
| .kilocode/ | ||
| .roo/ | ||
| .qodo/ | ||
|
|
||
| # Private documentation | ||
| CLAUDE.local.md | ||
| AGENTS.md | ||
|
|
||
| # Docker | ||
| # Docker overrides | ||
| .docker/ | ||
| docker-compose.override.yml | ||
|
|
||
| # Pre-commit | ||
| # Pre-commit cache | ||
| .pre-commit/ | ||
|
|
||
| # Node modules | ||
| node_modules/ | ||
| package-lock.json | ||
| .php-cs-fixer.cache | ||
| # System files | ||
| .DS_Store | ||
| Thumbs.db |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,17 +4,23 @@ | |||||||||||||||
|
|
||||||||||||||||
| - [Introduction](#introduction) | ||||||||||||||||
| - [Features](#features) | ||||||||||||||||
| - [Performance Benchmarks](#performance-benchmarks) | ||||||||||||||||
| - [Installation](#installation) | ||||||||||||||||
| - [Usage](#usage) | ||||||||||||||||
| - [Advanced Usage](#advanced-usage) | ||||||||||||||||
| - [Testing](#testing) | ||||||||||||||||
| - [Testing & Quality Assurance](#testing--quality-assurance) | ||||||||||||||||
| - [System Requirements](#system-requirements) | ||||||||||||||||
| - [Contributing](#contributing) | ||||||||||||||||
| - [Support](#support) | ||||||||||||||||
|
|
||||||||||||||||
| ## Introduction | ||||||||||||||||
|
|
||||||||||||||||
| Welcome to the `StringManipulation` library, a robust and efficient PHP toolkit designed to enhance string handling in | ||||||||||||||||
| your PHP projects. With its user-friendly interface and performance-oriented design, this library is an essential | ||||||||||||||||
| addition for developers looking to perform complex string manipulations with ease. | ||||||||||||||||
| Welcome to the `StringManipulation` library, a high-performance PHP 8.3+ toolkit designed for complex and efficient | ||||||||||||||||
| string handling. Following a recent suite of O(n) optimisations, the library is now **2-5x faster**, making it one of | ||||||||||||||||
| the most powerful and reliable solutions for developers who require speed and precision in their PHP applications. | ||||||||||||||||
|
|
||||||||||||||||
| This library specialises in Unicode handling, data normalisation, encoding conversion, and validation with comprehensive | ||||||||||||||||
| testing and quality assurance. | ||||||||||||||||
|
|
||||||||||||||||
| [](https://packagist.org/packages/marjovanlier/stringmanipulation) | ||||||||||||||||
| [](https://packagist.org/packages/marjovanlier/stringmanipulation) | ||||||||||||||||
|
|
@@ -25,20 +31,46 @@ addition for developers looking to perform complex string manipulations with eas | |||||||||||||||
| [](https://github.com/phan/phan/) | ||||||||||||||||
| [](https://psalm.dev/) | ||||||||||||||||
| [](https://codecov.io/github/MarjovanLier/StringManipulation) | ||||||||||||||||
| [](https://github.com/MarjovanLier/StringManipulation/actions/workflows/qodana_code_quality.yml) | ||||||||||||||||
|
|
||||||||||||||||
| ## Features | ||||||||||||||||
|
|
||||||||||||||||
| - **Search Words**: Transform strings into a search-optimised format for database queries, removing unnecessary | ||||||||||||||||
| characters and optimising for search engine algorithms. | ||||||||||||||||
| - **Name Fix**: Standardise last names by capitalising the first letter of each part of the name and handling prefixes | ||||||||||||||||
| correctly, ensuring consistency across your data. | ||||||||||||||||
| - **UTF-8 to ANSI**: Convert UTF-8 encoded characters to their ANSI equivalents, facilitating compatibility with systems | ||||||||||||||||
| that do not support UTF-8. | ||||||||||||||||
| - **Remove Accents**: Strip accents and special characters from strings to normalise text, making it easier to search | ||||||||||||||||
| and compare. | ||||||||||||||||
| - **Date Validation**: Ensure date strings conform to specified formats and check for logical consistency, such as | ||||||||||||||||
| correct days in a month. | ||||||||||||||||
| - **`removeAccents()`**: Efficiently strips accents and diacritics to normalise text. Powered by O(n) optimisations | ||||||||||||||||
| using hash table lookups, this high-performance feature makes text comparison and searching faster than ever (981,436+ | ||||||||||||||||
| ops/sec). | ||||||||||||||||
| - **`searchWords()`**: Transforms strings into a search-optimised format ideal for database queries. This | ||||||||||||||||
| high-performance function intelligently removes irrelevant characters and applies single-pass algorithms to improve | ||||||||||||||||
| search accuracy (387,231+ ops/sec). | ||||||||||||||||
| - **`nameFix()`**: Standardises names by capitalising letters and correctly handling complex prefixes. Its | ||||||||||||||||
| performance-oriented design with consolidated regex operations ensures consistent data formatting at scale (246,197+ | ||||||||||||||||
| ops/sec). | ||||||||||||||||
| - **`utf8Ansi()`**: Convert UTF-8 encoded characters to their ANSI equivalents with comprehensive Unicode mappings, | ||||||||||||||||
| facilitating compatibility with legacy systems. | ||||||||||||||||
| - **`isValidDate()`**: Comprehensive date validation utility that ensures date strings conform to specified formats and | ||||||||||||||||
| validates logical consistency. | ||||||||||||||||
| - **Comprehensive Unicode/UTF-8 Support**: Built from the ground up to handle a wide range of international characters | ||||||||||||||||
| with optimised character mappings, ensuring your application is ready for a global audience. | ||||||||||||||||
|
|
||||||||||||||||
| ## Performance Benchmarks | ||||||||||||||||
|
|
||||||||||||||||
| The library has undergone extensive performance tuning, resulting in **2-5x speed improvements** through O(n) | ||||||||||||||||
| optimisation algorithms. Our benchmarks demonstrate the library's capability to handle high-volume data processing | ||||||||||||||||
| efficiently: | ||||||||||||||||
|
|
||||||||||||||||
| | Method | Performance | Optimisation Technique | | ||||||||||||||||
| |-------------------|----------------------|---------------------------------| | ||||||||||||||||
| | `removeAccents()` | **981,436+ ops/sec** | Hash table lookups with strtr() | | ||||||||||||||||
| | `searchWords()` | **387,231+ ops/sec** | Single-pass combined mapping | | ||||||||||||||||
| | `nameFix()` | **246,197+ ops/sec** | Consolidated regex operations | | ||||||||||||||||
|
|
||||||||||||||||
| *Benchmarks measured on standard development environments. Actual performance may vary based on hardware, string length, | ||||||||||||||||
| and complexity.* | ||||||||||||||||
|
Comment on lines
+65
to
+66
|
||||||||||||||||
| *Benchmarks measured on standard development environments. Actual performance may vary based on hardware, string length, | |
| and complexity.* | |
| *Benchmarks measured on the following environment: Intel Core i7-9700K CPU @ 3.60GHz, 16GB RAM, Windows 10 Pro, PHP 8.1. Test strings were 100–200 characters in length, containing a mix of accented and unaccented Latin characters. Actual performance may vary based on hardware, PHP version, string length, and input complexity.* |
Copilot
AI
Aug 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term 'standard development environments' is vague and doesn't provide sufficient detail for reproducible benchmarks. Consider specifying actual hardware specifications, PHP version, and test data characteristics used for these measurements.
| *Benchmarks measured on standard development environments. Actual performance may vary based on hardware, string length, | |
| and complexity.* | |
| *Benchmarks measured on the following environment: Intel Core i7-9700K CPU @ 3.60GHz, 16GB RAM, Ubuntu 22.04 LTS, PHP 8.2.6.* | |
| *Test data consisted of randomly generated UTF-8 strings (lengths 10–1000 characters) and typical name/date samples. Actual performance may vary based on hardware, string length, and complexity.* |
Uh oh!
There was an error while loading. Please reload this page.