Author: caefer
Date: 2010-03-23 17:16:13 +0100 (Tue, 23 Mar 2010)
New Revision: 28722

Modified:
   
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
   
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/transforms/sfImageTransformManagerTest.php
Log:
removed never before used code and according tests

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
  2010-03-23 16:11:52 UTC (rev 28721)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
  2010-03-23 16:16:13 UTC (rev 28722)
@@ -26,11 +26,6 @@
   private $options = array();
 
   /**
-   * @var string $adapter Holds the adapter for the current transformation
-   */
-  private $adapter = 'GD';
-
-  /**
    *
    */
   public function __construct($formats = array())
@@ -91,54 +86,12 @@
    */
   private function transform(sfImage $sourceImage, $transformation)
   {
-    $this->setAdapter($sourceImage, $transformation['adapter']);
-
     $parameters = $this->prepareParameters($sourceImage, 
$transformation['transformation'], $transformation['param']);
 
     call_user_func_array(array($sourceImage, 
$transformation['transformation']), $parameters);
   }
 
   /**
-   * Sets new adapter on the image if necessary
-   *
-   * @param  sfImage $sourceImage The image to transform
-   * @param  array   $adapter     The adapter of the current transformation
-   * @return void
-   */
-  private function setAdapter(sfImage $sourceImage, $adapter)
-  {
-    if($adapter != $this->adapter)
-    {
-      $newAdapter = $this->createAdapter($adapter);
-      $this->adapter = $adapter;
-      $sourceImage->setAdapter($newAdapter);
-    }
-  }
-
-  /**
-   * Returns a adapter class of the specified type
-   * @access protected
-   * @param  string                          $name Name of the transformation 
to instantiate
-   * @return sfImageTransformAdapterAbstract
-   */
-  private function createAdapter($name)
-  {
-    $adapter_class = 'sfImageTransform' . $name . 'Adapter';
-
-    if (class_exists($adapter_class))
-    {
-      $adapter = new $adapter_class();
-    }
-    // Cannot find the adapter class so throw an exception
-    else
-    {
-      throw new sfImageTransformException(sprintf('Unsupported adapter: %s', 
$adapter_class));
-    }
-
-    return $adapter;
-  }
-
-  /**
    * Extends current transformation parameters by a callback
    *
    * This is needed for transformations that need certain objects in their 
parameters,

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/transforms/sfImageTransformManagerTest.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/transforms/sfImageTransformManagerTest.php
  2010-03-23 16:11:52 UTC (rev 28721)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/transforms/sfImageTransformManagerTest.php
  2010-03-23 16:16:13 UTC (rev 28722)
@@ -32,13 +32,6 @@
         'transformations' => array(
           0 => array(
             'adapter' => 'GD',
-            'transformation' => 'alphaMask',
-            'param' => array(
-              'mask' => 'masks/pattern.gif',
-            )
-          ),
-          1 => array(
-            'adapter' => 'GD',
             'transformation' => 'overlay',
             'param' => array(
               'overlay' => 'overlays/logo.png',
@@ -55,9 +48,9 @@
         'transformations' => array(
           0 => array(
             'adapter' => 'GD',
-            'transformation' => 'alphaMask',
+            'transformation' => 'overlay',
             'param' => array(
-              'mask' => 'masks/doesnotexist.gif',
+              'overlay' => 'overlays/doesnotexist.png',
             )
           ),
         ),

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to