Skip to content

Commit

Permalink
Optimize setContentType.
Browse files Browse the repository at this point in the history
  • Loading branch information
freyo committed Jun 5, 2017
1 parent ab5ddf6 commit dc9db84
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ public function write($path, $contents, Config $config)

$response = $this->normalizeResponse($response);

if (false === $response) {
return false;
if (false !== $response) {
$this->setContentType($path, $contents);;
}

$this->setContentType($path, $contents);

return $response;
}

Expand All @@ -107,12 +105,10 @@ public function writeStream($path, $resource, Config $config)

$response = $this->normalizeResponse($response);

if (false === $response) {
return false;
if (false !== $response) {
$this->setContentType($path, stream_get_contents($resource));
}

$this->setContentType($path, stream_get_contents($resource));

return $response;
}

Expand All @@ -134,12 +130,10 @@ public function update($path, $contents, Config $config)

$response = $this->normalizeResponse($response);

if (false === $response) {
return false;
if (false !== $response) {
$this->setContentType($path, $contents);
}

$this->setContentType($path, $contents);

return $response;
}

Expand All @@ -161,12 +155,10 @@ public function updateStream($path, $resource, Config $config)

$response = $this->normalizeResponse($response);

if (false === $response) {
return false;
if (false !== $response) {
$this->setContentType($path, stream_get_contents($resource));
}

$this->setContentType($path, stream_get_contents($resource));

return $response;
}

Expand Down

0 comments on commit dc9db84

Please sign in to comment.