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,15 @@
<?php
declare(strict_types=1);
namespace MyNamespace;
class EnumConsumer
{
public MyEnum $myEnum = MyEnum::VALUE1;
public function consume(MyEnum $enum = MyEnum::VALUE1): MyEnum
{
$this->myEnum = $enum;
}
}

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace MyNamespace;
enum MyBackedEnum : string
{
case VALUE1 = 'this is value1';
case VALUE2 = 'this is value2';
}

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace MyNamespace;
enum MyEnum
{
case VALUE1;
case VALUE2;
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace MyNamespace;
enum MyEnumWithConstant
{
public const MYCONST = 'MyConstValue';
public const INT_CONST = 0;
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
if (!function_exists('h')) {
function h() {
}
} elseif(!function_exists('i')) {
if (true) {
function i()
{
}
}
} else {
function j() {
}
}
function a() {
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
?>
<h1>Test</h1>
<?php
require 'Pizza.php';

View File

@@ -0,0 +1,13 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
require 'Pizza.php';

View File

@@ -0,0 +1,15 @@
#!/bin/php
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
require 'Pizza.php';

View File

@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
require 'Pizza.php';

View File

@@ -0,0 +1,14 @@
<h1>Test</h1>
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
require 'Pizza.php';

View File

@@ -0,0 +1,7 @@
<?php
use Acme\Plugin;
function foo( $output = Plugin::class ) {}
function bar( $output = OBJECT ) {}

View File

@@ -0,0 +1,23 @@
<?php
/**
* setup.php - Document the file.
*
* File long description goes here.
*
* @author Test Sample
*/
namespace {
/**
* autoloader function.
*
* Function long description goes here.
*
* @param string $class Namespaced class name
* @return void
*/
function libAutoload($class){
echo 'Do something';
}
spl_autoload_register('libAutoload');
}

View File

@@ -0,0 +1,11 @@
<?php
class Foo {
public function test() {
function internal() {
return "yep";
}
return internal();
}
}

View File

@@ -0,0 +1,15 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
declare(strict_types=1);
require 'Pizza.php';

View File

@@ -0,0 +1,21 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace Luigi {
trait ExampleNestedTrait
{
private function exampleTraitMethod()
{
}
}
}

View File

@@ -0,0 +1,17 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace Luigi;
interface Packing extends \Packing
{
}

View File

@@ -0,0 +1,99 @@
<?php
// phpcs:ignoreFile
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace Luigi;
use Luigi\Pizza\Sauce;
use Luigi\Pizza\TomatoSauce;
#[\Food("Pizza")]
#[\Food(country: "Italy", originDate: Pizza::class)]
class Pizza extends \Pizza
{
const
/** @var string DELIVERY designates that the delivery method is to deliver the pizza to the customer. */
DELIVERY = 'delivery',
/** @var string PICKUP designates that the delivery method is that the customer picks the pizza up. */
PICKUP = 'pickup';
use ExampleNestedTrait;
/** @var static contains the active instance for this Pizza. */
static private $instance;
/**
* @var Pizza\Style $style
* @var Pizza\Sauce|null $sauce
* @var Pizza\Topping[] $toppings
*/
private $style, $sauce, $toppings;
/**
* The size of the pizza in centimeters, defaults to 20cm.
*/
public int $size = \Luigi\Pizza\SIZE_20CM;
var $legacy; // don't use this anymore!
protected
/** @var string $packaging The type of packaging for this Pizza */
$packaging = self::PACKAGING,
/** @var string $deliveryMethod Is the customer picking this pizza up or must it be delivered? */
$deliveryMethod;
private function __construct(Pizza\Style $style, Sauce|null $sauce = null)
{
$this->style = $style;
}
/**
* Creates a new instance of a Pizza.
*
* This method can be used to instantiate a new object of this class which can then be retrieved using
* {@see self::getInstance()}.
*
* @param Pizza\Style $style
*
* @see self::getInstance to retrieve the pizza object.
*
* @return void
*/
public static function createInstance(Pizza\Style $style)
{
self::$instance = new static($style);
}
/**
* @return self
*/
static function getInstance()
{
return self::$instance;
}
final public function setSauce(Pizza\Sauce $sauce)
{
$this->sauce = $sauce;
}
final public function addTopping(Pizza\Topping $topping)
{
$this->toppings[] = $topping;
}
public function setSize(&$size = \Luigi\Pizza\SIZE_20CM)
{
}
public function getPrice()
{
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace Luigi;
use Luigi\Pizza\PizzaComponentFactory;
final class StyleFactory extends PizzaComponentFactory
{
public function getPrice()
{
}
protected function calculatePrice()
{
}
}

View File

@@ -0,0 +1,27 @@
<?php
// phpcs:ignoreFile
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace Luigi;
/**
* Any class implementing this interface has an associated price.
*
* Using this interface we can easily add the price of all components in a pizza by checking for this interface and
* adding the prices together for all components.
*/
interface Valued
{
const BASE_PRICE = 1;
function getPrice();
}

View File

@@ -0,0 +1,14 @@
<?php declare(strict_types=1);
namespace Luigi;
const OVEN_TEMPERATURE = 9001;
define('\\Luigi\\MAX_OVEN_TEMPERATURE', 9002);
define('OUTSIDE_OVEN_TEMPERATURE', 9002);
define(__NAMESPACE__ . 'Foo\\_OUTSIDE_OVEN_TEMPERATURE', 9002);
$v = 1;
define($v . '_OUTSIDE_OVEN_TEMPERATURE', 9002);
function in_function_define(){
define('IN_FUNCTION_OVEN_TEMPERATURE', 9003);
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace PHP8;
use DateTimeImmutable;
class ConstructorPromotion
{
private const DEFAULT_VALUE = 'default';
/**
* Constructor with promoted properties
*
* @param string $name my docblock name
*/
public function __construct(
/**
* Summary
*
* Description
*
* @var string $name property description
*/
public string $name = 'default name',
protected Email $email = new Email(),
private DateTimeImmutable $birth_date,
private DateTimeImmutable $created_at = new DateTimeImmutable('now'),
private array $uses_constants = [self::DEFAULT_VALUE],
) {}
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace PHP8;
class MixedType
{
public mixed $property;
public function getProperty(): mixed
{
return $this->property;
}
public function setProperty(mixed $value): void
{
$this->property = $value;
}
}

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace PHP8;
class StaticType
{
//Static is not allowed here
public static $property;
public function getProperty(): static
{
return $this->property;
}
public function setProperty($value): void
{
$this->property = $value;
}
}

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace PHP8;
use Foo\Date;
class UnionTypes
{
private string|null|false $property;
public function union(int|false $test): string|null|Date
{
}
}

View File

@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
namespace PHP83;
class TypedConstants
{
const string NAME = 'typed';
const int COUNT = 42;
const string|int UNION = 'either';
const ?string NULLABLE = null;
const UNTYPED = 'no type';
}

View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
class AsymmetricAccessor
{
private(set) \Pizza $pizza;
}

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
class AsymmetricPropertyPromotion
{
public function __construct(
protected(set) Pizza $pizza,
) {}
}

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace PHP84;
interface HasId
{
public int $id { get; }
}
interface HasName
{
public string $name { get; set; }
}

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
class PropertyHook
{
private bool $modified = false;
/** @var string this is my property */
#[Property(new DateTimeImmutable())]
public string $example = 'default value' {
/** Not sure this works, but it gets */
#[Getter(new DateTimeImmutable())]
get {
if ($this->modified) {
return $this->foo . ' (modified)';
}
return $this->foo;
}
/** Not sure this works, but it sets */
#[Setter(new DateTimeImmutable())]
set(string|int $value) {
$this->foo = strtolower($value);
$this->modified = true;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
class PropertyHook
{
private bool $modified = false;
/** @var string this is my property */
#[Property(new DateTimeImmutable())]
public private(set) string $example = 'default value' {
get {
if ($this->modified) {
return $this->foo . ' (modified)';
}
return $this->foo;
}
set(string|int $value) {
$this->foo = strtolower($value);
$this->modified = true;
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
class PropertyHook
{
private bool $modified = false;
/** @param string $example this is my property */
public function __construct(
/** @var string this is my property */
#[Property(new DateTimeImmutable())]
public string $example = 'default value' {
/** Not sure this works, but it gets */
#[Getter(new DateTimeImmutable())]
get {
if ($this->modified) {
return $this->foo . ' (modified)';
}
return $this->foo;
}
/** Not sure this works, but it sets */
#[Setter(new DateTimeImmutable())]
set(string|int $value) {
$this->foo = strtolower($value);
$this->modified = true;
}
}
)
{
}
}

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
class PropertyHookVirtual
{
/**
* A virtual property that composes a full name from first and last name
*/
public string $fullName {
// This is a virtual property with a getter
// It doesn't reference $this->fullName
get {
return $this->firstName . ' ' . $this->lastName;
}
}
/**
* A virtual property that decomposes a full name into first and last name
*/
public string $compositeName {
// This is a virtual property with a setter
// It doesn't reference $this->compositeName
set(string $value) {
[$this->firstName, $this->lastName] = explode(' ', $value, 2);
}
}
/**
* A virtual property with both getter and setter
*/
public string $completeFullName {
// Getter doesn't reference $this->completeFullName
get {
return $this->firstName . ' ' . $this->lastName;
}
// Setter doesn't reference $this->completeFullName
set(string $value) {
[$this->firstName, $this->lastName] = explode(' ', $value, 2);
}
}
/**
* A non-virtual property that references itself in its hook
*/
public string $nonVirtualName {
get {
return $this->nonVirtualName ?? $this->firstName;
}
set(string $value) {
$this->nonVirtualName = $value;
}
}
public function __construct(
private string $firstName = 'John',
private string $lastName = 'Doe'
) {
}
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2015-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
interface Packing
{
public function getName(): string;
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2018 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
/**
* This needs a docblock to separate from
* file docblock
*/
const OVEN_TEMPERATURE = 9001;
define('MAX_OVEN_TEMPERATURE', 9002);
/**
* Pizza base class
*/
class Pizza
{
/**
* The packaging method used to transport the pizza.
*/
const PACKAGING = 'box';
}

View File

@@ -0,0 +1,8 @@
<?php
function simpleFunction(array $options = []): void
{
return;
}
exit();