Completed
Push — feature/code-analysis ( 1158f1...5e4834 )
by Jonathan
03:51
created
src/Webtrees/Family.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@
 block discarded – undo
39 39
 	}
40 40
 	
41 41
 	/**
42
-	* Check if this family's marriages are sourced
43
-	*
44
-	* @return int Level of sources
45
-	* */
42
+	 * Check if this family's marriages are sourced
43
+	 *
44
+	 * @return int Level of sources
45
+	 * */
46 46
 	function isMarriageSourced(){
47 47
 		if($this->_ismarriagesourced != null) return $this->_ismarriagesourced;
48 48
 		$this->_ismarriagesourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC');
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Controller/MvcControllerInterface.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
  */
16 16
 interface MvcControllerInterface {
17 17
     
18
-    /**
19
-     * Return the module attached to this controller.
20
-     * 
21
-     * @return \Fisharebest\Webtrees\Module\AbstractModule
22
-     */
23
-    function getModule();
18
+	/**
19
+	 * Return the module attached to this controller.
20
+	 * 
21
+	 * @return \Fisharebest\Webtrees\Module\AbstractModule
22
+	 */
23
+	function getModule();
24 24
     
25 25
 }
26 26
  
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Controller/MvcController.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,28 +17,28 @@
 block discarded – undo
17 17
  */
18 18
 class MvcController implements MvcControllerInterface 
19 19
 {
20
-    /**
21
-     * Reference module
22
-     * @var Fisharebest\Webtrees\Module\AbstractModule $module
23
-     */
24
-    protected $module;
20
+	/**
21
+	 * Reference module
22
+	 * @var Fisharebest\Webtrees\Module\AbstractModule $module
23
+	 */
24
+	protected $module;
25 25
     
26
-    /**
27
-     * Constructor for MvcController
28
-     * 
29
-     * @param AbstractModule $module
30
-     */
31
-    public function __construct(AbstractModule $module) {
32
-        $this->module = $module;
33
-    }
26
+	/**
27
+	 * Constructor for MvcController
28
+	 * 
29
+	 * @param AbstractModule $module
30
+	 */
31
+	public function __construct(AbstractModule $module) {
32
+		$this->module = $module;
33
+	}
34 34
     
35
-    /**
36
-     * {@inheritDoc}
37
-     * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule()
38
-     */
39
-    public function getModule() {
40
-        return $this->module;
41
-    }
35
+	/**
36
+	 * {@inheritDoc}
37
+	 * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule()
38
+	 */
39
+	public function getModule() {
40
+		return $this->module;
41
+	}
42 42
         
43 43
 }
44 44
  
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Dispatcher.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@  discard block
 block discarded – undo
19 19
  */
20 20
 class Dispatcher implements DispatcherInterface {
21 21
     
22
-    /**
23
-     * @var Dispatcher $instance Singleton pattern instance
24
-     */
25
-    private static $instance = null;
22
+	/**
23
+	 * @var Dispatcher $instance Singleton pattern instance
24
+	 */
25
+	private static $instance = null;
26 26
     
27
-    /**
28
-     * Returns the *Dispatcher* instance of this class.
29
-     *
30
-     * @return Dispatcher The *Singleton* instance.
31
-     */
32
-    public static function getInstance()
33
-    {
34
-        if (null === static::$instance) {
35
-            static::$instance = new static();
36
-        }
27
+	/**
28
+	 * Returns the *Dispatcher* instance of this class.
29
+	 *
30
+	 * @return Dispatcher The *Singleton* instance.
31
+	 */
32
+	public static function getInstance()
33
+	{
34
+		if (null === static::$instance) {
35
+			static::$instance = new static();
36
+		}
37 37
     
38
-        return static::$instance;
39
-    }    
38
+		return static::$instance;
39
+	}    
40 40
     
41 41
 	/**
42
-     * Protected constructor.
43
-     */
44
-    protected function __construct() {}
42
+	 * Protected constructor.
43
+	 */
44
+	protected function __construct() {}
45 45
     
46
-    /**
47
-     * {@inheritdoc }
48
-     * @see \MyArtJaub\Webtrees\Mvc\DispatcherInterface::handle()
49
-     */
50
-    public function handle(fw\Module\AbstractModule $module, $request) {
46
+	/**
47
+	 * {@inheritdoc }
48
+	 * @see \MyArtJaub\Webtrees\Mvc\DispatcherInterface::handle()
49
+	 */
50
+	public function handle(fw\Module\AbstractModule $module, $request) {
51 51
 		
52 52
 		$fq_modclass_name = get_class($module);
53 53
 		$ctrl_namespace = substr($fq_modclass_name, 0, - strlen('Module')) . '\\';
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		
68 68
 		$ctrl_class = $ctrl_namespace . $ctrl_name . 'Controller';
69 69
 		if(class_exists($ctrl_class) 
70
-		    && is_subclass_of($ctrl_class, '\\MyArtJaub\\Webtrees\\Mvc\\Controller\\MvcController')
70
+			&& is_subclass_of($ctrl_class, '\\MyArtJaub\\Webtrees\\Mvc\\Controller\\MvcController')
71 71
 			&& $ctrl = new $ctrl_class($module) ) {
72 72
 			if(method_exists($ctrl, $method)) {
73 73
 				call_user_func_array(array($ctrl, $method), array());
@@ -79,27 +79,27 @@  discard block
 block discarded – undo
79 79
 		 else {
80 80
 			 throw new \Exception('The page requested does not exist');
81 81
 		 }
82
-    }
82
+	}
83 83
 
84
-    /**
85
-     * Private clone method to prevent cloning of the instance of the
86
-     * *Dispatcher* instance.
87
-     *
88
-     * @return void
89
-     */
90
-    private function __clone()
91
-    {
92
-    }
84
+	/**
85
+	 * Private clone method to prevent cloning of the instance of the
86
+	 * *Dispatcher* instance.
87
+	 *
88
+	 * @return void
89
+	 */
90
+	private function __clone()
91
+	{
92
+	}
93 93
     
94
-    /**
95
-     * Private unserialize method to prevent unserializing of the *Dispatcher*
96
-     * instance.
97
-     *
98
-     * @return void
99
-     */
100
-    private function __wakeup()
101
-    {
102
-    }
94
+	/**
95
+	 * Private unserialize method to prevent unserializing of the *Dispatcher*
96
+	 * instance.
97
+	 *
98
+	 * @return void
99
+	 */
100
+	private function __wakeup()
101
+	{
102
+	}
103 103
     
104 104
 }
105 105
 
Please login to merge, or discard this patch.
src/Webtrees/Mvc/DispatcherInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 * @param \Fisharebest\Webtrees\Module\AbstractModule $module
22 22
 	 * @param string $request
23 23
 	 */
24
-    public function handle(\Fisharebest\Webtrees\Module\AbstractModule $module, $request);
24
+	public function handle(\Fisharebest\Webtrees\Module\AbstractModule $module, $request);
25 25
     
26 26
 }
27 27
  
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/ViewFactory.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -17,87 +17,87 @@
 block discarded – undo
17 17
  */
18 18
 class ViewFactory {
19 19
     
20
-    /**
21
-     * @var ViewFactory $instance Singleton pattern instance
22
-     */
23
-    private static $instance = null;
20
+	/**
21
+	 * @var ViewFactory $instance Singleton pattern instance
22
+	 */
23
+	private static $instance = null;
24 24
     
25
-    /**
26
-     * Returns the *ViewFactory* instance of this class.
27
-     *
28
-     * @return ViewFactory The *Singleton* instance.
29
-     */
30
-    public static function getInstance()
31
-    {
32
-        if (null === static::$instance) {
33
-            static::$instance = new static();
34
-        }
25
+	/**
26
+	 * Returns the *ViewFactory* instance of this class.
27
+	 *
28
+	 * @return ViewFactory The *Singleton* instance.
29
+	 */
30
+	public static function getInstance()
31
+	{
32
+		if (null === static::$instance) {
33
+			static::$instance = new static();
34
+		}
35 35
     
36
-        return static::$instance;
37
-    }
36
+		return static::$instance;
37
+	}
38 38
     
39
-    /**
40
-     * Protected constructor
41
-     */
42
-    protected function __construct() {}
39
+	/**
40
+	 * Protected constructor
41
+	 */
42
+	protected function __construct() {}
43 43
               
44
-    /**
45
-     * Return the view specified by the controller and view name, using data from the ViewBag
46
-     * 
47
-     * @param string $view_name
48
-     * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
49
-     * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
50
-     * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
51
-     * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
52
-     * @throws \Exception
53
-     */
54
-    public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
55
-    {
56
-        if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
57
-        if(!$ctrl) throw new \Exception('Base Controller not defined');
58
-        if(!$view_name) throw new \Exception('View not defined');
44
+	/**
45
+	 * Return the view specified by the controller and view name, using data from the ViewBag
46
+	 * 
47
+	 * @param string $view_name
48
+	 * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
49
+	 * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
50
+	 * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
51
+	 * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
52
+	 * @throws \Exception
53
+	 */
54
+	public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
55
+	{
56
+		if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
57
+		if(!$ctrl) throw new \Exception('Base Controller not defined');
58
+		if(!$view_name) throw new \Exception('View not defined');
59 59
         
60
-        $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl);
61
-        $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View';       
62
-        if(!class_exists($view_class)) throw new \Exception('View does not exist');
60
+		$mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl);
61
+		$view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View';       
62
+		if(!class_exists($view_class)) throw new \Exception('View does not exist');
63 63
         
64
-        return new $view_class($ctrl, $data);
65
-    }
64
+		return new $view_class($ctrl, $data);
65
+	}
66 66
     
67
-    /**
68
-     * Static invocation of the makeView method
69
-     * 
70
-     * @param string $view_name
71
-     * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
72
-     * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
73
-     * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
74
-     * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
75
-     * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle()
76
-     */
77
-    public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
78
-    {
79
-        return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data);
80
-    }
67
+	/**
68
+	 * Static invocation of the makeView method
69
+	 * 
70
+	 * @param string $view_name
71
+	 * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
72
+	 * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
73
+	 * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
74
+	 * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
75
+	 * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle()
76
+	 */
77
+	public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
78
+	{
79
+		return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data);
80
+	}
81 81
     
82
-    /**
83
-     * Private clone method to prevent cloning of the instance of the
84
-     * *Dispatcher* instance.
85
-     *
86
-     * @return void
87
-     */
88
-    private function __clone()
89
-    {
90
-    }
82
+	/**
83
+	 * Private clone method to prevent cloning of the instance of the
84
+	 * *Dispatcher* instance.
85
+	 *
86
+	 * @return void
87
+	 */
88
+	private function __clone()
89
+	{
90
+	}
91 91
     
92
-    /**
93
-     * Private unserialize method to prevent unserializing of the *Dispatcher*
94
-     * instance.
95
-     *
96
-     * @return void
97
-     */
98
-    private function __wakeup()
99
-    {
100
-    }
92
+	/**
93
+	 * Private unserialize method to prevent unserializing of the *Dispatcher*
94
+	 * instance.
95
+	 *
96
+	 * @return void
97
+	 */
98
+	private function __wakeup()
99
+	{
100
+	}
101 101
     
102 102
 }
103 103
  
104 104
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/AbstractView.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -15,62 +15,62 @@
 block discarded – undo
15 15
  */
16 16
 abstract class AbstractView {
17 17
     
18
-    /**
19
-     * Reference controller
20
-     * @var \Fisharebest\Webtrees\Controller\BaseController $ctrl
21
-     */
22
-    protected $ctrl;
18
+	/**
19
+	 * Reference controller
20
+	 * @var \Fisharebest\Webtrees\Controller\BaseController $ctrl
21
+	 */
22
+	protected $ctrl;
23 23
     
24
-    /**
25
-     * Structure containing the data of the view
26
-     * @var ViewBag $data
27
-     */
28
-    protected $data;
24
+	/**
25
+	 * Structure containing the data of the view
26
+	 * @var ViewBag $data
27
+	 */
28
+	protected $data;
29 29
     
30
-    /**
31
-     * Constructor 
32
-     * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl Controller
33
-     * @param ViewBag $data ViewBag holding view data
34
-     */
35
-    public function __construct(\Fisharebest\Webtrees\Controller\BaseController $ctrl, ViewBag $data) {
36
-        $this->ctrl = $ctrl;
37
-        $this->data = $data;
38
-    }
30
+	/**
31
+	 * Constructor 
32
+	 * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl Controller
33
+	 * @param ViewBag $data ViewBag holding view data
34
+	 */
35
+	public function __construct(\Fisharebest\Webtrees\Controller\BaseController $ctrl, ViewBag $data) {
36
+		$this->ctrl = $ctrl;
37
+		$this->data = $data;
38
+	}
39 39
     
40
-    /**
41
-     * Render the view to the page, including header.
42
-     * 
43
-     * @throws \Exception
44
-     */
45
-    public function render() {
40
+	/**
41
+	 * Render the view to the page, including header.
42
+	 * 
43
+	 * @throws \Exception
44
+	 */
45
+	public function render() {
46 46
 		global $controller;
47 47
 		
48
-        if(!$this->ctrl) throw new \Exception('Controller not initialised');
48
+		if(!$this->ctrl) throw new \Exception('Controller not initialised');
49 49
         
50 50
 		$controller = $this->ctrl;
51
-        $this->ctrl->pageHeader();
51
+		$this->ctrl->pageHeader();
52 52
         
53
-        echo $this->renderContent();
54
-    }
53
+		echo $this->renderContent();
54
+	}
55 55
     
56
-    /**
57
-     * Render the view to the page, without any header
58
-     */
59
-    public function renderPartial() {
60
-        echo $this->getHtmlPartial();
61
-    }
56
+	/**
57
+	 * Render the view to the page, without any header
58
+	 */
59
+	public function renderPartial() {
60
+		echo $this->getHtmlPartial();
61
+	}
62 62
     
63
-    /**
64
-     * Return the HTML code generated by the view, without any header
65
-     */
66
-    public function getHtmlPartial() {
67
-        return $this->renderContent();
68
-    }
63
+	/**
64
+	 * Return the HTML code generated by the view, without any header
65
+	 */
66
+	public function getHtmlPartial() {
67
+		return $this->renderContent();
68
+	}
69 69
     
70
-    /**
71
-     * Abstract method containing the details of the view.
72
-     */
73
-    abstract protected function renderContent();
70
+	/**
71
+	 * Abstract method containing the details of the view.
72
+	 */
73
+	abstract protected function renderContent();
74 74
     
75 75
 }
76 76
  
77 77
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Functions/Functions.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public static function encodeFileSystemToUtf8($string){
186 186
 		if (strtoupper(substr(php_uname('s'), 0, 7)) === 'WINDOWS') {
187
-		    return iconv('cp1252', 'utf-8//IGNORE',$string);
187
+			return iconv('cp1252', 'utf-8//IGNORE',$string);
188 188
 		}
189 189
 		return $string;
190 190
 	}
@@ -249,20 +249,20 @@  discard block
 block discarded – undo
249 249
 	 * @return boolean|string Is supported?
250 250
 	 */
251 251
 	public static function isImageTypeSupported($reqtype) {
252
-	    $supportByGD = array('jpg'=>'jpeg', 'jpeg'=>'jpeg', 'gif'=>'gif', 'png'=>'png');
253
-	    $reqtype = strtolower($reqtype);
252
+		$supportByGD = array('jpg'=>'jpeg', 'jpeg'=>'jpeg', 'gif'=>'gif', 'png'=>'png');
253
+		$reqtype = strtolower($reqtype);
254 254
 	
255
-	    if (empty($supportByGD[$reqtype])) {
256
-	        return false;
257
-	    }
255
+		if (empty($supportByGD[$reqtype])) {
256
+			return false;
257
+		}
258 258
 	
259
-	    $type = $supportByGD[$reqtype];
259
+		$type = $supportByGD[$reqtype];
260 260
 	
261
-	    if (function_exists('imagecreatefrom'.$type) && function_exists('image'.$type)) {
262
-	        return $type;
263
-	    }
261
+		if (function_exists('imagecreatefrom'.$type) && function_exists('image'.$type)) {
262
+			return $type;
263
+		}
264 264
 	
265
-	    return false;
265
+		return false;
266 266
 	}
267 267
 		
268 268
 }
Please login to merge, or discard this patch.
src/Webtrees/ImageBuilder.php 1 patch
Indentation   +290 added lines, -290 removed lines patch added patch discarded remove patch
@@ -21,54 +21,54 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class ImageBuilder {
23 23
     
24
-    /**
25
-     * Reference media
26
-     * @var Media $media
27
-     */
28
-    protected $media;
24
+	/**
25
+	 * Reference media
26
+	 * @var Media $media
27
+	 */
28
+	protected $media;
29 29
     
30
-    /**
31
-     * Use TTF font
32
-     * @var bool $use_ttf
33
-     */
34
-    protected $use_ttf;
30
+	/**
31
+	 * Use TTF font
32
+	 * @var bool $use_ttf
33
+	 */
34
+	protected $use_ttf;
35 35
     
36
-    /**
37
-     * Expiration offset. Default is one day.
38
-     * @var int $expire_offset
39
-     */
40
-    protected $expire_offset;
36
+	/**
37
+	 * Expiration offset. Default is one day.
38
+	 * @var int $expire_offset
39
+	 */
40
+	protected $expire_offset;
41 41
    
42
-    /**
43
-     * Should the certificate display a watermark
44
-     * @var bool $show_watermark
45
-     */
46
-    protected $show_watermark;
42
+	/**
43
+	 * Should the certificate display a watermark
44
+	 * @var bool $show_watermark
45
+	 */
46
+	protected $show_watermark;
47 47
         
48
-    /**
49
-     * Maximum watermark font size. Default is 18.
50
-     * @var int $font_max_size
51
-     */
52
-    protected $font_max_size;
48
+	/**
49
+	 * Maximum watermark font size. Default is 18.
50
+	 * @var int $font_max_size
51
+	 */
52
+	protected $font_max_size;
53 53
     
54
-    /**
55
-     * Watermark font color, in hexadecimal. Default is #4D6DF3.
56
-     * @var string $font_color
57
-     */
58
-    protected $font_color;
54
+	/**
55
+	 * Watermark font color, in hexadecimal. Default is #4D6DF3.
56
+	 * @var string $font_color
57
+	 */
58
+	protected $font_color;
59 59
     
60 60
 	/**
61
-	* Contructor for ImageBuilder
62
-	*
63
-	* @param Media|null $media Reference media object
64
-	*/
61
+	 * Contructor for ImageBuilder
62
+	 *
63
+	 * @param Media|null $media Reference media object
64
+	 */
65 65
 	public function __construct(Media $media = null){
66
-	    $this->media = $media;
67
-	    $this->use_ttf = function_exists('imagettftext');
68
-	    $this->expire_offset = 3600 * 24;
69
-	    $this->show_watermark = true;
70
-	    $this->font_max_size = 18;
71
-	    $this->font_color = '#4D6DF3';
66
+		$this->media = $media;
67
+		$this->use_ttf = function_exists('imagettftext');
68
+		$this->expire_offset = 3600 * 24;
69
+		$this->show_watermark = true;
70
+		$this->font_max_size = 18;
71
+		$this->font_color = '#4D6DF3';
72 72
 	}
73 73
 	
74 74
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return int
78 78
 	 */
79 79
 	public function getExpireOffset() {
80
-	    return $this->expire_offset;
80
+		return $this->expire_offset;
81 81
 	}
82 82
 	
83 83
 	/**
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 * @return ImageBuilder
88 88
 	 */
89 89
 	public function setExpireOffset($expireOffset) {
90
-	    if($expireOffset) $this->expire_offset = $expireOffset;
91
-	    return $this;
90
+		if($expireOffset) $this->expire_offset = $expireOffset;
91
+		return $this;
92 92
 	}
93 93
 	
94 94
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * @return bool
98 98
 	 */
99 99
 	public function isShowWatermark() {
100
-	    return $this->show_watermark;
100
+		return $this->show_watermark;
101 101
 	}
102 102
 	
103 103
 	/**
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 	 * @return ImageBuilder
108 108
 	 */
109 109
 	public function setShowWatermark($show_watermark) {
110
-	    if(!is_null($show_watermark)) $this->show_watermark = $show_watermark;
111
-	    return $this;
110
+		if(!is_null($show_watermark)) $this->show_watermark = $show_watermark;
111
+		return $this;
112 112
 	}
113 113
 	
114 114
 	/**
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	 * @return ImageBuilder
119 119
 	 */
120 120
 	public function setFontMaxSize($font_max_size) {
121
-	    if($font_max_size) $this->font_max_size = $font_max_size;
122
-	    return $this;
121
+		if($font_max_size) $this->font_max_size = $font_max_size;
122
+		return $this;
123 123
 	}
124 124
 	
125 125
 	/**
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
 	 * @return ImageBuilder
130 130
 	 */
131 131
 	public function setFontColor($font_color) {
132
-	    if($font_color) $this->font_color = $font_color;
133
-	    return $this;
132
+		if($font_color) $this->font_color = $font_color;
133
+		return $this;
134 134
 	}
135 135
 	
136 136
 	/**
@@ -138,134 +138,134 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function render(){
140 140
 	    
141
-	    if (!$this->media || !$this->media->canShow()) {
142
-	        Log::addMediaLog('Image Builder error: >' . I18N::translate('Missing or private media object.'));
143
-	        $this->renderError();
144
-	    }
141
+		if (!$this->media || !$this->media->canShow()) {
142
+			Log::addMediaLog('Image Builder error: >' . I18N::translate('Missing or private media object.'));
143
+			$this->renderError();
144
+		}
145 145
 	    
146
-	    $serverFilename = $this->media->getServerFilename();
146
+		$serverFilename = $this->media->getServerFilename();
147 147
 	    
148
-	    if (!file_exists($serverFilename)) {
149
-	        Log::addMediaLog('Image Builder error: >'. I18N::translate('The media object does not exist.').'< for path >'.$serverFilename.'<');
150
-	        $this->renderError();
151
-	    }
148
+		if (!file_exists($serverFilename)) {
149
+			Log::addMediaLog('Image Builder error: >'. I18N::translate('The media object does not exist.').'< for path >'.$serverFilename.'<');
150
+			$this->renderError();
151
+		}
152 152
 	    
153
-	    $mimetype = $this->media->mimeType();
154
-	    $imgsize = $this->media->getImageAttributes();
155
-	    $filetime = $this->media->getFiletime();
156
-	    $filetimeHeader = gmdate('D, d M Y H:i:s', $filetime) . ' GMT';	    
157
-	    $expireHeader = gmdate('D, d M Y H:i:s', WT_TIMESTAMP + $this->getExpireOffset()) . ' GMT';
153
+		$mimetype = $this->media->mimeType();
154
+		$imgsize = $this->media->getImageAttributes();
155
+		$filetime = $this->media->getFiletime();
156
+		$filetimeHeader = gmdate('D, d M Y H:i:s', $filetime) . ' GMT';	    
157
+		$expireHeader = gmdate('D, d M Y H:i:s', WT_TIMESTAMP + $this->getExpireOffset()) . ' GMT';
158 158
 	    
159
-	    $type = Functions::isImageTypeSupported($imgsize['ext']);
160
-	    $usewatermark = false;
161
-	    // if this image supports watermarks and the watermark module is intalled...
162
-	    if ($type) {
163
-	        $usewatermark = $this->isShowWatermark();
164
-	    }
159
+		$type = Functions::isImageTypeSupported($imgsize['ext']);
160
+		$usewatermark = false;
161
+		// if this image supports watermarks and the watermark module is intalled...
162
+		if ($type) {
163
+			$usewatermark = $this->isShowWatermark();
164
+		}
165 165
 	    
166
-	    // determine whether we have enough memory to watermark this image
167
-	    if ($usewatermark) {
168
-	        if (!FunctionsMedia::hasMemoryForImage($serverFilename)) {
169
-	            // not enough memory to watermark this file
170
-	            $usewatermark = false;
171
-	        }
172
-	    }
166
+		// determine whether we have enough memory to watermark this image
167
+		if ($usewatermark) {
168
+			if (!FunctionsMedia::hasMemoryForImage($serverFilename)) {
169
+				// not enough memory to watermark this file
170
+				$usewatermark = false;
171
+			}
172
+		}
173 173
 	    
174
-	    $etag = $this->media->getEtag();
174
+		$etag = $this->media->getEtag();
175 175
 	    
176
-	    // parse IF_MODIFIED_SINCE header from client
177
-	    $if_modified_since = 'x';
178
-	    if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
179
-	        $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
180
-	    }
176
+		// parse IF_MODIFIED_SINCE header from client
177
+		$if_modified_since = 'x';
178
+		if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
179
+			$if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
180
+		}
181 181
 	    
182
-	    // parse IF_NONE_MATCH header from client
183
-	    $if_none_match = 'x';
184
-	    if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
185
-	        $if_none_match = str_replace('"', '', $_SERVER['HTTP_IF_NONE_MATCH']);
186
-	    }
182
+		// parse IF_NONE_MATCH header from client
183
+		$if_none_match = 'x';
184
+		if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
185
+			$if_none_match = str_replace('"', '', $_SERVER['HTTP_IF_NONE_MATCH']);
186
+		}
187 187
 	    
188
-	    // add caching headers.  allow browser to cache file, but not proxy
189
-	    header('Last-Modified: ' . $filetimeHeader);
190
-	    header('ETag: "' . $etag . '"');
191
-	    header('Expires: ' . $expireHeader);
192
-	    header('Cache-Control: max-age=' . $this->getExpireOffset() . ', s-maxage=0, proxy-revalidate');
188
+		// add caching headers.  allow browser to cache file, but not proxy
189
+		header('Last-Modified: ' . $filetimeHeader);
190
+		header('ETag: "' . $etag . '"');
191
+		header('Expires: ' . $expireHeader);
192
+		header('Cache-Control: max-age=' . $this->getExpireOffset() . ', s-maxage=0, proxy-revalidate');
193 193
 	    
194
-	    // if this file is already in the user’s cache, don’t resend it
195
-	    // first check if the if_modified_since param matches
196
-	    if ($if_modified_since === $filetimeHeader) {
197
-	        // then check if the etag matches
198
-	        if ($if_none_match === $etag) {
199
-	            http_response_code(304);
194
+		// if this file is already in the user’s cache, don’t resend it
195
+		// first check if the if_modified_since param matches
196
+		if ($if_modified_since === $filetimeHeader) {
197
+			// then check if the etag matches
198
+			if ($if_none_match === $etag) {
199
+				http_response_code(304);
200 200
 	    
201
-	            return;
202
-	        }
203
-	    }	    
201
+				return;
202
+			}
203
+		}	    
204 204
 
205
-	    // send headers for the image
206
-	    header('Content-Type: ' . $mimetype);
207
-	    header('Content-Disposition: filename="' . addslashes(basename($this->media->getFilename())) . '"');
205
+		// send headers for the image
206
+		header('Content-Type: ' . $mimetype);
207
+		header('Content-Disposition: filename="' . addslashes(basename($this->media->getFilename())) . '"');
208 208
 	     
209
-	    if ($usewatermark) {
210
-	        // generate the watermarked image
211
-	        $imCreateFunc = 'imagecreatefrom' . $type;
212
-	        $imSendFunc   = 'image' . $type;
209
+		if ($usewatermark) {
210
+			// generate the watermarked image
211
+			$imCreateFunc = 'imagecreatefrom' . $type;
212
+			$imSendFunc   = 'image' . $type;
213 213
 	    
214
-	        if (function_exists($imCreateFunc) && function_exists($imSendFunc)) {
215
-	            $im = $imCreateFunc($serverFilename);
216
-	            $im = $this->applyWatermark($im);
214
+			if (function_exists($imCreateFunc) && function_exists($imSendFunc)) {
215
+				$im = $imCreateFunc($serverFilename);
216
+				$im = $this->applyWatermark($im);
217 217
 	    	    
218
-	            // send the image
219
-	            $imSendFunc($im);
220
-	            imagedestroy($im);
218
+				// send the image
219
+				$imSendFunc($im);
220
+				imagedestroy($im);
221 221
 	    
222
-	            return;
223
-	        } else {
224
-	            // this image is defective.  log it
225
-	            Log::addMediaLog('Image Builder error: >' . I18N::translate('This media file is broken and cannot be watermarked.') . '< in file >' . $serverFilename . '< memory used: ' . memory_get_usage());
226
-	        }
227
-	    }
222
+				return;
223
+			} else {
224
+				// this image is defective.  log it
225
+				Log::addMediaLog('Image Builder error: >' . I18N::translate('This media file is broken and cannot be watermarked.') . '< in file >' . $serverFilename . '< memory used: ' . memory_get_usage());
226
+			}
227
+		}
228 228
 	    
229
-	    // determine filesize of image (could be original or watermarked version)
230
-	    $filesize = filesize($serverFilename);
229
+		// determine filesize of image (could be original or watermarked version)
230
+		$filesize = filesize($serverFilename);
231 231
 	    
232
-	    // set content-length header, send file
233
-	    header('Content-Length: ' . $filesize);
232
+		// set content-length header, send file
233
+		header('Content-Length: ' . $filesize);
234 234
 	    
235
-	    // Some servers disable fpassthru() and readfile()
236
-	    if (function_exists('readfile')) {
237
-	        readfile($serverFilename);
238
-	    } else {
239
-	        $fp = fopen($serverFilename, 'rb');
240
-	        if (function_exists('fpassthru')) {
241
-	            fpassthru($fp);
242
-	        } else {
243
-	            while (!feof($fp)) {
244
-	                echo fread($fp, 65536);
245
-	            }
246
-	        }
247
-	        fclose($fp);
248
-	    }	    
235
+		// Some servers disable fpassthru() and readfile()
236
+		if (function_exists('readfile')) {
237
+			readfile($serverFilename);
238
+		} else {
239
+			$fp = fopen($serverFilename, 'rb');
240
+			if (function_exists('fpassthru')) {
241
+				fpassthru($fp);
242
+			} else {
243
+				while (!feof($fp)) {
244
+					echo fread($fp, 65536);
245
+				}
246
+			}
247
+			fclose($fp);
248
+		}	    
249 249
 	}
250 250
 	
251 251
 	/**
252 252
 	 * Render an error as an image.
253 253
 	 */
254 254
 	protected function renderError() {	
255
-	    $error = I18N::translate('The media file was not found in this family tree.');
255
+		$error = I18N::translate('The media file was not found in this family tree.');
256 256
 
257
-    	$width  = (mb_strlen($error) * 6.5 + 50) * 1.15;
258
-    	$height = 60;
259
-    	$im     = imagecreatetruecolor($width, $height); /* Create a black image */
260
-    	$bgc    = imagecolorallocate($im, 255, 255, 255); /* set background color */
261
-    	imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
257
+		$width  = (mb_strlen($error) * 6.5 + 50) * 1.15;
258
+		$height = 60;
259
+		$im     = imagecreatetruecolor($width, $height); /* Create a black image */
260
+		$bgc    = imagecolorallocate($im, 255, 255, 255); /* set background color */
261
+		imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
262 262
     
263
-    	$this->embedText($im, $error, 100, '255, 0, 0', WT_ROOT . Config::FONT_DEJAVU_SANS_TTF, 'top', 'left');
263
+		$this->embedText($im, $error, 100, '255, 0, 0', WT_ROOT . Config::FONT_DEJAVU_SANS_TTF, 'top', 'left');
264 264
     
265
-    	http_response_code(404);
266
-    	header('Content-Type: image/png');
267
-    	imagepng($im);
268
-    	imagedestroy($im);
265
+		http_response_code(404);
266
+		header('Content-Type: image/png');
267
+		imagepng($im);
268
+		imagedestroy($im);
269 269
 	}
270 270
 	
271 271
 	/**
@@ -277,25 +277,25 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	protected function applyWatermark($im) {
279 279
 	    
280
-	    // text to watermark with	    
281
-	    if(method_exists($this->media, 'getWatermarkText')) {
282
-	       $word1_text = $this->media->getWatermarkText();
283
-	    }
284
-	    else {
285
-	        $word1_text = $this->media->getTitle();
286
-	    }
280
+		// text to watermark with	    
281
+		if(method_exists($this->media, 'getWatermarkText')) {
282
+		   $word1_text = $this->media->getWatermarkText();
283
+		}
284
+		else {
285
+			$word1_text = $this->media->getTitle();
286
+		}
287 287
 	
288
-	    $this->embedText(
289
-	        $im, 
290
-	        $word1_text, 
291
-	        $this->font_max_size,
292
-	        $this->font_color,
293
-	        WT_ROOT . Config::FONT_DEJAVU_SANS_TTF,
294
-	        'top', 
295
-	        'left'
296
-	     );
288
+		$this->embedText(
289
+			$im, 
290
+			$word1_text, 
291
+			$this->font_max_size,
292
+			$this->font_color,
293
+			WT_ROOT . Config::FONT_DEJAVU_SANS_TTF,
294
+			'top', 
295
+			'left'
296
+		 );
297 297
 	
298
-	    return ($im);
298
+		return ($im);
299 299
 	}
300 300
 	
301 301
 	/**
@@ -312,94 +312,94 @@  discard block
 block discarded – undo
312 312
 	 */
313 313
 	protected function embedText($im, $text, $maxsize, $color, $font, $vpos, $hpos) {
314 314
 	    
315
-	    // there are two ways to embed text with PHP
316
-	    // (preferred) using GD and FreeType you can embed text using any True Type font
317
-	    // (fall back) if that is not available, you can insert basic monospaced text
315
+		// there are two ways to embed text with PHP
316
+		// (preferred) using GD and FreeType you can embed text using any True Type font
317
+		// (fall back) if that is not available, you can insert basic monospaced text
318 318
 	    
319
-	    $col = $this->hexrgb($color);
320
-	    $textcolor = imagecolorallocate($im, $col['red'], $col['green'], $col['blue']);
319
+		$col = $this->hexrgb($color);
320
+		$textcolor = imagecolorallocate($im, $col['red'], $col['green'], $col['blue']);
321 321
 	    
322
-	    // make adjustments to settings that imagestring and imagestringup can’t handle
323
-	    if (!$this->use_ttf) {
324
-	        // imagestringup only writes up, can’t use top2bottom
325
-	        if ($hpos === 'top2bottom') {
326
-	            $hpos = 'bottom2top';
327
-	        }
328
-	    }
322
+		// make adjustments to settings that imagestring and imagestringup can’t handle
323
+		if (!$this->use_ttf) {
324
+			// imagestringup only writes up, can’t use top2bottom
325
+			if ($hpos === 'top2bottom') {
326
+				$hpos = 'bottom2top';
327
+			}
328
+		}
329 329
 	    
330
-	    $text       = I18N::reverseText($text);
331
-	    $height     = imagesy($im);
332
-	    $width      = imagesx($im);
333
-	    $calc_angle = rad2deg(atan($height / $width));
334
-	    $hypoth     = $height / sin(deg2rad($calc_angle));
330
+		$text       = I18N::reverseText($text);
331
+		$height     = imagesy($im);
332
+		$width      = imagesx($im);
333
+		$calc_angle = rad2deg(atan($height / $width));
334
+		$hypoth     = $height / sin(deg2rad($calc_angle));
335 335
 	    
336
-	    // vertical and horizontal position of the text
337
-	    switch ($vpos) {
338
-	        default:
339
-	        case 'top':
340
-	            $taille   = $this->textLength($maxsize, $width, $text);
341
-	            $pos_y    = $height * 0.15 + $taille;
342
-	            $pos_x    = $width * 0.15;
343
-	            $rotation = 0;
344
-	            break;
345
-	        case 'middle':
346
-	            $taille   = $this->textLength($maxsize, $width, $text);
347
-	            $pos_y    = ($height + $taille) / 2;
348
-	            $pos_x    = $width * 0.15;
349
-	            $rotation = 0;
350
-	            break;
351
-	        case 'bottom':
352
-	            $taille   = $this->textLength($maxsize, $width, $text);
353
-	            $pos_y    = ($height * .85 - $taille);
354
-	            $pos_x    = $width * 0.15;
355
-	            $rotation = 0;
356
-	            break;
357
-	        case 'across':
358
-	            switch ($hpos) {
359
-	                default:
360
-	                case 'left':
361
-	                    $taille   = $this->textLength($maxsize, $hypoth, $text);
362
-	                    $pos_y    = ($height * .85 - $taille);
363
-	                    $pos_x    = $width * 0.15;
364
-	                    $rotation = $calc_angle;
365
-	                    break;
366
-	                case 'right':
367
-	                    $taille   = $this->textLength($maxsize, $hypoth, $text);
368
-	                    $pos_y    = ($height * .15 - $taille);
369
-	                    $pos_x    = $width * 0.85;
370
-	                    $rotation = $calc_angle + 180;
371
-	                    break;
372
-	                case 'top2bottom':
373
-	                    $taille   = $this->textLength($maxsize, $height, $text);
374
-	                    $pos_y    = ($height * .15 - $taille);
375
-	                    $pos_x    = ($width * .90 - $taille);
376
-	                    $rotation = -90;
377
-	                    break;
378
-	                case 'bottom2top':
379
-	                    $taille   = $this->textLength($maxsize, $height, $text);
380
-	                    $pos_y    = $height * 0.85;
381
-	                    $pos_x    = $width * 0.15;
382
-	                    $rotation = 90;
383
-	                    break;
384
-	            }
385
-	            break;
386
-	    }
336
+		// vertical and horizontal position of the text
337
+		switch ($vpos) {
338
+			default:
339
+			case 'top':
340
+				$taille   = $this->textLength($maxsize, $width, $text);
341
+				$pos_y    = $height * 0.15 + $taille;
342
+				$pos_x    = $width * 0.15;
343
+				$rotation = 0;
344
+				break;
345
+			case 'middle':
346
+				$taille   = $this->textLength($maxsize, $width, $text);
347
+				$pos_y    = ($height + $taille) / 2;
348
+				$pos_x    = $width * 0.15;
349
+				$rotation = 0;
350
+				break;
351
+			case 'bottom':
352
+				$taille   = $this->textLength($maxsize, $width, $text);
353
+				$pos_y    = ($height * .85 - $taille);
354
+				$pos_x    = $width * 0.15;
355
+				$rotation = 0;
356
+				break;
357
+			case 'across':
358
+				switch ($hpos) {
359
+					default:
360
+					case 'left':
361
+						$taille   = $this->textLength($maxsize, $hypoth, $text);
362
+						$pos_y    = ($height * .85 - $taille);
363
+						$pos_x    = $width * 0.15;
364
+						$rotation = $calc_angle;
365
+						break;
366
+					case 'right':
367
+						$taille   = $this->textLength($maxsize, $hypoth, $text);
368
+						$pos_y    = ($height * .15 - $taille);
369
+						$pos_x    = $width * 0.85;
370
+						$rotation = $calc_angle + 180;
371
+						break;
372
+					case 'top2bottom':
373
+						$taille   = $this->textLength($maxsize, $height, $text);
374
+						$pos_y    = ($height * .15 - $taille);
375
+						$pos_x    = ($width * .90 - $taille);
376
+						$rotation = -90;
377
+						break;
378
+					case 'bottom2top':
379
+						$taille   = $this->textLength($maxsize, $height, $text);
380
+						$pos_y    = $height * 0.85;
381
+						$pos_x    = $width * 0.15;
382
+						$rotation = 90;
383
+						break;
384
+				}
385
+				break;
386
+		}
387 387
 	    
388
-	    // apply the text
389
-	    if ($this->use_ttf) {
390
-	        // if imagettftext throws errors, catch them with a custom error handler
391
-	        set_error_handler(array($this, 'imageTtfTextErrorHandler'));
392
-	        imagettftext($im, $taille, $rotation, $pos_x, $pos_y, $textcolor, $font, $text);
393
-	        restore_error_handler();
394
-	    }
395
-	    // Don’t use an ‘else’ here since imagettftextErrorHandler may have changed the value of $useTTF from true to false
396
-	    if (!$this->use_ttf) {
397
-	        if ($rotation !== 90) {
398
-	            imagestring($im, 5, $pos_x, $pos_y, $text, $textcolor);
399
-	        } else {
400
-	            imagestringup($im, 5, $pos_x, $pos_y, $text, $textcolor);
401
-	        }
402
-	    }
388
+		// apply the text
389
+		if ($this->use_ttf) {
390
+			// if imagettftext throws errors, catch them with a custom error handler
391
+			set_error_handler(array($this, 'imageTtfTextErrorHandler'));
392
+			imagettftext($im, $taille, $rotation, $pos_x, $pos_y, $textcolor, $font, $text);
393
+			restore_error_handler();
394
+		}
395
+		// Don’t use an ‘else’ here since imagettftextErrorHandler may have changed the value of $useTTF from true to false
396
+		if (!$this->use_ttf) {
397
+			if ($rotation !== 90) {
398
+				imagestring($im, 5, $pos_x, $pos_y, $text, $textcolor);
399
+			} else {
400
+				imagestringup($im, 5, $pos_x, $pos_y, $text, $textcolor);
401
+			}
402
+		}
403 403
 	
404 404
 	}
405 405
 	
@@ -411,53 +411,53 @@  discard block
 block discarded – undo
411 411
 	 */
412 412
 	protected function hexrgb ($hexstr)
413 413
 	{
414
-	    $int = hexdec($hexstr);
414
+		$int = hexdec($hexstr);
415 415
 	
416
-	    return array('red' => 0xFF & ($int >> 0x10),
417
-	        'green' => 0xFF & ($int >> 0x8),
418
-	        'blue' => 0xFF & $int);
416
+		return array('red' => 0xFF & ($int >> 0x10),
417
+			'green' => 0xFF & ($int >> 0x8),
418
+			'blue' => 0xFF & $int);
419 419
 	}
420 420
 	
421
-    /**
422
-     * Generate an approximate length of text, in pixels.
423
-     *
424
-     * @param int    $t
425
-     * @param int    $mxl
426
-     * @param string $text
427
-     *
428
-     * @return int
429
-     */
430
-    function textLength($t, $mxl, $text) {
431
-    	$taille_c = $t;
432
-    	$len      = mb_strlen($text);
433
-    	while (($taille_c - 2) * $len > $mxl) {
434
-    		$taille_c--;
435
-    		if ($taille_c == 2) {
436
-    			break;
437
-    		}
438
-    	}
421
+	/**
422
+	 * Generate an approximate length of text, in pixels.
423
+	 *
424
+	 * @param int    $t
425
+	 * @param int    $mxl
426
+	 * @param string $text
427
+	 *
428
+	 * @return int
429
+	 */
430
+	function textLength($t, $mxl, $text) {
431
+		$taille_c = $t;
432
+		$len      = mb_strlen($text);
433
+		while (($taille_c - 2) * $len > $mxl) {
434
+			$taille_c--;
435
+			if ($taille_c == 2) {
436
+				break;
437
+			}
438
+		}
439 439
     
440
-    	return $taille_c;
441
-    }
440
+		return $taille_c;
441
+	}
442 442
     
443
-    /**
444
-     * imagettftext is the function that is most likely to throw an error
445
-     * use this custom error handler to catch and log it
446
-     *
447
-     * @param int    $errno
448
-     * @param string $errstr
449
-     *
450
-     * @return bool
451
-     */
452
-    function imageTtfTextErrorHandler($errno, $errstr) {
453
-        // log the error
454
-        Log::addErrorLog('Image Builder error: >' . $errno . '/' . $errstr . '< while processing file >' . $this->media->getServerFilename() . '<');
443
+	/**
444
+	 * imagettftext is the function that is most likely to throw an error
445
+	 * use this custom error handler to catch and log it
446
+	 *
447
+	 * @param int    $errno
448
+	 * @param string $errstr
449
+	 *
450
+	 * @return bool
451
+	 */
452
+	function imageTtfTextErrorHandler($errno, $errstr) {
453
+		// log the error
454
+		Log::addErrorLog('Image Builder error: >' . $errno . '/' . $errstr . '< while processing file >' . $this->media->getServerFilename() . '<');
455 455
     
456
-        // change value of useTTF to false so the fallback watermarking can be used.
457
-        $this->use_ttf = false;
456
+		// change value of useTTF to false so the fallback watermarking can be used.
457
+		$this->use_ttf = false;
458 458
     
459
-        return true;
460
-    }
459
+		return true;
460
+	}
461 461
 		
462 462
 }
463 463
 
Please login to merge, or discard this patch.