for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Htsl\Parser;
use Htsl\Helper\TGetter;
////////////////////////////////////////////////////////////////
/**
* @property-read string $content Content of this section.
* @property-read string|null $name Name of this section.
*/
class Section
{
use TGetter;
* Section name.
*
* @access private
* @var string
private $name;
* Content.
private $content='';
This check looks for improperly formatted assignments.
Every assignment must have exactly one space before and one space after the equals operator.
To illustrate:
$a = "a"; $ab = "ab"; $abc = "abc";
will have no issues, while
will report issues in lines 1 and 2.
* Setting name and constructing instance of Section.
* @access public
* @param string | null $name
public function __construct( string$name=null )
$this->name = $name;
}
* Appending content to this section.
* @param string $content
* @return self
public function append( string$content ):self
$this->content.=$content;
return $this;
* Getting content of this section.
* @return string
public function getContent():string
return $this->content;
* Getting name of this section
* @return string | null
public function getName()#:string|null
return $this->name;
This check marks files that end in a newline character, i.e. an empy line.
This check looks for improperly formatted assignments.
Every assignment must have exactly one space before and one space after the equals operator.
To illustrate:
will have no issues, while
will report issues in lines 1 and 2.