chengkun
2025-09-05 4822304b63e1bd6327860af7f3db0133cecf167f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
 
namespace PhpOffice\PhpSpreadsheet\Chart;
 
use PhpOffice\PhpSpreadsheet\Style\Font;
 
class AxisText extends Properties
{
    private ?int $rotation = null;
 
    private Font $font;
 
    public function __construct()
    {
        parent::__construct();
        $this->font = new Font();
        $this->font->setSize(null, true);
    }
 
    public function setRotation(?int $rotation): self
    {
        $this->rotation = $rotation;
 
        return $this;
    }
 
    public function getRotation(): ?int
    {
        return $this->rotation;
    }
 
    public function getFillColorObject(): ChartColor
    {
        $fillColor = $this->font->getChartColor();
        if ($fillColor === null) {
            $fillColor = new ChartColor();
            $this->font->setChartColorFromObject($fillColor);
        }
 
        return $fillColor;
    }
 
    public function getFont(): Font
    {
        return $this->font;
    }
 
    public function setFont(Font $font): self
    {
        $this->font = $font;
 
        return $this;
    }
 
    /**
     * Implement PHP __clone to create a deep clone, not just a shallow copy.
     */
    public function __clone()
    {
        parent::__clone();
        $this->font = clone $this->font;
    }
}