Skip to content

Commit 74c55a7

Browse files
committed
removed gettype type validation
1 parent c0335c5 commit 74c55a7

File tree

6 files changed

+1
-40
lines changed

6 files changed

+1
-40
lines changed

app/helpers/MetaFormats/MetaFormatHelper.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,4 @@ public static function createFormatInstance(string $format): MetaFormat
189189
$instance = new $format();
190190
return $instance;
191191
}
192-
193-
/**
194-
* Checks whether a value is of a given type.
195-
* @param mixed $value The value to be tested.
196-
* @param \App\Helpers\MetaFormats\PhpTypes $type The desired type of the value.
197-
* @return bool Returns whether the value is of the given type.
198-
*/
199-
public static function checkType($value, PhpTypes $type): bool
200-
{
201-
return gettype($value) === $type->value;
202-
}
203192
}

app/helpers/MetaFormats/PhpTypes.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/helpers/MetaFormats/Validators/VBool.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace App\Helpers\MetaFormats\Validators;
44

5-
use App\Helpers\MetaFormats\MetaFormatHelper;
6-
use App\Helpers\MetaFormats\PhpTypes;
7-
85
/**
96
* Validates boolean values. Accepts only boolean true and false.
107
*/

app/helpers/MetaFormats/Validators/VDouble.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace App\Helpers\MetaFormats\Validators;
44

5-
use App\Helpers\MetaFormats\MetaFormatHelper;
6-
use App\Helpers\MetaFormats\PhpTypes;
7-
85
/**
96
* Validates doubles. Accepts doubles as well as their stringified versions.
107
*/

app/helpers/MetaFormats/Validators/VInt.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
namespace App\Helpers\MetaFormats\Validators;
44

5-
use App\Helpers\MetaFormats\MetaFormatHelper;
6-
use App\Helpers\MetaFormats\PhpTypes;
7-
85
/**
96
* Validates integers. Accepts ints as well as their stringified versions.
107
*/
118
class VInt
129
{
1310
public const SWAGGER_TYPE = "integer";
1411

15-
public function getExampleValue()
12+
public function getExampleValue(): int|string
1613
{
1714
return "0";
1815
}

app/helpers/MetaFormats/Validators/VString.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace App\Helpers\MetaFormats\Validators;
44

5-
use App\Helpers\MetaFormats\MetaFormatHelper;
6-
use App\Helpers\MetaFormats\PhpTypes;
7-
85
/**
96
* Validates strings.
107
*/

0 commit comments

Comments
 (0)