Files
wp-agentic-writer/vendor/parsica-php/parsica/docs/resources/03_naming_conventions.md
Dwindi Ramadhana 690991c526 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.
2026-06-17 05:27:58 +07:00

1.0 KiB

title, sidebar_label
title sidebar_label
Naming Conventions 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
$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
$parser = stringI('hello world'); 
$result = $parser->tryString("hElLO WoRlD"); 
assertEquals("hElLO WoRlD", $result->output());