Created
October 1, 2018 08:52
-
-
Save joelhinz/287f9b933c8b7f83b9c369739b004aa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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