Skip to content

Commit

Permalink
Add missing doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Aug 11, 2024
1 parent 706ca2c commit 54aa51e
Show file tree
Hide file tree
Showing 90 changed files with 532 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Colors/Hsl/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

class Color extends AbstractColor
{
/**
* Create new color object
*
* @param int $h
* @param int $s
* @param int $l
* @return void
*/
public function __construct(int $h, int $s, int $l)
{
/** @throws void */
Expand Down
8 changes: 8 additions & 0 deletions src/Colors/Hsv/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

class Color extends AbstractColor
{
/**
* Create new color object
*
* @param int $h
* @param int $s
* @param int $v
* @return void
*/
public function __construct(int $h, int $s, int $v)
{
/** @throws void */
Expand Down
5 changes: 5 additions & 0 deletions src/Colors/Rgb/Decoders/TransparentColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class TransparentColorDecoder extends HexColorDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/ColorspaceAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class ColorspaceAnalyzer extends GenericColorspaceAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return new Colorspace();
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/HeightAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class HeightAnalyzer extends GenericHeightAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return imagesy($image->core()->native());
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/PixelColorAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

class PixelColorAnalyzer extends GenericPixelColorAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return $this->colorAt(
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/PixelColorsAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

class PixelColorsAnalyzer extends PixelColorAnalyzer
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
$colors = new Collection();
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/ResolutionAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class ResolutionAnalyzer extends GenericResolutionAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return new Resolution(...imageresolution($image->core()->native()));
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Analyzers/WidthAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class WidthAnalyzer extends GenericWidthAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return imagesx($image->core()->native());
Expand Down
16 changes: 16 additions & 0 deletions src/Drivers/Gd/ColorProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@

class ColorProcessor implements ColorProcessorInterface
{
/**
* Create new color processor object
*
* @param ColorspaceInterface $colorspace
* @return void
*/
public function __construct(protected ColorspaceInterface $colorspace = new Colorspace())
{
}

/**
* {@inheritdoc}
*
* @see ColorProcessorInterface::colorToNative()
*/
public function colorToNative(ColorInterface $color): int
{
// convert color to colorspace
Expand All @@ -39,6 +50,11 @@ public function colorToNative(ColorInterface $color): int
return ($a << 24) + ($r << 16) + ($g << 8) + $b;
}

/**
* {@inheritdoc}
*
* @see ColorProcessorInterface::nativeToColor()
*/
public function nativeToColor(mixed $value): ColorInterface
{
if (!is_int($value)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Decoders/Base64ImageDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class Base64ImageDecoder extends BinaryImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!$this->isValidBase64($input)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Decoders/DataUriImageDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class DataUriImageDecoder extends BinaryImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Decoders/FilePathImageDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

class FilePathImageDecoder extends NativeObjectDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!$this->isFile($input)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Decoders/FilePointerImageDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class FilePointerImageDecoder extends BinaryImageDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_resource($input) || !in_array(get_resource_type($input), ['file', 'stream'])) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Decoders/SplFileInfoImageDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

class SplFileInfoImageDecoder extends FilePathImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_a($input, SplFileInfo::class)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Encoders/AvifEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class AvifEncoder extends GenericAvifEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$gd = $image->core()->native();
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Encoders/BmpEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class BmpEncoder extends GenericBmpEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$data = $this->buffered(function () use ($image) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Encoders/GifEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

class GifEncoder extends GenericGifEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
if ($image->isAnimated()) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Encoders/JpegEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

class JpegEncoder extends GenericJpegEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$blendingColor = $this->driver()->handleInput(
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Encoders/WebpEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class WebpEncoder extends GenericWebpEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$quality = $this->quality === 100 ? IMG_WEBP_LOSSLESS : $this->quality;
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/AlignRotationModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class AlignRotationModifier extends GenericAlignRotationModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$image = match ($image->exif('IFD0.Orientation')) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

class BlendTransparencyModifier extends GenericBlendTransparencyModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
// decode blending color
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/BlurModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class BlurModifier extends GenericBlurModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/BrightnessModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class BrightnessModifier extends GenericBrightnessModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/ColorizeModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class ColorizeModifier extends GenericColorizeModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
// normalize colorize levels
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/ColorspaceModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

class ColorspaceModifier extends GenericColorspaceModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
if (!is_a($this->targetColorspace(), RgbColorspace::class)) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/ContainModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

class ContainModifier extends GenericContainModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$crop = $this->getCropSize($image);
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/ContrastModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class ContrastModifier extends GenericContrastModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/CoverModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

class CoverModifier extends GenericCoverModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$crop = $this->getCropSize($image);
Expand Down
5 changes: 5 additions & 0 deletions src/Drivers/Gd/Modifiers/CropModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

class CropModifier extends GenericCropModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$originalSize = $image->size();
Expand Down
3 changes: 3 additions & 0 deletions src/Drivers/Gd/Modifiers/DrawBezierModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
class DrawBezierModifier extends ModifiersDrawBezierModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
* @throws RuntimeException
* @throws GeometryException
*/
Expand Down
Loading

0 comments on commit 54aa51e

Please sign in to comment.