1: <?php
2:
3: /**
4: * Copyright 2016 LINE Corporation
5: *
6: * LINE Corporation licenses this file to you under the Apache License,
7: * version 2.0 (the "License"); you may not use this file except in compliance
8: * with the License. You may obtain a copy of the License at:
9: *
10: * https://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations
16: * under the License.
17: */
18:
19: namespace LINE\LINEBot\ImagemapActionBuilder;
20:
21: /**
22: * A builder class for area of imagemap.
23: *
24: * @package LINE\LINEBot\ImagemapActionBuilder
25: */
26: class AreaBuilder
27: {
28: /** @var int */
29: private $x;
30: /** @var int */
31: private $y;
32: /** @var int */
33: private $width;
34: /** @var int */
35: private $height;
36:
37: /**
38: * AreaBuilder constructor.
39: *
40: * @param int $x Position of x-axis.
41: * @param int $y Position of y-axis.
42: * @param int $width Width of area.
43: * @param int $height Height of area.
44: */
45: public function __construct($x, $y, $width, $height)
46: {
47: $this->x = $x;
48: $this->y = $y;
49: $this->width = $width;
50: $this->height = $height;
51: }
52:
53: /**
54: * Builds imagemap area structure.
55: *
56: * @return array Built area structure.
57: */
58: public function build()
59: {
60: return [
61: 'x' => $this->x,
62: 'y' => $this->y,
63: 'width' => $this->width,
64: 'height' => $this->height,
65: ];
66: }
67: }
68: