for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FLAIRUK\GoodTillSystem\Models;
use FLAIRUK\GoodTillSystem\API;
use Illuminate\Support\Facades\Config;
class PaymentType extends API {
protected $url;
const PAYMENT_TYPES = 'ajax/payment_types';
/**
* Create a new GoodTill 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($user)
{
$this->user = $user;
user
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;
parent::__construct($user, $this->url);
}
public function setURL(): void {
$this->url = Config::get('goodtill.routes.api') . self::REGISTERS . '/';
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.