7 Commits
3.8.1 ... 3.8.8

Author SHA1 Message Date
6d1f1b79ba magic methods fixed 2026-03-09 09:10:11 +05:00
393f37577d json POST $variables fix 2025-12-02 18:58:04 +03:00
584285b92c fix #b61599aac9 merge 2025-11-04 12:27:54 +03:00
ed2a41a139 suggest mirzaev/files 2025-11-04 02:42:27 +07:00
89c6d0c814 suggest mirzaev/languages and mirzaev/currencies 2025-11-04 02:24:05 +07:00
67a2ea3e1d suggest mirzaev/pot 2025-11-04 02:16:40 +07:00
cd4a7912d0 suggest mirzaev/baza 2025-11-04 02:14:39 +07:00
7 changed files with 41 additions and 2331 deletions

3
.gitignore vendored
View File

@@ -1 +1,2 @@
vendor vendor
composer.lock

View File

@@ -14,7 +14,7 @@
"name": "Arsen Mirzaev Tatyano-Muradovich", "name": "Arsen Mirzaev Tatyano-Muradovich",
"email": "arsen@mirzaev.sexy", "email": "arsen@mirzaev.sexy",
"homepage": "https://mirzaev.sexy", "homepage": "https://mirzaev.sexy",
"role": "Programmer" "role": "Creator"
} }
], ],
"support": { "support": {
@@ -24,6 +24,13 @@
"require": { "require": {
"php": "~8.4" "php": "~8.4"
}, },
"suggest": {
"mirzaev/baza": "Baza database",
"mirzaev/pot": "Template for projects",
"mirzaev/files": "Easy working with files",
"mirzaev/languages": "Easy languages integration",
"mirzaev/currencies": "Easy currencies integration"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"mirzaev\\minimal\\": "mirzaev/minimal/system" "mirzaev\\minimal\\": "mirzaev/minimal/system"

2320
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@ use Closure as closure,
* @param model $model An instance of the model * @param model $model An instance of the model
* @param router $router An instance of the router * @param router $router An instance of the router
* *
* @mathod void __construct(?string $namespace) Constructor * @method void __construct(?string $namespace) Constructor
* @method void __destruct() Destructor * @method void __destruct() Destructor
* @method string|null start() Initialize request by environment and handle it * @method string|null start() Initialize request by environment and handle it
* @method string|null request(request $request, array $parameters = []) Handle request * @method string|null request(request $request, array $parameters = []) Handle request

View File

@@ -408,9 +408,6 @@ final class request
// Exit (false) // Exit (false)
throw new exception_argument('Failed to validate JSON from the input buffer', status::unprocessable_content->value); throw new exception_argument('Failed to validate JSON from the input buffer', status::unprocessable_content->value);
} }
// Writing parameters from environment into the property
$this->parameters = $_POST ?? [];
} else if ($this->method === method::post) { } else if ($this->method === method::post) {
// POST method // POST method

View File

@@ -114,6 +114,18 @@ final class route
get => $this->options ?? []; get => $this->options ?? [];
} }
/**
* Parameters
*
* @see https://wiki.php.net/rfc/property-hooks (find a table about backed and virtual hooks)
*
* @var array $parameters Arguments for the $this->method (will be concatenated together with generated request parameters)
*/
public array $variables = [] {
// Read
&get => $this->variables;
}
/** /**
* Constructor * Constructor
* *

View File

@@ -8,7 +8,8 @@ namespace mirzaev\minimal\traits;
use mirzaev\minimal\http\enumerations\status; use mirzaev\minimal\http\enumerations\status;
// Built-in libraries // Built-in libraries
use exception; use Exception as exception,
DomainException as exception_domain;
/** /**
* Trait of magical methods * Trait of magical methods
@@ -28,6 +29,8 @@ trait magic
/** /**
* Write property * Write property
* *
* @throws exception_domain Not found the proprty
*
* @param string $name Name of the property * @param string $name Name of the property
* @param mixed $value Value of the property * @param mixed $value Value of the property
* *
@@ -35,14 +38,24 @@ trait magic
*/ */
public function __set(string $name, mixed $value = null): void public function __set(string $name, mixed $value = null): void
{ {
match ($name) { if (property_exists(static, $name)) {
default => throw new exception('Failed to find property: ' . static::class . "::\$$name", status::not_found->value) // Exist the property
};
// Writing the property
$this->{$name} = $value;
} else {
// Not exist the property
// Exit (fail)
throw new exception_domain('Not found the property: ' . static::class . "::\$$name", status::not_found->value);
}
} }
/** /**
* Read property * Read property
* *
* @throws exception_domain Not found the property
*
* @param string $name Name of the property * @param string $name Name of the property
* *
* @return mixed Value of the property * @return mixed Value of the property
@@ -50,7 +63,7 @@ trait magic
public function __get(string $name): mixed public function __get(string $name): mixed
{ {
return match ($name) { return match ($name) {
default => throw new exception('Failed to find property: ' . static::class . "::\$$name", status::not_found->value) default => throw new exception_domain('Not found the property: ' . static::class . "::\$$name", status::not_found->value)
}; };
} }