for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Balloon\Reader\Factory;
use Balloon\Reader\FileReader;
use Balloon\Reader\IFileReader;
/**
* Class FileReaderFactory
* @package Balloon\Reader\Factory
* @author Raphaël Lefebvre <[email protected]>
*/
class FileReaderFactory implements IFileReaderFactory
{
* @var bool
private $useIncludePath;
* @var resource
private $context;
* @param bool $useIncludePath
* @param resource $context
$context
resource|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
public function __construct($useIncludePath = false, $context = null)
$this->useIncludePath = $useIncludePath;
$this->context = $context;
}
* @param $filePath
* @return IFileReader
FileReader
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 create($filePath)
return new FileReader($filePath, $this->useIncludePath, $this->context);
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.