* * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION * DEFGROUP: MokoPlatform.Stubs * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/stubs/joomla.php * BRIEF: PHPStan stub declarations for Joomla framework classes * * Declaration-only stubs so PHPStan can resolve Joomla types in extension source * code without requiring a full Joomla installation as a dev dependency. */ declare(strict_types=1); namespace Joomla\CMS\Factory { class Factory { public static function getApplication(): \Joomla\CMS\Application\CMSApplication {} public static function getContainer(): \Joomla\DI\Container {} public static function getDbo(): \Joomla\Database\DatabaseInterface {} public static function getDate(string $time = 'now', mixed $tzOffset = null): \Joomla\CMS\Date\Date {} public static function getLanguage(): \Joomla\CMS\Language\Language {} /** @deprecated 4.0 */ public static function getUser(?int $id = null): \Joomla\CMS\User\User {} public static function getConfig(): \Joomla\Registry\Registry {} public static function getDocument(): \Joomla\CMS\Document\Document {} public static function getSession(): \Joomla\CMS\Session\Session {} } } namespace Joomla\CMS\Application { class CMSApplication { public function input(): \Joomla\CMS\Input\Input {} public function getIdentity(): ?\Joomla\CMS\User\User {} public function getMenu(string $name = 'site', array $options = []): ?\Joomla\CMS\Menu\AbstractMenu {} public function enqueueMessage(string $msg, string $type = self::MSG_INFO): void {} public function redirect(string $url, int $code = 303): void {} public function getRouter(string $name = null, array $options = []): \Joomla\CMS\Router\Router {} public function isSite(): bool {} public function isClient(string $name): bool {} public function triggerEvent(string $eventName, array $args = []): array {} public const MSG_EMERGENCY = 'emergency'; public const MSG_ALERT = 'alert'; public const MSG_CRITICAL = 'critical'; public const MSG_ERROR = 'error'; public const MSG_WARNING = 'warning'; public const MSG_NOTICE = 'notice'; public const MSG_INFO = 'info'; public const MSG_DEBUG = 'debug'; } } namespace Joomla\CMS\MVC\Model { class BaseModel { /** @var \Joomla\Database\DatabaseInterface */ protected $db; public function getState(string $property = null, mixed $default = null): mixed {} public function setState(string $property, mixed $value = null): mixed {} /** @return static */ public static function getInstance(string $type, string $prefix = '', array $config = []): static {} } class ListModel extends BaseModel { /** @return array|false */ public function getItems(): array|false {} public function getPagination(): \Joomla\CMS\Pagination\Pagination {} public function getTotal(): int {} public function getStart(): int {} protected function getListQuery(): \Joomla\Database\QueryInterface {} protected function populateState(string $ordering = null, string $direction = null): void {} } class AdminModel extends BaseModel { public function getTable(string $name = '', string $prefix = 'Table', array $options = []): \Joomla\CMS\Table\Table {} public function getItem(int $pk = null): object|false {} public function save(array $data): bool {} public function delete(array &$pks): bool {} public function validate(\Joomla\CMS\Form\Form $form, array $data, string $group = null): array|false {} public function getForm(array $data = [], bool $loadData = true): \Joomla\CMS\Form\Form|false {} } } namespace Joomla\CMS\MVC\View { class HtmlView { /** @var \Joomla\CMS\MVC\Model\BaseModel */ protected $model; protected string $layout = 'default'; public function display(string $tpl = null): void {} public function setLayout(string $layout): string {} public function getLayout(): string {} public function escape(string $var): string {} public function setModel(\Joomla\CMS\MVC\Model\BaseModel $model, bool $default = false): void {} /** @return \Joomla\CMS\MVC\Model\BaseModel|false */ public function getModel(string $name = ''): mixed {} public function loadTemplate(string $tpl = null): string {} } } namespace Joomla\CMS\Table { abstract class Table { protected string $tbl_name = ''; protected string $tbl_key = 'id'; /** @var \Joomla\Database\DatabaseInterface */ protected $_db; public function __construct(string $table, mixed $key, \Joomla\Database\DatabaseInterface &$db) {} public function load(mixed $keys = null, bool $reset = true): bool {} public function store(bool $updateNulls = false): bool {} public function delete(mixed $pk = null): bool {} public function bind(array|object $array, mixed $ignore = ''): bool {} public function check(): bool {} public function reset(): void {} public function publish(mixed $pks, int $state = 1, int $userId = 0): bool {} public function reorder(string $where = ''): bool {} public function hit(mixed $pk = null): bool {} /** @return static */ public static function getInstance(string $type, string $prefix = 'Table', array $config = []): static {} } } namespace Joomla\CMS\User { class User { public int $id = 0; public string $username = ''; public string $name = ''; public string $email = ''; public bool $guest = true; /** @var array */ public array $params = []; public function authorise(string $action, string $assetname = null): bool {} public function getAuthorisedCategories(string $component, string $action): array {} public function getAuthorisedViewLevels(): array {} /** @return static */ public static function getInstance(int $identifier = 0): static {} } } namespace Joomla\CMS\Component { class ComponentHelper { public static function getParams(string $option): \Joomla\Registry\Registry {} public static function isEnabled(string $option): bool {} public static function getComponent(string $option, bool $strict = false): object {} } } namespace Joomla\CMS\Input { class Input { public function get(string $name, mixed $default = null, string $filter = 'cmd'): mixed {} public function getInt(string $name, int $default = 0): int {} public function getString(string $name, string $default = ''): string {} public function getBool(string $name, bool $default = false): bool {} public function getArray(array $vars = [], array $datasource = null): array {} public function getCmd(string $name, string $default = ''): string {} public function getWord(string $name, string $default = ''): string {} public function post(): static {} public function server(): static {} public function cookie(): static {} public function files(): static {} } } namespace Joomla\Registry { class Registry { public function __construct(mixed $data = null) {} public function get(string $path, mixed $default = null): mixed {} public function set(string $path, mixed $value, string $separator = '.'): mixed {} public function has(string $path): bool {} public function def(string $key, mixed $default = null): mixed {} public function merge(Registry $source, bool $recursive = false): bool {} public function toArray(): array {} public function toObject(): object {} public function toString(string $format = 'JSON', array $options = []): string {} } } namespace Joomla\Database { interface DatabaseInterface { public function getQuery(bool $new = false): QueryInterface; public function setQuery(mixed $query, int $offset = 0, int $limit = 0): static; public function loadObject(string $class = 'stdClass'): ?object; /** @return object[] */ public function loadObjectList(string $key = ''): array; /** @return mixed[] */ public function loadRow(): array; /** @return mixed[][] */ public function loadRowList(int $key = null): array; /** @return mixed */ public function loadResult(): mixed; /** @return mixed[] */ public function loadColumn(): array; public function execute(): bool; public function getNumRows(): int; public function quote(mixed $value, bool $escape = true): string; public function quoteName(mixed $name, mixed $as = null): mixed; public function escape(string $text, bool $extra = false): string; public function insertid(): int; public function transactionStart(bool $asSavepoint = false): void; public function transactionCommit(bool $toSavepoint = false): void; public function transactionRollback(bool $toSavepoint = false): void; } interface QueryInterface { public function select(mixed $columns): static; public function from(mixed $tables, string $subQueryAlias = null): static; public function where(mixed $conditions, string $glue = 'AND'): static; public function join(string $type, mixed $conditions): static; public function order(mixed $columns): static; public function group(mixed $columns): static; public function having(mixed $conditions, string $glue = 'AND'): static; public function insert(mixed $table, bool $incrementField = false): static; public function update(mixed $table): static; public function delete(mixed $table = null): static; public function set(mixed $conditions, string $glue = ','): static; public function values(mixed $values): static; public function columns(mixed $columns): static; public function limit(int $limit = 0, int $offset = 0): static; public function __toString(): string; public function quote(mixed $value, bool $escape = true): string; public function quoteName(mixed $name, mixed $as = null): mixed; } } namespace Joomla\CMS\Language { class Text { public static function _(string $string, bool $jsSafe = false, bool $interpretBackSlashes = true, bool $script = false): string {} public static function plural(string $string, int $n, mixed ...$args): string {} public static function sprintf(string $string, mixed ...$args): string {} public static function script(string $string, bool $jsSafe = true, bool $interpretBackSlashes = true): string {} } } namespace Joomla\CMS\Form { class Form { public function bind(mixed $data): bool {} public function getField(string $name, string $group = null, mixed $value = null): ?FormField {} public function getFieldsets(string $group = null): array {} public function renderField(string $name, string $group = null, mixed $default = null, array $options = []): string {} public function renderFieldset(string $name, array $options = []): string {} public function getValue(string $name, string $group = null, mixed $default = null): mixed {} public function setValue(string $name, ?string $group, mixed $value): void {} public function validate(array $data, string $group = null): bool {} public function filter(array $data, string $group = null): array {} /** @return static */ public static function getInstance(string $name, string $data = null, array $options = [], bool $replace = true, mixed $xpath = false): static {} } abstract class FormField { public string $type = ''; public string $name = ''; public string $label = ''; public mixed $value = null; public function renderField(array $options = []): string {} } } namespace Joomla\CMS\Router { class Route { public static function _(string $url, bool $xhtml = true, int $ssl = null, bool $absolute = false): string {} } } namespace Joomla\CMS\HTML { class HTMLHelper { /** @param mixed ...$args */ public static function _(string $key, ...$args): mixed {} public static function date(mixed $input, string $format = '', mixed $tz = true, bool $gregorian = false): string {} public static function link(string $url, string $text, mixed $attribs = null): string {} public static function image(string $file, string $alt, mixed $attribs = null, bool $relative = false, int $returnPath = 0): string {} public static function calendar(mixed $value, string $name, string $id, string $format = '%Y-%m-%d', mixed $attribs = null): string {} public static function tooltip(string $tooltip, string $title = '', string $image = '', string $text = '', string $href = ''): string {} } }