From a1c9392811e693834a71df4b399eee9812fb0702 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Mon, 6 Apr 2026 20:34:02 +0200 Subject: [PATCH 1/2] test: Modernize test suite and coverage attributes --- phpunit.xml.dist | 3 ++- test/AllTests.php | 4 ---- test/{ => Unit}/ArrayTest.php | 3 ++- test/{ => Unit}/BacktraceTest.php | 9 +++++---- test/{ => Unit}/CaseInsensitiveArrayTest.php | 10 +++++----- test/{ => Unit}/CombineStreamTest.php | 4 ++-- test/{ => Unit}/ConsistentHashTest.php | 4 ++-- test/{ => Unit}/GuidTest.php | 4 ++-- .../Helper/ConsistentHashInstrumented.php | 2 +- test/{ => Unit}/InflectorTest.php | 6 ++++-- test/{ => Unit}/MemoryTest.php | 4 ++-- test/{ => Unit}/Numerizer/Locale/BaseTest.php | 3 ++- test/{ => Unit}/Numerizer/Locale/DeTest.php | 3 ++- test/{ => Unit}/ObjectStubTest.php | 4 ++-- test/{ => Unit}/RandomidTest.php | 4 ++-- test/{ => Unit}/StackTest.php | 4 ++-- test/{ => Unit}/StringStreamTest.php | 4 ++-- test/{ => Unit}/StubTest.php | 4 ++-- test/{ => Unit}/TimerTest.php | 4 ++-- test/{ => Unit}/UuidTest.php | 4 ++-- test/bootstrap.php | 13 ------------- 21 files changed, 45 insertions(+), 55 deletions(-) delete mode 100644 test/AllTests.php rename test/{ => Unit}/ArrayTest.php (98%) rename test/{ => Unit}/BacktraceTest.php (91%) rename test/{ => Unit}/CaseInsensitiveArrayTest.php (87%) rename test/{ => Unit}/CombineStreamTest.php (93%) rename test/{ => Unit}/ConsistentHashTest.php (98%) rename test/{ => Unit}/GuidTest.php (93%) rename test/{ => Unit}/Helper/ConsistentHashInstrumented.php (94%) rename test/{ => Unit}/InflectorTest.php (98%) rename test/{ => Unit}/MemoryTest.php (94%) rename test/{ => Unit}/Numerizer/Locale/BaseTest.php (96%) rename test/{ => Unit}/Numerizer/Locale/DeTest.php (96%) rename test/{ => Unit}/ObjectStubTest.php (89%) rename test/{ => Unit}/RandomidTest.php (90%) rename test/{ => Unit}/StackTest.php (96%) rename test/{ => Unit}/StringStreamTest.php (92%) rename test/{ => Unit}/StubTest.php (95%) rename test/{ => Unit}/TimerTest.php (92%) rename test/{ => Unit}/UuidTest.php (90%) delete mode 100644 test/bootstrap.php 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/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 98% rename from test/ArrayTest.php rename to test/Unit/ArrayTest.php index b53fd9f..b075ca5 100644 --- a/test/ArrayTest.php +++ b/test/Unit/ArrayTest.php @@ -12,6 +12,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Array; use ArrayObject; @@ -20,8 +21,8 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing */ +#[CoversClass(Horde_Support_Array::class)] class ArrayTest extends TestCase { public function testImplementsArrayAccess() diff --git a/test/BacktraceTest.php b/test/Unit/BacktraceTest.php similarity index 91% rename from test/BacktraceTest.php rename to test/Unit/BacktraceTest.php index ea4d48c..2e51629 100644 --- a/test/BacktraceTest.php +++ b/test/Unit/BacktraceTest.php @@ -12,6 +12,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Backtrace; use Exception; @@ -25,8 +26,8 @@ function backtraceTestFunction() * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing */ +#[CoversClass(Horde_Support_Backtrace::class)] class BacktraceTest extends TestCase { // Keep these two methods on the top so that the line numbers don't change @@ -96,9 +97,9 @@ public function testToString() $backtrace = new Horde_Support_Backtrace(array_slice($this->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 87% rename from test/CaseInsensitiveArrayTest.php rename to test/Unit/CaseInsensitiveArrayTest.php index ea9e30c..75b9f16 100644 --- a/test/CaseInsensitiveArrayTest.php +++ b/test/Unit/CaseInsensitiveArrayTest.php @@ -13,6 +13,8 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Horde_Support_CaseInsensitiveArray; /** @@ -21,20 +23,18 @@ * @license http://www.horde.org/licenses/bsd * @package Support * @subpackage UnitTests - * @coversNothing */ +#[CoversClass(Horde_Support_CaseInsensitiveArray::class)] class CaseInsensitiveArrayTest extends TestCase { - /** - * @dataProvider implementsProvider - */ + #[DataProvider('implementsProvider')] public function testImplements($interface) { $o = new Horde_Support_CaseInsensitiveArray(); $this->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 93% rename from test/CombineStreamTest.php rename to test/Unit/CombineStreamTest.php index 09f22f0..5f8b7a0 100644 --- a/test/CombineStreamTest.php +++ b/test/Unit/CombineStreamTest.php @@ -2,7 +2,6 @@ /** * Copyright 2009-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_CombineStream; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_CombineStream::class)] */ class CombineStreamTest extends TestCase { diff --git a/test/ConsistentHashTest.php b/test/Unit/ConsistentHashTest.php similarity index 98% rename from test/ConsistentHashTest.php rename to test/Unit/ConsistentHashTest.php index 5c43fcd..3853e98 100644 --- a/test/ConsistentHashTest.php +++ b/test/Unit/ConsistentHashTest.php @@ -2,7 +2,6 @@ /** * Copyright 2008-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde\Support\Test\Helper\ConsistentHashInstrumented; use InvalidArgumentException; @@ -20,7 +20,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_ConsistentHash::class)] */ class ConsistentHashTest extends TestCase { diff --git a/test/GuidTest.php b/test/Unit/GuidTest.php similarity index 93% rename from test/GuidTest.php rename to test/Unit/GuidTest.php index 4b9aaa8..0505349 100644 --- a/test/GuidTest.php +++ b/test/Unit/GuidTest.php @@ -2,7 +2,6 @@ /** * Copyright 2010-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Guid; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Guid::class)] */ class GuidTest extends TestCase { diff --git a/test/Helper/ConsistentHashInstrumented.php b/test/Unit/Helper/ConsistentHashInstrumented.php similarity index 94% rename from test/Helper/ConsistentHashInstrumented.php rename to test/Unit/Helper/ConsistentHashInstrumented.php index 4fabd74..5de3e2a 100644 --- a/test/Helper/ConsistentHashInstrumented.php +++ b/test/Unit/Helper/ConsistentHashInstrumented.php @@ -7,7 +7,7 @@ * ConsistentHash does not expose the NodeCount though * Maybe we could find another way to observe correctness * - * @author Ralf Lang + * @author Ralf Lang */ declare(strict_types=1); diff --git a/test/InflectorTest.php b/test/Unit/InflectorTest.php similarity index 98% rename from test/InflectorTest.php rename to test/Unit/InflectorTest.php index 2acb6e8..cd9dea8 100644 --- a/test/InflectorTest.php +++ b/test/Unit/InflectorTest.php @@ -2,7 +2,6 @@ /** * Copyright 2007-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Inflector; /** @@ -19,10 +19,12 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Inflector::class)] */ class InflectorTest extends TestCase { + private Horde_Support_Inflector $inflector; + /** * Words to test * diff --git a/test/MemoryTest.php b/test/Unit/MemoryTest.php similarity index 94% rename from test/MemoryTest.php rename to test/Unit/MemoryTest.php index bbd25df..cbd9381 100644 --- a/test/MemoryTest.php +++ b/test/Unit/MemoryTest.php @@ -2,7 +2,6 @@ /** * Copyright 2011-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Memory; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Memory::class)] */ class MemoryTest extends TestCase { diff --git a/test/Numerizer/Locale/BaseTest.php b/test/Unit/Numerizer/Locale/BaseTest.php similarity index 96% rename from test/Numerizer/Locale/BaseTest.php rename to test/Unit/Numerizer/Locale/BaseTest.php index f1815f5..9a0d769 100644 --- a/test/Numerizer/Locale/BaseTest.php +++ b/test/Unit/Numerizer/Locale/BaseTest.php @@ -10,13 +10,14 @@ use Numerizer\Locale; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Numerizer; /** * @category Horde * @package Support * @subpackage UnitTests - * @coversNothing +#[CoversClass(Horde_Support_Numerizer_Locale_Base::class)] */ class BaseTest extends TestCase { diff --git a/test/Numerizer/Locale/DeTest.php b/test/Unit/Numerizer/Locale/DeTest.php similarity index 96% rename from test/Numerizer/Locale/DeTest.php rename to test/Unit/Numerizer/Locale/DeTest.php index a27c370..0de2f68 100644 --- a/test/Numerizer/Locale/DeTest.php +++ b/test/Unit/Numerizer/Locale/DeTest.php @@ -9,13 +9,14 @@ namespace Horde\Support\Test\Numerizer\Locale; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Numerizer; /** * @category Horde * @package Support * @subpackage UnitTests - * @coversNothing +#[CoversClass(Horde_Support_Numerizer_Locale_De::class)] */ class DeTest extends TestCase { diff --git a/test/ObjectStubTest.php b/test/Unit/ObjectStubTest.php similarity index 89% rename from test/ObjectStubTest.php rename to test/Unit/ObjectStubTest.php index fdb6714..be99ba3 100644 --- a/test/ObjectStubTest.php +++ b/test/Unit/ObjectStubTest.php @@ -2,7 +2,6 @@ /** * Copyright 2012-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_ObjectStub; use stdClass; @@ -20,7 +20,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_ObjectStub::class)] */ class ObjectStubTest extends TestCase { diff --git a/test/RandomidTest.php b/test/Unit/RandomidTest.php similarity index 90% rename from test/RandomidTest.php rename to test/Unit/RandomidTest.php index bc0dd03..b7896ea 100644 --- a/test/RandomidTest.php +++ b/test/Unit/RandomidTest.php @@ -2,7 +2,6 @@ /** * Copyright 2010-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Randomid; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Randomid::class)] */ class RandomidTest extends TestCase { diff --git a/test/StackTest.php b/test/Unit/StackTest.php similarity index 96% rename from test/StackTest.php rename to test/Unit/StackTest.php index eaf2a06..7c82003 100644 --- a/test/StackTest.php +++ b/test/Unit/StackTest.php @@ -2,7 +2,6 @@ /** * Copyright 2007-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Stack; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Stack::class)] */ class StackTest extends TestCase { diff --git a/test/StringStreamTest.php b/test/Unit/StringStreamTest.php similarity index 92% rename from test/StringStreamTest.php rename to test/Unit/StringStreamTest.php index 12bacea..a96b997 100644 --- a/test/StringStreamTest.php +++ b/test/Unit/StringStreamTest.php @@ -2,7 +2,6 @@ /** * Copyright 2008-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_StringStream; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_StringStream::class)] */ class StringStreamTest extends TestCase { diff --git a/test/StubTest.php b/test/Unit/StubTest.php similarity index 95% rename from test/StubTest.php rename to test/Unit/StubTest.php index edffc2c..39904c1 100644 --- a/test/StubTest.php +++ b/test/Unit/StubTest.php @@ -2,7 +2,6 @@ /** * Copyright 2008-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Stub; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Stub::class)] */ class StubTest extends TestCase { diff --git a/test/TimerTest.php b/test/Unit/TimerTest.php similarity index 92% rename from test/TimerTest.php rename to test/Unit/TimerTest.php index bfba0ef..2260063 100644 --- a/test/TimerTest.php +++ b/test/Unit/TimerTest.php @@ -2,7 +2,6 @@ /** * Copyright 2009-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Timer; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Timer::class)] */ class TimerTest extends TestCase { diff --git a/test/UuidTest.php b/test/Unit/UuidTest.php similarity index 90% rename from test/UuidTest.php rename to test/Unit/UuidTest.php index a20b225..5108219 100644 --- a/test/UuidTest.php +++ b/test/Unit/UuidTest.php @@ -2,7 +2,6 @@ /** * Copyright 2010-2017 Horde LLC (http://www.horde.org/) - * * @category Horde * @package Support * @subpackage UnitTests @@ -12,6 +11,7 @@ namespace Horde\Support\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Horde_Support_Uuid; /** @@ -19,7 +19,7 @@ * @package Support * @subpackage UnitTests * @license http://www.horde.org/licenses/bsd - * @coversNothing +#[CoversClass(Horde_Support_Uuid::class)] */ class UuidTest extends TestCase { diff --git a/test/bootstrap.php b/test/bootstrap.php deleted file mode 100644 index 88f2d9b..0000000 --- a/test/bootstrap.php +++ /dev/null @@ -1,13 +0,0 @@ - Date: Mon, 6 Apr 2026 20:34:55 +0200 Subject: [PATCH 2/2] style: php-cs-fixer --- lib/Horde/Support/Array.php | 2 +- lib/Horde/Support/Backtrace.php | 6 +++--- lib/Horde/Support/CaseInsensitiveArray.php | 2 +- lib/Horde/Support/CombineStream.php | 6 +++--- lib/Horde/Support/ConsistentHash.php | 2 +- lib/Horde/Support/Guid.php | 2 +- lib/Horde/Support/Inflector.php | 6 +++--- lib/Horde/Support/Memory.php | 2 +- lib/Horde/Support/Numerizer.php | 2 +- lib/Horde/Support/Numerizer/Locale/Base.php | 2 +- lib/Horde/Support/Numerizer/Locale/De.php | 2 +- lib/Horde/Support/Numerizer/Locale/Pt.php | 2 +- lib/Horde/Support/ObjectStub.php | 2 +- lib/Horde/Support/Randomid.php | 6 +++--- lib/Horde/Support/Stack.php | 2 +- lib/Horde/Support/StringStream.php | 6 +++--- lib/Horde/Support/Stub.php | 2 +- lib/Horde/Support/Timer.php | 2 +- lib/Horde/Support/Uuid.php | 2 +- src/Backtrace.php | 6 +++--- src/CaseInsensitiveArray.php | 2 +- src/CombineStream.php | 6 +++--- src/ConsistentHash.php | 2 +- src/Guid.php | 2 +- src/HordeArray.php | 2 +- src/Inflector.php | 6 +++--- src/Memory.php | 2 +- src/Numerizer.php | 4 ++-- src/Numerizer/Locale/Base.php | 2 +- src/Numerizer/Locale/De.php | 2 +- src/Numerizer/Locale/Pt.php | 2 +- src/ObjectStub.php | 2 +- src/Randomid.php | 6 +++--- src/Stack.php | 2 +- src/StringStream.php | 6 +++--- src/Stub.php | 2 +- src/Timer.php | 2 +- src/Uuid.php | 2 +- test/Unit/ArrayTest.php | 7 ++++--- test/Unit/BacktraceTest.php | 2 +- test/Unit/CaseInsensitiveArrayTest.php | 2 +- test/Unit/CombineStreamTest.php | 3 ++- test/Unit/ConsistentHashTest.php | 3 ++- test/Unit/GuidTest.php | 3 ++- test/Unit/InflectorTest.php | 3 ++- test/Unit/MemoryTest.php | 3 ++- test/Unit/Numerizer/Locale/BaseTest.php | 1 + test/Unit/Numerizer/Locale/DeTest.php | 1 + test/Unit/ObjectStubTest.php | 3 ++- test/Unit/RandomidTest.php | 3 ++- test/Unit/StackTest.php | 3 ++- test/Unit/StringStreamTest.php | 3 ++- test/Unit/StubTest.php | 3 ++- test/Unit/TimerTest.php | 3 ++- test/Unit/UuidTest.php | 3 ++- 55 files changed, 91 insertions(+), 76 deletions(-) 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/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/Unit/ArrayTest.php b/test/Unit/ArrayTest.php index b075ca5..e0ae3bc 100644 --- a/test/Unit/ArrayTest.php +++ b/test/Unit/ArrayTest.php @@ -1,7 +1,7 @@ update([]); - } catch (\Exception $e) { + } catch (Exception $e) { $thrown = $e; } $this->assertNull($thrown); @@ -162,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/Unit/BacktraceTest.php b/test/Unit/BacktraceTest.php index 2e51629..12cd63d 100644 --- a/test/Unit/BacktraceTest.php +++ b/test/Unit/BacktraceTest.php @@ -1,7 +1,7 @@