forked from vinkla/extended-acf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dimensions.php
43 lines (34 loc) · 902 Bytes
/
Dimensions.php
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
<?php
/**
* Copyright (c) Vincent Klaiber.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/vinkla/extended-acf
*/
declare(strict_types=1);
namespace Extended\ACF\Fields\Settings;
trait Dimensions
{
public function height(int|null $min = null, int|null $max = null): static
{
if ($min !== null) {
$this->settings['min_height'] = $min;
}
if ($max !== null) {
$this->settings['max_height'] = $max;
}
return $this;
}
public function width(int|null $min = null, int|null $max = null): static
{
if ($min !== null) {
$this->settings['min_width'] = $min;
}
if ($max !== null) {
$this->settings['max_width'] = $max;
}
return $this;
}
}