BCGDraw   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A setFilename() 0 2 1
1
<?php
2
namespace tinymeng\code\Gateways\barcode\drawer;
3
4
/**
5
 *--------------------------------------------------------------------
6
 *
7
 * Base class to draw images
8
 *
9
 *--------------------------------------------------------------------
10
 * Copyright (C) Jean-Sebastien Goupil
11
 * http://www.barcodephp.com
12
 */
13
abstract class BCGDraw {
14
    protected $im;
15
    protected $filename;
16
17
    /**
18
     * Constructor.
19
     *
20
     * @param resource $im
21
     */
22
    protected function __construct($im) {
23
        $this->im = $im;
24
    }
25
26
    /**
27
     * Sets the filename.
28
     *
29
     * @param string $filename
30
     */
31
    public function setFilename($filename) {
32
        $this->filename = $filename;
33
    }
34
35
    /**
36
     * Method needed to draw the image based on its specification (JPG, GIF, etc.).
37
     */
38
    abstract public function draw();
39
}
40
?>
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...