wp/wp-includes/random_compat/error_polyfill.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 19 3d72ae0968f4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
     2 /**
     2 /**
     3  * Random_* Compatibility Library 
     3  * Random_* Compatibility Library 
     4  * for using the new PHP 7 random_* API in PHP 5 projects
     4  * for using the new PHP 7 random_* API in PHP 5 projects
     5  * 
     5  * 
     6  * The MIT License (MIT)
     6  * The MIT License (MIT)
     7  * 
     7  *
     8  * Copyright (c) 2015 Paragon Initiative Enterprises
     8  * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises
     9  * 
     9  * 
    10  * Permission is hereby granted, free of charge, to any person obtaining a copy
    10  * Permission is hereby granted, free of charge, to any person obtaining a copy
    11  * of this software and associated documentation files (the "Software"), to deal
    11  * of this software and associated documentation files (the "Software"), to deal
    12  * in the Software without restriction, including without limitation the rights
    12  * in the Software without restriction, including without limitation the rights
    13  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    13  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    33         
    33         
    34     }
    34     }
    35 }
    35 }
    36 
    36 
    37 if (!class_exists('TypeError', false)) {
    37 if (!class_exists('TypeError', false)) {
    38     class TypeError extends Error
    38     if (is_subclass_of('Error', 'Exception')) {
    39     {
    39         class TypeError extends Error
    40         
    40         {
       
    41             
       
    42         }
       
    43     } else {
       
    44         class TypeError extends Exception
       
    45         {
       
    46             
       
    47         }
    41     }
    48     }
    42 }
    49 }