frontend and backend
This commit is contained in:
29
backend/src/Entity/PregDTO.php
Normal file
29
backend/src/Entity/PregDTO.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Resource\Functions;
|
||||
|
||||
/**
|
||||
* Basic data comming from form.
|
||||
*/
|
||||
class PregDTO
|
||||
{
|
||||
public function __construct(
|
||||
public readonly Functions $method,
|
||||
public readonly string $pattern,
|
||||
public readonly string $replacement,
|
||||
public readonly string $subject,
|
||||
public readonly bool $PREG_OFFSET_CAPTURE,
|
||||
public readonly bool $PREG_SET_ORDER,
|
||||
public readonly bool $PREG_SPLIT_DELIM_CAPTURE,
|
||||
public readonly bool $PREG_SPLIT_NO_EMPTY,
|
||||
public readonly bool $PREG_SPLIT_OFFSET_CAPTURE,
|
||||
public readonly bool $PREG_UNMATCHED_AS_NULL,
|
||||
public readonly ?int $offset,
|
||||
public readonly ?int $limit,
|
||||
public readonly ?string $delimiter
|
||||
) {}
|
||||
}
|
24
backend/src/Entity/PregResponse.php
Normal file
24
backend/src/Entity/PregResponse.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Data returned to web interface. Will be converted to JSON most likely.
|
||||
*/
|
||||
class PregResponse
|
||||
{
|
||||
public function __construct(
|
||||
public readonly mixed $dump,
|
||||
public readonly string $code,
|
||||
public readonly ?string $returnType,
|
||||
public readonly ?string $returnValue,
|
||||
) {
|
||||
if (preg_last_error() !== PREG_NO_ERROR) {
|
||||
throw new Exception('preg_last_error() = '. preg_last_error_msg());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user