for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Balloon\Reader;
use Gaufrette\Filesystem;
/**
* Class GaufretteAdapter
* @package Balloon\Reader
* @author Raphaël Lefebvre <[email protected]>
*/
class GaufretteAdapter implements IFileReader
{
* @var Filesystem
private $gaufrette;
* @var string
private $filePath;
* @param Filesystem $gaufrette
* @param string $filePath
public function __construct(Filesystem $gaufrette, $filePath)
$this->gaufrette = $gaufrette;
$this->filePath = $filePath;
}
* @return mixed
string|boolean
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function read()
if(!$this->gaufrette->has($this->filePath)){
return '';
return $this->gaufrette->read($this->filePath);
* @param mixed $data
* @param int $mode
* @return int
integer|boolean
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public function write($data, $mode = 0)
if($mode & FILE_APPEND){
$data = $this->read() . $data;
$this->gaufrette->createFile($this->filePath);
return $this->gaufrette->write($this->filePath, $data, true);
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.