Permalink
Browse files

fixed CS (mainly method signatures)

  • Loading branch information...
1 parent c123857 commit 04edc329027cf987462fa4d74c1112d186212f4f @fabpot fabpot committed Jul 9, 2012
Showing with 18 additions and 18 deletions.
  1. +6 −6 Escaper.php
  2. +9 −9 Inline.php
  3. +1 −1 Unescaper.php
  4. +2 −2 Yaml.php
View
@@ -25,13 +25,13 @@ class Escaper
// first to ensure proper escaping because str_replace operates iteratively
// on the input arrays. This ordering of the characters avoids the use of strtr,
// which performs more slowly.
- static private $escapees = array('\\\\', '\\"', '"',
+ private static $escapees = array('\\\\', '\\"', '"',
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9");
- static private $escaped = array('\\"', '\\\\', '\\"',
+ private static $escaped = array('\\"', '\\\\', '\\"',
"\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a",
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f",
"\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17",
@@ -45,7 +45,7 @@ class Escaper
*
* @return Boolean True if the value would require double quotes.
*/
- static public function requiresDoubleQuoting($value)
+ public static function requiresDoubleQuoting($value)
{
return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
}
@@ -57,7 +57,7 @@ static public function requiresDoubleQuoting($value)
*
* @return string The quoted, escaped string
*/
- static public function escapeWithDoubleQuotes($value)
+ public static function escapeWithDoubleQuotes($value)
{
return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value));
}
@@ -69,7 +69,7 @@ static public function escapeWithDoubleQuotes($value)
*
* @return Boolean True if the value would require single quotes.
*/
- static public function requiresSingleQuoting($value)
+ public static function requiresSingleQuoting($value)
{
return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ - ? | < > = ! % @ ` ]/x', $value);
}
@@ -81,7 +81,7 @@ static public function requiresSingleQuoting($value)
*
* @return string The quoted, escaped string
*/
- static public function escapeWithSingleQuotes($value)
+ public static function escapeWithSingleQuotes($value)
{
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
}
View
@@ -29,7 +29,7 @@ class Inline
*
* @return array A PHP array representing the YAML string
*/
- static public function parse($value)
+ public static function parse($value)
{
$value = trim($value);
@@ -69,7 +69,7 @@ static public function parse($value)
*
* @throws DumpException When trying to dump PHP resource
*/
- static public function dump($value)
+ public static function dump($value)
{
switch (true) {
case is_resource($value):
@@ -119,7 +119,7 @@ static public function dump($value)
*
* @return string The YAML string representing the PHP array
*/
- static private function dumpArray($value)
+ private static function dumpArray($value)
{
// array
$keys = array_keys($value);
@@ -156,7 +156,7 @@ static private function dumpArray($value)
*
* @throws ParseException When malformed inline YAML string is parsed
*/
- static public function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
+ public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
{
if (in_array($scalar[$i], $stringDelimiters)) {
// quoted scalar
@@ -194,7 +194,7 @@ static public function parseScalar($scalar, $delimiters = null, $stringDelimiter
*
* @throws ParseException When malformed inline YAML string is parsed
*/
- static private function parseQuotedScalar($scalar, &$i)
+ private static function parseQuotedScalar($scalar, &$i)
{
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
@@ -224,7 +224,7 @@ static private function parseQuotedScalar($scalar, &$i)
*
* @throws ParseException When malformed inline YAML string is parsed
*/
- static private function parseSequence($sequence, &$i = 0)
+ private static function parseSequence($sequence, &$i = 0)
{
$output = array();
$len = strlen($sequence);
@@ -280,7 +280,7 @@ static private function parseSequence($sequence, &$i = 0)
*
* @throws ParseException When malformed inline YAML string is parsed
*/
- static private function parseMapping($mapping, &$i = 0)
+ private static function parseMapping($mapping, &$i = 0)
{
$output = array();
$len = strlen($mapping);
@@ -341,7 +341,7 @@ static private function parseMapping($mapping, &$i = 0)
*
* @return string A YAML string
*/
- static private function evaluateScalar($scalar)
+ private static function evaluateScalar($scalar)
{
$scalar = trim($scalar);
@@ -386,7 +386,7 @@ static private function evaluateScalar($scalar)
*
* @return string The regular expression
*/
- static private function getTimestampRegex()
+ private static function getTimestampRegex()
{
return <<<EOF
~^
View
@@ -48,7 +48,7 @@ public function unescapeSingleQuotedString($value)
public function unescapeDoubleQuotedString($value)
{
$self = $this;
- $callback = function($match) use($self) {
+ $callback = function($match) use ($self) {
return $self->unescapeCharacter($match[0]);
};
View
@@ -42,7 +42,7 @@ class Yaml
*
* @api
*/
- static public function parse($input)
+ public static function parse($input)
{
$file = '';
@@ -93,7 +93,7 @@ static public function parse($input)
*
* @api
*/
- static public function dump($array, $inline = 2)
+ public static function dump($array, $inline = 2)
{
$yaml = new Dumper();

0 comments on commit 04edc32

Please sign in to comment.