Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (3 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Form/Types/Text.php

    r874 r887  
    55class TypeText extends TypeBase
    66{
    7   var $DatabaseCompareOperators = array('Jako' => 'LIKE', 'Rovno' => '=', 'Nerovno' => '!=');
     7  function __construct(FormManager $FormManager)
     8  {
     9    parent::__construct($FormManager);
     10    $this->DatabaseCompareOperators = array('Jako' => 'LIKE', 'Rovno' => '=', 'Nerovno' => '!=');
     11  }
    812
    9   function OnView($Item)
     13  function OnView(array $Item): ?string
    1014  {
    1115    $Output = str_replace("\n", '<br/>', strip_tags($Item['Value']));
     
    1317  }
    1418
    15   function OnEdit($Item)
     19  function OnEdit(array $Item): string
    1620  {
    1721    $Output = '<textarea name="'.$Item['Name'].'">'.$Item['Value'].'</textarea>';
     
    1923  }
    2024
    21   function OnLoad($Item)
     25  function OnLoad(array $Item): ?string
    2226  {
    2327    return $_POST[$Item['Name']];
    2428  }
    2529
    26   function DatabaseEscape($Value)
     30  function DatabaseEscape(string $Value): string
    2731  {
    2832    return '"'.addslashes($Value).'"';
Note: See TracChangeset for help on using the changeset viewer.