Procházet zdrojové kódy

Fixed coding standard problems

Dinoweb před 14 roky
rodič
revize
a6dd4fdaac

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

@@ -19,6 +19,5 @@ final class Sluggable extends Annotation
 {
     public $position = 0;
     public $slugField = 'slug';
-
 }
 

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

@@ -109,15 +109,11 @@ class Annotation implements AnnotationDriverInterface
                     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]['style'] = $slug->style;
                 $config['slugFields'][$field]['updatable'] = $slug->updatable;
                 $config['slugFields'][$field]['unique'] = $slug->unique;
                 $config['slugFields'][$field]['separator'] = $slug->separator;
-
-                
-                
             }
         }
     }

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

@@ -65,7 +65,7 @@ class Xml extends BaseXml
                     if (!$this->isValidField($meta, $field)) {
                         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')) {
                         $options['position'] =  (int)$this->_getAttribute($mapping->sluggable, 'position');
                     }
@@ -86,8 +86,6 @@ class Xml extends BaseXml
                     if (isset($config['slug'])) {
                         throw new InvalidMappingException("There cannot be two slug fields: [{$slug}] and [{$config['slug']}], in class - {$meta->name}.");
                     }
-                    
-                    
                     $config['slugFields'][$field]['slug'] = $field;
                     $config['slugFields'][$field]['style'] = $this->_isAttributeSet($slug, 'style') ?
                         $this->_getAttribute($slug, 'style') : 'default';

+ 0 - 3
lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php

@@ -63,10 +63,7 @@ class Yaml extends File implements Driver
                             throw new InvalidMappingException("Cannot slug field - [{$field}] type is not valid and must be 'string' in class - {$meta->name}");
                         }
                         $sluggable = $fieldMapping['gedmo'][array_search('sluggable', $fieldMapping['gedmo'])];
-                            
                         $slugField = isset($sluggable['slugField'])? $sluggable['slugField']:'slug';
-                        
-                        
                         $config['fields'][$slugField][] = array('field' => $field, 'position' => $sluggable['position'], 'slugField' => $slugField);
                     } elseif (isset($fieldMapping['gedmo']['slug']) || in_array('slug', $fieldMapping['gedmo'])) {
                         $slug = $fieldMapping['gedmo']['slug'];

+ 0 - 9
lib/Gedmo/Sluggable/SluggableListener.php

@@ -116,13 +116,10 @@ class SluggableListener extends MappedEventSubscriber
             if ($config = $this->getConfiguration($om, $meta->name)) {
                 // generate first to exclude this object from similar persisted slugs result
                 $this->generateSlug($ea, $object);
-                
                 foreach ($config['fields'] as $slugField=>$fieldsForSlugField) {
                     $slug = $meta->getReflectionProperty($slugField)->getValue($object);
                     $this->persistedSlugs[$config['useObjectClass']][] = $slug;
                 }
-                
-                
             }
         }
         // we use onFlush and not preUpdate event to let other
@@ -131,13 +128,10 @@ class SluggableListener extends MappedEventSubscriber
             $meta = $om->getClassMetadata(get_class($object));
             if ($config = $this->getConfiguration($om, $meta->name)) {
                 foreach ($config['slugFields'] as $slugField) {
-                
                     if ($slugField['updatable']) {
                         $this->generateSlug($ea, $object);
                     }
-                
                 }
-                
             }
         }
     }
@@ -166,7 +160,6 @@ class SluggableListener extends MappedEventSubscriber
         $uow = $om->getUnitOfWork();
         $changeSet = $ea->getObjectChangeSet($uow, $object);
         $config = $this->getConfiguration($om, $meta->name);
-        
         foreach ($config['fields'] as $slugField=>$fieldsForSlugField) {
 
             // sort sluggable fields by position
@@ -253,9 +246,7 @@ class SluggableListener extends MappedEventSubscriber
         $meta = $om->getClassMetadata(get_class($object));
         if (count ($config) == 0)
         {
-        
             $config = $this->getConfiguration($om, $meta->name);
-        
         }