GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d399db...857eb8 )
by Steevan
02:14
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 1
eloc 11
nc 1
nop 3
1
<?php
2
3
namespace steevanb\DoctrineReadOnlyHydrator\Exception;
4
5
use steevanb\DoctrineReadOnlyHydrator\Hydrator\ReadOnlyHydrator;
6
7
class PrivateMethodShouldNotAccessPropertiesException extends \Exception
8
{
9
    /**
10
     * @param string $className
11
     * @param string $method
12
     * @param array $properties
13
     */
14
    public function __construct($className, $method, array $properties)
15
    {
16
        array_walk($properties, function(&$property) {
17
            $property = '$this->' . $property;
18
        });
19
        $formatedProperties = implode(', ', $properties);
20
21
        $message = 'Private method ' . $className . '::' . $method . '() ';
22
        $message .= 'should not directly access ' . $formatedProperties . ', ';
23
        $message .= 'it should use accessor or be protected. ';
24
        $message .= 'As method is private, ' . ReadOnlyHydrator::class . ' could not handle method call, ';
25
        $message .= 'so it can\'t ensure when property is not loaded, ';
26
        $message .= 'no calls to ' . $formatedProperties . ' are made.';
27
28
        parent::__construct($message);
29
    }
30
}
31