Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
148
vendor/sokil/php-isocodes/src/IsoCodesFactory.php
vendored
Normal file
148
vendor/sokil/php-isocodes/src/IsoCodesFactory.php
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sokil\IsoCodes;
|
||||
|
||||
use Sokil\IsoCodes\Database\Countries;
|
||||
use Sokil\IsoCodes\Database\Currencies;
|
||||
use Sokil\IsoCodes\Database\HistoricCountries;
|
||||
use Sokil\IsoCodes\Database\Languages;
|
||||
use Sokil\IsoCodes\Database\LanguagesInterface;
|
||||
use Sokil\IsoCodes\Database\LanguagesPartitioned;
|
||||
use Sokil\IsoCodes\Database\Scripts;
|
||||
use Sokil\IsoCodes\Database\Subdivisions;
|
||||
use Sokil\IsoCodes\Database\SubdivisionsInterface;
|
||||
use Sokil\IsoCodes\Database\SubdivisionsPartitioned;
|
||||
use Sokil\IsoCodes\TranslationDriver\GettextExtensionDriver;
|
||||
use Sokil\IsoCodes\TranslationDriver\TranslationDriverInterface;
|
||||
|
||||
/**
|
||||
* Factory class to build ISO databases
|
||||
*/
|
||||
class IsoCodesFactory
|
||||
{
|
||||
/**
|
||||
* Database splits into partition files.
|
||||
*
|
||||
* Fetching some entry will load only little part of database.
|
||||
* Loaded entries not stored statically.
|
||||
*
|
||||
* This scenario may be useful when just few entries need
|
||||
* to be loaded, for example on web request when one entry fetched.
|
||||
*
|
||||
* This may require a lot of file read operations.
|
||||
*/
|
||||
public const OPTIMISATION_MEMORY = 1;
|
||||
|
||||
/**
|
||||
* Entire database loaded into memory from single JSON file once.
|
||||
*
|
||||
* All entries created and stored into RAM. Next read of save
|
||||
* entry will just return it without io operations with files and building objects.
|
||||
*
|
||||
* This scenario may be useful for daemons to decrease file operations,
|
||||
* or when most entries will be fetched from database.
|
||||
*
|
||||
* This may require a lot of RAM for storing all entries.
|
||||
*/
|
||||
public const OPTIMISATION_IO = 2;
|
||||
|
||||
/**
|
||||
* Path to directory with databases
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $baseDirectory;
|
||||
|
||||
/**
|
||||
* @var TranslationDriverInterface
|
||||
*/
|
||||
private $translationDriver;
|
||||
|
||||
public function __construct(
|
||||
?string $baseDirectory = null,
|
||||
?TranslationDriverInterface $translationDriver = null
|
||||
) {
|
||||
$this->baseDirectory = $baseDirectory;
|
||||
$this->translationDriver = $translationDriver ?? new GettextExtensionDriver();
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 3166-1
|
||||
*/
|
||||
public function getCountries(): Countries
|
||||
{
|
||||
return new Countries($this->baseDirectory, $this->translationDriver);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 3166-2
|
||||
*
|
||||
* @param int $optimisation One of self::OPTIMISATION_* constants
|
||||
*
|
||||
* @throws \InvalidArgumentException When invalid optimisation specified
|
||||
*/
|
||||
public function getSubdivisions(int $optimisation = self::OPTIMISATION_MEMORY): SubdivisionsInterface
|
||||
{
|
||||
switch ($optimisation) {
|
||||
case self::OPTIMISATION_MEMORY:
|
||||
$database = new SubdivisionsPartitioned($this->baseDirectory, $this->translationDriver);
|
||||
break;
|
||||
case self::OPTIMISATION_IO:
|
||||
$database = new Subdivisions($this->baseDirectory, $this->translationDriver);
|
||||
break;
|
||||
default:
|
||||
throw new \InvalidArgumentException('Invalid optimisation specified');
|
||||
}
|
||||
|
||||
return $database;
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 3166-3
|
||||
*/
|
||||
public function getHistoricCountries(): HistoricCountries
|
||||
{
|
||||
return new HistoricCountries($this->baseDirectory, $this->translationDriver);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 15924
|
||||
*/
|
||||
public function getScripts(): Scripts
|
||||
{
|
||||
return new Scripts($this->baseDirectory, $this->translationDriver);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 4217
|
||||
*/
|
||||
public function getCurrencies(): Currencies
|
||||
{
|
||||
return new Currencies($this->baseDirectory, $this->translationDriver);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 639-3
|
||||
*
|
||||
* @param int $optimisation One of self::OPTIMISATION_* constants
|
||||
*
|
||||
* @throws \InvalidArgumentException When invalid optimisation specified
|
||||
*/
|
||||
public function getLanguages(int $optimisation = self::OPTIMISATION_MEMORY): LanguagesInterface
|
||||
{
|
||||
switch ($optimisation) {
|
||||
case self::OPTIMISATION_MEMORY:
|
||||
$database = new LanguagesPartitioned($this->baseDirectory, $this->translationDriver);
|
||||
break;
|
||||
case self::OPTIMISATION_IO:
|
||||
$database = new Languages($this->baseDirectory, $this->translationDriver);
|
||||
break;
|
||||
default:
|
||||
throw new \InvalidArgumentException('Invalid optimisation specified');
|
||||
}
|
||||
|
||||
return $database;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user