Completed
Push — symfony-console-application ( 3187e2...c3ee2a )
by Luis
10:39
created

plBasePropertyException::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
class plBasePropertyException extends Exception 
4
{
5
    const READ = 1;
6
    const WRITE = 2;
7
    
8
    public function __construct( $key, $type ) 
9
    {
10
        parent::__construct( 'Invalid property access. The property "' . $key . '" is not '. ( $type === self::READ ? 'readable' : 'writable' ) . '.'  );
11
    }
12
}
13
14
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
15