PHP Classes

best to do

Recommend this page to a friend!

      PHP Avatar Stylizer  >  All threads  >  best to do  >  (Un) Subscribe thread alerts  
Subject:best to do
Summary:an upgrade
Messages:1
Author:François Chérubin
Date:2017-12-13 00:42:15
 

 


  1. best to do   Reply   Report abuse  
Picture of François Chérubin François Chérubin - 2017-12-13 00:42:15
when you do this


public function getColorFromImage($imagePath,$x = 0,$y = 0)
{
if (isset($imagePath))
{
..

}
else die();
}

I think is better for debugging and to reading script to do like this


public function getColorFromImage($imagePath,$x = 0,$y = 0)
{
if (!isset($imagePath) && $imagePath=="") throw new Exception("thank to put a real path");
..

}