for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the NeedleProject\FileIo package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NeedleProject\FileIo\Content;
* Class Content
* @package NeedleProject\FileIo\Content
* @author Adrian Tilita <[email protected]>
* @copyright 2017 Adrian Tilita
* @license https://opensource.org/licenses/MIT MIT Licence
class Content implements ContentInterface
{
* @var null|string
private $content = null;
* Content constructor.
* @param string $content
public function __construct($content)
$this->content = $content;
}
* @return string
null|string
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 get()
return $this->content;
* Return the content as an array
* @return array
array<null|string>
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
* @throws \NeedleProject\FileIo\Exception\ContentException
public function getArray()
return [$this->content];
* @return mixed|\stdClass
public function getObject()
return (object)['content' => $this->content];
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.