From b3af604cc18f1c2ec7571d62e2b4268848a05050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Tue, 23 Aug 2016 13:44:23 +0200 Subject: [PATCH] [core] remove useless static methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- lib/Bridge.php | 6 +----- lib/Format.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/Bridge.php b/lib/Bridge.php index cca4b5a..688c502 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -262,7 +262,7 @@ class Bridge{ * @return Bridge object dedicated */ static public function create($nameBridge){ - if( !static::isValidNameBridge($nameBridge) ){ + if( !preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameBridge)){ throw new \InvalidArgumentException('Name bridge must be at least one uppercase follow or not by alphanumeric or dash characters.'); } @@ -303,10 +303,6 @@ class Bridge{ return $dirBridge; } - static public function isValidNameBridge($nameBridge){ - return preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameBridge); - } - /** * Lists the available bridges. * @return array List of the bridges diff --git a/lib/Format.php b/lib/Format.php index a2ede6d..0391606 100644 --- a/lib/Format.php +++ b/lib/Format.php @@ -118,7 +118,7 @@ class Format{ } static public function create($nameFormat){ - if( !static::isValidNameFormat($nameFormat) ){ + if( !preg_match('@^[A-Z][a-zA-Z]*$@', $nameFormat)){ throw new \InvalidArgumentException('Name format must be at least one uppercase follow or not by alphabetic characters.'); } @@ -155,10 +155,6 @@ class Format{ return $dirFormat; } - static public function isValidNameFormat($nameFormat){ - return preg_match('@^[A-Z][a-zA-Z]*$@', $nameFormat); - } - /** * Read format dir and catch informations about each format depending annotation * @return array Informations about each format