Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
96.77% covered (success)
96.77%
60 / 62
94.87% covered (success)
94.87%
37 / 39
CRAP
0.00% covered (danger)
0.00%
0 / 1
Emoji
96.77% covered (success)
96.77%
60 / 62
94.87% covered (success)
94.87%
37 / 39
44
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
1
 __toString
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 openAPITypes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 openAPIFormats
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isNullable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isNullableSetToNull
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 attributeMap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setters
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getters
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getModelName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 listInvalidProperties
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 valid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFont
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFont
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getWidth
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setWidth
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getHeight
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setHeight
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getTop
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTop
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getBottom
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setBottom
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getLeft
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLeft
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getRight
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRight
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getX
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setX
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getY
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setY
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 offsetExists
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetGet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetSet
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
 offsetUnset
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 jsonSerialize
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 toHeaderValue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 openAPINullables
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getOpenAPINullablesSetToNull
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setOpenAPINullablesSetToNull
n/a
0 / 0
n/a
0 / 0
1
 setIfExists
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
4
1<?php
2
3/**
4 * Emoji.
5 *
6 * @category Class
7 *
8 * @author   Fingerprint
9 *
10 * @see      https://fingerprint.com
11 */
12
13/**
14 * Server API.
15 *
16 * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
17 *
18 * The version of the OpenAPI document: 4
19 * Contact: support@fingerprint.com
20 * Generated by: https://openapi-generator.tech
21 * Generator version: 7.21.0
22 */
23
24/**
25 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 * https://openapi-generator.tech
27 * Do not edit the class manually.
28 */
29
30namespace Fingerprint\ServerSdk\Model;
31
32use Fingerprint\ServerSdk\ObjectSerializer;
33
34/**
35 * Bounding box metrics describing how the emoji glyph renders.
36 *
37 * @category Class
38 *
39 * @description Bounding box metrics describing how the emoji glyph renders.
40 *
41 * @author   Fingerprint
42 *
43 * @see      https://fingerprint.com
44 *
45 * @implements \ArrayAccess<string, mixed>
46 *
47 * @noinspection GrazieInspection
48 * @noinspection RedundantSuppression
49 */
50class Emoji implements ModelInterface, \ArrayAccess, \JsonSerializable
51{
52    public const DISCRIMINATOR = null;
53
54    /**
55     * The original name of the model.
56     *
57     */
58    protected static string $openAPIModelName = 'Emoji';
59
60    /**
61     * Array of property to type mappings. Used for (de)serialization.
62     *
63     * @var string[]
64     */
65    protected static array $openAPITypes = [
66        'font' => 'string',
67        'width' => 'float',
68        'height' => 'float',
69        'top' => 'float',
70        'bottom' => 'float',
71        'left' => 'float',
72        'right' => 'float',
73        'x' => 'float',
74        'y' => 'float',
75    ];
76
77    /**
78     * Array of property to format mappings. Used for (de)serialization.
79     *
80     * @var string[]
81     *
82     * @phpstan-var array<string, string|null>
83     *
84     * @psalm-var array<string, string|null>
85     */
86    protected static array $openAPIFormats = [
87        'font' => null,
88        'width' => 'double',
89        'height' => 'double',
90        'top' => 'double',
91        'bottom' => 'double',
92        'left' => 'double',
93        'right' => 'double',
94        'x' => 'double',
95        'y' => 'double',
96    ];
97
98    /**
99     * Array of nullable properties. Used for (de)serialization.
100     *
101     * @var bool[]
102     */
103    protected static array $openAPINullables = [
104        'font' => false,
105        'width' => false,
106        'height' => false,
107        'top' => false,
108        'bottom' => false,
109        'left' => false,
110        'right' => false,
111        'x' => false,
112        'y' => false,
113    ];
114
115    /**
116     * If a nullable field gets set to null, insert it here.
117     *
118     * @var bool[]
119     */
120    protected array $openAPINullablesSetToNull = [];
121
122    /**
123     * Array of attributes where the key is the local name,
124     * and the value is the original name.
125     *
126     * @var string[]
127     */
128    protected static array $attributeMap = [
129        'font' => 'font',
130        'width' => 'width',
131        'height' => 'height',
132        'top' => 'top',
133        'bottom' => 'bottom',
134        'left' => 'left',
135        'right' => 'right',
136        'x' => 'x',
137        'y' => 'y',
138    ];
139
140    /**
141     * Array of attributes to setter functions (for deserialization of responses).
142     *
143     * @var string[]
144     */
145    protected static array $setters = [
146        'font' => 'setFont',
147        'width' => 'setWidth',
148        'height' => 'setHeight',
149        'top' => 'setTop',
150        'bottom' => 'setBottom',
151        'left' => 'setLeft',
152        'right' => 'setRight',
153        'x' => 'setX',
154        'y' => 'setY',
155    ];
156
157    /**
158     * Array of attributes to getter functions (for serialization of requests).
159     *
160     * @var string[]
161     */
162    protected static array $getters = [
163        'font' => 'getFont',
164        'width' => 'getWidth',
165        'height' => 'getHeight',
166        'top' => 'getTop',
167        'bottom' => 'getBottom',
168        'left' => 'getLeft',
169        'right' => 'getRight',
170        'x' => 'getX',
171        'y' => 'getY',
172    ];
173
174    /**
175     * Associative array for storing property values.
176     */
177    protected array $container = [];
178
179    /**
180     * Constructor.
181     *
182     * @param array|null $data Associated array of property values
183     *                         initializing the model
184     *
185     * @noinspection DuplicatedCode
186     */
187    public function __construct(?array $data = null)
188    {
189        $this->setIfExists('font', $data ?? [], null);
190        $this->setIfExists('width', $data ?? [], null);
191        $this->setIfExists('height', $data ?? [], null);
192        $this->setIfExists('top', $data ?? [], null);
193        $this->setIfExists('bottom', $data ?? [], null);
194        $this->setIfExists('left', $data ?? [], null);
195        $this->setIfExists('right', $data ?? [], null);
196        $this->setIfExists('x', $data ?? [], null);
197        $this->setIfExists('y', $data ?? [], null);
198    }
199
200    /**
201     * Gets the string presentation of the object.
202     *
203     */
204    public function __toString(): string
205    {
206        return json_encode(
207            ObjectSerializer::sanitizeForSerialization($this),
208            JSON_PRETTY_PRINT
209        );
210    }
211
212    /**
213     * Array of property to type mappings. Used for (de)serialization.
214     *
215     */
216    public static function openAPITypes(): array
217    {
218        return self::$openAPITypes;
219    }
220
221    /**
222     * Array of property to format mappings. Used for (de)serialization.
223     */
224    public static function openAPIFormats(): array
225    {
226        return self::$openAPIFormats;
227    }
228
229    /**
230     * Checks if a property is nullable.
231     *
232     */
233    public static function isNullable(string $property): bool
234    {
235        return self::openAPINullables()[$property] ?? false;
236    }
237
238    /**
239     * Checks if a nullable property is set to null.
240     *
241     */
242    public function isNullableSetToNull(string $property): bool
243    {
244        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
245    }
246
247    /**
248     * Array of attributes where the key is the local name,
249     * and the value is the original name.
250     *
251     */
252    public static function attributeMap(): array
253    {
254        return self::$attributeMap;
255    }
256
257    /**
258     * Array of attributes to setter functions (for deserialization of responses).
259     *
260     */
261    public static function setters(): array
262    {
263        return self::$setters;
264    }
265
266    /**
267     * Array of attributes to getter functions (for serialization of requests).
268     *
269     */
270    public static function getters(): array
271    {
272        return self::$getters;
273    }
274
275    /**
276     * The original name of the model.
277     *
278     */
279    public function getModelName(): string
280    {
281        return self::$openAPIModelName;
282    }
283
284    /**
285     * Show all the invalid properties with reasons.
286     *
287     * @return array invalid properties with reasons
288     */
289    public function listInvalidProperties(): array
290    {
291        return [];
292    }
293
294    /**
295     * Validate all the properties in the model
296     * return true if all passed.
297     *
298     * @return bool True if all properties are valid
299     */
300    public function valid(): bool
301    {
302        return 0 === count($this->listInvalidProperties());
303    }
304
305    /**
306     * Gets font.
307     *
308     */
309    public function getFont(): ?string
310    {
311        return $this->container['font'];
312    }
313
314    /**
315     * Sets font.
316     *
317     * @param string $font font family reported by the browser when drawing the emoji
318     *
319     */
320    public function setFont(string $font): self
321    {
322        $this->container['font'] = $font;
323
324        return $this;
325    }
326
327    /**
328     * Gets width.
329     *
330     */
331    public function getWidth(): ?float
332    {
333        return $this->container['width'];
334    }
335
336    /**
337     * Sets width.
338     *
339     * @param float $width width
340     *
341     */
342    public function setWidth(float $width): self
343    {
344        $this->container['width'] = $width;
345
346        return $this;
347    }
348
349    /**
350     * Gets height.
351     *
352     */
353    public function getHeight(): ?float
354    {
355        return $this->container['height'];
356    }
357
358    /**
359     * Sets height.
360     *
361     * @param float $height height
362     *
363     */
364    public function setHeight(float $height): self
365    {
366        $this->container['height'] = $height;
367
368        return $this;
369    }
370
371    /**
372     * Gets top.
373     *
374     */
375    public function getTop(): ?float
376    {
377        return $this->container['top'];
378    }
379
380    /**
381     * Sets top.
382     *
383     * @param float $top top
384     *
385     */
386    public function setTop(float $top): self
387    {
388        $this->container['top'] = $top;
389
390        return $this;
391    }
392
393    /**
394     * Gets bottom.
395     *
396     */
397    public function getBottom(): ?float
398    {
399        return $this->container['bottom'];
400    }
401
402    /**
403     * Sets bottom.
404     *
405     * @param float $bottom bottom
406     *
407     */
408    public function setBottom(float $bottom): self
409    {
410        $this->container['bottom'] = $bottom;
411
412        return $this;
413    }
414
415    /**
416     * Gets left.
417     *
418     */
419    public function getLeft(): ?float
420    {
421        return $this->container['left'];
422    }
423
424    /**
425     * Sets left.
426     *
427     * @param float $left left
428     *
429     */
430    public function setLeft(float $left): self
431    {
432        $this->container['left'] = $left;
433
434        return $this;
435    }
436
437    /**
438     * Gets right.
439     *
440     */
441    public function getRight(): ?float
442    {
443        return $this->container['right'];
444    }
445
446    /**
447     * Sets right.
448     *
449     * @param float $right right
450     *
451     */
452    public function setRight(float $right): self
453    {
454        $this->container['right'] = $right;
455
456        return $this;
457    }
458
459    /**
460     * Gets x.
461     *
462     */
463    public function getX(): ?float
464    {
465        return $this->container['x'];
466    }
467
468    /**
469     * Sets x.
470     *
471     * @param float $x x
472     *
473     */
474    public function setX(float $x): self
475    {
476        $this->container['x'] = $x;
477
478        return $this;
479    }
480
481    /**
482     * Gets y.
483     *
484     */
485    public function getY(): ?float
486    {
487        return $this->container['y'];
488    }
489
490    /**
491     * Sets y.
492     *
493     * @param float $y y
494     *
495     */
496    public function setY(float $y): self
497    {
498        $this->container['y'] = $y;
499
500        return $this;
501    }
502
503    /**
504     * Returns true if offset exists. False otherwise.
505     *
506     * @param int|string $offset Offset
507     *
508     */
509    public function offsetExists(mixed $offset): bool
510    {
511        return isset($this->container[$offset]);
512    }
513
514    /**
515     * Gets offset.
516     *
517     * @param int|string $offset Offset
518     *
519     * @return mixed|null
520     */
521    #[\ReturnTypeWillChange]
522    public function offsetGet(mixed $offset): mixed
523    {
524        return $this->container[$offset] ?? null;
525    }
526
527    /**
528     * Sets value based on offset.
529     *
530     * @param int|null $offset Offset
531     * @param mixed    $value  Value to be set
532     *
533     */
534    public function offsetSet(mixed $offset, mixed $value): void
535    {
536        if (is_null($offset)) {
537            $this->container[] = $value;
538        } else {
539            $this->container[$offset] = $value;
540        }
541    }
542
543    /**
544     * Unsets offset.
545     *
546     * @param int|string $offset Offset
547     *
548     */
549    public function offsetUnset(mixed $offset): void
550    {
551        unset($this->container[$offset]);
552    }
553
554    /**
555     * Serializes the object to a value that can be serialized natively by json_encode().
556     *
557     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
558     *
559     * @return mixed returns data which can be serialized by json_encode(), which is a value
560     *               of any type other than a resource
561     */
562    #[\ReturnTypeWillChange]
563    public function jsonSerialize(): mixed
564    {
565        return ObjectSerializer::sanitizeForSerialization($this);
566    }
567
568    /**
569     * Gets a header-safe presentation of the object.
570     *
571     */
572    public function toHeaderValue(): string
573    {
574        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
575    }
576
577    /**
578     * Array of nullable properties.
579     */
580    protected static function openAPINullables(): array
581    {
582        return self::$openAPINullables;
583    }
584
585    /**
586     * Array of nullable field names deliberately set to null.
587     *
588     * @return bool[]
589     */
590    private function getOpenAPINullablesSetToNull(): array
591    {
592        return $this->openAPINullablesSetToNull;
593    }
594
595    /**
596     * Setter - Array of nullable field names deliberately set to null.
597     *
598     * @param bool[] $openAPINullablesSetToNull
599     *
600     * @codeCoverageIgnore
601     */
602    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
603    {
604        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
605    }
606
607    /**
608     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
609     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
610     * $this->openAPINullablesSetToNull array.
611     *
612     * @noinspection PhpSameParameterValueInspection
613     */
614    private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
615    {
616        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
617            $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore
618        }
619
620        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
621    }
622}