refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
This commit is contained in:
38
vendor/parsica-php/parsica/docs/resources/03_naming_conventions.md
vendored
Normal file
38
vendor/parsica-php/parsica/docs/resources/03_naming_conventions.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: Naming Conventions
|
||||
sidebar_label: Naming Conventions
|
||||
---
|
||||
|
||||
|
||||
## String and Character
|
||||
|
||||
PHP doesn't have a separate type for strings and characters, as opposed to some languages where string is defined as a list of characters. Still, as a convention in Parsica and its documentation, we generally use `'a'`, `'1'` (single quoted) to indicate a single character, and `"a"`, `"abc123"` (double quoted) to indicate a string.
|
||||
|
||||
We also use single quotes to indicate constant strings or symbols, such as `'STATUS_SUCCESS'`;
|
||||
|
||||
|
||||
## Predicates
|
||||
|
||||
Predicates are either prefixed with `is` or suffixed with `pred`.
|
||||
|
||||
```php
|
||||
<?php
|
||||
$predicate = orPred(isEqual('5'), isEqual('6'));
|
||||
assertTrue($predicate('6'));
|
||||
```
|
||||
|
||||
## Character Parsers
|
||||
|
||||
A parser for a single character is always suffixed with `Char`, as in `digitChar()`. These always output a string.
|
||||
|
||||
## Case
|
||||
|
||||
Some parsers have case-insensitive versions. These are sufficed with 'I'.
|
||||
|
||||
```php
|
||||
<?php
|
||||
$parser = stringI('hello world');
|
||||
$result = $parser->tryString("hElLO WoRlD");
|
||||
assertEquals("hElLO WoRlD", $result->output());
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user