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:
<?php
namespace Scene7\Commands;
trait Width
{
/**
* @param int $width
* @return $this
*/
public function setWidth($width)
{
$width = (int) $width;
if ($width < 1) {
throw new \InvalidArgumentException('Width must be an integer greater than 0');
}
$this->addCommand(['wid' => $width]);
return $this;
}
/**
* @return int|null
*/
public function getWidth()
{
return isset($this->commands['wid']) ? $this->commands['wid'] : null;
}
}