Skip to content

Commit

Permalink
fixed CS (mainly method signatures)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jul 9, 2012
1 parent 40e029e commit 6de3b71
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 30 deletions.
3 changes: 1 addition & 2 deletions Encoder/DecoderInterface.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Encoder;


/*
* This file is part of the Symfony framework.
*
Expand All @@ -27,5 +26,5 @@ interface DecoderInterface
*
* @return mixed
*/
function decode($data, $format);
public function decode($data, $format);
}
3 changes: 1 addition & 2 deletions Encoder/EncoderInterface.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Encoder;


/*
* This file is part of the Symfony framework.
*
Expand All @@ -27,5 +26,5 @@ interface EncoderInterface
*
* @return string
*/
function encode($data, $format);
public function encode($data, $format);
}
1 change: 0 additions & 1 deletion Encoder/JsonEncoder.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Encoder;


/*
* This file is part of the Symfony framework.
*
Expand Down
1 change: 0 additions & 1 deletion Encoder/NormalizationAwareInterface.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Encoder;


/*
* This file is part of the Symfony framework.
*
Expand Down
1 change: 0 additions & 1 deletion Normalizer/CustomNormalizer.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Normalizer;


/*
* This file is part of the Symfony framework.
*
Expand Down
4 changes: 2 additions & 2 deletions Normalizer/NormalizableInterface.php
Expand Up @@ -35,7 +35,7 @@ interface NormalizableInterface
* based on different output formats.
* @return array|scalar
*/
function normalize(SerializerInterface $serializer, $format = null);
public function normalize(SerializerInterface $serializer, $format = null);

/**
* Denormalizes the object back from an array of scalars|arrays.
Expand All @@ -49,5 +49,5 @@ function normalize(SerializerInterface $serializer, $format = null);
* @param string|null $format The format is optionally given to be able to denormalize differently
* based on different input formats.
*/
function denormalize(SerializerInterface $serializer, $data, $format = null);
public function denormalize(SerializerInterface $serializer, $data, $format = null);
}
9 changes: 4 additions & 5 deletions Normalizer/NormalizerInterface.php
Expand Up @@ -2,7 +2,6 @@

namespace Symfony\Component\Serializer\Normalizer;


/*
* This file is part of the Symfony framework.
*
Expand All @@ -26,7 +25,7 @@ interface NormalizerInterface
* @param string $format format the normalization result will be encoded as
* @return array|scalar
*/
function normalize($object, $format = null);
public function normalize($object, $format = null);

/**
* Denormalizes data back into an object of the given class
Expand All @@ -36,7 +35,7 @@ function normalize($object, $format = null);
* @param string $format format the given data was extracted from
* @return object
*/
function denormalize($data, $class, $format = null);
public function denormalize($data, $class, $format = null);

/**
* Checks whether the given class is supported for normalization by this normalizer
Expand All @@ -45,7 +44,7 @@ function denormalize($data, $class, $format = null);
* @param string $format The format being (de-)serialized from or into.
* @return Boolean
*/
function supportsNormalization($data, $format = null);
public function supportsNormalization($data, $format = null);

/**
* Checks whether the given class is supported for denormalization by this normalizer
Expand All @@ -55,5 +54,5 @@ function supportsNormalization($data, $format = null);
* @param string $format The format being deserialized from.
* @return Boolean
*/
function supportsDenormalization($data, $type, $format = null);
public function supportsDenormalization($data, $type, $format = null);
}
8 changes: 4 additions & 4 deletions Serializer.php
Expand Up @@ -59,7 +59,7 @@ public function __construct(array $normalizers = array(), array $encoders = arra
/**
* {@inheritdoc}
*/
public final function serialize($data, $format)
final public function serialize($data, $format)
{
if (!$this->supportsSerialization($format)) {
throw new UnexpectedValueException('Serialization for the format '.$format.' is not supported');
Expand All @@ -77,7 +77,7 @@ public final function serialize($data, $format)
/**
* {@inheritdoc}
*/
public final function deserialize($data, $type, $format)
final public function deserialize($data, $type, $format)
{
if (!$this->supportsDeserialization($format)) {
throw new UnexpectedValueException('Deserialization for the format '.$format.' is not supported');
Expand Down Expand Up @@ -131,15 +131,15 @@ public function denormalize($data, $type, $format = null)
/**
* {@inheritdoc}
*/
public final function encode($data, $format)
final public function encode($data, $format)
{
return $this->getEncoder($format)->encode($data, $format);
}

/**
* {@inheritdoc}
*/
public final function decode($data, $format)
final public function decode($data, $format)
{
return $this->getEncoder($format)->decode($data, $format);
}
Expand Down
2 changes: 1 addition & 1 deletion SerializerAwareInterface.php
Expand Up @@ -25,5 +25,5 @@ interface SerializerAwareInterface
*
* @param SerializerInterface $serializer
*/
function setSerializer(SerializerInterface $serializer);
public function setSerializer(SerializerInterface $serializer);
}
22 changes: 11 additions & 11 deletions SerializerInterface.php
Expand Up @@ -27,7 +27,7 @@ interface SerializerInterface
* @param string $format format name
* @return string
*/
function serialize($data, $format);
public function serialize($data, $format);

/**
* Deserializes data into the given type.
Expand All @@ -36,7 +36,7 @@ function serialize($data, $format);
* @param string $type
* @param string $format
*/
function deserialize($data, $type, $format);
public function deserialize($data, $type, $format);

/**
* Normalizes any data into a set of arrays/scalars
Expand All @@ -45,7 +45,7 @@ function deserialize($data, $type, $format);
* @param string $format format name, present to give the option to normalizers to act differently based on formats
* @return array|scalar
*/
function normalize($data, $format = null);
public function normalize($data, $format = null);

/**
* Denormalizes data into the given type.
Expand All @@ -55,7 +55,7 @@ function normalize($data, $format = null);
* @param string $format
* @return mixed
*/
function denormalize($data, $type, $format = null);
public function denormalize($data, $type, $format = null);

/**
* Encodes data into the given format
Expand All @@ -64,7 +64,7 @@ function denormalize($data, $type, $format = null);
* @param string $format format name
* @return array|scalar
*/
function encode($data, $format);
public function encode($data, $format);

/**
* Decodes a string from the given format back into PHP data
Expand All @@ -73,44 +73,44 @@ function encode($data, $format);
* @param string $format format name
* @return mixed
*/
function decode($data, $format);
public function decode($data, $format);

/**
* Checks whether the serializer can serialize to given format
*
* @param string $format format name
* @return Boolean
*/
function supportsSerialization($format);
public function supportsSerialization($format);

/**
* Checks whether the serializer can deserialize from given format
*
* @param string $format format name
* @return Boolean
*/
function supportsDeserialization($format);
public function supportsDeserialization($format);

/**
* Checks whether the serializer can encode to given format
*
* @param string $format format name
* @return Boolean
*/
function supportsEncoding($format);
public function supportsEncoding($format);

/**
* Checks whether the serializer can decode from given format
*
* @param string $format format name
* @return Boolean
*/
function supportsDecoding($format);
public function supportsDecoding($format);

/**
* Get the encoder for the given format
*
* @return EncoderInterface
*/
function getEncoder($format);
public function getEncoder($format);
}

0 comments on commit 6de3b71

Please sign in to comment.