Bläddra i källkod

Fix CS errors

Dinoweb 14 år sedan
förälder
incheckning
f702ed4efa

+ 0 - 1
lib/Gedmo/Sluggable/Mapping/Driver/Annotation.php

@@ -108,7 +108,6 @@ class Annotation implements AnnotationDriverInterface
                 if (!$this->isValidField($meta, $field)) {
                 if (!$this->isValidField($meta, $field)) {
                     throw new InvalidMappingException("Cannot use field - [{$field}] for slug storage, type is not valid and must be 'string' in class - {$meta->name}");
                     throw new InvalidMappingException("Cannot use field - [{$field}] for slug storage, type is not valid and must be 'string' in class - {$meta->name}");
                 }
                 }
-                
                 $config['slugFields'][$field]['slug'] = $field;
                 $config['slugFields'][$field]['slug'] = $field;
                 $config['slugFields'][$field]['style'] = $slug->style;
                 $config['slugFields'][$field]['style'] = $slug->style;
                 $config['slugFields'][$field]['updatable'] = $slug->updatable;
                 $config['slugFields'][$field]['updatable'] = $slug->updatable;

+ 3 - 3
lib/Gedmo/Sluggable/Mapping/Driver/Xml.php

@@ -65,15 +65,15 @@ class Xml extends BaseXml
                     if (!$this->isValidField($meta, $field)) {
                     if (!$this->isValidField($meta, $field)) {
                         throw new InvalidMappingException("Cannot slug field - [{$field}] type is not valid and must be 'string' in class - {$meta->name}");
                         throw new InvalidMappingException("Cannot slug field - [{$field}] type is not valid and must be 'string' in class - {$meta->name}");
                     }
                     }
-                    $options = array('position'=>false, 'field'=>$field, 'slugField'=>'slug');
+                    $options = array('position' => false, 'field' => $field, 'slugField' => 'slug');
                     if ($this->_isAttributeSet($mapping->sluggable, 'position')) {
                     if ($this->_isAttributeSet($mapping->sluggable, 'position')) {
                         $options['position'] =  (int)$this->_getAttribute($mapping->sluggable, 'position');
                         $options['position'] =  (int)$this->_getAttribute($mapping->sluggable, 'position');
                     }
                     }
-                    
+
                     if ($this->_isAttributeSet($mapping->sluggable, 'slugField')) {
                     if ($this->_isAttributeSet($mapping->sluggable, 'slugField')) {
                         $options['slugField'] =  $this->_getAttribute($mapping->sluggable, 'slugField');
                         $options['slugField'] =  $this->_getAttribute($mapping->sluggable, 'slugField');
                     }
                     }
-                    
+
                     $config['fields'][$options['slugField']][] = $options;
                     $config['fields'][$options['slugField']][] = $options;
                 } elseif (isset($mapping->slug)) {
                 } elseif (isset($mapping->slug)) {
                     /**
                     /**

+ 2 - 4
lib/Gedmo/Sluggable/SluggableListener.php

@@ -182,19 +182,18 @@ class SluggableListener extends MappedEventSubscriber
             }
             }
             // if slug is changed, do further processing
             // if slug is changed, do further processing
             if ($needToChangeSlug) {            
             if ($needToChangeSlug) {            
-    
                 if (!strlen(trim($slug))) {
                 if (!strlen(trim($slug))) {
                     throw new \Gedmo\Exception\UnexpectedValueException("Unable to find any non empty sluggable fields for slug [{$slugField}] , make sure they have something at least.");
                     throw new \Gedmo\Exception\UnexpectedValueException("Unable to find any non empty sluggable fields for slug [{$slugField}] , make sure they have something at least.");
                 }
                 }
                 
                 
                 $slugFieldConfig = $config['slugFields'][$slugField];
                 $slugFieldConfig = $config['slugFields'][$slugField];
-        
+
                 // build the slug
                 // build the slug
                 $slug = call_user_func_array(
                 $slug = call_user_func_array(
                     $this->transliterator,
                     $this->transliterator,
                     array($slug, $slugFieldConfig['separator'], $object)
                     array($slug, $slugFieldConfig['separator'], $object)
                 );
                 );
-        
+
                 // stylize the slug
                 // stylize the slug
                 switch ($slugFieldConfig['style']) {
                 switch ($slugFieldConfig['style']) {
                     case 'camel':
                     case 'camel':
@@ -247,7 +246,6 @@ class SluggableListener extends MappedEventSubscriber
         {
         {
             $config = $this->getConfiguration($om, $meta->name);
             $config = $this->getConfiguration($om, $meta->name);
         }
         }
-        
 
 
         // search for similar slug
         // search for similar slug
         $result = $ea->getSimilarSlugs($object, $meta, $config, $preferedSlug);
         $result = $ea->getSimilarSlugs($object, $meta, $config, $preferedSlug);

+ 0 - 2
tests/Gedmo/Sluggable/TranslatableManySlugTest.php

@@ -77,8 +77,6 @@ class TranslatableManySlugTest extends BaseTestCaseORM
         $this->assertEquals('title-in-de-code-in-de', $translations['de_de']['slug']);
         $this->assertEquals('title-in-de-code-in-de', $translations['de_de']['slug']);
     }
     }
 
 
-
-
     protected function getUsedEntityFixtures()
     protected function getUsedEntityFixtures()
     {
     {
         return array(
         return array(