<?php require "vendor/autoload.php"; use Facepunch\Facepunch as FacepunchController; class ExampleClass { protected $facepunch; public function __construct() { $this->facepunch = new FacepunchController(); } public function getUsername($userid) { $this->facepunch->setUserID($userid); if (!$this->facepunch->isUserValid()) { return false; } return $this->facepunch->getUsername(); } } //Create Class $example = new ExampleClass(); //Echo it out echo $example->getUsername('1');