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 Sale extends API {
protected $url;
/**
* 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($url = null): void {
$this->url = $url ? $url : Config::get('goodtill.routes.api') . 'sales/';
* Product Set Outlet ID
* @param $id
* @return object
public function summary($name): object {
$this->product_name = ['product_name' => $name];
product_name
// $this->product_name = array_merge($this->payload, ['product_name' => $name ]);
return $this;
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.