-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from Sybio/rector-refactoring
Refactoring code using Rector
- Loading branch information
Showing
14 changed files
with
336 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
# ================================ | ||
# ImageWorkshop class | ||
# ================================ | ||
|
||
[![Test status](https://secure.travis-ci.org/Sybio/ImageWorkshop.png?branch=master)](https://travis-ci.org/Sybio/ImageWorkshop) | ||
[![Latest Stable Version](https://poser.pugx.org/sybio/image-workshop/v/stable)](https://packagist.org/packages/sybio/image-workshop) | ||
[![Total Downloads](https://poser.pugx.org/sybio/image-workshop/downloads)](https://packagist.org/packages/sybio/image-workshop) | ||
[![Monthly Downloads](https://poser.pugx.org/sybio/image-workshop/d/monthly)](https://packagist.org/packages/sybio/image-workshop) | ||
[![License](https://poser.pugx.org/sybio/image-workshop/license)](https://packagist.org/packages/sybio/image-workshop) | ||
|
||
### Summary and features | ||
Really flexible and easy-to-use PHP class to work with images using the GD Library | ||
|
||
http://phpimageworkshop.com/ | ||
|
||
### Installation | ||
|
||
The class is designed for PHP 5.3+, but it can work with older PHP versions... Check how to install the class here: http://phpimageworkshop.com/installation.html | ||
|
||
### Usage | ||
|
||
- Learn how to use the class in 5 minutes: http://phpimageworkshop.com/quickstart.html | ||
- The complete documentation: http://phpimageworkshop.com/documentation.html | ||
- Usefull tutorials: http://phpimageworkshop.com/tutorials.html | ||
- Changelog: [CHANGELOG.md](CHANGELOG.md) | ||
|
||
**What's new in the doc' ?** | ||
|
||
- Installation guide: http://phpimageworkshop.com/installation.html | ||
- Adding the flip documentation: http://phpimageworkshop.com/doc/25/flip-vertical-horizontal-mirror.html | ||
- Adding the opacity documentation which was omitted: http://phpimageworkshop.com/doc/24/opacity-transparency.html | ||
- Tutorial "Manage animated GIF with ImageWorkshop (and GiFFrameExtractor & GifCreator)": http://phpimageworkshop.com/tutorial/5/manage-animated-gif-with-imageworkshop.html | ||
|
||
### @todo | ||
- Adding a method to add easily borders to a layer (external, inside and middle border) | ||
- Check given hexa' color and remove # if exists. | ||
# ================================ | ||
# ImageWorkshop class | ||
# ================================ | ||
|
||
[![Test status](https://secure.travis-ci.org/Sybio/ImageWorkshop.png?branch=master)](https://travis-ci.org/Sybio/ImageWorkshop) | ||
[![Latest Stable Version](https://poser.pugx.org/sybio/image-workshop/v/stable)](https://packagist.org/packages/sybio/image-workshop) | ||
[![Total Downloads](https://poser.pugx.org/sybio/image-workshop/downloads)](https://packagist.org/packages/sybio/image-workshop) | ||
[![Monthly Downloads](https://poser.pugx.org/sybio/image-workshop/d/monthly)](https://packagist.org/packages/sybio/image-workshop) | ||
[![License](https://poser.pugx.org/sybio/image-workshop/license)](https://packagist.org/packages/sybio/image-workshop) | ||
|
||
### Summary and features | ||
Really flexible and easy-to-use PHP class to work with images using the GD Library | ||
|
||
http://phpimageworkshop.com/ | ||
|
||
Current `master` branch correspond to the next major release (v3) which only support PHP 8.0+. | ||
|
||
### Installation | ||
|
||
The class is designed for PHP 8.0+... Check how to install the class here: http://phpimageworkshop.com/installation.html | ||
|
||
For older PHP versions support, install the [2.x](https://github.com/Sybio/ImageWorkshop/tree/2.x) version branch. | ||
|
||
### Usage | ||
|
||
- Learn how to use the class in 5 minutes: http://phpimageworkshop.com/quickstart.html | ||
- The complete documentation: http://phpimageworkshop.com/documentation.html | ||
- Usefull tutorials: http://phpimageworkshop.com/tutorials.html | ||
- Changelog: [CHANGELOG.md](CHANGELOG.md) | ||
|
||
**What's new in the doc' ?** | ||
|
||
- Installation guide: http://phpimageworkshop.com/installation.html | ||
- Adding the flip documentation: http://phpimageworkshop.com/doc/25/flip-vertical-horizontal-mirror.html | ||
- Adding the opacity documentation which was omitted: http://phpimageworkshop.com/doc/24/opacity-transparency.html | ||
- Tutorial "Manage animated GIF with ImageWorkshop (and GiFFrameExtractor & GifCreator)": http://phpimageworkshop.com/tutorial/5/manage-animated-gif-with-imageworkshop.html | ||
|
||
### @todo | ||
- Adding a method to add easily borders to a layer (external, inside and middle border) | ||
- Check given hexa' color and remove # if exists. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; | ||
use Rector\Config\RectorConfig; | ||
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; | ||
use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector; | ||
use Rector\Php74\Rector\Property\TypedPropertyRector; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; | ||
|
||
return static function(RectorConfig $config): void { | ||
$config->paths([ | ||
__DIR__ . '/src' | ||
]); | ||
|
||
$config->import(SetList::DEAD_CODE); | ||
$config->import(SetList::TYPE_DECLARATION_STRICT); | ||
$config->import(SetList::TYPE_DECLARATION); | ||
$config->import(SetList::PHP_80); | ||
$config->import(SetList::PHP_74); | ||
$config->import(SetList::PHP_73); | ||
$config->import(SetList::EARLY_RETURN); | ||
$config->import(SetList::CODE_QUALITY); | ||
|
||
// register a single rule | ||
$config->rule(InlineConstructorDefaultToPropertyRector::class); | ||
$config->rule(RemoveExtraParametersRector::class); | ||
|
||
// define sets of rules | ||
$config->sets([ | ||
LevelSetList::UP_TO_PHP_80 | ||
]); | ||
|
||
$config->phpstanConfig(__DIR__ . '/phpstan.neon'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.