From 557e9f48fb59194f581c6760f484aacb80d5d13d Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 8 May 2021 19:27:18 +0200 Subject: Fix return types for abstract class GeneratorBase. --- generate-sample-gig-data.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'generate-sample-gig-data.php') diff --git a/generate-sample-gig-data.php b/generate-sample-gig-data.php index bbc3e7d..cd18197 100644 --- a/generate-sample-gig-data.php +++ b/generate-sample-gig-data.php @@ -7,9 +7,9 @@ abstract class GeneratorBase { - abstract public function get(); + abstract public function get() : string; - function pick($arr) + function pick(array $arr) : string { return $arr[array_rand($arr)]; } @@ -51,10 +51,7 @@ class BandNameGenerator extends GeneratorBase "ed", ); - /** - * @return string - */ - public function get() + public function get() : string { $parts = array( $this->pick($this->prefixes), @@ -94,10 +91,7 @@ class VenueGenerator extends GeneratorBase "lighthouse" ); - /** - * @return string - */ - public function get() + public function get() : string { $parts = array( $this->pick($this->prefix1), @@ -113,7 +107,7 @@ class LinkGenerator extends GeneratorBase /** * @return string */ - public function get() + public function get() : string { return 'https://example.com/' . bin2hex(random_bytes(8)); } -- cgit v1.2.3