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

PrivateMethodShouldNotAccessPropertiesException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
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