Skip to content

Commit

Permalink
Apply Rector
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Jan 14, 2022
1 parent 29d9686 commit b24262a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions rector.php
Expand Up @@ -44,7 +44,9 @@

$parameters = $containerConfigurator->parameters();

$parameters->set(Option::PARALLEL, true);
// Temporarily disabled https://github.com/rectorphp/rector/issues/6903
// $parameters->set(Option::PARALLEL, true);

// The paths to refactor (can also be supplied with CLI arguments)
$parameters->set(Option::PATHS, [
__DIR__ . '/src/',
Expand All @@ -57,7 +59,7 @@
]);

// Set the target version for refactoring
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_73);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_74);

// Auto-import fully qualified class names
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
Expand Down
16 changes: 10 additions & 6 deletions src/Thumbnails.php
Expand Up @@ -214,13 +214,17 @@ public function create(string $input, string $output): self
$result = false;

foreach ($handlers as $handler) {
if ($handler->create($file, $output, $this->imageType, $this->width, $this->height)) {
// Verify the output file
if (exif_imagetype($output) === $this->imageType) {
$result = true;
break;
}
if (! $handler->create($file, $output, $this->imageType, $this->width, $this->height)) {
continue;
}

// Verify the output file
if (exif_imagetype($output) !== $this->imageType) {
continue;
}

$result = true;
break;
}

$this->reset();
Expand Down

0 comments on commit b24262a

Please sign in to comment.