PHP code example of gcworld / interfaces
1. Go to this page and download the library: Download gcworld/interfaces library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gcworld / interfaces example snippets
use GCWorld\Interfaces\UIRenderableInterface;
final class StatusBadge implements UIRenderableInterface
{
public function __construct(private readonly string $label)
{
}
public function render(): string
{
return sprintf('<span class="status">%s</span>', htmlspecialchars($this->label));
}
}
function renderWidget(UIRenderableInterface $widget): string
{
return $widget->render();
}
console
./dc exec php composer lint
./dc exec php composer phpstan
./dc exec php composer phpcs