for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package Fuel\FileSystem
* @version 2.0
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2015 Fuel Development Team
* @link http://fuelphp.com
*/
namespace Fuel\FileSystem;
class File extends Handler
{
* Returns the files contents
*
* @return string
public function getContents()
return file_get_contents($this->path);
}
* Appends data to a file
* @param string $data
* @return boolean
public function append($data)
$bites = file_put_contents($this->path, $data, FILE_APPEND | LOCK_EX);
return $bites !== false;
* Updates a file
public function update($data)
$bites = file_put_contents($this->path, $data, LOCK_EX);
* Copies a file
* @param string $destination
public function copyTo($destination)
return copy($this->path, $destination);
* Returns the file size
$destination
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
public function getSize()
return filesize($this->path);
* Returns the mime-type
public function getMimeType()
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $this->path);
finfo_close($finfo);
return $mime;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.