Skip to content

Commit f2ea298

Browse files
authored
strict_types=1 (#22)
* strict_types=1 * PHP 8 (experimental)
1 parent aec9f4f commit f2ea298

22 files changed

Lines changed: 71 additions & 15 deletions

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
# @link https://github.com/JBZoo/Image
1212
#
1313

14+
/.phan export-ignore
15+
/build export-ignore
16+
/tests export-ignore
17+
/.editorconfig export-ignore
18+
/.gitattributes export-ignore
19+
/.gitignore export-ignore
20+
/.travis.yml export-ignore
21+
/phpunit.xml.dist export-ignore
22+
/Makefile export-ignore
23+
1424
* text eol=lf
1525

1626
# (binary is a macro for -text -diff)

.phan/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php';
1719

1820
return array_merge($default, [

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ php:
1919
- 7.2
2020
- 7.3
2121
- 7.4
22+
- 8.0
23+
- nightly
24+
25+
jobs:
26+
fast_finish: true
27+
allow_failures:
28+
- php: 8.0
29+
- php: nightly
2230

2331
env:
24-
global:
25-
- XDEBUG_MODE=coverage
2632
matrix:
2733
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
2834
- JBZOO_COMPOSER_UPDATE_FLAGS=""
2935

30-
before_install:
31-
- sudo apt-get update
32-
3336
before_script:
3437
- composer self-update
3538

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JBZoo / Image
22

3-
[![Build Status](https://travis-ci.org/JBZoo/Image.svg)](https://travis-ci.org/JBZoo/Image) [![Coverage Status](https://coveralls.io/repos/JBZoo/Image/badge.svg)](https://coveralls.io/github/JBZoo/Image) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Image/coverage.svg)](https://shepherd.dev/github/JBZoo/Image)
3+
[![Build Status](https://travis-ci.org/JBZoo/Image.svg)](https://travis-ci.org/JBZoo/Image) [![Coverage Status](https://coveralls.io/repos/JBZoo/Image/badge.svg)](https://coveralls.io/github/JBZoo/Image) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Image/coverage.svg)](https://shepherd.dev/github/JBZoo/Image) [![PHP Strict Types](https://img.shields.io/badge/strict__types-%3D1-brightgreen)](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
44
[![Stable Version](https://poser.pugx.org/jbzoo/image/version)](https://packagist.org/packages/jbzoo/image) [![Latest Unstable Version](https://poser.pugx.org/jbzoo/image/v/unstable)](https://packagist.org/packages/jbzoo/image) [![Dependents](https://poser.pugx.org/jbzoo/image/dependents)](https://packagist.org/packages/jbzoo/image/dependents?order_by=downloads) [![GitHub Issues](https://img.shields.io/github/issues/jbzoo/image)](https://github.com/JBZoo/Image/issues) [![Total Downloads](https://poser.pugx.org/jbzoo/image/downloads)](https://packagist.org/packages/jbzoo/image/stats) [![GitHub License](https://img.shields.io/github/license/jbzoo/image)](https://github.com/JBZoo/Image/blob/master/LICENSE)
55

66

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
"ext-exif" : "*",
3030
"ext-ctype" : "*",
3131

32-
"jbzoo/utils" : "^4.2.3",
33-
"jbzoo/data" : "^4.1.2"
32+
"jbzoo/utils" : "^4.3.0",
33+
"jbzoo/data" : "^4.2.0"
3434
},
3535

3636
"require-dev" : {
37-
"jbzoo/toolbox-dev" : "^2.6.2"
37+
"jbzoo/toolbox-dev" : "^2.10.0"
3838
},
3939

4040
"autoload" : {

src/Exception.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
namespace JBZoo\Image;
1719

1820
/**

src/Filter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
namespace JBZoo\Image;
1719

1820
use JBZoo\Utils\Filter as VarFilter;
@@ -24,7 +26,7 @@
2426
* @package JBZoo\Image
2527
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
2628
*/
27-
class Filter
29+
final class Filter
2830
{
2931
public const BLUR_SEL = 0;
3032
public const BLUR_GAUS = 1;
@@ -62,7 +64,7 @@ public static function grayscale($image): void
6264
public static function pixelate($image, int $blockSize = 10): void
6365
{
6466
$blockSize = VarFilter::int($blockSize);
65-
imagefilter($image, IMG_FILTER_PIXELATE, $blockSize, 1);
67+
imagefilter($image, IMG_FILTER_PIXELATE, $blockSize);
6668
}
6769

6870
/**

src/Image.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
namespace JBZoo\Image;
1719

1820
use JBZoo\Utils\Filter as VarFilter;
@@ -29,7 +31,7 @@
2931
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
3032
* @SuppressWarnings(PHPMD.ExcessiveClassLength)
3133
*/
32-
class Image
34+
final class Image
3335
{
3436
public const LANDSCAPE = 'landscape';
3537
public const PORTRAIT = 'portrait';

src/Text.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
namespace JBZoo\Image;
1719

1820
use JBZoo\Utils\FS;
@@ -22,7 +24,7 @@
2224
* Class Text
2325
* @package JBZoo\Image
2426
*/
25-
class Text
27+
final class Text
2628
{
2729
/**
2830
* @var array

tests/FilterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://github.com/JBZoo/Image
1414
*/
1515

16+
declare(strict_types=1);
17+
1618
namespace JBZoo\PHPUnit;
1719

1820
use JBZoo\Image\Filter;

0 commit comments

Comments
 (0)