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:
Dwindi Ramadhana
2026-06-17 05:27:58 +07:00
parent d3f142222c
commit 690991c526
7963 changed files with 941566 additions and 67372 deletions

View File

@@ -0,0 +1,18 @@
<?php
/**
* Class containing no style errors according to the end-to-end tests phpcs.xml.dist.
*
* @copyright 2025 PHPCSStandards and contributors
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
*/
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
class ClassOneWithoutStyleError
{
private function foo()
{
return 'bar';
}
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* Class containing no style errors.
*
* @copyright 2025 PHPCSStandards and contributors
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
*/
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
class ClassTwoWithoutStyleError
{
/**
* A property.
*
* @var string
*/
private $bar = 'baz';
}

View File

@@ -0,0 +1,22 @@
<?php
/**
* Class containing a simple style error that phpcbf can fix.
*
* @copyright 2025 PHPCSStandards and contributors
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
*/
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
class ClassWithStyleError
{
/**
* The bracket for this function is misaligned and this can be automatically fixed by phpcbf.
*
* @return string
*/
private function foo() {
return 'bar';
}
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="EndToEndTests" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>The coding standard for end to end tests.</description>
<rule ref="PSR12"/>
<file>.</file>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="75"/>
<arg value="p"/>
</ruleset>

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
function tear_down() {
rm -f tests/EndToEnd/Fixtures/*.fixed
}
function test_phpcs_out_of_memory_error_handling() {
OUTPUT="$(bin/phpcs -d memory_limit=4M --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/)"
# Exit code may be 255 or 139 depending on the PHP version, but the exact code is not our concern, just that it's non-zero.
assert_unsuccessful_code
assert_contains "The PHP_CodeSniffer \"phpcs\" command ran out of memory." "$OUTPUT"
assert_contains "Either raise the \"memory_limit\" of PHP in the php.ini file or raise the memory limit at runtime" "$OUTPUT"
assert_contains "using \"phpcs -d memory_limit=512M\" (replace 512M with the desired memory limit)." "$OUTPUT"
}
function test_phpcbf_out_of_memory_error_handling() {
OUTPUT="$(bin/phpcbf -d memory_limit=4M --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ --suffix=.fixed)"
# Exit code may be 255 or 139 depending on the PHP version, but the exact code is not our concern, just that it's non-zero.
assert_unsuccessful_code
assert_contains "The PHP_CodeSniffer \"phpcbf\" command ran out of memory." "$OUTPUT"
assert_contains "Either raise the \"memory_limit\" of PHP in the php.ini file or raise the memory limit at runtime" "$OUTPUT"
assert_contains "using \"phpcbf -d memory_limit=512M\" (replace 512M with the desired memory limit)." "$OUTPUT"
}

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
function tear_down() {
rm -rf tests/EndToEnd/Fixtures/*.fixed
}
function test_phpcbf_is_working() {
OUTPUT="$(bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
assert_successful_code
assert_contains "No violations were found" "$OUTPUT"
}
function test_phpcbf_is_working_in_parallel() {
OUTPUT="$(bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
assert_successful_code
assert_contains "No violations were found" "$OUTPUT"
}
function test_phpcbf_returns_error_on_issues() {
OUTPUT="$(bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
assert_exit_code 1
assert_contains "F 1 / 1 (100%)" "$OUTPUT"
assert_contains "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" "$OUTPUT"
}
function test_phpcbf_bug_1112() {
# See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
if [[ "$(uname)" == "Darwin" ]]; then
# Perform some magic with `& fg` to prevent the processes from turning into a background job.
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc" & fg')"
else
# This is not needed on Linux / GitHub Actions
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc"')"
fi
}

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
function test_phpcs_is_working() {
assert_successful_code "$(bin/phpcs --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
}
function test_phpcs_is_working_in_parallel() {
assert_successful_code "$(bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
}
function test_phpcs_returns_error_on_issues() {
OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
assert_exit_code 2
assert_contains "E 1 / 1 (100%)" "$OUTPUT"
assert_contains "FOUND 1 ERROR AFFECTING 1 LINE" "$OUTPUT"
}
function test_phpcs_bug_1112() {
# See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
if [[ "$(uname)" == "Darwin" ]]; then
# Perform some magic with `& fg` to prevent the processes from turning into a background job.
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc" & fg')"
else
# This is not needed on Linux / GitHub Actions
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc"')"
fi
}