for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Parser
*
* @copyright Copyright (c) Vasil Dakov <[email protected]>
* @license http://opensource.org/licenses/MIT MIT
*/
namespace VasilDakov\Postcode;
use VasilDakov\Postcode\Postcode;
class Parser implements ParserInterface
{
* Constructor
* @param Postcode $postcode
public function __construct(Postcode $postcode)
$this->postcode = $postcode;
postcode
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;
}
* @return string $outward
public function outward() {}
* @return string $inward
public function inward() {}
* @return string $district
public function district() {}
* @return string $area
public function area() {}
* @return string $unit
public function unit() {}
* @return array
public function parse() {}
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: