Skip to content

Commit

Permalink
Merge pull request #8 from heiglandreas/fixCsIssues
Browse files Browse the repository at this point in the history
Fix cs issues
  • Loading branch information
heiglandreas committed Jun 16, 2017
2 parents bbf4761 + d5698b6 commit f9a822d
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 196 deletions.
32 changes: 32 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<ruleset name="org.heigl.Ghostscript">
<description>The coding standard for Org_Heigl\Ghostscript.</description>

<file>src</file>
<file>tests</file>

<exclude-pattern>*/Standards/*/Tests/*.(inc|css|js)</exclude-pattern>

<arg name="basepath" value="."/>
<arg name="colors" />
<arg name="parallel" value="75" />
<arg value="np"/>

<!-- Don't hide tokenizer exceptions -->
<rule ref="Internal.Tokenizer.Exception">
<type>error</type>
</rule>

<!-- Include the whole PEAR standard -->
<rule ref="PSR2"/>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
</ruleset>
10 changes: 5 additions & 5 deletions src/Device/Jpeg.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function getDevice()
public function getParameterString()
{
$string = '';
$string .= ' -sDEVICE=' . $this -> getDevice();
$string .= ' -dJPEGQ=' . $this -> getQuality();
$string .= ' -dQFactor=' . 1 / 100 * $this -> getQuality();
$string .= ' -sDEVICE=' . $this->getDevice();
$string .= ' -dJPEGQ=' . $this->getQuality();
$string .= ' -dQFactor=' . 1 / 100 * $this->getQuality();

return $string;
}
Expand All @@ -90,7 +90,7 @@ public function setQuality($quality)
$quality = 0;
}

$this -> _quality = $quality;
$this->_quality = $quality;

return $this;
}
Expand All @@ -102,7 +102,7 @@ public function setQuality($quality)
*/
public function getQuality()
{
return $this -> _quality;
return $this->_quality;
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/Device/Png.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Png implements DeviceInterface
*/
public function getDevice()
{
return $this -> _device;
return $this->_device;
}

/**
Expand Down Expand Up @@ -89,7 +89,7 @@ public function setDevice($device)
];
$this->_device = 'pngalpha';
if (in_array($device, $devices)) {
$this -> _device = $device;
$this->_device = $device;
}

return $this;
Expand All @@ -102,9 +102,9 @@ public function setDevice($device)
*/
public function getParameterString()
{
$string = ' -sDEVICE=' . $this -> getDevice();
if (('pngalpha' === $this -> getDevice()) && (null !== $this -> getBackgroundColor())) {
$string .= ' -dBackgroundColor=16#' . $this -> getBackgroundColor();
$string = ' -sDEVICE=' . $this->getDevice();
if (('pngalpha' === $this->getDevice()) && (null !== $this->getBackgroundColor())) {
$string .= ' -dBackgroundColor=16#' . $this->getBackgroundColor();
}

return $string;
Expand All @@ -125,7 +125,7 @@ public function setBackgroundColor($color)
$color = null;
}

$this -> _color = $color;
$this->_color = $color;

return $this;
}
Expand All @@ -137,7 +137,7 @@ public function setBackgroundColor($color)
*/
public function getBackgroundColor()
{
return $this -> _color;
return $this->_color;
}

/**
Expand Down

0 comments on commit f9a822d

Please sign in to comment.