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

Commit

Permalink
[PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_space…
Browse files Browse the repository at this point in the history
…s,linefeed

Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed
  • Loading branch information
Maks3w committed Jul 12, 2012
1 parent 01b3149 commit c2796da
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/Compress.php
Expand Up @@ -165,8 +165,8 @@ public function setAdapterOptions(array $options)

/**
* Get individual or all options from underlying adapter
*
* @param null|string $option
*
* @param null|string $option
* @return mixed
*/
public function getOptions($option = null)
Expand Down
4 changes: 2 additions & 2 deletions src/Compress/Gz.php
Expand Up @@ -143,7 +143,7 @@ public function compress($content)
gzwrite($file, $content);
gzclose($file);
$compressed = true;
} else if ($this->options['mode'] == 'deflate') {
} elseif ($this->options['mode'] == 'deflate') {
$compressed = gzdeflate($content, $this->getLevel());
} else {
$compressed = gzcompress($content, $this->getLevel());
Expand Down Expand Up @@ -186,7 +186,7 @@ public function decompress($content)
$file = gzopen($archive, 'r');
$compressed = gzread($file, $size);
gzclose($file);
} else if ($mode == 'deflate') {
} elseif ($mode == 'deflate') {
$compressed = gzinflate($content);
} else {
$compressed = gzuncompress($content);
Expand Down
2 changes: 1 addition & 1 deletion src/Compress/Rar.php
Expand Up @@ -182,7 +182,7 @@ public function compress($content)
*
* @param string $content
* @return boolean
* @throws Exception\RuntimeException if archive not found, cannot be opened,
* @throws Exception\RuntimeException if archive not found, cannot be opened,
* or error during decompression
*/
public function decompress($content)
Expand Down
2 changes: 1 addition & 1 deletion src/Compress/Zip.php
Expand Up @@ -182,7 +182,7 @@ public function compress($content)
*
* @param string $content
* @return string
* @throws Exception\RuntimeException If archive file not found, target directory not found,
* @throws Exception\RuntimeException If archive file not found, target directory not found,
* or error during decompression
*/
public function decompress($content)
Expand Down
2 changes: 1 addition & 1 deletion src/Encrypt.php
Expand Up @@ -61,7 +61,7 @@ public function setAdapter($options = null)
{
if (is_string($options)) {
$adapter = $options;
} else if (isset($options['adapter'])) {
} elseif (isset($options['adapter'])) {
$adapter = $options['adapter'];
unset($options['adapter']);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Encrypt/EncryptionAlgorithmInterface.php
Expand Up @@ -36,7 +36,7 @@ public function decrypt($value);

/**
* Return the adapter name
*
*
* @return string
*/
public function toString();
Expand Down
4 changes: 2 additions & 2 deletions src/Encrypt/Mcrypt.php
Expand Up @@ -168,7 +168,7 @@ public function setVector($vector = null)
}

$vector = mcrypt_create_iv($size, $method);
} else if (strlen($vector) != $size) {
} elseif (strlen($vector) != $size) {
throw new Exception\InvalidArgumentException('The given vector has a wrong size for the set algorithm');
}

Expand Down Expand Up @@ -312,7 +312,7 @@ protected function _initCipher($cipher)
if (empty($keysizes) || ($this->_encryption['salt'] == true)) {
$keysize = mcrypt_enc_get_key_size($cipher);
$key = substr(md5($key), 0, $keysize);
} else if (!in_array(strlen($key), $keysizes)) {
} elseif (!in_array(strlen($key), $keysizes)) {
throw new Exception\RuntimeException('The given key has a wrong size for the set algorithm');
}

Expand Down
2 changes: 1 addition & 1 deletion src/File/Rename.php
Expand Up @@ -179,7 +179,7 @@ public function filter($value)
* @param array $options
* @return array
*/
protected function _convertOptions($options)
protected function _convertOptions($options)
{
$files = array();
foreach ($options as $key => $value) {
Expand Down
26 changes: 13 additions & 13 deletions src/FilterChain.php
Expand Up @@ -38,7 +38,7 @@ class FilterChain extends AbstractFilter implements Countable

/**
* Initialize filter chain
*
*
*/
public function __construct($options = null)
{
Expand Down Expand Up @@ -90,7 +90,7 @@ public function setOptions($options)

/**
* Return the count of attached filters
*
*
* @return int
*/
public function count()
Expand All @@ -100,7 +100,7 @@ public function count()

/**
* Get plugin manager instance
*
*
* @return FilterPluginManager
*/
public function getPluginManager()
Expand All @@ -113,8 +113,8 @@ public function getPluginManager()

/**
* Set plugin manager instance
*
* @param FilterPluginManager $plugins
*
* @param FilterPluginManager $plugins
* @return FilterChain
*/
public function setPluginManager(FilterPluginManager $plugins)
Expand All @@ -125,9 +125,9 @@ public function setPluginManager(FilterPluginManager $plugins)

/**
* Retrieve a filter plugin by name
*
* @param mixed $name
* @param array $options
*
* @param mixed $name
* @param array $options
* @return Filter
*/
public function plugin($name, array $options = array())
Expand All @@ -138,7 +138,7 @@ public function plugin($name, array $options = array())

/**
* Attach a filter to the chain
*
*
* @param callback|FilterInterface $callback A Filter implementation or valid PHP callback
* @param int $priority Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)
* @return FilterChain
Expand All @@ -161,11 +161,11 @@ public function attach($callback, $priority = self::DEFAULT_PRIORITY)
/**
* Attach a filter to the chain using a short name
*
* Retrieves the filter from the attached plugin broker, and then calls attach()
* Retrieves the filter from the attached plugin broker, and then calls attach()
* with the retrieved instance.
*
* @param string $name
* @param mixed $options
*
* @param string $name
* @param mixed $options
* @param int $priority Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)
* @return FilterChain
*/
Expand Down
6 changes: 3 additions & 3 deletions src/FilterPluginManager.php
Expand Up @@ -26,7 +26,7 @@ class FilterPluginManager extends AbstractPluginManager
{
/**
* Default set of filters
*
*
* @var array
*/
protected $invokableClasses = array(
Expand Down Expand Up @@ -87,8 +87,8 @@ class FilterPluginManager extends AbstractPluginManager
*
* Checks that the filter loaded is either a valid callback or an instance
* of FilterInterface.
*
* @param mixed $plugin
*
* @param mixed $plugin
* @return void
* @throws Exception\RuntimeException if invalid
*/
Expand Down
6 changes: 3 additions & 3 deletions src/StaticFilter.php
Expand Up @@ -23,8 +23,8 @@ class StaticFilter

/**
* Set plugin manager for resolving filter classes
*
* @param FilterPluginManager $manager
*
* @param FilterPluginManager $manager
* @return void
*/
public static function setPluginManager(FilterPluginManager $manager = null)
Expand All @@ -38,7 +38,7 @@ public static function setPluginManager(FilterPluginManager $manager = null)

/**
* Get plugin manager for loading filter classes
*
*
* @return FilterPluginManager
*/
public static function getPluginManager()
Expand Down
4 changes: 2 additions & 2 deletions src/Word/CamelCaseToSeparator.php
Expand Up @@ -18,8 +18,8 @@ class CamelCaseToSeparator extends AbstractSeparator
{
/**
* Defined by Zend\Filter\Filter
*
* @param string $value
*
* @param string $value
* @return string
*/
public function filter($value)
Expand Down
4 changes: 2 additions & 2 deletions src/Word/DashToSeparator.php
Expand Up @@ -18,8 +18,8 @@ class DashToSeparator extends AbstractSeparator
{
/**
* Defined by Zend\Filter\Filter
*
* @param string $value
*
* @param string $value
* @return string
*/
public function filter($value)
Expand Down
8 changes: 4 additions & 4 deletions test/Compress/RarTest.php
Expand Up @@ -203,19 +203,19 @@ public function testSettingCallback()
$this->assertEquals($callback, $filter->getCallback());

}

public function testSettingCallbackThrowsExceptionOnMissingCallback()
{
$filter = new RarCompression();

$this->setExpectedException('Zend\Filter\Exception\InvalidArgumentException', 'must be between');
$filter->compress('test.txt');
}

public function testSettingCallbackThrowsExceptionOnInvalidCallback()
{
$filter = new RarCompression();

$this->setExpectedException('Zend\Filter\Exception\InvalidArgumentException', 'must be between');
$filter->setCallback('invalidCallback');
}
Expand Down
6 changes: 3 additions & 3 deletions test/CompressTest.php
Expand Up @@ -193,9 +193,9 @@ public function testSetAdapter()
$filter = new CompressFilter();
$this->assertEquals('Gz', $filter->getAdapterName());


$filter->setAdapter('\Zend\Filter\Boolean');

$this->setExpectedException('\Zend\Filter\Exception\InvalidArgumentException', 'does not implement');
$adapter = $filter->getAdapter();
}
Expand Down Expand Up @@ -227,7 +227,7 @@ public function testDecompressArchive()
public function testInvalidMethod()
{
$filter = new CompressFilter();

$this->setExpectedException('\Zend\Filter\Exception\BadMethodCallException', 'Unknown method');
$filter->invalidMethod();
}
Expand Down
2 changes: 1 addition & 1 deletion test/File/RenameTest.php
Expand Up @@ -358,7 +358,7 @@ public function testGetNewNameExceptionWithExistingFile()
array('source' => $this->_oldFile,
'target' => $this->_newFile,
'overwrite' => false)), $filter->getFile());

$this->setExpectedException('\Zend\Filter\Exception\InvalidArgumentException', 'could not be renamed');
$this->assertEquals($this->_newFile, $filter->getNewName($this->_oldFile));
}
Expand Down
8 changes: 4 additions & 4 deletions test/HtmlEntitiesTest.php
Expand Up @@ -175,7 +175,7 @@ public function testQuoteStyleQuotesEncodeDouble()
{
$input = "A 'single' and " . '"double"';
$result = "A 'single' and "double"";

$this->_filter->setQuoteStyle(ENT_COMPAT);
$this->assertEquals($result, $this->_filter->filter($input));
}
Expand Down Expand Up @@ -206,7 +206,7 @@ public function testCorrectsForEncodingMismatch()

$string = file_get_contents(dirname(__FILE__) . '/_files/latin-1-text.txt');

// restore_error_handler can emit an E_WARNING; let's ignore that, as
// restore_error_handler can emit an E_WARNING; let's ignore that, as
// we want to test the returned value
set_error_handler(array($this, 'errorHandler'), E_NOTICE | E_WARNING);
$result = $this->_filter->filter($string);
Expand All @@ -226,7 +226,7 @@ public function testStripsUnknownCharactersWhenEncodingMismatchDetected()

$string = file_get_contents(dirname(__FILE__) . '/_files/latin-1-text.txt');

// restore_error_handler can emit an E_WARNING; let's ignore that, as
// restore_error_handler can emit an E_WARNING; let's ignore that, as
// we want to test the returned value
set_error_handler(array($this, 'errorHandler'), E_NOTICE | E_WARNING);
$result = $this->_filter->filter($string);
Expand All @@ -246,7 +246,7 @@ public function testRaisesExceptionIfEncodingMismatchDetectedAndFinalStringIsEmp

$string = file_get_contents(dirname(__FILE__) . '/_files/latin-1-dash-only.txt');

// restore_error_handler can emit an E_WARNING; let's ignore that, as
// restore_error_handler can emit an E_WARNING; let's ignore that, as
// we want to test the returned value
// Also, explicit try, so that we don't mess up PHPUnit error handlers
set_error_handler(array($this, 'errorHandler'), E_NOTICE | E_WARNING);
Expand Down
4 changes: 2 additions & 2 deletions test/NullTest.php
Expand Up @@ -35,7 +35,7 @@ public function testConstructorParams()

$this->assertEquals(NullFilter::TYPE_INTEGER, $filter->getType());
}

/**
* @param mixed $value
* @param bool $expected
Expand All @@ -45,7 +45,7 @@ public function testDefault($value, $expected)
{
$filter = new NullFilter();
$this->assertSame($expected, $filter->filter($value));
}
}

/**
* @param int $type
Expand Down
2 changes: 1 addition & 1 deletion test/PregReplaceTest.php
Expand Up @@ -26,7 +26,7 @@ class PregReplaceTest extends \PHPUnit_Framework_TestCase
* @var PregReplaceFilter
*/
protected $filter;

public function setUp()
{
$this->filter = new PregReplaceFilter();
Expand Down

0 comments on commit c2796da

Please sign in to comment.