Skip to content

Commit

Permalink
Mark calculateVariableSpace() as deprecated and will be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ve3 committed Mar 15, 2024
1 parent b26ffaf commit d4216f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
4 changes: 4 additions & 0 deletions Rundiz/Image/Traits/CalculationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public function calculateStartXOfCenter($objWidth, $canvasWidth)
* 20 - 10 = 10 (different size)<br>
* 0 - (10 * .3) = -3<br>
*
* @todo This method is no longer in use, remove this method in v3.2.
* @deprecated since v3.1.3. Will be removed in v3.2.
* @param int $currentSize
* @param int $minSize
* @param int $minSpace
Expand All @@ -221,6 +223,8 @@ protected function calculateVariableSpace($currentSize, $minSize, $minSpace, $di
throw new \InvalidArgumentException('The arguments must be number.');
}

trigger_error('This method is no longer in use and will be removed in v3.2.', E_USER_DEPRECATED);

$return = $minSpace;
if ($currentSize > $minSize) {
$sizeDiffMin = ($currentSize - $minSize);
Expand Down
9 changes: 0 additions & 9 deletions tests/phpunit/ExtendedAbstractImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ public function calculateImageSizeRatio($width, $height)
}// calculateImageSizeRatio


/**
* {@inheritDoc}
*/
public function calculateVariableSpace($currentSize, $minSize, $minSpace, $differentEach)
{
return parent::calculateVariableSpace($currentSize, $minSize, $minSpace, $differentEach);
}// calculateVariableSpace


public function clear()
{
}
Expand Down
10 changes: 0 additions & 10 deletions tests/phpunit/TraitsTest/CalculationTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ public function testCalculateStartXOfCenter()
}// testCalculateStartXOfCenter


public function testCalculateVariableSpace()
{
$ImgAc = new \Rundiz\Image\Tests\ExtendedAbstractImage(static::$source_images_dir . 'city-amsterdam.jpg');
$this->assertSame(-3, $ImgAc->calculateVariableSpace(20, 10, 0, .3));
$this->assertSame(-6, $ImgAc->calculateVariableSpace(30, 10, 0, .3));
$this->assertSame(-7, $ImgAc->calculateVariableSpace(30, 10, 3, .5));
unset($ImgAc);
}// testCalculateVariableSpace


public function testCalculateWatermarkImageStartXY()
{
$ImgAc = new \Rundiz\Image\Tests\ExtendedAbstractImage(static::$source_images_dir . 'city-amsterdam.jpg');
Expand Down

0 comments on commit d4216f1

Please sign in to comment.