Skip to content

style: fix to laravel code style #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/Facades/SnappyImage.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php

namespace Barryvdh\Snappy\Facades;

use Illuminate\Support\Facades\Facade as BaseFacade;

class SnappyImage extends BaseFacade {

class SnappyImage extends BaseFacade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'snappy.image.wrapper'; }


protected static function getFacadeAccessor()
{
return 'snappy.image.wrapper';
}
}
17 changes: 9 additions & 8 deletions src/Facades/SnappyPdf.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Barryvdh\Snappy\Facades;

use Illuminate\Support\Facades\Facade as BaseFacade;
use Barryvdh\Snappy\PdfFaker;

use Illuminate\Support\Facades\Facade as BaseFacade;

/**
* @method static \Barryvdh\Snappy\PdfWrapper setPaper($paper, $orientation = 'portrait')
Expand All @@ -16,16 +16,18 @@
* @method static \Barryvdh\Snappy\PdfWrapper save()
* @method static \Illuminate\Http\Response download($filename = 'document.pdf')
* @method static \Illuminate\Http\Response inline($filename = 'document.pdf')
*
*/
class SnappyPdf extends BaseFacade {

class SnappyPdf extends BaseFacade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'snappy.pdf.wrapper'; }
protected static function getFacadeAccessor()
{
return 'snappy.pdf.wrapper';
}

/**
* Replace the bound instance with a fake.
Expand All @@ -36,5 +38,4 @@ public static function fake()
{
static::swap(new PdfFaker(app('snappy.pdf')));
}

}
}
64 changes: 29 additions & 35 deletions src/IlluminateSnappyImage.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<?php namespace Barryvdh\Snappy;
<?php

namespace Barryvdh\Snappy;

use Knp\Snappy\Image;
use Illuminate\Filesystem\Filesystem;
use Knp\Snappy\Image;

class IlluminateSnappyImage extends Image {
class IlluminateSnappyImage extends Image
{
/**
* @var \Illuminate\Filesystem\Filesystem
*/
protected $fs;

/**
* @param \Illuminate\Filesystem\Filesystem
* @param string $binary
* @param array $options
*/
public function __construct(Filesystem $fs, $binary, array $options, array $env)
{
parent::__construct($binary, $options, $env);
/**
* @param \Illuminate\Filesystem\Filesystem
* @param string $binary
*/
public function __construct(Filesystem $fs, $binary, array $options, array $env)
{
parent::__construct($binary, $options, $env);

$this->fs = $fs;
}
$this->fs = $fs;
}

/**
* Wrapper for the "file_get_contents" function
*
* @param string $filename
*
* @param string $filename
* @return string
*/
protected function getFileContents($filename)
Expand All @@ -36,9 +37,8 @@ protected function getFileContents($filename)
/**
* Wrapper for the "file_exists" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function fileExists($filename)
{
Expand All @@ -48,9 +48,8 @@ protected function fileExists($filename)
/**
* Wrapper for the "is_file" method
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function isFile($filename)
{
Expand All @@ -60,9 +59,8 @@ protected function isFile($filename)
/**
* Wrapper for the "filesize" function
*
* @param string $filename
*
* @return integer or FALSE on failure
* @param string $filename
* @return int or FALSE on failure
*/
protected function filesize($filename)
{
Expand All @@ -72,9 +70,8 @@ protected function filesize($filename)
/**
* Wrapper for the "unlink" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function unlink($filename)
{
Expand All @@ -84,9 +81,8 @@ protected function unlink($filename)
/**
* Wrapper for the "is_dir" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function isDir($filename)
{
Expand All @@ -96,13 +92,11 @@ protected function isDir($filename)
/**
* Wrapper for the mkdir function
*
* @param string $pathname
*
* @return boolean
* @param string $pathname
* @return bool
*/
protected function mkdir($pathname)
{
return $this->fs->makeDirectory($pathname, 0777, true, true);
}

}
}
64 changes: 29 additions & 35 deletions src/IlluminateSnappyPdf.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<?php namespace Barryvdh\Snappy;
<?php

namespace Barryvdh\Snappy;

use Knp\Snappy\Pdf;
use Illuminate\Filesystem\Filesystem;
use Knp\Snappy\Pdf;

class IlluminateSnappyPdf extends Pdf {
class IlluminateSnappyPdf extends Pdf
{
/**
* @var \Illuminate\Filesystem\Filesystem
*/
protected $fs;
protected $fs;

/**
* @param \Illuminate\Filesystem\Filesystem
* @param string $binary
* @param array $options
*/
public function __construct(Filesystem $fs, $binary, array $options, array $env)
{
parent::__construct($binary, $options, $env);
/**
* @param \Illuminate\Filesystem\Filesystem
* @param string $binary
*/
public function __construct(Filesystem $fs, $binary, array $options, array $env)
{
parent::__construct($binary, $options, $env);

$this->fs = $fs;
}
$this->fs = $fs;
}

/**
* Wrapper for the "file_get_contents" function
*
* @param string $filename
*
* @param string $filename
* @return string
*/
protected function getFileContents($filename)
Expand All @@ -36,9 +37,8 @@ protected function getFileContents($filename)
/**
* Wrapper for the "file_exists" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function fileExists($filename)
{
Expand All @@ -48,9 +48,8 @@ protected function fileExists($filename)
/**
* Wrapper for the "is_file" method
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function isFile($filename)
{
Expand All @@ -60,9 +59,8 @@ protected function isFile($filename)
/**
* Wrapper for the "filesize" function
*
* @param string $filename
*
* @return integer or FALSE on failure
* @param string $filename
* @return int or FALSE on failure
*/
protected function filesize($filename)
{
Expand All @@ -72,9 +70,8 @@ protected function filesize($filename)
/**
* Wrapper for the "unlink" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function unlink($filename)
{
Expand All @@ -84,9 +81,8 @@ protected function unlink($filename)
/**
* Wrapper for the "is_dir" function
*
* @param string $filename
*
* @return boolean
* @param string $filename
* @return bool
*/
protected function isDir($filename)
{
Expand All @@ -96,13 +92,11 @@ protected function isDir($filename)
/**
* Wrapper for the mkdir function
*
* @param string $pathname
*
* @return boolean
* @param string $pathname
* @return bool
*/
protected function mkdir($pathname)
{
return $this->fs->makeDirectory($pathname, 0777, true, true);
}

}
Loading