for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package s9e\TextFormatter
* @copyright Copyright (c) 2010-2019 The s9e Authors
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace s9e\TextFormatter\Configurator\RecursiveParser;
use s9e\TextFormatter\Configurator\RecursiveParser;
abstract class AbstractRecursiveMatcher implements MatcherInterface
{
* @param RecursiveParser $parser
* @return void
public function __construct(RecursiveParser $parser)
$this->parser = $parser;
parser
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Parse given string and return its value
*
* @param string $str
* @param string $restrict Pipe-separated list of allowed matches (ignored if empty)
* @return mixed
protected function recurse(string $str, string $restrict = '')
return $this->parser->parse($str, $restrict)['value'];
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: