Proxy pattern: Difference between revisions

Content deleted Content added
PHP: PHP-FIG PSR
PHP: Remove unnecessary phpDoc, clenaup code, use strict comparsion === null
Line 78:
{
private string $filename = null;
 
/**
* Constructor
* @param $filename
*/
public function __construct(string $filename)
{
Line 93 ⟶ 90:
private function loadImageFromDisk()
{
echo "Loading {$this->filename}" . \r\n"PHP_EOL;
}
 
Line 101 ⟶ 98:
public function displayImage()
{
echo "Displaying {$this->filename}" . \r\n"PHP_EOL;
}
}
Line 110 ⟶ 107:
private Image $image = null;
private string $filename = null;
 
/**
* Constructor
* @param $filename
*/
public function __construct(string $filename)
{
Line 124 ⟶ 118:
public function displayImage()
{
if ($this->image === null) {
$this->image = new RealImage($this->filename);
}