コード例 #1
0
 public function buildConfiguration()
 {
     $config = Configuration::fromEnvironmentVariable(CloudinaryEnvironmentVariable::fromString($this->getEnvironmentVariable()));
     if ($this->getCdnSubdomainFlag()) {
         $config->enableCdnSubdomain();
     }
     $config->getDefaultTransformation()->withGravity(Gravity::fromString($this->getDefaultGravity()))->withFetchFormat(FetchFormat::fromString($this->getFetchFormat()))->withQuality(Quality::fromString($this->getImageQuality()))->withDpr(Dpr::fromString($this->getImageDpr()));
     return $config;
 }
コード例 #2
0
 function it_builds_with_crop_set_to_crop_when_gravity_is_set()
 {
     $transformationArray = self::builder()->withGravity(Gravity::fromString('center'))->build();
     $transformationArray->offsetGet('crop')->shouldBe('crop');
 }