Skip to content

Commit

Permalink
Update stubs to work with latest version of gen_stubs.php.
Browse files Browse the repository at this point in the history
It was giving an error on parameter info duplicated in doc-block and parameter type.
  • Loading branch information
Danack committed Oct 3, 2021
1 parent e614095 commit 704bd11
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 67 deletions.
78 changes: 18 additions & 60 deletions Imagick.stub.php
Expand Up @@ -306,44 +306,28 @@ public function getImageGravity(): int {}
#endif

#if MagickLibVersion > 0x645
/**
* @param int $x
* @param int $y
* @param int $width
* @param int $height
* @param string $map
* @param int $pixelstorage // PIXELSTORAGE
* @param array $pixels
* @return bool
*/
public function importImagePixels(
int $x,
int $y,
int $width,
int $height,
string $map,
int $pixelstorage,
int $pixelstorage, // PIXELSTORAGE
array $pixels): bool {}

public function deskewImage(float $threshold): bool {}

/**
* @param int $colorspace // COLORSPACE
* @param float $cluster_threshold
* @param float $smooth_threshold
* @param bool $verbose
* @return bool
*/

public function segmentImage(
int $colorspace,
int $colorspace, // COLORSPACE
float $cluster_threshold,
float $smooth_threshold,
bool $verbose = false
): bool {}

// SPARSECOLORMETHOD_*

public function sparseColorImage(
int $sparsecolormethod,
int $sparsecolormethod, // SPARSECOLORMETHOD_*
array $arguments,
int $channel = Imagick::CHANNEL_DEFAULT
): bool {}
Expand All @@ -357,22 +341,13 @@ public function houghLineImage(int $width, int $height, float $threshold): bool
#endif

#if MagickLibVersion > 0x646
/**
* @param int $x
* @param int $y
* @param int $width
* @param int $height
* @param string $map e.g. "RGB"
* @param int $pixelstorage // PIXELSTORAGE
* @return array
*/
public function exportImagePixels(
int $x,
int $y,
int $width,
int $height,
string $map,
int $pixelstorage
string $map, // e.g. "RGB"
int $pixelstorage // PIXELSTORAGE
): array {}
#endif

Expand Down Expand Up @@ -403,15 +378,15 @@ public function blueShiftImage(float $factor = 1.5): bool {}

#if MagickLibVersion > 0x656
/**
* @param string $artifact example 'compose:args'
* @return string
* $artifact example 'compose:args'
*
*/
public function getImageArtifact(string $artifact): string {}

/**
* @param string $artifact example 'compose:args'
* @param string $value example "1,0,-0.5,0.5"
* @return bool
* $artifact example 'compose:args'
* $value example "1,0,-0.5,0.5"
*
*/
public function setImageArtifact(string $artifact, string $value): bool {}

Expand Down Expand Up @@ -568,21 +543,12 @@ public function modulateImage(float $brightness, float $saturation, float $hue):
public function getImageColors(): int {}



/**
* @param ImagickDraw $settings
* @param string $tile_geometry e.g. "3x2+0+0"
* @param string $thumbnail_geometry e.g. "200x160+3+3>"
* @param int $monatgemode // MONTAGEMODE_
* @param string $frame // "10x10+2+2"
* @return Imagick
*/
public function montageImage(
ImagickDraw $settings,
string $tile_geometry,
string $thumbnail_geometry,
int $monatgemode,
string $frame
string $tile_geometry, // e.g. "3x2+0+0"
string $thumbnail_geometry, // e.g. "200x160+3+3>"
int $monatgemode, // MONTAGEMODE_
string $frame // "10x10+2+2"
): Imagick {}

public function identifyImage(bool $append_raw_output = false): array {}
Expand Down Expand Up @@ -1307,15 +1273,8 @@ public static function listRegistry(): array {}

#if MagickLibVersion >= 0x680

/**
* @param int $morphology MORPHOLOGY_*
* @param int $iterations
* @param ImagickKernel $kernel
* @param int $channel
* @return bool
*/
public function morphology(
int $morphology,
int $morphology, // MORPHOLOGY_*
int $iterations,
ImagickKernel $kernel,
int $channel = Imagick::CHANNEL_DEFAULT
Expand All @@ -1335,7 +1294,7 @@ public function getAntialias(): bool {}

#if MagickLibVersion > 0x676
/**
* @param string $color_correction_collection
* $color_correction_collection example:
* <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
* <ColorCorrection id="cc03345">
* <SOPNode>
Expand All @@ -1349,7 +1308,6 @@ public function getAntialias(): bool {}
* </ColorCorrection>
* </ColorCorrectionCollection>
*
* @return bool
*/
public function colorDecisionListImage(string $color_correction_collection): bool {}
#endif
Expand Down
3 changes: 1 addition & 2 deletions ImagickDraw.stub.php
Expand Up @@ -57,8 +57,7 @@ public function setFontSize(float $point_size): bool {}
public function setFontStyle(int $style): bool {}

/**
* @param int $weight font weight (valid range 100-900)
* @return bool
* $weight font weight (valid range 100-900)
*/
public function setFontWeight(int $weight): bool {}

Expand Down
9 changes: 4 additions & 5 deletions ImagickPixel.stub.php
Expand Up @@ -23,8 +23,8 @@ public function getColorQuantum(): array {}
public function getColorValue(int $color): float {}

/**
* @param int $color // COLOR_*
* @return mixed
* $color // COLOR_*
* return
* - Float if IM compiled with HDRI
* - int if IM compiled with fixed point math
*/
Expand Down Expand Up @@ -57,9 +57,8 @@ public function setColorCount(int $color_count): bool {}
public function setColorValue(int $color, float $value): bool {}

/**
* @param int $color // COLOR_*
* @param mixed $value
* @return bool
* $color // COLOR_*
* $value
*
* Type of value depends on how ImageMagick was compiled.
* - Float if IM compiled with HDRI
Expand Down

0 comments on commit 704bd11

Please sign in to comment.