Skip to content

Commit 8e84bc2

Browse files
committed
add ValueError and FILTER_VALIDATE_BOOL
1 parent 48ce670 commit 8e84bc2

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Symfony Polyfill / Php80
44
This component provides functions added to PHP 8.0 core:
55

66
- [`fdiv`](https://php.net/fdiv) (only for PHP 7.0+)
7+
- `ValueError` class
8+
- `FILTER_VALIDATE_BOOL` constant
79

810
More information can be found in the
911
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).

Resources/stubs/ValueError.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
class ValueError extends Error
4+
{
5+
}

bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@
1515
if (!function_exists('fdiv')) {
1616
function fdiv($dividend, $divisor) { return p\Php80::fdiv($dividend, $divisor); }
1717
}
18+
19+
if (!defined('FILTER_VALIDATE_BOOL')) {
20+
define('FILTER_VALIDATE_BOOL', FILTER_VALIDATE_BOOLEAN);
21+
}
1822
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
},
2525
"autoload": {
2626
"psr-4": { "Symfony\\Polyfill\\Php80\\": "" },
27-
"files": [ "bootstrap.php" ]
27+
"files": [ "bootstrap.php" ],
28+
"classmap": [ "Resources/stubs" ]
2829
},
2930
"minimum-stability": "dev",
3031
"extra": {

0 commit comments

Comments
 (0)