for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace vipnytt\RobotsTxtParser\Directives;
use vipnytt\RobotsTxtParser\UrlToolbox;
/**
* Class Sitemap
*
* @package vipnytt\RobotsTxtParser\Directives
*/
class Sitemap implements DirectiveInterface
{
use UrlToolbox;
* Directive
const DIRECTIVE = 'Sitemap';
protected $parent;
protected $array = [];
public function __construct($array, $parent = null)
$this->array = $array;
$array
string
array
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* Add
* @param string $line
* @return bool
public function add($line)
if (
!$this->urlValidate(($url = $this->urlEncode($line))) ||
in_array($url, $this->array)
) {
return false;
$this->array[] = $url;
return true;
public function export()
return empty($this->array) ? [] : [self::DIRECTIVE => $this->array];
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..