From f58cbefd1e36080452df905bcb7a268a31c1fc15 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Fri, 10 May 2019 22:13:11 +0200 Subject: [PATCH] revert scalar type hints to retain support for PHP < 7.0 --- lib/Model/AbstractModel.php | 4 ++-- lib/Model/Paste.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Model/AbstractModel.php b/lib/Model/AbstractModel.php index c7f367a7..87bf2b35 100644 --- a/lib/Model/AbstractModel.php +++ b/lib/Model/AbstractModel.php @@ -86,7 +86,7 @@ abstract class AbstractModel * @param string $id * @throws Exception */ - public function setId(string $id) + public function setId($id) { if (!self::isValidId($id)) { throw new Exception('Invalid paste ID.', 60); @@ -154,7 +154,7 @@ abstract class AbstractModel * @param string $id * @return bool */ - public static function isValidId(string $id) + public static function isValidId($id) { return (bool) preg_match('#\A[a-f\d]{16}\z#', (string) $id); } diff --git a/lib/Model/Paste.php b/lib/Model/Paste.php index a665f50a..dc9e9af1 100644 --- a/lib/Model/Paste.php +++ b/lib/Model/Paste.php @@ -136,7 +136,7 @@ class Paste extends AbstractModel * @throws Exception * @return Comment */ - public function getComment(string $parentId, string $commentId = '') + public function getComment($parentId, $commentId = '') { if (!$this->exists()) { throw new Exception('Invalid data.', 62);