Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/psr-2_compliance' of git://github.com/RWOverdijk…
Browse files Browse the repository at this point in the history
…/zf2 into RWOverdijk-hotfix/psr-2_compliance
  • Loading branch information
Ralph Schindler committed Aug 13, 2012
2 parents 6f57ae9 + 6597f26 commit 116cf37
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/AbstractFilter.php
Expand Up @@ -39,7 +39,7 @@ abstract class AbstractFilter implements FilterInterface
public static function hasPcreUnicodeSupport()
{
if (static::$hasPcreUnicodeSupport === null) {
if (defined('PREG_BAD_UTF8_OFFSET_ERROR') || @preg_match('/\pL/u', 'a') == 1){
if (defined('PREG_BAD_UTF8_OFFSET_ERROR') || @preg_match('/\pL/u', 'a') == 1) {
static::$hasPcreUnicodeSupport = true;
} else {
static::$hasPcreUnicodeSupport = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Compress/Rar.php
Expand Up @@ -215,7 +215,7 @@ public function decompress($content)
throw new Exception\RuntimeException("Error reading the RAR Archive");
}

foreach($filelist as $file) {
foreach ($filelist as $file) {
$file->extract($target);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Compress/Zip.php
Expand Up @@ -230,7 +230,7 @@ public function decompress($content)
*/
public function errorString($error)
{
switch($error) {
switch ($error) {
case ZipArchive::ER_MULTIDISK :
return 'Multidisk ZIP Archives not supported';

Expand Down
14 changes: 7 additions & 7 deletions src/Encrypt/Openssl.php
Expand Up @@ -177,7 +177,7 @@ public function getPublicKey()
public function setPublicKey($key)
{
if (is_array($key)) {
foreach($key as $type => $option) {
foreach ($key as $type => $option) {
if ($type !== 'public') {
$key['public'] = $option;
unset($key[$type]);
Expand Down Expand Up @@ -211,7 +211,7 @@ public function getPrivateKey()
public function setPrivateKey($key, $passphrase = null)
{
if (is_array($key)) {
foreach($key as $type => $option) {
foreach ($key as $type => $option) {
if ($type !== 'private') {
$key['private'] = $option;
unset($key[$type]);
Expand Down Expand Up @@ -248,7 +248,7 @@ public function getEnvelopeKey()
public function setEnvelopeKey($key)
{
if (is_array($key)) {
foreach($key as $type => $option) {
foreach ($key as $type => $option) {
if ($type !== 'envelope') {
$key['envelope'] = $option;
unset($key[$type]);
Expand Down Expand Up @@ -351,7 +351,7 @@ public function encrypt($value)
$keys = array();
$fingerprints = array();
$count = -1;
foreach($this->keys['public'] as $key => $cert) {
foreach ($this->keys['public'] as $key => $cert) {
$keys[$key] = openssl_pkey_get_public($cert);
if ($this->package) {
$details = openssl_pkey_get_details($keys[$key]);
Expand Down Expand Up @@ -384,7 +384,7 @@ public function encrypt($value)
// Pack data and envelope keys into single string
if ($this->package) {
$header = pack('n', count($this->keys['envelope']));
foreach($this->keys['envelope'] as $key => $envKey) {
foreach ($this->keys['envelope'] as $key => $envKey) {
$header .= pack('H32n', $fingerprints[$key], strlen($envKey)) . $envKey;
}

Expand Down Expand Up @@ -416,7 +416,7 @@ public function decrypt($value)
throw new Exception\RuntimeException('Please give an envelope key for decryption with Openssl');
}

foreach($this->keys['private'] as $key => $cert) {
foreach ($this->keys['private'] as $key => $cert) {
$keys = openssl_pkey_get_private($cert, $this->getPassphrase());
}

Expand All @@ -431,7 +431,7 @@ public function decrypt($value)
$count = unpack('ncount', $value);
$count = $count['count'];
$length = 2;
for($i = $count; $i > 0; --$i) {
for ($i = $count; $i > 0; --$i) {
$header = unpack('H32print/nsize', substr($value, $length, 18));
$length += 18;
if ($header['print'] == $fingerprint) {
Expand Down
2 changes: 1 addition & 1 deletion src/Inflector.php
Expand Up @@ -412,7 +412,7 @@ public function setStaticRuleReference($name, &$reference)
public function filter($source)
{
// clean source
foreach ( (array) $source as $sourceName => $sourceValue) {
foreach ((array) $source as $sourceName => $sourceValue) {
$source[ltrim($sourceName, ':')] = $sourceValue;
}

Expand Down
2 changes: 1 addition & 1 deletion src/RealPath.php
Expand Up @@ -31,7 +31,7 @@ class RealPath extends AbstractFilter
public function __construct($existsOrOptions = true)
{
if ($existsOrOptions !== null) {
if (!static::isOptions($existsOrOptions)){
if (!static::isOptions($existsOrOptions)) {
$this->setExists($existsOrOptions);
} else {
$this->setOptions($existsOrOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/StringToLower.php
Expand Up @@ -33,7 +33,7 @@ class StringToLower extends AbstractUnicode
public function __construct($encodingOrOptions = null)
{
if ($encodingOrOptions !== null) {
if (!static::isOptions($encodingOrOptions)){
if (!static::isOptions($encodingOrOptions)) {
$this->setEncoding($encodingOrOptions);
} else {
$this->setOptions($encodingOrOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/StringToUpper.php
Expand Up @@ -33,7 +33,7 @@ class StringToUpper extends AbstractUnicode
public function __construct($encodingOrOptions = null)
{
if ($encodingOrOptions !== null) {
if (!static::isOptions($encodingOrOptions)){
if (!static::isOptions($encodingOrOptions)) {
$this->setEncoding($encodingOrOptions);
} else {
$this->setOptions($encodingOrOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/StripTags.php
Expand Up @@ -112,7 +112,7 @@ public function setTagsAllowed($tagsAllowed)
$this->tagsAllowed[$tagName] = array();
}
// Otherwise, if a tag was provided with attributes
else if (is_string($index) && (is_array($element) || is_string($element))) {
elseif (is_string($index) && (is_array($element) || is_string($element))) {
// Canonicalize the tag name
$tagName = strtolower($index);
// Canonicalize the attributes
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/RarTest.php
Expand Up @@ -38,7 +38,7 @@ public function setUp()
dirname(__DIR__) . '/_files/_compress'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down Expand Up @@ -70,7 +70,7 @@ public function tearDown()
dirname(__DIR__) . '/_files/_compress'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down
2 changes: 1 addition & 1 deletion test/Compress/TarLoadArchiveTarTest.php
Expand Up @@ -30,7 +30,7 @@ public function testArchiveTarNotLoaded()
try {
$tar = new TarCompression;
$this->fail('ExtensionNotLoadedException was expected but not thrown');
} catch(ExtensionNotLoadedException $e) {
} catch (ExtensionNotLoadedException $e) {
}
}
}
4 changes: 2 additions & 2 deletions test/Compress/TarTest.php
Expand Up @@ -44,7 +44,7 @@ public function setUp()
dirname(__DIR__) . '/_files/compressed.tar'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down Expand Up @@ -77,7 +77,7 @@ public function tearDown()
dirname(__DIR__) . '/_files/compressed.tar'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/ZipTest.php
Expand Up @@ -40,7 +40,7 @@ public function setUp()
dirname(__DIR__) . '/_files/_compress'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down Expand Up @@ -74,7 +74,7 @@ public function tearDown()
dirname(__DIR__) . '/_files/_compress'
);

foreach($files as $file) {
foreach ($files as $file) {
if (file_exists($file)) {
if (is_dir($file)) {
rmdir($file);
Expand Down

0 comments on commit 116cf37

Please sign in to comment.