From ba16c036275ad296191f10a06b9f1c616b64a7e7 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 3 Dec 2025 10:25:34 +0100 Subject: [PATCH 1/2] merged some tests --- .../Type.fromReflection.function.80.phpt | 42 ------------------- tests/Utils/Type.fromReflection.function.phpt | 12 ++++++ .../Type.fromReflection.property.74.phpt | 36 ---------------- tests/Utils/Type.fromReflection.property.phpt | 24 +++++++++++ 4 files changed, 36 insertions(+), 78 deletions(-) delete mode 100644 tests/Utils/Type.fromReflection.function.80.phpt delete mode 100644 tests/Utils/Type.fromReflection.property.74.phpt diff --git a/tests/Utils/Type.fromReflection.function.80.phpt b/tests/Utils/Type.fromReflection.function.80.phpt deleted file mode 100644 index 7a4d35dfd..000000000 --- a/tests/Utils/Type.fromReflection.function.80.phpt +++ /dev/null @@ -1,42 +0,0 @@ -getNames()); -Assert::same('string', (string) $type); - - -$type = Type::fromReflection(new ReflectionFunction(function (): ?string {})); - -Assert::same(['string', 'null'], $type->getNames()); -Assert::same('?string', (string) $type); - - -$type = Type::fromReflection(new ReflectionFunction(function (): Foo {})); - -Assert::same(['Foo'], $type->getNames()); -Assert::same('Foo', (string) $type); - - -$type = Type::fromReflection(new ReflectionFunction(function (): Foo|string {})); - -Assert::same(['Foo', 'string'], $type->getNames()); -Assert::same('Foo|string', (string) $type); - - -$type = Type::fromReflection(new ReflectionFunction(function (): mixed {})); - -Assert::same(['mixed'], $type->getNames()); -Assert::same('mixed', (string) $type); diff --git a/tests/Utils/Type.fromReflection.function.phpt b/tests/Utils/Type.fromReflection.function.phpt index b179fab54..fea85b208 100644 --- a/tests/Utils/Type.fromReflection.function.phpt +++ b/tests/Utils/Type.fromReflection.function.phpt @@ -24,3 +24,15 @@ $type = Type::fromReflection(new ReflectionFunction(function (): Foo {})); Assert::same(['Foo'], $type->getNames()); Assert::same('Foo', (string) $type); + + +$type = Type::fromReflection(new ReflectionFunction(function (): Foo|string {})); + +Assert::same(['Foo', 'string'], $type->getNames()); +Assert::same('Foo|string', (string) $type); + + +$type = Type::fromReflection(new ReflectionFunction(function (): mixed {})); + +Assert::same(['mixed'], $type->getNames()); +Assert::same('mixed', (string) $type); diff --git a/tests/Utils/Type.fromReflection.property.74.phpt b/tests/Utils/Type.fromReflection.property.74.phpt deleted file mode 100644 index 2563c4ef2..000000000 --- a/tests/Utils/Type.fromReflection.property.74.phpt +++ /dev/null @@ -1,36 +0,0 @@ -getProperty('foo')); - -Assert::same(['string'], $type->getNames()); -Assert::same('string', (string) $type); - - -$type = Type::fromReflection((new ReflectionObject(new class { - public ?string $foo; -}))->getProperty('foo')); - -Assert::same(['string', 'null'], $type->getNames()); -Assert::same('?string', (string) $type); - - -$type = Type::fromReflection((new ReflectionObject(new class { - public Foo $foo; -}))->getProperty('foo')); - -Assert::same(['Foo'], $type->getNames()); -Assert::same('Foo', (string) $type); diff --git a/tests/Utils/Type.fromReflection.property.phpt b/tests/Utils/Type.fromReflection.property.phpt index d287d2238..dd4ce2b39 100644 --- a/tests/Utils/Type.fromReflection.property.phpt +++ b/tests/Utils/Type.fromReflection.property.phpt @@ -12,3 +12,27 @@ $type = Type::fromReflection((new ReflectionObject(new class { public $foo; }))->getProperty('foo')); Assert::null($type); + + +$type = Type::fromReflection((new ReflectionObject(new class { + public string $foo; +}))->getProperty('foo')); + +Assert::same(['string'], $type->getNames()); +Assert::same('string', (string) $type); + + +$type = Type::fromReflection((new ReflectionObject(new class { + public ?string $foo; +}))->getProperty('foo')); + +Assert::same(['string', 'null'], $type->getNames()); +Assert::same('?string', (string) $type); + + +$type = Type::fromReflection((new ReflectionObject(new class { + public Foo $foo; +}))->getProperty('foo')); + +Assert::same(['Foo'], $type->getNames()); +Assert::same('Foo', (string) $type); From 64a39bdf422182113d799ed244c3084679b1e186 Mon Sep 17 00:00:00 2001 From: David Grudl Date: 2026年2月23日 02:47:17 +0100 Subject: [PATCH 2/2] singleline declare statements --- .phpstorm.meta.php | 4 +--- src/HtmlStringable.php | 4 +--- src/Iterators/CachingIterator.php | 4 +--- src/Iterators/Mapper.php | 4 +--- src/SmartObject.php | 4 +--- src/StaticClass.php | 4 +--- src/Translator.php | 4 +--- src/Utils/ArrayHash.php | 4 +--- src/Utils/ArrayList.php | 4 +--- src/Utils/Arrays.php | 4 +--- src/Utils/Callback.php | 4 +--- src/Utils/DateTime.php | 4 +--- src/Utils/FileInfo.php | 4 +--- src/Utils/FileSystem.php | 4 +--- src/Utils/Finder.php | 4 +--- src/Utils/Floats.php | 4 +--- src/Utils/Helpers.php | 4 +--- src/Utils/Html.php | 4 +--- src/Utils/Image.php | 4 +--- src/Utils/ImageColor.php | 4 +--- src/Utils/ImageType.php | 4 +--- src/Utils/Iterables.php | 4 +--- src/Utils/Json.php | 4 +--- src/Utils/ObjectHelpers.php | 4 +--- src/Utils/Paginator.php | 4 +--- src/Utils/Random.php | 4 +--- src/Utils/Reflection.php | 4 +--- src/Utils/ReflectionMethod.php | 4 +--- src/Utils/Strings.php | 4 +--- src/Utils/Type.php | 4 +--- src/Utils/Validators.php | 4 +--- src/Utils/exceptions.php | 4 +--- src/compatibility.php | 4 +--- src/exceptions.php | 4 +--- tests/Iterators/CachingIterator.basic.phpt | 4 +--- tests/Iterators/CachingIterator.construct.phpt | 4 +--- tests/Iterators/CachingIterator.width.phpt | 4 +--- tests/Iterators/Mapper.phpt | 4 +--- tests/Utils/ArrayHash.phpt | 4 +--- tests/Utils/ArrayList.phpt | 4 +--- tests/Utils/Arrays.associate().error.phpt | 4 +--- tests/Utils/Arrays.associate().phpt | 4 +--- tests/Utils/Arrays.contains().phpt | 4 +--- tests/Utils/Arrays.every().phpt | 4 +--- tests/Utils/Arrays.filter().phpt | 4 +--- tests/Utils/Arrays.first().phpt | 4 +--- tests/Utils/Arrays.firstKey().phpt | 4 +--- tests/Utils/Arrays.flatten().phpt | 4 +--- tests/Utils/Arrays.get().phpt | 4 +--- tests/Utils/Arrays.getKeyOffset().phpt | 4 +--- tests/Utils/Arrays.getRef().phpt | 4 +--- tests/Utils/Arrays.grep().errors.phpt | 4 +--- tests/Utils/Arrays.grep().phpt | 4 +--- tests/Utils/Arrays.insertBefore().phpt | 4 +--- tests/Utils/Arrays.invoke.phpt | 4 +--- tests/Utils/Arrays.invokeMethod.phpt | 4 +--- tests/Utils/Arrays.isList.phpt | 4 +--- tests/Utils/Arrays.last().phpt | 4 +--- tests/Utils/Arrays.lastKey().phpt | 4 +--- tests/Utils/Arrays.map().phpt | 4 +--- tests/Utils/Arrays.mapWithKeys().phpt | 4 +--- tests/Utils/Arrays.normalize.phpt | 4 +--- tests/Utils/Arrays.pick().phpt | 4 +--- tests/Utils/Arrays.renameKey().phpt | 4 +--- tests/Utils/Arrays.renameKey().ref.phpt | 4 +--- tests/Utils/Arrays.some().phpt | 4 +--- tests/Utils/Arrays.toKey.phpt | 4 +--- tests/Utils/Arrays.toObject.phpt | 4 +--- tests/Utils/Arrays.wrap().phpt | 4 +--- tests/Utils/Callback.check.phpt | 4 +--- tests/Utils/Callback.closure.phpt | 4 +--- tests/Utils/Callback.invokeSafe.phpt | 4 +--- tests/Utils/DateTime.JSON.phpt | 4 +--- tests/Utils/DateTime.construct.phpt | 4 +--- tests/Utils/DateTime.createFromFormat.phpt | 4 +--- tests/Utils/DateTime.from.phpt | 4 +--- tests/Utils/DateTime.fromParts.phpt | 4 +--- tests/Utils/DateTime.modify.phpt | 4 +--- tests/Utils/DateTime.modifyClone.phpt | 4 +--- tests/Utils/DateTime.relativeToSeconds.phpt | 4 +--- tests/Utils/DateTime.setDateTime.phpt | 4 +--- tests/Utils/FileSystem.copy.phpt | 4 +--- tests/Utils/FileSystem.createDir.phpt | 4 +--- tests/Utils/FileSystem.delete.phpt | 4 +--- tests/Utils/FileSystem.isAbsolute.phpt | 4 +--- tests/Utils/FileSystem.joinPaths.phpt | 4 +--- tests/Utils/FileSystem.makeWritable.phpt | 4 +--- tests/Utils/FileSystem.normalizePath.phpt | 4 +--- tests/Utils/FileSystem.open.phpt | 4 +--- tests/Utils/FileSystem.platformSlashes.phpt | 4 +--- tests/Utils/FileSystem.read-write.phpt | 4 +--- tests/Utils/FileSystem.readLines.phpt | 4 +--- tests/Utils/FileSystem.rename.phpt | 4 +--- tests/Utils/FileSystem.resolvePath.phpt | 4 +--- tests/Utils/FileSystem.unixSlashes.phpt | 4 +--- tests/Utils/Finder.append.phpt | 4 +--- tests/Utils/Finder.basic.phpt | 4 +--- tests/Utils/Finder.errors.phpt | 4 +--- tests/Utils/Finder.fileInfo.phpt | 4 +--- tests/Utils/Finder.filters.phpt | 4 +--- tests/Utils/Finder.mask.phpt | 4 +--- tests/Utils/Finder.multiple.phpt | 4 +--- tests/Utils/Finder.phar.phpt | 4 +--- tests/Utils/Finder.sort.phpt | 4 +--- tests/Utils/Floats.areEqual().phpt | 4 +--- tests/Utils/Floats.compare().phpt | 4 +--- tests/Utils/Floats.isGreaterThan().phpt | 4 +--- tests/Utils/Floats.isGreaterThanOrEqualTo().phpt | 4 +--- tests/Utils/Floats.isInteger().phpt | 4 +--- tests/Utils/Floats.isLessThan().phpt | 4 +--- tests/Utils/Floats.isLessThanOrEqualTo().phpt | 4 +--- tests/Utils/Floats.isZero().phpt | 4 +--- tests/Utils/Helpers.capture().phpt | 4 +--- tests/Utils/Helpers.clamp().phpt | 4 +--- tests/Utils/Helpers.compare().phpt | 4 +--- tests/Utils/Helpers.falseToNull().phpt | 4 +--- tests/Utils/Helpers.getLastError().phpt | 4 +--- tests/Utils/Helpers.getSuggestion().phpt | 4 +--- tests/Utils/Helpers.splitClassName().phpt | 4 +--- tests/Utils/Html.basic.phpt | 4 +--- tests/Utils/Html.children.phpt | 4 +--- tests/Utils/Html.construct.phpt | 4 +--- tests/Utils/Html.data.phpt | 4 +--- tests/Utils/Html.style.phpt | 4 +--- tests/Utils/Image.alpha1.phpt | 4 +--- tests/Utils/Image.alpha2.phpt | 4 +--- tests/Utils/Image.clone.phpt | 4 +--- tests/Utils/Image.color.phpt | 4 +--- tests/Utils/Image.drawing.phpt | 4 +--- tests/Utils/Image.factories.phpt | 4 +--- tests/Utils/Image.isTypeSupported.phpt | 4 +--- tests/Utils/Image.place.phpt | 4 +--- tests/Utils/Image.resize.phpt | 4 +--- tests/Utils/Image.save.phpt | 4 +--- tests/Utils/Image.send.phpt | 4 +--- tests/Utils/Iterables.contains().phpt | 4 +--- tests/Utils/Iterables.containsKey().phpt | 4 +--- tests/Utils/Iterables.every().phpt | 4 +--- tests/Utils/Iterables.filter().phpt | 4 +--- tests/Utils/Iterables.first().phpt | 4 +--- tests/Utils/Iterables.firstKey().phpt | 4 +--- tests/Utils/Iterables.map().phpt | 4 +--- tests/Utils/Iterables.mapWithKeys().phpt | 4 +--- tests/Utils/Iterables.memoize().phpt | 4 +--- tests/Utils/Iterables.repeatable().phpt | 4 +--- tests/Utils/Iterables.some().phpt | 4 +--- tests/Utils/Iterables.toIterator().phpt | 4 +--- tests/Utils/Json.decode().phpt | 4 +--- tests/Utils/Json.encode().phpt | 4 +--- tests/Utils/ObjectHelpers.getMagicProperites().phpt | 4 +--- tests/Utils/ObjectHelpers.getSuggestion().phpt | 4 +--- tests/Utils/ObjectHelpers.strictness.phpt | 4 +--- tests/Utils/Paginator.phpt | 4 +--- tests/Utils/Random.generate().phpt | 4 +--- tests/Utils/Reflection.expandClassName.phpt | 4 +--- tests/Utils/Reflection.getDeclaringMethod.alias.phpt | 4 +--- tests/Utils/Reflection.getDeclaringMethod.insteadof.phpt | 4 +--- tests/Utils/Reflection.getDeclaringMethod.overwrite.phpt | 4 +--- tests/Utils/Reflection.getDeclaringMethod.phpt | 4 +--- tests/Utils/Reflection.getParameterDefaultValue.phpt | 4 +--- .../Utils/Reflection.getPropertyDeclaringClass.overwrite.phpt | 4 +--- .../Reflection.getPropertyDeclaringClass.overwrite2.phpt | 4 +--- tests/Utils/Reflection.getPropertyDeclaringClass.phpt | 4 +--- tests/Utils/Reflection.groupUseStatements.phpt | 4 +--- tests/Utils/Reflection.nonClassUseStatements.phpt | 4 +--- tests/Utils/Reflection.toString.phpt | 4 +--- tests/Utils/SmartObject.arrayProperty.phpt | 4 +--- tests/Utils/SmartObject.events.phpt | 4 +--- tests/Utils/SmartObject.property.inheritance.phpt | 4 +--- tests/Utils/SmartObject.property.phpt | 4 +--- tests/Utils/SmartObject.referenceProperty.phpt | 4 +--- tests/Utils/SmartObject.undeclaredMethod.annotation.phpt | 4 +--- tests/Utils/SmartObject.undeclaredMethod.hints.phpt | 4 +--- tests/Utils/SmartObject.undeclaredMethod.phpt | 4 +--- tests/Utils/SmartObject.unsetProperty.phpt | 4 +--- tests/Utils/StaticClass.phpt | 4 +--- tests/Utils/Strings.Regexp.errors.backtrack.phpt | 4 +--- tests/Utils/Strings.Regexp.errors.compilation.phpt | 4 +--- tests/Utils/Strings.Regexp.errors.utf8.phpt | 4 +--- tests/Utils/Strings.after().phpt | 4 +--- tests/Utils/Strings.before().phpt | 4 +--- tests/Utils/Strings.checkEncoding().phpt | 4 +--- tests/Utils/Strings.chr().phpt | 4 +--- tests/Utils/Strings.compare().phpt | 4 +--- tests/Utils/Strings.contains().phpt | 4 +--- tests/Utils/Strings.convertCase.phpt | 4 +--- tests/Utils/Strings.endsWith().phpt | 4 +--- tests/Utils/Strings.findPrefix().phpt | 4 +--- tests/Utils/Strings.fixEncoding().phpt | 4 +--- tests/Utils/Strings.indent().phpt | 4 +--- tests/Utils/Strings.indexOf().phpt | 4 +--- tests/Utils/Strings.length().phpt | 4 +--- tests/Utils/Strings.match().phpt | 4 +--- tests/Utils/Strings.matchAll().phpt | 4 +--- tests/Utils/Strings.matchAll.lazy().phpt | 4 +--- tests/Utils/Strings.normalize().phpt | 4 +--- tests/Utils/Strings.normalizeNewLines().phpt | 4 +--- tests/Utils/Strings.ord().phpt | 4 +--- tests/Utils/Strings.pad.phpt | 4 +--- tests/Utils/Strings.platformNewLines().phpt | 4 +--- tests/Utils/Strings.replace().errors.callback.phpt | 4 +--- tests/Utils/Strings.replace().phpt | 4 +--- tests/Utils/Strings.reverse().phpt | 4 +--- tests/Utils/Strings.split().phpt | 4 +--- tests/Utils/Strings.startsWith().phpt | 4 +--- tests/Utils/Strings.substring().phpt | 4 +--- tests/Utils/Strings.toAscii().phpt | 4 +--- tests/Utils/Strings.trim().phpt | 4 +--- tests/Utils/Strings.truncate().phpt | 4 +--- tests/Utils/Strings.unixNewLines().phpt | 4 +--- tests/Utils/Strings.webalize().phpt | 4 +--- tests/Utils/Type.allows.phpt | 4 +--- tests/Utils/Type.fromReflection.function.81.phpt | 4 +--- tests/Utils/Type.fromReflection.function.82.phpt | 4 +--- tests/Utils/Type.fromReflection.function.phpt | 4 +--- tests/Utils/Type.fromReflection.method.phpt | 4 +--- tests/Utils/Type.fromReflection.parameter.phpt | 4 +--- tests/Utils/Type.fromReflection.property.phpt | 4 +--- tests/Utils/Type.fromString.phpt | 4 +--- tests/Utils/Type.fromValue.phpt | 4 +--- tests/Utils/Type.with.phpt | 4 +--- tests/Utils/Validators.assert().phpt | 4 +--- tests/Utils/Validators.assertField().phpt | 4 +--- tests/Utils/Validators.everyIs().phpt | 4 +--- tests/Utils/Validators.is().phpt | 4 +--- tests/Utils/Validators.isBuiltinType.phpt | 4 +--- tests/Utils/Validators.isInRange().phpt | 4 +--- tests/Utils/Validators.isNumeric().phpt | 4 +--- tests/Utils/Validators.isTypeDeclaration.phpt | 4 +--- tests/Utils/fixtures.reflection/defaultValue.php | 4 +--- tests/bootstrap.php | 4 +--- tests/phpstan-bootstrap.php | 4 +--- 232 files changed, 232 insertions(+), 696 deletions(-) diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 25851af66..64dc48708 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -1,6 +1,4 @@ -

AltStyle によって変換されたページ (->オリジナル) /