diff --git a/lib/Horde/Support/Array.php b/lib/Horde/Support/Array.php index 681bec9..001afec 100644 --- a/lib/Horde/Support/Array.php +++ b/lib/Horde/Support/Array.php @@ -1,7 +1,7 @@ backtrace); - $pad = strlen((string)$count); + $pad = strlen((string) $count); $map = ''; for ($i = $count - 1; $i >= 0; $i--) { - $map .= str_pad((string)($count - $i), $pad, ' ', STR_PAD_LEFT) . '. '; + $map .= str_pad((string) ($count - $i), $pad, ' ', STR_PAD_LEFT) . '. '; if (isset($this->backtrace[$i]['class'])) { $map .= $this->backtrace[$i]['class'] . $this->backtrace[$i]['type']; diff --git a/lib/Horde/Support/CaseInsensitiveArray.php b/lib/Horde/Support/CaseInsensitiveArray.php index 37d948d..2ff1a5b 100644 --- a/lib/Horde/Support/CaseInsensitiveArray.php +++ b/lib/Horde/Support/CaseInsensitiveArray.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD @@ -69,8 +69,8 @@ public function getFileObject() */ public function installWrapper() { - if (!in_array('horde-combine', stream_get_wrappers()) && - !stream_wrapper_register('horde-combine', 'Horde_Stream_Wrapper_Combine')) { + if (!in_array('horde-combine', stream_get_wrappers()) + && !stream_wrapper_register('horde-combine', 'Horde_Stream_Wrapper_Combine')) { throw new Exception('Unable to register horde-combine stream wrapper.'); } } diff --git a/lib/Horde/Support/ConsistentHash.php b/lib/Horde/Support/ConsistentHash.php index 81d1a10..ce1738f 100644 --- a/lib/Horde/Support/ConsistentHash.php +++ b/lib/Horde/Support/ConsistentHash.php @@ -6,7 +6,7 @@ * and also the original paper: * http://www8.org/w8-papers/2a-webserver/caching/paper2.html * - * Copyright 2007-2017 Horde LLC (http://www.horde.org/) + * Copyright 2007-2026 Horde LLC (http://www.horde.org/) * * @todo Ideas for future enhancement: * - provide a callback when a point is moved on the circle, so that the diff --git a/lib/Horde/Support/Guid.php b/lib/Horde/Support/Guid.php index 8b81c7f..3cd3bf4 100644 --- a/lib/Horde/Support/Guid.php +++ b/lib/Horde/Support/Guid.php @@ -7,7 +7,7 @@ * $uid = (string)new Horde_Support_Guid([$opts = array()]); * * - * Copyright 2009-2017 Horde LLC (http://www.horde.org/) + * Copyright 2009-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/lib/Horde/Support/Inflector.php b/lib/Horde/Support/Inflector.php index 3ab9b82..5be0136 100644 --- a/lib/Horde/Support/Inflector.php +++ b/lib/Horde/Support/Inflector.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD diff --git a/lib/Horde/Support/Numerizer/Locale/Base.php b/lib/Horde/Support/Numerizer/Locale/Base.php index 06cc6ff..b6b821a 100644 --- a/lib/Horde/Support/Numerizer/Locale/Base.php +++ b/lib/Horde/Support/Numerizer/Locale/Base.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD diff --git a/lib/Horde/Support/Numerizer/Locale/De.php b/lib/Horde/Support/Numerizer/Locale/De.php index cb79531..15f1389 100644 --- a/lib/Horde/Support/Numerizer/Locale/De.php +++ b/lib/Horde/Support/Numerizer/Locale/De.php @@ -1,7 +1,7 @@ * @author Jan Schneider diff --git a/lib/Horde/Support/Numerizer/Locale/Pt.php b/lib/Horde/Support/Numerizer/Locale/Pt.php index b998192..454bff2 100644 --- a/lib/Horde/Support/Numerizer/Locale/Pt.php +++ b/lib/Horde/Support/Numerizer/Locale/Pt.php @@ -1,7 +1,7 @@ * @category Horde diff --git a/lib/Horde/Support/Randomid.php b/lib/Horde/Support/Randomid.php index aba4a8d..911a8ff 100644 --- a/lib/Horde/Support/Randomid.php +++ b/lib/Horde/Support/Randomid.php @@ -8,7 +8,7 @@ * $id = (string)new Horde_Support_Randomid(); * * - * Copyright 2010-2017 Horde LLC (http://www.horde.org/) + * Copyright 2010-2026 Horde LLC (http://www.horde.org/) * * @author Michael Slusarz * @category Horde @@ -46,8 +46,8 @@ public function generate() if (function_exists('zend_thread_id')) { $elts[] = zend_thread_id(); } - if (function_exists('sys_getloadavg') && - ($loadavg = sys_getloadavg())) { + if (function_exists('sys_getloadavg') + && ($loadavg = sys_getloadavg())) { $elts = array_merge($elts, $loadavg); } if (function_exists('memory_get_usage')) { diff --git a/lib/Horde/Support/Stack.php b/lib/Horde/Support/Stack.php index a086d3c..e4003d7 100644 --- a/lib/Horde/Support/Stack.php +++ b/lib/Horde/Support/Stack.php @@ -3,7 +3,7 @@ /** * Simple class for using an array as a stack. * - * Copyright 2008-2017 Horde LLC (http://www.horde.org/) + * Copyright 2008-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/lib/Horde/Support/StringStream.php b/lib/Horde/Support/StringStream.php index 59a8335..4299add 100644 --- a/lib/Horde/Support/StringStream.php +++ b/lib/Horde/Support/StringStream.php @@ -1,7 +1,7 @@ * @category Horde @@ -82,8 +82,8 @@ public function getFileObject() */ public function installWrapper() { - if (!in_array(self::WNAME, stream_get_wrappers()) && - !stream_wrapper_register(self::WNAME, 'Horde_Stream_Wrapper_String')) { + if (!in_array(self::WNAME, stream_get_wrappers()) + && !stream_wrapper_register(self::WNAME, 'Horde_Stream_Wrapper_String')) { throw new Exception('Unable to register stream wrapper.'); } } diff --git a/lib/Horde/Support/Stub.php b/lib/Horde/Support/Stub.php index 4bea526..483191b 100644 --- a/lib/Horde/Support/Stub.php +++ b/lib/Horde/Support/Stub.php @@ -1,7 +1,7 @@ pop(); * * - * Copyright 1999-2017 Horde LLC (http://www.horde.org/) + * Copyright 1999-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/lib/Horde/Support/Uuid.php b/lib/Horde/Support/Uuid.php index 4558909..a832d6b 100644 --- a/lib/Horde/Support/Uuid.php +++ b/lib/Horde/Support/Uuid.php @@ -7,7 +7,7 @@ * $uuid = (string)new Horde_Support_Uuid; * * - * Copyright 2008-2017 Horde LLC (http://www.horde.org/) + * Copyright 2008-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd9744f..9a6e740 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,10 +11,11 @@ failOnPhpunitDeprecation="true" failOnRisky="true" failOnWarning="true" + defaultTestSuite="unit" colors="true"> - test/unit + test/Unit diff --git a/src/Backtrace.php b/src/Backtrace.php index 39995c2..0703e23 100644 --- a/src/Backtrace.php +++ b/src/Backtrace.php @@ -9,7 +9,7 @@ /** * Wrapper around backtraces providing utility methods. * - * Copyright 1999-2017 Horde LLC (http://www.horde.org/) + * Copyright 1999-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support @@ -150,10 +150,10 @@ public function getCallingContext() public function __toString() { $count = count($this->backtrace); - $pad = strlen((string)$count); + $pad = strlen((string) $count); $map = ''; for ($i = $count - 1; $i >= 0; $i--) { - $map .= str_pad((string)($count - $i), $pad, ' ', STR_PAD_LEFT) . '. '; + $map .= str_pad((string) ($count - $i), $pad, ' ', STR_PAD_LEFT) . '. '; if (isset($this->backtrace[$i]['class'])) { $map .= $this->backtrace[$i]['class'] . $this->backtrace[$i]['type']; diff --git a/src/CaseInsensitiveArray.php b/src/CaseInsensitiveArray.php index 4dc12d5..0f82ef3 100644 --- a/src/CaseInsensitiveArray.php +++ b/src/CaseInsensitiveArray.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD @@ -75,8 +75,8 @@ public function getFileObject() */ public function installWrapper() { - if (!in_array('horde-combine', stream_get_wrappers()) && - !stream_wrapper_register('horde-combine', 'Horde_Stream_Wrapper_Combine')) { + if (!in_array('horde-combine', stream_get_wrappers()) + && !stream_wrapper_register('horde-combine', 'Horde_Stream_Wrapper_Combine')) { throw new Exception('Unable to register horde-combine stream wrapper.'); } } diff --git a/src/ConsistentHash.php b/src/ConsistentHash.php index a99b32c..28b2c45 100644 --- a/src/ConsistentHash.php +++ b/src/ConsistentHash.php @@ -11,7 +11,7 @@ * and also the original paper: * http://www8.org/w8-papers/2a-webserver/caching/paper2.html * - * Copyright 2007-2017 Horde LLC (http://www.horde.org/) + * Copyright 2007-2026 Horde LLC (http://www.horde.org/) * * @todo Ideas for future enhancement: * - provide a callback when a point is moved on the circle, so that the diff --git a/src/Guid.php b/src/Guid.php index 1899542..bf6c348 100644 --- a/src/Guid.php +++ b/src/Guid.php @@ -9,7 +9,7 @@ * $uid = (string)new Horde_Support_Guid([$opts = array()]); * * - * Copyright 2009-2017 Horde LLC (http://www.horde.org/) + * Copyright 2009-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/src/HordeArray.php b/src/HordeArray.php index e2a68c3..b11e755 100644 --- a/src/HordeArray.php +++ b/src/HordeArray.php @@ -10,7 +10,7 @@ use ArrayIterator; /** - * Copyright 2007-2017 Horde LLC (http://www.horde.org/) + * Copyright 2007-2026 Horde LLC (http://www.horde.org/) * * @todo - Incorporate stuff from Horde_Array? * - http://docs.python.org/lib/typesmapping.html diff --git a/src/Inflector.php b/src/Inflector.php index 374c50f..bc8193c 100644 --- a/src/Inflector.php +++ b/src/Inflector.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD @@ -45,6 +45,6 @@ public static function factory($args = []) } } - return new \Horde\Support\Numerizer\Locale\Base($args); + return new Numerizer\Locale\Base($args); } } diff --git a/src/Numerizer/Locale/Base.php b/src/Numerizer/Locale/Base.php index 83e94cd..ae55da4 100644 --- a/src/Numerizer/Locale/Base.php +++ b/src/Numerizer/Locale/Base.php @@ -1,7 +1,7 @@ * @license http://www.horde.org/licenses/bsd BSD diff --git a/src/Numerizer/Locale/De.php b/src/Numerizer/Locale/De.php index 57e64b2..b21398e 100644 --- a/src/Numerizer/Locale/De.php +++ b/src/Numerizer/Locale/De.php @@ -1,7 +1,7 @@ * @author Jan Schneider diff --git a/src/Numerizer/Locale/Pt.php b/src/Numerizer/Locale/Pt.php index 64ad6a0..48e7fcd 100644 --- a/src/Numerizer/Locale/Pt.php +++ b/src/Numerizer/Locale/Pt.php @@ -1,7 +1,7 @@ * @category Horde diff --git a/src/Randomid.php b/src/Randomid.php index 9330ccd..084a7cd 100644 --- a/src/Randomid.php +++ b/src/Randomid.php @@ -14,7 +14,7 @@ * $id = (string)new Horde_Support_Randomid(); * * - * Copyright 2010-2017 Horde LLC (http://www.horde.org/) + * Copyright 2010-2026 Horde LLC (http://www.horde.org/) * * @author Michael Slusarz * @category Horde @@ -52,8 +52,8 @@ public function generate() if (function_exists('zend_thread_id')) { $elts[] = zend_thread_id(); } - if (function_exists('sys_getloadavg') && - ($loadavg = sys_getloadavg())) { + if (function_exists('sys_getloadavg') + && ($loadavg = sys_getloadavg())) { $elts = array_merge($elts, $loadavg); } if (function_exists('memory_get_usage')) { diff --git a/src/Stack.php b/src/Stack.php index b33a282..fb3d494 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -5,7 +5,7 @@ /** * Simple class for using an array as a stack. * - * Copyright 2008-2017 Horde LLC (http://www.horde.org/) + * Copyright 2008-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/src/StringStream.php b/src/StringStream.php index 5c708e7..aeb1bf4 100644 --- a/src/StringStream.php +++ b/src/StringStream.php @@ -1,7 +1,7 @@ * @category Horde @@ -88,8 +88,8 @@ public function getFileObject() */ public function installWrapper() { - if (!in_array(self::WNAME, stream_get_wrappers()) && - !stream_wrapper_register(self::WNAME, 'Horde_Stream_Wrapper_String')) { + if (!in_array(self::WNAME, stream_get_wrappers()) + && !stream_wrapper_register(self::WNAME, 'Horde_Stream_Wrapper_String')) { throw new Exception('Unable to register stream wrapper.'); } } diff --git a/src/Stub.php b/src/Stub.php index a94cd39..2e85652 100644 --- a/src/Stub.php +++ b/src/Stub.php @@ -1,7 +1,7 @@ pop(); * * - * Copyright 1999-2017 Horde LLC (http://www.horde.org/) + * Copyright 1999-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/src/Uuid.php b/src/Uuid.php index 3e54467..3c1f9b7 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -9,7 +9,7 @@ * $uuid = (string)new Horde_Support_Uuid; * * - * Copyright 2008-2017 Horde LLC (http://www.horde.org/) + * Copyright 2008-2026 Horde LLC (http://www.horde.org/) * * @category Horde * @package Support diff --git a/test/AllTests.php b/test/AllTests.php deleted file mode 100644 index 0695700..0000000 --- a/test/AllTests.php +++ /dev/null @@ -1,4 +0,0 @@ -run(); diff --git a/test/ArrayTest.php b/test/Unit/ArrayTest.php similarity index 96% rename from test/ArrayTest.php rename to test/Unit/ArrayTest.php index b53fd9f..e0ae3bc 100644 --- a/test/ArrayTest.php +++ b/test/Unit/ArrayTest.php @@ -1,7 +1,7 @@ update([]); - } catch (\Exception $e) { + } catch (Exception $e) { $thrown = $e; } $this->assertNull($thrown); @@ -161,7 +163,7 @@ public function testUpdateDoesNotThrowWhenArgumentIsTraversable() try { $o = new Horde_Support_Array(); $o->update(new ArrayObject()); - } catch (\Exception $e) { + } catch (Exception $e) { $thrown = $e; } $this->assertNull($thrown); diff --git a/test/BacktraceTest.php b/test/Unit/BacktraceTest.php similarity index 89% rename from test/BacktraceTest.php rename to test/Unit/BacktraceTest.php index ea4d48c..12cd63d 100644 --- a/test/BacktraceTest.php +++ b/test/Unit/BacktraceTest.php @@ -1,7 +1,7 @@ instanceMethod(), 0, 4)); $file = __FILE__; $this->assertStringContainsString('1. Horde\Support\Test\BacktraceTest->testToString()', (string) $backtrace); - $this->assertStringContainsString("2. Horde\Support\Test\BacktraceTest->instanceMethod() $file:92", (string) $backtrace); - $this->assertStringContainsString("3. Horde\Support\Test\BacktraceTest::staticMethod() $file:32", (string) $backtrace); - $this->assertStringContainsString("4. Horde\Support\Test\backtraceTestFunction() $file:37", (string) $backtrace); + $this->assertStringContainsString("2. Horde\Support\Test\BacktraceTest->instanceMethod() $file:97", (string) $backtrace); + $this->assertStringContainsString("3. Horde\Support\Test\BacktraceTest::staticMethod() $file:37", (string) $backtrace); + $this->assertStringContainsString("4. Horde\Support\Test\backtraceTestFunction() $file:42", (string) $backtrace); } public function returnBacktrace() diff --git a/test/CaseInsensitiveArrayTest.php b/test/Unit/CaseInsensitiveArrayTest.php similarity index 84% rename from test/CaseInsensitiveArrayTest.php rename to test/Unit/CaseInsensitiveArrayTest.php index ea9e30c..34d83a8 100644 --- a/test/CaseInsensitiveArrayTest.php +++ b/test/Unit/CaseInsensitiveArrayTest.php @@ -1,7 +1,7 @@ assertInstanceOf($interface, $o); } - public function implementsProvider() + public static function implementsProvider() { return [ ['ArrayAccess'], diff --git a/test/CombineStreamTest.php b/test/Unit/CombineStreamTest.php similarity index 89% rename from test/CombineStreamTest.php rename to test/Unit/CombineStreamTest.php index 09f22f0..93f8517 100644 --- a/test/CombineStreamTest.php +++ b/test/Unit/CombineStreamTest.php @@ -1,8 +1,7 @@ + * @author Ralf Lang */ declare(strict_types=1); diff --git a/test/InflectorTest.php b/test/Unit/InflectorTest.php similarity index 97% rename from test/InflectorTest.php rename to test/Unit/InflectorTest.php index 2acb6e8..80d9763 100644 --- a/test/InflectorTest.php +++ b/test/Unit/InflectorTest.php @@ -1,8 +1,7 @@