File: ReflectionHelper.php

package info (click to toggle)
php-mock-phpunit 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 256 kB
  • sloc: php: 1,089; makefile: 20; xml: 8; sh: 7
file content (23 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

namespace phpmock\phpunit;

/**
 * @internal
 */
final class ReflectionHelper
{
    private function __construct()
    {
    }

    public static function setAccessible($reflection)
    {
        // As of PHP 8.1.0, reflection setAccessible is no-op; all properties are accessible by default.
        if (PHP_VERSION_ID >= 80100) {
            return;
        }

        $reflection->setAccessible(true);
    }
}