diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 32b53e5..5dedb9f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,7 +23,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest', 'macos-latest'] - php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Get source code uses: actions/checkout@v4 diff --git a/Image/Color.php b/Image/Color.php index 2721693..fce329b 100644 --- a/Image/Color.php +++ b/Image/Color.php @@ -273,7 +273,7 @@ function changeLightness($degree = 10) * @static * @author Jason Lotito */ - function getTextColor($color, $light = '#FFFFFF', $dark = '#000000') + static function getTextColor($color, $light = '#FFFFFF', $dark = '#000000') { $color = Image_Color::_splitColor($color); if ($color[1] > hexdec('66')) { @@ -312,7 +312,7 @@ function _setColors($col1, $col2) * @static * @author Jason Lotito */ - function _splitColor($color) + static function _splitColor($color) { $color = str_replace('#', '', $color); $c[] = hexdec(substr($color, 0, 2)); @@ -327,7 +327,7 @@ function _splitColor($color) * @deprecated Function deprecated after 1.0.1 * @see rgb2hex(). */ - function _returnColor ( $color ) + static function _returnColor ( $color ) { return Image_Color::rgb2hex($color); } @@ -342,7 +342,7 @@ function _returnColor ( $color ) * @author Jason Lotito * @see hex2rgb() */ - function rgb2hex($color) + static function rgb2hex($color) { return sprintf('%02X%02X%02X',$color[0],$color[1],$color[2]); } @@ -359,7 +359,7 @@ function rgb2hex($color) * @author Jason Lotito * @see rgb2hex() */ - function hex2rgb($hex) + static function hex2rgb($hex) { $return = Image_Color::_splitColor($hex); $return['hex'] = $hex; @@ -379,7 +379,7 @@ function hex2rgb($hex) * @uses hsv2hex() to convert the HSV value to Hex. * @uses hex2rgb() to convert the Hex value to RGB. */ - function hsv2rgb($h, $s, $v) + static function hsv2rgb($h, $s, $v) { return Image_Color::hex2rgb(Image_Color::hsv2hex($h, $s, $v)); } @@ -399,7 +399,7 @@ function hsv2rgb($h, $s, $v) * @author Jurgen Schwietering * @uses rgb2hex() to convert the return value to a hex string. */ - function hsv2hex($h, $s, $v) + static function hsv2hex($h, $s, $v) { $s /= 256.0; $v /= 256.0; @@ -470,7 +470,7 @@ function hsv2hex($h, $s, $v) * @uses ImageColorAllocate() to allocate the color. * @uses color2RGB() to parse the color into RGB values. */ - function allocateColor(&$img, $color) { + static function allocateColor(&$img, $color) { $color = Image_Color::color2RGB($color); return ImageColorAllocate($img, $color[0], $color[1], $color[2]); @@ -490,11 +490,11 @@ function allocateColor(&$img, $color) { * @uses hex2rgb() to convert colors begining with the # character. * @uses namedColor2RGB() to convert everything not starting with a #. */ - function color2RGB($color) + static function color2RGB($color) { $c = array(); - if ($color{0} == '#') { + if ($color[0] == '#') { $c = Image_Color::hex2rgb($color); } else { $c = Image_Color::namedColor2RGB($color); @@ -514,7 +514,7 @@ function color2RGB($color) * @static * @author Sebastian Bergmann */ - function namedColor2RGB($color) + static function namedColor2RGB($color) { static $colornames; @@ -680,7 +680,7 @@ function namedColor2RGB($color) * @access public * @static */ - function percentageColor2RGB($color) + static function percentageColor2RGB($color) { // remove spaces $color = str_replace(' ', '', $color); diff --git a/composer.json b/composer.json index e652261..cf4684b 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ }, "type": "library", "require" : { - "php": ">=5.6, < 8.0" + "php": ">=5.6" }, "require-dev": { "yoast/phpunit-polyfills": "^2.0"