diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index 763c609c21..8500644655 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -288,7 +288,7 @@ class Container implements IntrospectableContainerInterface $ids = array(); $r = new \ReflectionClass($this); foreach ($r->getMethods() as $method) { - if (preg_match('/^get(.+)Service$/', $method->getName(), $match)) { + if (preg_match('/^get(.+)Service$/', $method->name, $match)) { $ids[] = self::underscore($match[1]); } } diff --git a/src/Symfony/Component/Form/Util/PropertyPath.php b/src/Symfony/Component/Form/Util/PropertyPath.php index 5a184ac56e..88a94b5f76 100644 --- a/src/Symfony/Component/Form/Util/PropertyPath.php +++ b/src/Symfony/Component/Form/Util/PropertyPath.php @@ -384,19 +384,19 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface if ($reflClass->hasMethod($getter)) { if (!$reflClass->getMethod($getter)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $getter, $reflClass->getName())); + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $getter, $reflClass->name)); } $result = $objectOrArray->$getter(); } elseif ($reflClass->hasMethod($isser)) { if (!$reflClass->getMethod($isser)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $isser, $reflClass->getName())); + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $isser, $reflClass->name)); } $result = $objectOrArray->$isser(); } elseif ($reflClass->hasMethod($hasser)) { if (!$reflClass->getMethod($hasser)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $hasser, $reflClass->getName())); + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $hasser, $reflClass->name)); } $result = $objectOrArray->$hasser(); @@ -405,7 +405,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface $result =& $objectOrArray->$property; } elseif ($reflClass->hasProperty($property)) { if (!$reflClass->getProperty($property)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()"?', $property, $reflClass->getName(), $getter, $isser)); + throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()"?', $property, $reflClass->name, $getter, $isser)); } $result =& $objectOrArray->$property; @@ -413,7 +413,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface // needed to support \stdClass instances $result =& $objectOrArray->$property; } else { - throw new InvalidPropertyException(sprintf('Neither property "%s" nor method "%s()" nor method "%s()" exists in class "%s"', $property, $getter, $isser, $reflClass->getName())); + throw new InvalidPropertyException(sprintf('Neither property "%s" nor method "%s()" nor method "%s()" exists in class "%s"', $property, $getter, $isser, $reflClass->name)); } } else { throw new InvalidPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you should write the property path as "[%s]" instead?', $property, $property)); @@ -486,7 +486,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface $setter = 'set'.$this->camelize($property); if ($reflClass->hasMethod($setter)) { if (!$reflClass->getMethod($setter)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $setter, $reflClass->getName())); + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $setter, $reflClass->name)); } $objectOrArray->$setter($value); @@ -495,7 +495,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface $objectOrArray->$property = $value; } elseif ($reflClass->hasProperty($property)) { if (!$reflClass->getProperty($property)->isPublic()) { - throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()"?', $property, $reflClass->getName(), $setter)); + throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()"?', $property, $reflClass->name, $setter)); } $objectOrArray->$property = $value; @@ -503,7 +503,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface // needed to support \stdClass instances $objectOrArray->$property = $value; } else { - throw new InvalidPropertyException(sprintf('Neither element "%s" nor method "%s()" exists in class "%s"', $property, $setter, $reflClass->getName())); + throw new InvalidPropertyException(sprintf('Neither element "%s" nor method "%s()" exists in class "%s"', $property, $setter, $reflClass->name)); } } else { throw new InvalidPropertyException(sprintf('Cannot write property "%s" in an array. Maybe you should write the property path as "[%s]" instead?', $property, $property)); @@ -542,7 +542,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface throw new InvalidPropertyException(sprintf( 'The public method "%s" with exactly one required parameter was not found on class %s', $addMethod, - $reflClass->getName() + $reflClass->name )); } @@ -550,7 +550,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface throw new InvalidPropertyException(sprintf( 'The public method "%s" with exactly one required parameter was not found on class %s', $removeMethod, - $reflClass->getName() + $reflClass->name )); } @@ -579,7 +579,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface 'Found the public method "%s", but did not find a public "%s" on class %s', $addMethodFound ? $addMethod : $removeMethod, $addMethodFound ? $removeMethod : $addMethod, - $reflClass->getName() + $reflClass->name )); } } diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php index d535c55e4b..cd3caf6158 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -114,8 +114,8 @@ class ControllerResolver implements ControllerResolverInterface $attributes = $request->attributes->all(); $arguments = array(); foreach ($parameters as $param) { - if (array_key_exists($param->getName(), $attributes)) { - $arguments[] = $attributes[$param->getName()]; + if (array_key_exists($param->name, $attributes)) { + $arguments[] = $attributes[$param->name]; } elseif ($param->getClass() && $param->getClass()->isInstance($request)) { $arguments[] = $request; } elseif ($param->isDefaultValueAvailable()) { @@ -129,7 +129,7 @@ class ControllerResolver implements ControllerResolverInterface $repr = $controller; } - throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->getName())); + throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->name)); } } diff --git a/src/Symfony/Component/OptionsResolver/Options.php b/src/Symfony/Component/OptionsResolver/Options.php index 21bca78676..51540b0b2f 100644 --- a/src/Symfony/Component/OptionsResolver/Options.php +++ b/src/Symfony/Component/OptionsResolver/Options.php @@ -431,6 +431,6 @@ class Options implements \ArrayAccess, \Iterator, \Countable return false; } - return __CLASS__ === $params[0]->getClass()->getName(); + return __CLASS__ === $params[0]->getClass()->name; } } diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index 16c84a49e4..317b7f9b52 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -200,7 +200,7 @@ abstract class AnnotationClassLoader implements LoaderInterface */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { - $name = strtolower(str_replace('\\', '_', $class->getName()).'_'.$method->getName()); + $name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name); if ($this->defaultRouteIndex > 0) { $name .= '_'.$this->defaultRouteIndex; } diff --git a/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php b/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php index 0f9b4c1279..25ded7a5f9 100644 --- a/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php +++ b/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php @@ -47,6 +47,6 @@ foreach ($finder as $file) { } $platform = $reflection->newInstance(); - $targetFile = sprintf(__DIR__.'/../schema/%s.sql', $platform->getName()); + $targetFile = sprintf(__DIR__.'/../schema/%s.sql', $platform->name); file_put_contents($targetFile, implode("\n\n", $schema->toSql($platform))); } diff --git a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php index 921a861937..4dfe1770e5 100644 --- a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php @@ -74,7 +74,7 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal $attributes = array(); foreach ($reflectionMethods as $method) { if ($this->isGetMethod($method)) { - $attributeName = lcfirst(substr($method->getName(), 3)); + $attributeName = lcfirst(substr($method->name, 3)); if (in_array($attributeName, $this->ignoredAttributes)) { continue; @@ -108,7 +108,7 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal $params = array(); foreach ($constructorParameters as $constructorParameter) { - $paramName = lcfirst($constructorParameter->getName()); + $paramName = lcfirst($constructorParameter->name); if (isset($data[$paramName])) { $params[] = $data[$paramName]; @@ -118,7 +118,7 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal throw new RuntimeException( 'Cannot create an instance of '.$class. ' from serialized data because its constructor requires '. - 'parameter "'.$constructorParameter->getName(). + 'parameter "'.$constructorParameter->name. '" to be present.'); } } @@ -182,8 +182,8 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal private function isGetMethod(\ReflectionMethod $method) { return ( - 0 === strpos($method->getName(), 'get') && - 3 < strlen($method->getName()) && + 0 === strpos($method->name, 'get') && + 3 < strlen($method->name) && 0 === $method->getNumberOfRequiredParameters() ); } diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php index 22e4a313f6..bbf831d6ef 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php @@ -53,15 +53,15 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface // Include constraints from the parent class if ($parent = $metadata->getReflectionClass()->getParentClass()) { - $metadata->mergeConstraints($this->getClassMetadata($parent->getName())); + $metadata->mergeConstraints($this->getClassMetadata($parent->name)); } // Include constraints from all implemented interfaces foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) { - if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->getName()) { + if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name) { continue; } - $metadata->mergeConstraints($this->getClassMetadata($interface->getName())); + $metadata->mergeConstraints($this->getClassMetadata($interface->name)); } $this->loader->loadClassMetadata($metadata); diff --git a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php index 30642a0474..0e7e89b548 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php @@ -33,7 +33,7 @@ class AnnotationLoader implements LoaderInterface public function loadClassMetadata(ClassMetadata $metadata) { $reflClass = $metadata->getReflectionClass(); - $className = $reflClass->getName(); + $className = $reflClass->name; $loaded = false; foreach ($this->reader->getClassAnnotations($reflClass) as $constraint) { @@ -49,10 +49,10 @@ class AnnotationLoader implements LoaderInterface } foreach ($reflClass->getProperties() as $property) { - if ($property->getDeclaringClass()->getName() == $className) { + if ($property->getDeclaringClass()->name == $className) { foreach ($this->reader->getPropertyAnnotations($property) as $constraint) { if ($constraint instanceof Constraint) { - $metadata->addPropertyConstraint($property->getName(), $constraint); + $metadata->addPropertyConstraint($property->name, $constraint); } $loaded = true; @@ -61,13 +61,13 @@ class AnnotationLoader implements LoaderInterface } foreach ($reflClass->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() == $className) { + if ($method->getDeclaringClass()->name == $className) { foreach ($this->reader->getMethodAnnotations($method) as $constraint) { if ($constraint instanceof Constraint) { - if (preg_match('/^(get|is)(.+)$/i', $method->getName(), $matches)) { + if (preg_match('/^(get|is)(.+)$/i', $method->name, $matches)) { $metadata->addGetterConstraint(lcfirst($matches[2]), $constraint); } else { - throw new MappingException(sprintf('The constraint on "%s::%s" cannot be added. Constraints can only be added on methods beginning with "get" or "is".', $className, $method->getName())); + throw new MappingException(sprintf('The constraint on "%s::%s" cannot be added. Constraints can only be added on methods beginning with "get" or "is".', $className, $method->name)); } } diff --git a/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php index a74ffbb429..e8622d2f09 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php @@ -34,10 +34,10 @@ class StaticMethodLoader implements LoaderInterface $reflMethod = $reflClass->getMethod($this->methodName); if (!$reflMethod->isStatic()) { - throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->getName(), $this->methodName)); + throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->name, $this->methodName)); } - if ($reflMethod->getDeclaringClass()->getName() != $reflClass->getName()) { + if ($reflMethod->getDeclaringClass()->name != $reflClass->name) { return false; }