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.

EThumbnail::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
class EThumbnail extends CComponent
3
{
4
    /**
5
     * @var ThumbBase
6
     */
7
    private $_thumbnail;
8
9
    public function getDimensions()
10
    {
11
      return $this->_thumbnail->getCurrentDimensions();
0 ignored issues
show
Documentation Bug introduced by
The method getCurrentDimensions does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
12
    }
13
14 1
    public function __construct($thumbnail) {
15 1
        $this->_thumbnail=$thumbnail;
16 1
    }
17
    /**
18
     * Re-sizes this image to the given dimensions.
19
     * @param integer $width the maximum width.
20
     * @param integer $height the maximum height.
21
     * @return EThumbnail
22
     */
23 1
    public function resize($width=0,$height=0)
24
    {
25 1
            $this->_thumbnail=$this->_thumbnail->resize($width,$height);
0 ignored issues
show
Documentation Bug introduced by
The method resize does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
26 1
            return $this;
27
    }
28
29
    /**
30
     * Resizes the image to the given dimensions as close as possible,
31
     * then crops it from center.
32
     * @param integer $width the width to crop the image to.
33
     * @param integer $height the height to crop the image to.
34
     * @return EThumbnail
35
     */
36
    public function adaptiveResize($width,$height)
37
    {
38
            $this->_thumbnail=$this->_thumbnail->adaptiveResize($width,$height);
0 ignored issues
show
Documentation Bug introduced by
The method adaptiveResize does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
39
            return $this;
40
    }
41
42
    /**
43
     * Resizes this image by the given percent uniformly.
44
     * @param integer $percent the percent to resize by.
45
     * @return EThumbnail
46
     */
47
    public function resizePercent($percent)
48
    {
49
            $this->_thumbnail=$this->_thumbnail->resizePercent($percent);
0 ignored issues
show
Documentation Bug introduced by
The method resizePercent does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
50
            return $this;
51
    }
52
53
    /**
54
     * Crops this image from the given coordinates with the specified width and height.
55
     * This is also known as Vanilla-cropping.
56
     * @param integer $x the starting x-coordinate.
57
     * @param integer $y the starting y-coordinate.
58
     * @param integer $width the width to crop with.
59
     * @param integer $height the height to crop with.
60
     * @return EThumbnail
61
     */
62
    public function crop($x,$y,$width,$height)
63
    {
64
            $this->_thumbnail=$this->_thumbnail->crop($x,$y,$width,$height);
0 ignored issues
show
Documentation Bug introduced by
The method crop does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
65
            return $this;
66
    }
67
68
    /**
69
     * Crops this image from the center with the specified width and height.
70
     * @param integer $width the width to crop with.
71
     * @param integer $height the height to crop with, if null the height will be the same as the width.
72
     * @return EThumbnail
73
     */
74
    public function cropFromCenter($width,$height=null)
75
    {
76
            $this->_thumbnail=$this->_thumbnail->cropFromCenter($width,$height);
0 ignored issues
show
Documentation Bug introduced by
The method cropFromCenter does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
77
            return $this;
78
    }
79
80
    /**
81
     * Rotates this image by 90 degrees in the specified direction.
82
     * @param string $direction the direction to rotate the image in.
83
     * @return EThumbnail
84
     */
85
    public function rotateImage($direction='CW')
86
    {
87
            $this->_thumbnail=$this->_thumbnail->rotateImage($direction);
0 ignored issues
show
Documentation Bug introduced by
The method rotateImage does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
88
            return $this;
89
    }
90
91
    /**
92
     * Rotates this image by the specified amount of degrees.
93
     * The image is always rotated clock-wise.
94
     * @param integer $degrees the amount of degrees.
95
     * @return EThumbnail
96
     */
97
    public function rotateImageNDegrees($degrees)
98
    {
99
            $this->_thumbnail=$this->_thumbnail->rotateImageNDegrees($degrees);
0 ignored issues
show
Documentation Bug introduced by
The method rotateImageNDegrees does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
100
            return $this;
101
    }
102
103
    /**
104
     * Saves this image.
105
     * @param string $path the path where to save the image.
106
     * @param string $extension the file extension.
107
     * @return EThumbnail
108
     */
109 1
    public function save($path,$extension=null)
110
    {
111 1
            $this->_thumbnail=$this->_thumbnail->save($path,$extension);
0 ignored issues
show
Documentation Bug introduced by
The method save does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
112 1
            return $this;
113
    }
114
115
    /**
116
     * Renders this image.
117
     * @return EThumbnail
118
     */
119
    public function show()
120
    {
121
            $this->_thumbnail=$this->_thumbnail->show();
0 ignored issues
show
Documentation Bug introduced by
The method show does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
122
            return $this;
123
    }
124
125
    /**
126
     * Returns the Working Image as a String
127
     * @return string
128
     */
129 1
    public function getImageAsString()
130
    {
131 1
            return $this->_thumbnail->getImageAsString();
0 ignored issues
show
Documentation Bug introduced by
The method getImageAsString does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
132
    }
133
134
  /**
135
   * Add watermark to Image
136
   *
137
   * @param $wm
138
   * @param $pos
139
   * @param $opacity
140
   * @param $offsetX
141
   * @param $offsetY
142
   *
143
   * @return EThumbnail
144
   */
145
    public function addWatermark($wm, $pos, $opacity, $offsetX, $offsetY)
146
    {
147
            $this->_thumbnail=$this->_thumbnail->addWatermark($wm->_thumbnail, $pos, $opacity, $offsetX, $offsetY);
0 ignored issues
show
Documentation Bug introduced by
The method addWatermark does not exist on object<ThumbBase>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
148
            return $this;
149
    }
150
}
151
?>
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...
152