mirror of
https://github.com/Intervention/image.git
synced 2025-08-12 08:54:03 +02:00
fixed coding standards
This commit is contained in:
@@ -12,8 +12,8 @@ class Driver extends \Intervention\Image\AbstractDriver
|
|||||||
* @param Intervention\Image\Gd\Source $source
|
* @param Intervention\Image\Gd\Source $source
|
||||||
* @param Intervention\Image\Gd\Encoder $encoder
|
* @param Intervention\Image\Gd\Encoder $encoder
|
||||||
*/
|
*/
|
||||||
public function __construct(Source $source = null, Encoder $encoder = null)
|
public function __construct(Source $source = null, Encoder $encoder = null)
|
||||||
{
|
{
|
||||||
if ( ! $this->coreAvailable()) {
|
if ( ! $this->coreAvailable()) {
|
||||||
throw new \Intervention\Image\Exception\NotSupportedException(
|
throw new \Intervention\Image\Exception\NotSupportedException(
|
||||||
"GD Library extension not available with this PHP installation."
|
"GD Library extension not available with this PHP installation."
|
||||||
@@ -21,8 +21,8 @@ class Driver extends \Intervention\Image\AbstractDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->source = $source ? $source : new Source;
|
$this->source = $source ? $source : new Source;
|
||||||
$this->encoder = $encoder ? $encoder : new Encoder;
|
$this->encoder = $encoder ? $encoder : new Encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new image instance
|
* Creates new image instance
|
||||||
|
@@ -18,7 +18,7 @@ class CircleShape extends EllipseShape
|
|||||||
*
|
*
|
||||||
* @param integer $radius
|
* @param integer $radius
|
||||||
*/
|
*/
|
||||||
function __construct($radius = null)
|
public function __construct($radius = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
||||||
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
||||||
|
@@ -27,7 +27,7 @@ class EllipseShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $width
|
* @param integer $width
|
||||||
* @param integer $height
|
* @param integer $height
|
||||||
*/
|
*/
|
||||||
function __construct($width = null, $height = null)
|
public function __construct($width = null, $height = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($width) ? intval($width) : $this->width;
|
$this->width = is_numeric($width) ? intval($width) : $this->width;
|
||||||
$this->height = is_numeric($height) ? intval($height) : $this->height;
|
$this->height = is_numeric($height) ? intval($height) : $this->height;
|
||||||
|
@@ -41,7 +41,7 @@ class LineShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $x
|
* @param integer $x
|
||||||
* @param integer $y
|
* @param integer $y
|
||||||
*/
|
*/
|
||||||
function __construct($x = null, $y = null)
|
public function __construct($x = null, $y = null)
|
||||||
{
|
{
|
||||||
$this->x = is_numeric($x) ? intval($x) : $this->x;
|
$this->x = is_numeric($x) ? intval($x) : $this->x;
|
||||||
$this->y = is_numeric($y) ? intval($y) : $this->y;
|
$this->y = is_numeric($y) ? intval($y) : $this->y;
|
||||||
|
@@ -43,7 +43,7 @@ class RectangleShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $x2
|
* @param integer $x2
|
||||||
* @param integer $y2
|
* @param integer $y2
|
||||||
*/
|
*/
|
||||||
function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
|
public function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
|
||||||
{
|
{
|
||||||
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
|
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
|
||||||
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
|
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
|
||||||
|
@@ -3,39 +3,39 @@
|
|||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
class ImageServiceProvider extends ServiceProvider {
|
class ImageServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Indicates if loading of the provider is deferred.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $defer = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if loading of the provider is deferred.
|
* Bootstrap the application events.
|
||||||
*
|
*
|
||||||
* @var bool
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected $defer = false;
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->package('intervention/image');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap the application events.
|
* Register the service provider.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->package('intervention/image');
|
$app = $this->app;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$app['image'] = $app->share(function ($app) {
|
||||||
* Register the service provider.
|
return new ImageManager($app['config']);
|
||||||
*
|
});
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
$app = $this->app;
|
|
||||||
|
|
||||||
$app['image'] = $app->share(function ($app) {
|
// try to create imagecache route only if imagecache is present
|
||||||
return new ImageManager($app['config']);
|
|
||||||
});
|
|
||||||
|
|
||||||
// try to create imagecache route only if imagecache is present
|
|
||||||
if (class_exists('Intervention\Image\ImageCache')) {
|
if (class_exists('Intervention\Image\ImageCache')) {
|
||||||
|
|
||||||
// load imagecache config
|
// load imagecache config
|
||||||
@@ -95,16 +95,16 @@ class ImageServiceProvider extends ServiceProvider {
|
|||||||
}))->where(array('template' => join('|', array_keys($config->get('imagecache::templates'))), 'filename' => '^[\/\w.-]+$'));
|
}))->where(array('template' => join('|', array_keys($config->get('imagecache::templates'))), 'filename' => '^[\/\w.-]+$'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the services provided by the provider.
|
* Get the services provided by the provider.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function provides()
|
public function provides()
|
||||||
{
|
{
|
||||||
return array('image');
|
return array('image');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,8 @@ class Driver extends \Intervention\Image\AbstractDriver
|
|||||||
* @param Intervention\Image\Imagick\Source $source
|
* @param Intervention\Image\Imagick\Source $source
|
||||||
* @param Intervention\Image\Imagick\Encoder $encoder
|
* @param Intervention\Image\Imagick\Encoder $encoder
|
||||||
*/
|
*/
|
||||||
public function __construct(Source $source = null, Encoder $encoder = null)
|
public function __construct(Source $source = null, Encoder $encoder = null)
|
||||||
{
|
{
|
||||||
if ( ! $this->coreAvailable()) {
|
if ( ! $this->coreAvailable()) {
|
||||||
throw new \Intervention\Image\Exception\NotSupportedException(
|
throw new \Intervention\Image\Exception\NotSupportedException(
|
||||||
"ImageMagick module not available with this PHP installation."
|
"ImageMagick module not available with this PHP installation."
|
||||||
@@ -21,8 +21,8 @@ class Driver extends \Intervention\Image\AbstractDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->source = $source ? $source : new Source;
|
$this->source = $source ? $source : new Source;
|
||||||
$this->encoder = $encoder ? $encoder : new Encoder;
|
$this->encoder = $encoder ? $encoder : new Encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new image instance
|
* Creates new image instance
|
||||||
|
@@ -18,7 +18,7 @@ class CircleShape extends EllipseShape
|
|||||||
*
|
*
|
||||||
* @param integer $radius
|
* @param integer $radius
|
||||||
*/
|
*/
|
||||||
function __construct($radius = null)
|
public function __construct($radius = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
||||||
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
||||||
|
@@ -27,7 +27,7 @@ class EllipseShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $width
|
* @param integer $width
|
||||||
* @param integer $height
|
* @param integer $height
|
||||||
*/
|
*/
|
||||||
function __construct($width = null, $height = null)
|
public function __construct($width = null, $height = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($width) ? intval($width) : $this->width;
|
$this->width = is_numeric($width) ? intval($width) : $this->width;
|
||||||
$this->height = is_numeric($height) ? intval($height) : $this->height;
|
$this->height = is_numeric($height) ? intval($height) : $this->height;
|
||||||
|
@@ -41,7 +41,7 @@ class LineShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $x
|
* @param integer $x
|
||||||
* @param integer $y
|
* @param integer $y
|
||||||
*/
|
*/
|
||||||
function __construct($x = null, $y = null)
|
public function __construct($x = null, $y = null)
|
||||||
{
|
{
|
||||||
$this->x = is_numeric($x) ? intval($x) : $this->x;
|
$this->x = is_numeric($x) ? intval($x) : $this->x;
|
||||||
$this->y = is_numeric($y) ? intval($y) : $this->y;
|
$this->y = is_numeric($y) ? intval($y) : $this->y;
|
||||||
|
@@ -43,7 +43,7 @@ class RectangleShape extends \Intervention\Image\AbstractShape
|
|||||||
* @param integer $x2
|
* @param integer $x2
|
||||||
* @param integer $y2
|
* @param integer $y2
|
||||||
*/
|
*/
|
||||||
function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
|
public function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
|
||||||
{
|
{
|
||||||
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
|
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
|
||||||
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
|
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
|
||||||
|
Reference in New Issue
Block a user