shouldBeGreaterThanOne() публичный статический Метод

public static shouldBeGreaterThanOne ( string $name, $value )
$name string
Пример #1
0
 /**
  * Crops the image to specific dimensions prior to any other resize operations.
  *
  * @param int $width
  * @param int $height
  * @param int $x
  * @param int $y
  *
  * @return $this
  *
  * @throws \Spatie\MediaLibrary\Exceptions\InvalidConversionParameter
  */
 public function setCrop(int $width, int $height, int $x, int $y)
 {
     foreach (compact('width', 'height') as $name => $value) {
         if ($value < 1) {
             throw InvalidConversionParameter::shouldBeGreaterThanOne($name, $value);
         }
     }
     $this->setManipulationParameter('crop', implode(',', [$width, $height, $x, $y]));
     return $this;
 }