Skip to content

Commit 7aef178

Browse files
Reduce number of backslashes
1 parent db82053 commit 7aef178

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ following in configuration `components` section:
1818

1919
```php
2020
'pdf' => array(
21-
'class' => '\Snappy\PdfComponent',
21+
'class' => 'Snappy\PdfComponent',
2222
'binary' => '/usr/local/bin/wkhtmltopdf',
2323
'options' => array('orientation' => 'landscape'),
2424
'tempdir' => __DIR__.'/../runtime/pdf',
2525
),
2626
'image' => array(
27-
'class' => '\Snappy\ImageComponent',
27+
'class' => 'Snappy\ImageComponent',
2828
'binary' => '/usr/local/bin/wkhtmltoimage',
2929
'tempdir' => __DIR__.'/../runtime/image',
3030
),

src/AbstractComponent.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Snappy;
44

5+
use CApplicationComponent;
6+
use Yii;
7+
58
/**
69
* Base class for generator components.
710
*
@@ -10,7 +13,7 @@
1013
* @method string getOutput(array|string $input, array $options)
1114
* @method string getOutputFromHtml(array|string $html, array $options)
1215
*/
13-
abstract class AbstractComponent extends \CApplicationComponent
16+
abstract class AbstractComponent extends CApplicationComponent
1417
{
1518
/**
1619
* @var string Path to wkhtmltox binary
@@ -37,7 +40,7 @@ abstract protected function getGenerator();
3740
*/
3841
public function __call($name, $parameters)
3942
{
40-
if (!method_exists('\Knp\Snappy\GeneratorInterface', $name)) {
43+
if (!method_exists('Knp\Snappy\GeneratorInterface', $name)) {
4144
return parent::__call($name, $parameters);
4245
}
4346

@@ -55,6 +58,6 @@ public function __call($name, $parameters)
5558
*/
5659
protected function resolveTempdir()
5760
{
58-
return $this->tempdir ?: \Yii::app()->params['snappy_tempdir'];
61+
return $this->tempdir ?: Yii::app()->params['snappy_tempdir'];
5962
}
6063
}

src/ImageComponent.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
namespace Snappy;
44

5+
use Knp\Snappy\Image;
6+
57
/**
68
* Image generator component.
79
*/
810
class ImageComponent extends AbstractComponent
911
{
1012
/**
11-
* @return \Knp\Snappy\Image
13+
* @return Image
1214
*/
1315
protected function getGenerator()
1416
{
15-
return new \Knp\Snappy\Image($this->binary, $this->options);
17+
return new Image($this->binary, $this->options);
1618
}
1719
}

src/PdfComponent.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
namespace Snappy;
44

5+
use Knp\Snappy\Pdf;
6+
57
/**
68
* PDF generator component.
79
*/
810
class PdfComponent extends AbstractComponent
911
{
1012
/**
11-
* @return \Knp\Snappy\Pdf
13+
* @return Pdf
1214
*/
1315
protected function getGenerator()
1416
{
15-
return new \Knp\Snappy\Pdf($this->binary, $this->options);
17+
return new Pdf($this->binary, $this->options);
1618
}
1719
}

0 commit comments

Comments
 (0)