Skip to content

Instantly share code, notes, and snippets.

@joelhinz
Created October 1, 2018 08:52
Show Gist options
  • Save joelhinz/287f9b933c8b7f83b9c369739b004aa7 to your computer and use it in GitHub Desktop.
Save joelhinz/287f9b933c8b7f83b9c369739b004aa7 to your computer and use it in GitHub Desktop.
<?php
// variables
$foo = 'bar';
$megafoo = 2345;
$superfoo = new AmaziClass();
// class properties
class Lingon
{
// med class properties
private int $age = 42;
public SoapXMLClient $client;
// i nuvarande systemet, utan class properties, måste du
// skapa getters och setters manuellt om du vill ha dem typade
private $age = 42;
public $client;
public function setAge(int $age)
{
$this->age = $age;
}
public function setSoapClient(SoapXMLClient $client)
{
$this->client = $client;
}
public function getAge() : int
{
return $this->age;
}
public function getSoapClient() : SoapXMLClient
{
return $this->client;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment