diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index a6046355..d62daac2 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -4,8 +4,7 @@ $finder = PhpCsFixer\Finder::create() ->exclude(['packages']) ->ignoreVCSIgnored(true) ->files()->name('*.php') - ->in(__DIR__) -; + ->in(__DIR__); $cfg = new PhpCsFixer\Config(); return $cfg @@ -15,81 +14,41 @@ return $cfg 'array_syntax' => ['syntax' => 'short'], 'combine_consecutive_unsets' => true, 'class_attributes_separation' => true, + 'class_attributes_separation' => ['elements' => ['const' => 'none', 'property' => 'none']], 'multiline_whitespace_before_semicolons' => false, 'single_quote' => true, - // 'blank_line_after_opening_tag' => true, - // 'blank_line_before_return' => true, - 'braces' => [ - 'allow_single_line_closure' => true, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'next', - 'position_after_functions_and_oop_constructs' => 'next', + 'blank_line_after_opening_tag' => true, + 'curly_braces_position' => [ + 'control_structures_opening_brace' => 'next_line_unless_newline_at_signature_end', + 'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end' + ], + 'control_structure_continuation_position' => [ + 'position' => 'next_line' + ], + 'cast_spaces' => [ + 'space' => 'none' ], - // 'cast_spaces' => true, - // 'class_definition' => array('singleLine' => true), 'concat_space' => ['spacing' => 'one'], 'declare_equal_normalize' => true, - 'function_typehint_space' => true, + 'type_declaration_spaces' => true, 'single_line_comment_style' => ['comment_types' => ['hash']], 'include' => true, 'lowercase_cast' => true, - // 'native_function_casing' => true, - // 'new_with_braces' => true, - // 'no_blank_lines_after_class_opening' => true, - // 'no_blank_lines_after_phpdoc' => true, - // 'no_empty_comment' => true, - // 'no_empty_phpdoc' => true, - // 'no_empty_statement' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, - // 'no_mixed_echo_print' => array('use' => 'echo'), 'no_multiline_whitespace_around_double_arrow' => true, - // 'no_short_bool_cast' => true, - // 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, - // 'no_trailing_comma_in_list_call' => true, - // 'no_trailing_comma_in_singleline_array' => true, - // 'no_unneeded_control_parentheses' => true, - // 'no_unused_imports' => true, 'no_whitespace_before_comma_in_array' => true, 'no_whitespace_in_blank_line' => true, - // 'normalize_index_brace' => true, 'object_operator_without_whitespace' => true, - // 'php_unit_fqcn_annotation' => true, - // 'phpdoc_align' => true, - // 'phpdoc_annotation_without_dot' => true, - // 'phpdoc_indent' => true, - // 'phpdoc_inline_tag' => true, - // 'phpdoc_no_access' => true, - // 'phpdoc_no_alias_tag' => true, - // 'phpdoc_no_empty_return' => true, - // 'phpdoc_no_package' => true, - // 'phpdoc_no_useless_inheritdoc' => true, - // 'phpdoc_return_self_reference' => true, - // 'phpdoc_scalar' => true, - // 'phpdoc_separation' => true, - // 'phpdoc_single_line_var_spacing' => true, - // 'phpdoc_summary' => true, - // 'phpdoc_to_comment' => true, - // 'phpdoc_trim' => true, - // 'phpdoc_types' => true, - // 'phpdoc_var_without_name' => true, - // 'pre_increment' => true, - // 'return_type_declaration' => true, - // 'self_accessor' => true, - // 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - // 'single_class_element_per_statement' => true, - // 'space_after_semicolon' => true, - // 'standardize_not_equals' => true, + 'blank_lines_before_namespace' => true, 'ternary_operator_spaces' => true, - // 'trailing_comma_in_multiline_array' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, + 'no_trailing_comma_in_singleline' => true ]) ->setIndent("\t") ->setLineEnding("\n") ->setUsingCache(false) - ->setFinder($finder) -; + ->setFinder($finder); diff --git a/app.php b/app.php index 31905be6..bc5b1b39 100644 --- a/app.php +++ b/app.php @@ -62,15 +62,18 @@ AppFactory::setContainer(new DI\Container()); $app = AppFactory::create(); $container = $app->getContainer(); -$container->set('view', function (Container $container) { +$container->set('view', function (Container $container) +{ return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); }); -$container->set('UrlManager', function (Container $container) { +$container->set('UrlManager', function (Container $container) +{ return new UrlManager(GROCY_BASE_URL); }); -$container->set('ApiKeyHeaderName', function (Container $container) { +$container->set('ApiKeyHeaderName', function (Container $container) +{ return 'GROCY-API-KEY'; }); diff --git a/controllers/BaseApiController.php b/controllers/BaseApiController.php index 6fb2a4bf..4066c1e3 100644 --- a/controllers/BaseApiController.php +++ b/controllers/BaseApiController.php @@ -8,9 +8,7 @@ use Psr\Http\Message\ResponseInterface as Response; class BaseApiController extends BaseController { const PATTERN_FIELD = '[A-Za-z_][A-Za-z0-9_]+'; - const PATTERN_OPERATOR = '!?((>=)|(<=)|=|~|<|>|(ยง))'; - const PATTERN_VALUE = '[A-Za-z\p{L}\p{M}0-9*_.$#^| -\\\]+'; protected $OpenApiSpec = null; diff --git a/controllers/BaseController.php b/controllers/BaseController.php index 1ef26a48..cbb6b3ad 100644 --- a/controllers/BaseController.php +++ b/controllers/BaseController.php @@ -29,7 +29,6 @@ class BaseController } protected $AppContainer; - private $View; protected function getApiKeyService() @@ -125,10 +124,12 @@ class BaseController $this->View->set('version', $versionInfo->Version); $localizationService = $this->getLocalizationService(); - $this->View->set('__t', function (string $text, ...$placeholderValues) use ($localizationService) { + $this->View->set('__t', function (string $text, ...$placeholderValues) use ($localizationService) + { return $localizationService->__t($text, $placeholderValues); }); - $this->View->set('__n', function ($number, $singularForm, $pluralForm, $isQu = false) use ($localizationService) { + $this->View->set('__n', function ($number, $singularForm, $pluralForm, $isQu = false) use ($localizationService) + { return $localizationService->__n($number, $singularForm, $pluralForm, $isQu); }); $this->View->set('LocalizationStrings', $localizationService->GetPoAsJsonString()); @@ -142,7 +143,8 @@ class BaseController } $this->View->set('dir', $dir); - $this->View->set('U', function ($relativePath, $isResource = false) use ($container) { + $this->View->set('U', function ($relativePath, $isResource = false) use ($container) + { return $container->get('UrlManager')->ConstructUrl($relativePath, $isResource); }); diff --git a/controllers/GrocycodeTrait.php b/controllers/GrocycodeTrait.php index 4d52cb8b..2f4d1ddd 100644 --- a/controllers/GrocycodeTrait.php +++ b/controllers/GrocycodeTrait.php @@ -16,11 +16,11 @@ trait GrocycodeTrait if (GROCY_GROCYCODE_TYPE == '2D') { - $png = (new DatamatrixFactory())->setCode((string) $grocycode)->setSize($size)->getDatamatrixPngData(); + $png = (new DatamatrixFactory())->setCode((string)$grocycode)->setSize($size)->getDatamatrixPngData(); } else { - $png = (new BarcodeFactory())->setType('C128')->setCode((string) $grocycode)->setHeight($size)->getBarcodePngData(); + $png = (new BarcodeFactory())->setType('C128')->setCode((string)$grocycode)->setHeight($size)->getBarcodePngData(); } $isDownload = $request->getQueryParam('download', false); diff --git a/controllers/Users/User.php b/controllers/Users/User.php index a374e6f3..01b18e4f 100644 --- a/controllers/Users/User.php +++ b/controllers/Users/User.php @@ -8,63 +8,34 @@ use LessQL\Result; class User { const PERMISSION_ADMIN = 'ADMIN'; - const PERMISSION_BATTERIES = 'BATTERIES'; - const PERMISSION_BATTERIES_TRACK_CHARGE_CYCLE = 'BATTERIES_TRACK_CHARGE_CYCLE'; - const PERMISSION_BATTERIES_UNDO_CHARGE_CYCLE = 'BATTERIES_UNDO_CHARGE_CYCLE'; - const PERMISSION_CALENDAR = 'CALENDAR'; - const PERMISSION_CHORES = 'CHORES'; - const PERMISSION_CHORE_TRACK_EXECUTION = 'CHORE_TRACK_EXECUTION'; - const PERMISSION_CHORE_UNDO_EXECUTION = 'CHORE_UNDO_EXECUTION'; - const PERMISSION_EQUIPMENT = 'EQUIPMENT'; - const PERMISSION_MASTER_DATA_EDIT = 'MASTER_DATA_EDIT'; - const PERMISSION_RECIPES = 'RECIPES'; - const PERMISSION_RECIPES_MEALPLAN = 'RECIPES_MEALPLAN'; - const PERMISSION_SHOPPINGLIST = 'SHOPPINGLIST'; - const PERMISSION_SHOPPINGLIST_ITEMS_ADD = 'SHOPPINGLIST_ITEMS_ADD'; - const PERMISSION_SHOPPINGLIST_ITEMS_DELETE = 'SHOPPINGLIST_ITEMS_DELETE'; - const PERMISSION_STOCK = 'STOCK'; - const PERMISSION_STOCK_CONSUME = 'STOCK_CONSUME'; - const PERMISSION_STOCK_EDIT = 'STOCK_EDIT'; - const PERMISSION_STOCK_INVENTORY = 'STOCK_INVENTORY'; - const PERMISSION_STOCK_OPEN = 'STOCK_OPEN'; - const PERMISSION_STOCK_PURCHASE = 'STOCK_PURCHASE'; - const PERMISSION_STOCK_TRANSFER = 'STOCK_TRANSFER'; - const PERMISSION_TASKS = 'TASKS'; - const PERMISSION_TASKS_MARK_COMPLETED = 'TASKS_MARK_COMPLETED'; - const PERMISSION_TASKS_UNDO_EXECUTION = 'TASKS_UNDO_EXECUTION'; - const PERMISSION_USERS = 'USERS'; - const PERMISSION_USERS_CREATE = 'USERS_CREATE'; - const PERMISSION_USERS_EDIT = 'USERS_EDIT'; - const PERMISSION_USERS_EDIT_SELF = 'USERS_EDIT_SELF'; - const PERMISSION_USERS_READ = 'USERS_READ'; public function __construct() diff --git a/controllers/UsersController.php b/controllers/UsersController.php index 6b479924..0945a4af 100644 --- a/controllers/UsersController.php +++ b/controllers/UsersController.php @@ -51,7 +51,8 @@ class UsersController extends BaseController public function UserSettings(Request $request, Response $response, array $args) { return $this->renderPage($response, 'usersettings', [ - 'languages' => array_filter(scandir(__DIR__ . '/../localization'), function ($item) { + 'languages' => array_filter(scandir(__DIR__ . '/../localization'), function ($item) + { if ($item == '.' || $item == '..') { return false; diff --git a/helpers/BaseBarcodeLookupPlugin.php b/helpers/BaseBarcodeLookupPlugin.php index c4df8f33..87a10a8e 100644 --- a/helpers/BaseBarcodeLookupPlugin.php +++ b/helpers/BaseBarcodeLookupPlugin.php @@ -11,7 +11,6 @@ abstract class BaseBarcodeLookupPlugin } protected $Locations; - protected $QuantityUnits; final public function Lookup($barcode) diff --git a/helpers/Grocycode.php b/helpers/Grocycode.php index 9eb4a3a4..10298474 100644 --- a/helpers/Grocycode.php +++ b/helpers/Grocycode.php @@ -18,13 +18,9 @@ namespace Grocy\Helpers; class Grocycode { public const PRODUCT = 'p'; - public const BATTERY = 'b'; - public const CHORE = 'c'; - public const RECIPE = 'r'; - public const MAGIC = 'grcy'; public function __construct(...$args) @@ -49,11 +45,8 @@ class Grocycode } public static $Items = [self::PRODUCT, self::BATTERY, self::CHORE, self::RECIPE]; - private $type; - private $id; - private $extra_data = []; public static function Validate(string $code) diff --git a/middleware/BaseMiddleware.php b/middleware/BaseMiddleware.php index 5129e3ad..62593cd0 100644 --- a/middleware/BaseMiddleware.php +++ b/middleware/BaseMiddleware.php @@ -8,7 +8,6 @@ use DI\Container; class BaseMiddleware { protected $AppContainer; - protected $ApplicationService; public function __construct(Container $container) diff --git a/middleware/LocaleMiddleware.php b/middleware/LocaleMiddleware.php index 3b2f6b06..4520d4b8 100644 --- a/middleware/LocaleMiddleware.php +++ b/middleware/LocaleMiddleware.php @@ -35,9 +35,10 @@ class LocaleMiddleware extends BaseMiddleware // Src: https://gist.github.com/spolischook/0cde9c6286415cddc088 $prefLocales = array_reduce( explode(',', $langs), - function ($res, $el) { + function ($res, $el) + { list($l, $q) = array_merge(explode(';q=', $el), [1]); - $res[$l] = (float) $q; + $res[$l] = (float)$q; return $res; }, [] diff --git a/routes.php b/routes.php index 9e2d1a88..16ab88bd 100644 --- a/routes.php +++ b/routes.php @@ -5,7 +5,8 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Slim\Routing\RouteCollectorProxy; -$app->group('', function (RouteCollectorProxy $group) { +$app->group('', function (RouteCollectorProxy $group) +{ // System routes $group->get('/', '\Grocy\Controllers\SystemController:Root')->setName('root'); $group->get('/about', '\Grocy\Controllers\SystemController:About'); @@ -124,7 +125,8 @@ $app->group('', function (RouteCollectorProxy $group) { $group->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey'); }); -$app->group('/api', function (RouteCollectorProxy $group) { +$app->group('/api', function (RouteCollectorProxy $group) +{ // OpenAPI $group->get('/openapi/specification', '\Grocy\Controllers\OpenApiController:DocumentationSpec'); @@ -243,6 +245,7 @@ $app->group('/api', function (RouteCollectorProxy $group) { })->add(JsonMiddleware::class); // Handle CORS preflight OPTIONS requests -$app->options('/api/{routes:.+}', function (Request $request, Response $response): Response { +$app->options('/api/{routes:.+}', function (Request $request, Response $response): Response +{ return $response->withStatus(204); }); diff --git a/services/ApiKeyService.php b/services/ApiKeyService.php index e1214d1c..3e2a4753 100644 --- a/services/ApiKeyService.php +++ b/services/ApiKeyService.php @@ -5,7 +5,6 @@ namespace Grocy\Services; class ApiKeyService extends BaseService { const API_KEY_TYPE_DEFAULT = 'default'; - const API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL = 'special-purpose-calendar-ical'; public function CreateApiKey(string $keyType = self::API_KEY_TYPE_DEFAULT, string $description = null) diff --git a/services/ApplicationService.php b/services/ApplicationService.php index e86ef58d..309843f7 100644 --- a/services/ApplicationService.php +++ b/services/ApplicationService.php @@ -33,7 +33,8 @@ class ApplicationService extends BaseService } // Sort changelog items to have the changelog descending by newest version - usort($changelogItems, function ($a, $b) { + usort($changelogItems, function ($a, $b) + { if ($a['release_number'] == $b['release_number']) { return 0; diff --git a/services/ChoresService.php b/services/ChoresService.php index ebfeb0da..5ee3313a 100644 --- a/services/ChoresService.php +++ b/services/ChoresService.php @@ -5,25 +5,15 @@ namespace Grocy\Services; class ChoresService extends BaseService { const CHORE_ASSIGNMENT_TYPE_IN_ALPHABETICAL_ORDER = 'in-alphabetical-order'; - const CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT = 'no-assignment'; - const CHORE_ASSIGNMENT_TYPE_RANDOM = 'random'; - const CHORE_ASSIGNMENT_TYPE_WHO_LEAST_DID_FIRST = 'who-least-did-first'; - const CHORE_PERIOD_TYPE_HOURLY = 'hourly'; - const CHORE_PERIOD_TYPE_DAILY = 'daily'; - const CHORE_PERIOD_TYPE_MANUALLY = 'manually'; - const CHORE_PERIOD_TYPE_MONTHLY = 'monthly'; - const CHORE_PERIOD_TYPE_WEEKLY = 'weekly'; - const CHORE_PERIOD_TYPE_YEARLY = 'yearly'; - const CHORE_PERIOD_TYPE_ADAPTIVE = 'adaptive'; public function CalculateNextExecutionAssignment($choreId) @@ -70,7 +60,8 @@ class ChoresService extends BaseService } elseif ($chore->assignment_type == self::CHORE_ASSIGNMENT_TYPE_IN_ALPHABETICAL_ORDER) { - usort($assignedUsers, function ($a, $b) { + usort($assignedUsers, function ($a, $b) + { return strcmp($a->display_name, $b->display_name); }); diff --git a/services/DatabaseService.php b/services/DatabaseService.php index c394a4af..4a05bda1 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php @@ -8,9 +8,7 @@ use LessQL\Database; class DatabaseService { private static $DbConnection = null; - private static $DbConnectionRaw = null; - private static $instance = null; public function ExecuteDbQuery(string $sql) @@ -63,7 +61,8 @@ class DatabaseService $logFilePath = GROCY_DATAPATH . '/sql.log'; if (file_exists($logFilePath)) { - self::$DbConnection->setQueryCallback(function ($query, $params) use ($logFilePath) { + self::$DbConnection->setQueryCallback(function ($query, $params) use ($logFilePath) + { file_put_contents($logFilePath, $query . ' #### ' . implode(';', $params) . PHP_EOL, FILE_APPEND); }); } @@ -80,12 +79,14 @@ class DatabaseService $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $pdo->setAttribute(\PDO::ATTR_ORACLE_NULLS, \PDO::NULL_EMPTY_STRING); - $pdo->sqliteCreateFunction('regexp', function ($pattern, $value) { + $pdo->sqliteCreateFunction('regexp', function ($pattern, $value) + { mb_regex_encoding('UTF-8'); return (false !== mb_ereg($pattern, $value)) ? 1 : 0; }); - $pdo->sqliteCreateFunction('grocy_user_setting', function ($value) { + $pdo->sqliteCreateFunction('grocy_user_setting', function ($value) + { $usersService = new UsersService(); return $usersService->GetUserSetting(GROCY_USER_ID, $value); }); diff --git a/services/DemoDataGeneratorService.php b/services/DemoDataGeneratorService.php index 814c4d63..129c0fbb 100644 --- a/services/DemoDataGeneratorService.php +++ b/services/DemoDataGeneratorService.php @@ -10,7 +10,6 @@ class DemoDataGeneratorService extends BaseService } protected $LocalizationService; - private $LastSupermarketId = 1; public function PopulateDemoData() diff --git a/services/LocalizationService.php b/services/LocalizationService.php index da318e69..859f3c2b 100644 --- a/services/LocalizationService.php +++ b/services/LocalizationService.php @@ -16,19 +16,12 @@ class LocalizationService } protected $Po; - protected $PoQu; - protected $Pot; - protected $PotMain; - protected $Translator; - protected $TranslatorQu; - protected $Culture; - private static $instanceMap = []; public function CheckAndAddMissingTranslationToPot($text) diff --git a/services/RecipesService.php b/services/RecipesService.php index 9aa8ab92..5ae0916d 100644 --- a/services/RecipesService.php +++ b/services/RecipesService.php @@ -7,11 +7,8 @@ use LessQL\Result; class RecipesService extends BaseService { const RECIPE_TYPE_MEALPLAN_DAY = 'mealplan-day'; // A recipe per meal plan day => name = YYYY-MM-DD - const RECIPE_TYPE_MEALPLAN_WEEK = 'mealplan-week'; // A recipe per meal plan week => name = YYYY-WW (week number) - const RECIPE_TYPE_MEALPLAN_SHADOW = 'mealplan-shadow'; // A recipe per meal plan recipe (for separated stock fulfillment checking) => name = YYYY-MM-DD# - const RECIPE_TYPE_NORMAL = 'normal'; // Normal / manually created recipes public function AddNotFulfilledProductsToShoppingList($recipeId, $excludedProductIds = null) diff --git a/services/StockService.php b/services/StockService.php index 3b38fc72..01d38020 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -8,21 +8,13 @@ use Grocy\Helpers\WebhookRunner; class StockService extends BaseService { const TRANSACTION_TYPE_CONSUME = 'consume'; - const TRANSACTION_TYPE_INVENTORY_CORRECTION = 'inventory-correction'; - const TRANSACTION_TYPE_PRODUCT_OPENED = 'product-opened'; - const TRANSACTION_TYPE_PURCHASE = 'purchase'; - const TRANSACTION_TYPE_SELF_PRODUCTION = 'self-production'; - const TRANSACTION_TYPE_STOCK_EDIT_NEW = 'stock-edit-new'; - const TRANSACTION_TYPE_STOCK_EDIT_OLD = 'stock-edit-old'; - const TRANSACTION_TYPE_TRANSFER_FROM = 'transfer_from'; - const TRANSACTION_TYPE_TRANSFER_TO = 'transfer_to'; public function AddMissingProductsToShoppingList($listId = 1) @@ -121,7 +113,7 @@ class StockService extends BaseService throw new \Exception('Product does not exist or is inactive'); } - $productDetails = (object) $this->GetProductDetails($productId); + $productDetails = (object)$this->GetProductDetails($productId); // Tare weight handling // The given amount is the new total amount including the container weight (gross) @@ -369,7 +361,7 @@ class StockService extends BaseService throw new \Exception('Location does not exist'); } - $productDetails = (object) $this->GetProductDetails($productId); + $productDetails = (object)$this->GetProductDetails($productId); // Tare weight handling // The given amount is the new total amount including the container weight (gross) @@ -915,7 +907,7 @@ class StockService extends BaseService throw new \Exception('Product does not exist or is inactive'); } - $productDetails = (object) $this->GetProductDetails($productId); + $productDetails = (object)$this->GetProductDetails($productId); if ($price === null) { @@ -979,7 +971,7 @@ class StockService extends BaseService throw new \Exception('Product does not exist or is inactive'); } - $productDetails = (object) $this->GetProductDetails($productId); + $productDetails = (object)$this->GetProductDetails($productId); $productStockAmountUnopened = $productDetails->stock_amount_aggregated - $productDetails->stock_amount_opened_aggregated; $potentialStockEntries = $this->GetProductStockEntries($productId, true, $allowSubproductSubstitution); $product = $this->getDatabase()->products($productId); @@ -1270,7 +1262,7 @@ class StockService extends BaseService // Tare weight handling // The given amount is the new total amount including the container weight (gross) // The amount to be posted needs to be the absolute value of the given amount - stock amount - tare weight - $productDetails = (object) $this->GetProductDetails($productId); + $productDetails = (object)$this->GetProductDetails($productId); if ($productDetails->product->enable_tare_weight_handling == 1) { diff --git a/services/UserfieldsService.php b/services/UserfieldsService.php index 0f48eddf..75cdbb4e 100644 --- a/services/UserfieldsService.php +++ b/services/UserfieldsService.php @@ -5,29 +5,17 @@ namespace Grocy\Services; class UserfieldsService extends BaseService { const USERFIELD_TYPE_CHECKBOX = 'checkbox'; - const USERFIELD_TYPE_DATE = 'date'; - const USERFIELD_TYPE_DATETIME = 'datetime'; - const USERFIELD_TYPE_DECIMAL_NUMBER = 'number-decimal'; - const USERFIELD_TYPE_FILE = 'file'; - const USERFIELD_TYPE_IMAGE = 'image'; - const USERFIELD_TYPE_INTEGRAL_NUMBER = 'number-integral'; - const USERFIELD_TYPE_LINK = 'link'; - const USERFIELD_TYPE_LINK_WITH_TITLE = 'link-with-title'; - const USERFIELD_TYPE_PRESET_CHECKLIST = 'preset-checklist'; - const USERFIELD_TYPE_PRESET_LIST = 'preset-list'; - const USERFIELD_TYPE_SINGLE_LINE_TEXT = 'text-single-line'; - const USERFIELD_TYPE_SINGLE_MULTILINE_TEXT = 'text-multi-line'; protected $OpenApiSpec = null;