Permalink
Browse files

fixed CS

  • Loading branch information...
1 parent a261cb1 commit bb18f5131f785483d3750a771df594eed1e5f863 @fabpot fabpot committed Jul 9, 2012
View
1 Definition/ArrayNode.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Config\Definition;
-
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
View
6 Definition/BaseNode.php
@@ -221,7 +221,7 @@ public function getPath()
*
* @throws ForbiddenOverwriteException
*/
- public final function merge($leftSide, $rightSide)
+ final public function merge($leftSide, $rightSide)
{
if (!$this->allowOverwrite) {
throw new ForbiddenOverwriteException(sprintf(
@@ -245,7 +245,7 @@ public function getPath()
*
* @return mixed The normalized value.
*/
- public final function normalize($value)
+ final public function normalize($value)
{
// run custom normalization closures
foreach ($this->normalizationClosures as $closure) {
@@ -273,7 +273,7 @@ public function getPath()
*
* @return mixed The finalized value
*/
- public final function finalize($value)
+ final public function finalize($value)
{
$this->validateType($value);
View
46 Definition/Builder/EnumNodeDefinition.php
@@ -12,30 +12,30 @@
*/
class EnumNodeDefinition extends ScalarNodeDefinition
{
- private $values;
-
- public function values(array $values)
- {
- $values = array_unique($values);
-
- if (count($values) <= 1) {
- throw new \InvalidArgumentException('->values() must be called with at least two distinct values.');
- }
-
- $this->values = $values;
- }
-
- /**
- * Instantiate a Node
- *
- * @return EnumNode The node
- */
- protected function instantiateNode()
+ private $values;
+
+ public function values(array $values)
+ {
+ $values = array_unique($values);
+
+ if (count($values) <= 1) {
+ throw new \InvalidArgumentException('->values() must be called with at least two distinct values.');
+ }
+
+ $this->values = $values;
+ }
+
+ /**
+ * Instantiate a Node
+ *
+ * @return EnumNode The node
+ */
+ protected function instantiateNode()
{
if (null === $this->values) {
throw new \RuntimeException('You must call ->values() on enum nodes.');
}
-
- return new EnumNode($this->name, $this->parent, $this->values);
- }
-}
+
+ return new EnumNode($this->name, $this->parent, $this->values);
+ }
+}
View
4 Definition/Builder/ExprBuilder.php
@@ -214,11 +214,11 @@ public function end()
*
* @return array
*/
- static public function buildExpressions(array $expressions)
+ public static function buildExpressions(array $expressions)
{
foreach ($expressions as $k => $expr) {
if ($expr instanceof ExprBuilder) {
- $expressions[$k] = function($v) use($expr) {
+ $expressions[$k] = function($v) use ($expr) {
return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v;
};
}
View
6 Definition/Builder/ParentNodeDefinitionInterface.php
@@ -18,9 +18,9 @@
*/
interface ParentNodeDefinitionInterface
{
- function children();
+ public function children();
- function append(NodeDefinition $node);
+ public function append(NodeDefinition $node);
- function setBuilder(NodeBuilder $builder);
+ public function setBuilder(NodeBuilder $builder);
}
View
2 Definition/ConfigurationInterface.php
@@ -23,5 +23,5 @@
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
- function getConfigTreeBuilder();
+ public function getConfigTreeBuilder();
}
View
2 Definition/EnumNode.php
@@ -47,4 +47,4 @@ protected function finalizeValue($value)
return $value;
}
-}
+}
View
16 Definition/NodeInterface.php
@@ -26,36 +26,36 @@
*
* @return string The name of the node
*/
- function getName();
+ public function getName();
/**
* Returns the path of the node.
*
* @return string The node path
*/
- function getPath();
+ public function getPath();
/**
* Returns true when the node is required.
*
* @return Boolean If the node is required
*/
- function isRequired();
+ public function isRequired();
/**
* Returns true when the node has a default value.
*
* @return Boolean If the node has a default value
*/
- function hasDefaultValue();
+ public function hasDefaultValue();
/**
* Returns the default value of the node.
*
* @return mixed The default value
* @throws \RuntimeException if the node has no default value
*/
- function getDefaultValue();
+ public function getDefaultValue();
/**
* Normalizes the supplied value.
@@ -64,7 +64,7 @@ function getDefaultValue();
*
* @return mixed The normalized value
*/
- function normalize($value);
+ public function normalize($value);
/**
* Merges two values together.
@@ -74,7 +74,7 @@ function normalize($value);
*
* @return mixed The merged values
*/
- function merge($leftSide, $rightSide);
+ public function merge($leftSide, $rightSide);
/**
* Finalizes a value.
@@ -83,5 +83,5 @@ function merge($leftSide, $rightSide);
*
* @return mixed The finalized value
*/
- function finalize($value);
+ public function finalize($value);
}
View
4 Definition/Processor.php
@@ -65,7 +65,7 @@ public function processConfiguration(ConfigurationInterface $configuration, arra
*
* @return array the config with normalized keys
*/
- static public function normalizeKeys(array $config)
+ public static function normalizeKeys(array $config)
{
foreach ($config as $key => $value) {
if (is_array($value)) {
@@ -104,7 +104,7 @@ static public function normalizeKeys(array $config)
*
* @return array
*/
- static public function normalizeConfig($config, $key, $plural = null)
+ public static function normalizeConfig($config, $key, $plural = null)
{
if (null === $plural) {
$plural = $key.'s';
View
2 Definition/PrototypeNodeInterface.php
@@ -23,5 +23,5 @@
*
* @param string $name The name of the node
*/
- function setName($name);
+ public function setName($name);
}
View
2 FileLocatorInterface.php
@@ -27,5 +27,5 @@
*
* @throws \InvalidArgumentException When file is not found
*/
- function locate($name, $currentPath = null, $first = true);
+ public function locate($name, $currentPath = null, $first = true);
}
View
2 Loader/FileLoader.php
@@ -22,7 +22,7 @@
*/
abstract class FileLoader extends Loader
{
- static protected $loading = array();
+ protected static $loading = array();
protected $locator;
View
8 Loader/LoaderInterface.php
@@ -24,7 +24,7 @@
* @param mixed $resource The resource
* @param string $type The resource type
*/
- function load($resource, $type = null);
+ public function load($resource, $type = null);
/**
* Returns true if this class supports the given resource.
@@ -34,20 +34,20 @@ function load($resource, $type = null);
*
* @return Boolean true if this class supports the given resource, false otherwise
*/
- function supports($resource, $type = null);
+ public function supports($resource, $type = null);
/**
* Gets the loader resolver.
*
* @return LoaderResolverInterface A LoaderResolverInterface instance
*/
- function getResolver();
+ public function getResolver();
/**
* Sets the loader resolver.
*
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
*/
- function setResolver(LoaderResolverInterface $resolver);
+ public function setResolver(LoaderResolverInterface $resolver);
}
View
2 Loader/LoaderResolverInterface.php
@@ -26,5 +26,5 @@
*
* @return LoaderInterface A LoaderInterface instance
*/
- function resolve($resource, $type = null);
+ public function resolve($resource, $type = null);
}
View
6 Resource/ResourceInterface.php
@@ -23,7 +23,7 @@
*
* @return string A string representation of the Resource
*/
- function __toString();
+ public function __toString();
/**
* Returns true if the resource has not been updated since the given timestamp.
@@ -32,12 +32,12 @@ function __toString();
*
* @return Boolean true if the resource has not been updated, false otherwise
*/
- function isFresh($timestamp);
+ public function isFresh($timestamp);
/**
* Returns the resource tied to this Resource.
*
* @return mixed The resource
*/
- function getResource();
+ public function getResource();
}
View
1 Tests/Definition/BooleanNodeTest.php
@@ -58,4 +58,3 @@ public function getInvalidValues()
);
}
}
-
View
2 Tests/Definition/Builder/EnumNodeDefinitionTest.php
@@ -34,4 +34,4 @@ public function testGetNode()
$node = $def->getNode();
$this->assertEquals(array('foo', 'bar'), $node->getValues());
}
-}
+}
View
5 Tests/Definition/Builder/ExprBuilderTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-
class ExprBuilderTest extends \PHPUnit_Framework_TestCase
{
@@ -160,6 +159,7 @@ public function testThenUnsetExpression()
protected function getTestBuilder()
{
$builder = new TreeBuilder();
+
return $builder
->root('test')
->children()
@@ -191,7 +191,8 @@ protected function finalizeTestBuilder($testBuilder, $config=null)
* @param $val The value that the closure must return
* @return Closure
*/
- protected function returnClosure($val) {
+ protected function returnClosure($val)
+ {
return function($v) use ($val) {
return $val;
};
View
2 Tests/Definition/EnumNodeTest.php
@@ -38,4 +38,4 @@ public function testFinalizeWithInvalidValue()
$node = new EnumNode('foo', null, array('foo', 'bar'));
$node->finalize('foobar');
}
-}
+}

0 comments on commit bb18f51

Please sign in to comment.