Вход Регистрация
Файл: vendor/intervention/image/src/Modifiers/RotateModifier.php
Строк: 50
<?php

declare(strict_types=1);

namespace 
InterventionImageModifiers;

use 
InterventionImageDriversSpecializableModifier;
use 
InterventionImageExceptionsStateException;
use 
InterventionImageInterfacesColorInterface;

class 
RotateModifier extends SpecializableModifier
{
    public function 
__construct(
        public 
float $angle,
        public 
null|string|ColorInterface $background null,
    ) {
        
//
    
}

    
/**
     * Clockwise rotation angle.
     *
     * Restricted beyond 360 degrees because the end result is the same.
     */
    
public function rotationAngle(): float
    
{
        return 
fmod($this->angle360);
    }

    
/**
     * Return color to fill the newly created areas after rotation.
     *
     * @throws StateException
     */
    
protected function backgroundColor(): ColorInterface
    
{
        return 
$this->driver()->decodeColor(
            
$this->background ?? $this->driver()->config()->backgroundColor,
        );
    }
}
Онлайн: 1
Реклама