for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Acacha\ForgePublish\Exceptions;
use Exception;
/**
* Class EnvironemntVariableNotFoundException
* @package Acacha\ForgePublish\Exceptions
*/
class EnvironmentVariableNotFoundException extends Exception
{
* The output returned from the operation.
*
* @var array
public $output;
* Create a new exception instance.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct($env_var)
parent::__construct('Environment variable not found: ' . $env_var);
$this->env_var = $env_var;
env_var
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 array
public function output()
return $this->output;
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.