Skip to content

Commit

Permalink
PSR2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozhidar Hristov committed Jul 6, 2016
1 parent a812f47 commit 81278f1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/TranslationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TranslationService
*
* @var Container
*/
private $Container;
private $container;

/**
*
Expand Down Expand Up @@ -183,14 +183,14 @@ protected function getTranslationFields($translationClass, array $exclude = arra
return $fields;
}

protected function getFieldByAnnotation($Class, $Annotation)
protected function getFieldByAnnotation($class, $Annotation)
{
if (is_object($Class)) {
$Class = get_class($Class);
if (is_object($class)) {
$class = get_class($class);
}

$Class = ClassUtils::getRealClass($Class);
$ReflectionClass = new \ReflectionClass($Class);
$class = ClassUtils::getRealClass($class);
$ReflectionClass = new \ReflectionClass($class);

foreach ($ReflectionClass->getProperties() as $ReflectionProperty) {
$Found = $this->annotationReader->getPropertyAnnotation($ReflectionProperty, $Annotation);
Expand All @@ -199,27 +199,27 @@ protected function getFieldByAnnotation($Class, $Annotation)
}
}

throw Exception\InvalidArgumentException::missingRequiredAnnotation($Class, $Annotation);
throw Exception\InvalidArgumentException::missingRequiredAnnotation($class, $Annotation);
}

public function getLanguageField($TranslationClass)
public function getLanguageField($translationClass)
{
return $this->getFieldByAnnotation($TranslationClass, 'ObjectBG\TranslationBundle\Annotation\Language');
return $this->getFieldByAnnotation($translationClass, 'ObjectBG\TranslationBundle\Annotation\Language');
}

public function getTranslatableField($TranslationClass)
public function getTranslatableField($translationClass)
{
return $this->getFieldByAnnotation($TranslationClass, 'ObjectBG\TranslationBundle\Annotation\Translatable');
return $this->getFieldByAnnotation($translationClass, 'ObjectBG\TranslationBundle\Annotation\Translatable');
}

public function getTranslationsField($TranslatableClass)
public function getTranslationsField($translatableClass)
{
return $this->getFieldByAnnotation($TranslatableClass, 'ObjectBG\TranslationBundle\Annotation\Translations');
return $this->getFieldByAnnotation($translatableClass, 'ObjectBG\TranslationBundle\Annotation\Translations');
}

public function getCurrentTranslationField($TranslatableClass)
public function getCurrentTranslationField($translatableClass)
{
return $this->getFieldByAnnotation($TranslatableClass, 'ObjectBG\TranslationBundle\Annotation\CurrentTranslation');
return $this->getFieldByAnnotation($translatableClass, 'ObjectBG\TranslationBundle\Annotation\CurrentTranslation');
}

public function getLanguageByLocale($locale)
Expand Down

0 comments on commit 81278f1

Please sign in to comment.