From ef128d37c9e7b469d666fab6cf325000df5b7092 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 6 May 2017 19:27:51 +0000 Subject: [PATCH] Apply fixes from StyleCI --- lib/danog/PrimeModule.php | 10 ++++++++-- tests/testing.php | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/danog/PrimeModule.php b/lib/danog/PrimeModule.php index b15e012..6f117da 100644 --- a/lib/danog/PrimeModule.php +++ b/lib/danog/PrimeModule.php @@ -185,13 +185,19 @@ class PrimeModule return $res; } + public static function native_single_cpp($what) { - if (!extension_loaded('primemodule')) return false; + if (!extension_loaded('primemodule')) { + return false; + } try { return factorize($what); - } catch (\Exception $e) { return false; } + } catch (\Exception $e) { + return false; + } } + public static function native_cpp($what) { $res = [self::native_single_cpp($what)]; diff --git a/tests/testing.php b/tests/testing.php index 0df091e..26dae88 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -32,7 +32,6 @@ function test($n) $GLOBALS['medium']['python_alt'] += $time; echo '| '.str_pad($result, 6, ' ', STR_PAD_RIGHT).' | python alt | '.str_pad($time, 20, ' ', STR_PAD_RIGHT).' |'.PHP_EOL; - list($time, $result) = get_time(['\danog\PrimeModule', 'python'], $n); $GLOBALS['medium']['python'] += $time; /*