repo
stringlengths
7
63
file_url
stringlengths
81
284
file_path
stringlengths
5
200
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:02:33
2026-01-05 05:24:06
truncated
bool
2 classes
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-define-arrays/php7.php
tests/stubs/converter/it-can-replace-define-arrays/php7.php
<?php define('ANIMALS', [ 'dog', 'cat', 'bird' ]);
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-define-arrays/php5.php
tests/stubs/converter/it-can-replace-define-arrays/php5.php
<?php const ANIMALS = ['dog', 'cat', 'bird'];
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-group-use-declarations/php7.php
tests/stubs/converter/it-can-replace-group-use-declarations/php7.php
<?php use Test\{ One, Two, Three };
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-group-use-declarations/php5.php
tests/stubs/converter/it-can-replace-group-use-declarations/php5.php
<?php use Test\One; use Test\Two; use Test\Three;
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-anonymous-classes/php7.php
tests/stubs/converter/it-can-replace-anonymous-classes/php7.php
<?php use Import; class Test { public function test() { $class = new class() { public function method(string $parameter = '') : string { return $parameter ?? 'no parameter set'; } }; $class->method(); $anotherClass = new class()...
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-anonymous-classes/php5.php
tests/stubs/converter/it-can-replace-anonymous-classes/php5.php
<?php use Import; class AnonymousClass0 { public function method($parameter = '') { return isset($parameter) ? $parameter : 'no parameter set'; } } class AnonymousClass1 { public function anotherMethod($integer) { return $integer < 3 ? -1 : ($integer == 3 ? 0 : 1); } } class Tes...
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-remove-class-constant-visibility-modifiers/php7.php
tests/stubs/converter/it-can-remove-class-constant-visibility-modifiers/php7.php
<?php class Test { public const FOO = 'BAR'; private const BAR = 'FOO'; const MY_CONSTANT = false; }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-remove-class-constant-visibility-modifiers/php5.php
tests/stubs/converter/it-can-remove-class-constant-visibility-modifiers/php5.php
<?php class Test { const FOO = 'BAR'; const BAR = 'FOO'; const MY_CONSTANT = false; }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-spaceship-operators/php7.php
tests/stubs/converter/it-can-replace-spaceship-operators/php7.php
<?php // Integers echo 1 <=> 1; // 0 echo 1 <=> 2; // -1 echo 2 <=> 1; // 1 // Floats echo 1.5 <=> 1.5; // 0 echo 1.5 <=> 2.5; // -1 echo 2.5 <=> 1.5; // 1 // Strings echo 'a' <=> 'a'; // 0 echo 'a' <=> 'b'; // -1 echo 'b' <=> 'a'; // 1 echo 'a' <=> 'aa'; // -1 echo 'zz' <=> 'aa'; // 1 // Arrays echo [] <=> []; //...
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/converter/it-can-replace-spaceship-operators/php5.php
tests/stubs/converter/it-can-replace-spaceship-operators/php5.php
<?php // Integers echo 1 < 1 ? -1 : (1 == 1 ? 0 : 1); // 0 echo 1 < 2 ? -1 : (1 == 2 ? 0 : 1); // -1 echo 2 < 1 ? -1 : (2 == 1 ? 0 : 1); // 1 // Floats echo 1.5 < 1.5 ? -1 : (1.5 == 1.5 ? 0 : 1); // 0 echo 1.5 < 2.5 ? -1 : (1.5 == 2.5 ? 0 : 1); // -1 echo 2.5 < 1.5 ? -1 : (2.5 == 1.5 ? 0 : 1); // 1 // Strings echo 'a'...
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/directoryConverter/sourceDirectory/file2.php
tests/stubs/directoryConverter/sourceDirectory/file2.php
<?php declare (strict_types = 1); class Test { }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/directoryConverter/sourceDirectory/file1.php
tests/stubs/directoryConverter/sourceDirectory/file1.php
<?php declare (strict_types = 1); class Test { }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/directoryConverter/sourceDirectory/directory1/file2.php
tests/stubs/directoryConverter/sourceDirectory/directory1/file2.php
<?php declare (strict_types = 1); class Test { }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
spatie/7to5
https://github.com/spatie/7to5/blob/64d1e12570eb3e4ce4976245ba48e881383b5580/tests/stubs/directoryConverter/sourceDirectory/directory1/file1.php
tests/stubs/directoryConverter/sourceDirectory/directory1/file1.php
<?php declare (strict_types = 1); class Test { }
php
MIT
64d1e12570eb3e4ce4976245ba48e881383b5580
2026-01-05T03:31:02.607877Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-is-heic.php
test-is-heic.php
<?php include "src/HeicToJpg.php"; var_dump(Maestroerror\HeicToJpg::isHeic("image1.heic"));
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-save.php
test-save.php
<?php include "src/HeicToJpg.php"; Maestroerror\HeicToJpg::convert("image1.heic")->saveAs("jpg-from-php.jpg");
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-save-mdat.php
test-save-mdat.php
<?php include "src/HeicToJpg.php"; Maestroerror\HeicToJpg::convert("samsung.heic-mdat", "/home/maestroerror/Desktop/php-heic-to-jpg/vendor/bin/heif-converter-linux")->saveAs("jpg-from-php.jpg");
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-binary-issue-36.php
test-binary-issue-36.php
<?php include "src/HeicToJpg.php"; $path = "test-binary-bad.heic"; $dest = "test-binary-bad.jpg"; if(Maestroerror\HeicToJpg::isHeic($path)) { // 1. save as file try{ $result = \Maestroerror\HeicToJpg::convert($path)->saveAs($dest); }catch (\Exception $e) { return explode(':', $e->getMessa...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-binary.php
test-binary.php
<?php include "src/HeicToJpg.php"; $jpg = Maestroerror\HeicToJpg::convert("image1.heic")->get(); file_put_contents("saved-with-php.jpg", $jpg);
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/test-os.php
test-os.php
<?php echo php_uname('s'); echo "\n"; echo php_uname('v'); echo "\n"; echo php_uname('m');
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/src/HeicToJpg.php
src/HeicToJpg.php
<?php namespace Maestroerror; class HeicToJpg { /** * Stores binary content of JPG file */ private string $binary; /** * Stores converted JPG file location */ private string $jpg; /** * Executable file name from bin folder */ protected string $exeName = "heicTo...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/Pest.php
tests/Pest.php
<?php /* |-------------------------------------------------------------------------- | Test Case |-------------------------------------------------------------------------- | | The closure you provide to your test functions is always bound to a specific PHPUnit test | case class. By default, that class is "PHPUnit\Fra...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/TestCase.php
tests/TestCase.php
<?php namespace Tests; use PHPUnit\Framework\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { // }
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/Unit/ConvertationTest.php
tests/Unit/ConvertationTest.php
<?php use Maestroerror\HeicToJpg; test('Converts and saves to the file', function () { $resultImg = "saved-as-jpg.jpg"; // Save converted image HeicToJpg::convert(__dir__ . "/images/image1.heic")->saveAs($resultImg); // Check mime type $mime = mime_content_type($resultImg); // Check image exis...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/Unit/convertFromUrlTest.php
tests/Unit/convertFromUrlTest.php
<?php use Maestroerror\HeicToJpg; test('Converts from URL and saves to the file', function () { $resultImg = "saved-from-url-as-jpg.jpg"; // Save converted image HeicToJpg::convertFromUrl("https://github.com/MaestroError/php-heic-to-jpg/raw/maestro/tests/Unit/images/image1.heic")->saveAs($resultImg); ...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/Unit/IsHeicTest.php
tests/Unit/IsHeicTest.php
<?php use Maestroerror\HeicToJpg; test('Checks heic file correctly', function () { // Check image is Heic format $fileIsHeic = HeicToJpg::isHeic(__dir__ . "/images/image1.heic"); expect($fileIsHeic)->toBeTrue(); }); test('Checks jpg file correctly', function () { // Check image is not Heic format ...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
MaestroError/php-heic-to-jpg
https://github.com/MaestroError/php-heic-to-jpg/blob/e41dded77a7eb7b99496ff5965640a4698a19cab/tests/Unit/SamsungGeneratedTest.php
tests/Unit/SamsungGeneratedTest.php
<?php use Maestroerror\HeicToJpg; // test("Converts samsung-generated image to JPEG and saves to the file", function () { // $resultImg = "saved-as-jpg.jpg"; // // Save converted image // HeicToJpg::convert(__dir__ . "/images/samsung-generated.heic", "/home/maestroerror/Desktop/php-heic-to-jpg/vendor/bin/...
php
MIT
e41dded77a7eb7b99496ff5965640a4698a19cab
2026-01-05T03:30:51.328902Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/finder.php
finder.php
<?php declare(strict_types=1); use StubsGenerator\Finder; // phpcs:disable Squiz.PHP.CommentedOutCode return Finder::create() ->in('source/wordpress') // Shim for load-styles.php and load-scripts.php. ->notPath('wp-admin/includes/noop.php') // This file is not included by WordPress. ->notPath('w...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/wordpress-stubs.php
wordpress-stubs.php
<?php /** * Generated stub declarations for WordPress. * @see https://wordpress.org * @see https://github.com/php-stubs/wordpress-stubs */ namespace { /** * Generic Skin for the WordPress Upgrader classes. This skin is designed to be extended for specific purposes. * * @since 2.8.0 * @since...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
true
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/visitor.php
visitor.php
<?php declare(strict_types=1); use PhpStubs\WordPress\Core\Visitor; require sprintf('%s/vendor/autoload.php', __DIR__); return new Visitor();
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/functionMap.php
functionMap.php
<?php declare(strict_types=1); $httpReturnType = 'array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error'; if (file_exists(sprintf('%...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
true
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/src/WordPressArg.php
src/WordPressArg.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core; final class WordPressArg extends WithChildren { public string $type; public bool $optional = false; public ?string $name = null; /** @return list<string> */ public function format(int $level = 1): array { $strings = ...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/src/WordPressTag.php
src/WordPressTag.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core; // phpcs:disable SlevomatCodingStandard.Functions.FunctionLength.FunctionLength final class WordPressTag extends WithChildren { public string $tag; public string $type; public ?string $name = null; public ?string $description = nul...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/src/WithChildren.php
src/WithChildren.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core; abstract class WithChildren { /** @var list<\PhpStubs\WordPress\Core\WordPressArg> */ public array $children = []; public function isArrayShape(): bool { foreach ($this->children as $child) { if ($child->name === n...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/src/Visitor.php
src/Visitor.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core; use phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Tags\Param; use phpDocumentor\Reflection\DocBlock\Tags\Return_; use phpDocumentor\Reflection\DocBlock\Tags\Var_; use phpDoc...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/ReturnTypeTest.php
tests/ReturnTypeTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; final class ReturnTypeTest extends TypeInferenceTest { public function getDataDirectory(): string { return __DIR__ . '/data/return'; } }
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/AssertionTest.php
tests/AssertionTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; final class AssertionTest extends TypeInferenceTest { public function getDataDirectory(): string { return __DIR__ . '/data/assert'; } }
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/ImpureTest.php
tests/ImpureTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; final class ImpureTest extends TypeInferenceTest { public function getDataDirectory(): string { return __DIR__ . '/data/impure'; } }
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/ParameterTypeTest.php
tests/ParameterTypeTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; class ParameterTypeTest extends IntegrationTest { public function testGetListTable(): void { $this->analyse( __DIR__ . '/data/param/_get-list-table.php', [ ['Parameter #2 $args of function ...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/PureTest.php
tests/PureTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; final class PureTest extends TypeInferenceTest { public function getDataDirectory(): string { return __DIR__ . '/data/pure'; } public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/da...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/Faker.php
tests/Faker.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; /** * Class that provides fake types via docBlocks for type testing. * * @method static bool bool() * @method static true true() * @method static false false() * @method static int int() * @method static int<1, max> positiveInt() * @meth...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/bootstrap.php
tests/bootstrap.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; // phpcs:disable Generic.PHP.ForbiddenFunctions define('OBJECT', 'OBJECT'); define('ARRAY_A', 'ARRAY_A'); define('ARRAY_N', 'ARRAY_N'); // phpcs:enable
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/TypeInferenceTest.php
tests/TypeInferenceTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use PHPStan\Testing\TypeInferenceTestCase; abstract class TypeInferenceTest extends TypeInferenceTestCase { abstract public function getDataDirectory(): string; /** @return iterable<mixed> */ public function dataAsserts(): iterable...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/IntegrationTest.php
tests/IntegrationTest.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use PHPStan\Analyser\Analyser; use PHPStan\Analyser\Error; use PHPStan\Testing\PHPStanTestCase; abstract class IntegrationTest extends PHPStanTestCase { /** * @see https://github.com/phpstan/phpstan-src/blob/2.1.22/src/Testing/RuleTest...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-shortcode-tags-in-content.php
tests/data/return/get-shortcode-tags-in-content.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_shortcode_tags_in_content; use function PHPStan\Testing\assertType; assertType('list<non-empty-string>', get_shortcode_tags_in_content('')); assertType('list<non-empty-string>', get_shortcode_tags_in_content('0')); assertType('...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-taxonomies-for-attachments.php
tests/data/return/get-taxonomies-for-attachments.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_taxonomies_for_attachments; use function PHPStan\Testing\assertType; // Default assertType('array<int, string>', get_taxonomies_for_attachments()); assertType('array<int, string>', get_taxonomies_for_attachments('names')); // ...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-post-ancestors.php
tests/data/return/get-post-ancestors.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_post_ancestors; use function PHPStan\Testing\assertType; assertType('list<int>', get_post_ancestors(123)); assertType('list<int>', get_post_ancestors(Faker::int())); assertType('list<int>', get_post_ancestors(Faker::wpPost()));...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-internal-hosts.php
tests/data/return/wp-internal-hosts.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_internal_hosts; use function PHPStan\Testing\assertType; assertType('array<lowercase-string>', wp_internal_hosts());
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-is-numeric-array.php
tests/data/return/wp-is-numeric-array.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_is_numeric_array; use function PHPStan\Testing\assertType; // No array assertType('false', wp_is_numeric_array(Faker::string())); assertType('false', wp_is_numeric_array(Faker::int())); assertType('false', wp_is_numeric_array(Fa...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-update-category.php
tests/data/return/wp-update-category.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_update_category; use function PHPStan\Testing\assertType; assertType('int<0, max>|false', wp_update_category([])); assertType('int<0, max>|false', wp_update_category(['cat_ID' => 123])); assertType('int<0, max>|false', wp_update...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-get-post-terms.php
tests/data/return/wp-get-post-terms.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_get_post_terms; use function PHPStan\Testing\assertType; $postID = 123; $taxonomy = 'post_tag'; // Default argument values (fields => all) assertType('array<int, WP_Term>|WP_Error', wp_get_post_terms($postID, $taxonomy)); asser...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-get-wp-version.php
tests/data/return/wp-get-wp-version.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_get_wp_version; use function PHPStan\Testing\assertType; assertType('non-falsy-string', wp_get_wp_version());
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-is-post-revision.php
tests/data/return/wp-is-post-revision.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_is_post_revision; use function PHPStan\Testing\assertType; assertType('false', wp_is_post_revision(0)); assertType('false', wp_is_post_revision(Faker::nonPositiveInt())); assertType('int<0, max>|false', wp_is_post_revision(123))...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-approved-comments.php
tests/data/return/get-approved-comments.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_approved_comments; use function PHPStan\Testing\assertType; assertType('array<int, WP_Comment>', get_approved_comments(1)); assertType('int', get_approved_comments(1, ['count' => true])); assertType('int', get_approved_commen...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-sites.php
tests/data/return/get-sites.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_sites; use function PHPStan\Testing\assertType; // Default parameter assertType('array<int, WP_Site>', get_sites()); assertType('array<int, WP_Site>', get_sites([])); // Non constant array parameter. assertType('array<int, int...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/term-exists.php
tests/data/return/term-exists.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function term_exists; use function tag_exists; use function PHPStan\Testing\assertType; $termStr = Faker::string(); $termInt = Faker::int(); $termIntStr = Faker::union(Faker::int(), Faker::string()); // Empty taxonomy assertType('string|nu...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/paginate-links.php
tests/data/return/paginate-links.php
<?php /** * Note: * Starting from PHPStan 1.10.49, void types, including void in unions, are * transformed into null. * * @link https://github.com/phpstan/phpstan-src/pull/2778 */ declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function paginate_links; use function PHPStan\Testing\assert...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-get-archives.php
tests/data/return/wp-get-archives.php
<?php /** * Note: * Starting from PHPStan 1.10.49, void types, including void in unions, are * transformed into null. * * @link https://github.com/phpstan/phpstan-src/pull/2778 */ declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_get_archives; use function PHPStan\Testing\asser...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-die.php
tests/data/return/wp-die.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_die; use function PHPStan\Testing\assertType; // default (['exit' => true]) assertType('never', wp_die()); assertType('never', wp_die('')); assertType('never', wp_die('', '')); // explicit exit assertType('never', wp_die('', ''...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/rest-authorization-required-code.php
tests/data/return/rest-authorization-required-code.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function rest_authorization_required_code; use function PHPStan\Testing\assertType; assertType('401|403', rest_authorization_required_code());
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-block-wrapper-attributes.php
tests/data/return/get-block-wrapper-attributes.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_block_wrapper_attributes; use function PHPStan\Testing\assertType; assertType('string', get_block_wrapper_attributes()); assertType('string', get_block_wrapper_attributes([])); assertType('non-falsy-string', get_block_wrapper_a...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-post-types.php
tests/data/return/get-post-types.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_post_types; use function PHPStan\Testing\assertType; // Default output assertType('array<string, string>', get_post_types([])); assertType('array<string, string>', get_post_types([], 'names')); // Objects output assertType('ar...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-theme.php
tests/data/return/wp-theme.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function PHPStan\Testing\assertType; $theme = Faker::wpTheme(); // WP_Theme::__get() assertType('string', $theme->name); assertType('string', $theme->title); assertType('string', $theme->version); assertType('string', $theme->parent_theme)...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/_get-list-table.php
tests/data/return/_get-list-table.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function _get_list_table; use function PHPStan\Testing\assertType; // A non-class-string assertType('false', _get_list_table('string')); // A class-string that is not class-string<WP_List_Table> assertType('false', _get_list_table('WP_Post...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-extract-urls.php
tests/data/return/wp-extract-urls.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_extract_urls; use function PHPStan\Testing\assertType; assertType('array{}', wp_extract_urls('')); assertType('list<string>', wp_extract_urls('content with no URLs')); assertType('list<string>', wp_extract_urls('content with on...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/addslashes-gpc.php
tests/data/return/addslashes-gpc.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function addslashes_gpc; use function PHPStan\Testing\assertType; assertType('string', addslashes_gpc('')); assertType('string', addslashes_gpc('value')); assertType('string', addslashes_gpc(Faker::nonEmptyString())); assertType('string', a...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-compat-media-markup.php
tests/data/return/get-compat-media-markup.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_compat_media_markup; use function PHPStan\Testing\assertType; // Default output assertType('array{item: string, meta: string}', get_compat_media_markup(Faker::nonNegativeInt())); assertType('array{item: string, meta: string}', ...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/validate-plugin.php
tests/data/return/validate-plugin.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function validate_plugin; use function PHPStan\Testing\assertType; assertType('WP_Error', validate_plugin('')); assertType('0|WP_Error', validate_plugin('pluginPath')); assertType('0|WP_Error', validate_plugin(Faker::string()));
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-tags.php
tests/data/return/get-tags.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_tags; use function PHPStan\Testing\assertType; // Default argument values (fields => all) assertType('array<int, WP_Term>|WP_Error', get_tags()); assertType('array<int, WP_Term>|WP_Error', get_tags([])); // Requesting a count ...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-rest-request.php
tests/data/return/wp-rest-request.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function PHPStan\Testing\assertType; /** * @var \WP_REST_Request<array> $request */ $request = Faker::wpRestRequest(); assertType('mixed', $request->get_param('maybeParam')); assertType('mixed', $request['maybeParam']); assertType('array...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/trailingslashit.php
tests/data/return/trailingslashit.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function trailingslashit; use function PHPStan\Testing\assertType; assertType('non-falsy-string', trailingslashit('')); assertType('non-falsy-string', trailingslashit('value')); assertType('non-falsy-string', trailingslashit(Faker::string()...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-translations.php
tests/data/return/wp-translations.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function PHPStan\Testing\assertType; $translations = Faker::wpTranslations(); $string = Faker::string(); $singular = Faker::union(Faker::string(), null); // WP_Translation::translate() assertType('null', $translations->translate(null)); a...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/echo-parameter.php
tests/data/return/echo-parameter.php
<?php /** * Note: * Starting from PHPStan 1.10.49, void types, including void in unions, are * transformed into null. * * @link https://github.com/phpstan/phpstan-src/pull/2778 */ declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function comment_class; use function edit_term_link; use fun...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-is-uuid.php
tests/data/return/wp-is-uuid.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_is_uuid; use function PHPStan\Testing\assertType; // Default $version assertType('bool', wp_is_uuid('')); assertType('bool', wp_is_uuid('abc')); assertType('bool', wp_is_uuid(Faker::string())); // $version = 4 assertType('bool'...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-dropdown-languages.php
tests/data/return/wp-dropdown-languages.php
<?php /** * Note: * Starting from PHPStan 1.10.49, void types, including void in unions, are * transformed into null. * * @link https://github.com/phpstan/phpstan-src/pull/2778 */ declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_dropdown_languages; use function PHPStan\Testing...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/rest-sanitize-boolean.php
tests/data/return/rest-sanitize-boolean.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function rest_sanitize_boolean; use function PHPStan\Testing\assertType; assertType('true', rest_sanitize_boolean(true)); assertType('false', rest_sanitize_boolean(false)); assertType('bool', rest_sanitize_boolean(Faker::bool())); assertTy...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/add-feed.php
tests/data/return/add-feed.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function add_feed; use function PHPStan\Testing\assertType; assertType('non-falsy-string', add_feed('', Faker::callable())); assertType('non-falsy-string', add_feed('value', Faker::callable())); assertType('non-falsy-string', add_feed(Faker...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-http-validate-url.php
tests/data/return/wp-http-validate-url.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_http_validate_url; use function PHPStan\Testing\assertType; assertType('false', wp_http_validate_url('')); assertType('false', wp_http_validate_url('1')); assertType('false', wp_http_validate_url(Faker::numericString())); asser...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-list-categories.php
tests/data/return/wp-list-categories.php
<?php /** * Note: * Starting from PHPStan 1.10.49, void types, including void in unions, are * transformed into null. * * @link https://github.com/phpstan/phpstan-src/pull/2778 */ declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_list_categories; use function PHPStan\Testing\as...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-post.php
tests/data/return/get-post.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_post; use function PHPStan\Testing\assertType; $postIntNull = Faker::union(Faker::wpPost(), Faker::int(), null); // Default output assertType('WP_Post|null', get_post()); assertType('WP_Post|null', get_post($postIntNull)); ass...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-plugin-page-hookname.php
tests/data/return/get-plugin-page-hookname.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_plugin_page_hookname; use function PHPStan\Testing\assertType; assertType('non-falsy-string', get_plugin_page_hookname('', '')); assertType('non-falsy-string', get_plugin_page_hookname('plugin_page', 'parent_page')); assertType...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-dependencies.php
tests/data/return/wp-dependencies.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function PHPStan\Testing\assertType; assertType('array<string, int|false>', Faker::wpDependencies()->groups); assertType('array<string, int|false>', Faker::wpScripts()->groups); assertType('array<string, int|false>', Faker::wpStyles()->grou...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/rest-ensure-response.php
tests/data/return/rest-ensure-response.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function rest_ensure_response; use function PHPStan\Testing\assertType; assertType('WP_Error', rest_ensure_response(Faker::wpError())); assertType('WP_REST_Response', rest_ensure_response([])); assertType('WP_REST_Response', rest_ensure_res...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/bookmark.php
tests/data/return/bookmark.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_bookmark; use function get_bookmark_field; use function sanitize_bookmark_field; use function PHPStan\Testing\assertType; $stdClassOrInt = Faker::union(Faker::stdClass(), Faker::int()); /* * get_bookmark() */ assertType('st...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-post-stati.php
tests/data/return/get-post-stati.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_post_stati; use function PHPStan\Testing\assertType; // Default assertType('array<string, string>', get_post_stati()); assertType('array<string, string>', get_post_stati([])); assertType('array<string, string>', get_post_stati(...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/image-link-input-fields.php
tests/data/return/image-link-input-fields.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function image_link_input_fields; use function PHPStan\Testing\assertType; assertType('non-falsy-string', image_link_input_fields(Faker::wpPost())); assertType('non-falsy-string', image_link_input_fields(Faker::wpPost(), '')); assertType('n...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-parse-list.php
tests/data/return/wp-parse-list.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_parse_list; use function PHPStan\Testing\assertType; assertType('list<string>', wp_parse_list(Faker::string())); assertType('array<bool|float|int|string>', wp_parse_list(Faker::array()));
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/prep-atom-text-construct.php
tests/data/return/prep-atom-text-construct.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function prep_atom_text_construct; use function PHPStan\Testing\assertType; assertType("array{'html'|'text'|'xhtml', string}", prep_atom_text_construct('')); assertType("array{'html'|'text'|'xhtml', string}", prep_atom_text_construct('data'...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-get-speculation-rules-configuration.php
tests/data/return/wp-get-speculation-rules-configuration.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_get_speculation_rules_configuration; use function PHPStan\Testing\assertType; assertType("array{mode: 'prefetch'|'prerender', eagerness: 'conservative'|'eager'|'moderate'}|null", wp_get_speculation_rules_configuration());
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/sanitize-post-field.php
tests/data/return/sanitize-post-field.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function sanitize_post_field; use function PHPStan\Testing\assertType; $postId = Faker::int(); // Int fields => int - regardless of (non-constant) $value assertType('int', sanitize_post_field('ID', Faker::mixed(), $postId, 'raw')); assertT...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/block-version.php
tests/data/return/block-version.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function block_version; use function PHPStan\Testing\assertType; // Returns input for non-negative integers assertType('0', block_version('')); assertType('0|1', block_version('content')); assertType('0|1', block_version(Faker::string()));
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-object-taxonomies.php
tests/data/return/get-object-taxonomies.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_object_taxonomies; use function PHPStan\Testing\assertType; // Default output assertType('array<int, string>', get_object_taxonomies('post')); assertType('array<int, string>', get_object_taxonomies('post', 'names')); // Object...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/get-user-by.php
tests/data/return/get-user-by.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function get_user_by; use function PHPStan\Testing\assertType; assertType('WP_User|false', get_user_by('id', Faker::int())); assertType('WP_User|false', get_user_by('id', Faker::positiveInt())); assertType('WP_User|false', get_user_by('id',...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/block-core.php
tests/data/return/block-core.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function build_dropdown_script_block_core_categories; use function render_block_core_categories; use function PHPStan\Testing\assertType; assertType('non-falsy-string', render_block_core_categories(Faker::array(), Faker::string(), Faker::wp...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/sanitize-post.php
tests/data/return/sanitize-post.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use stdClass; use function sanitize_post; use function PHPStan\Testing\assertType; assertType('WP_Post', sanitize_post(Faker::wpPost(), Faker::string())); assertType('object', sanitize_post(Faker::object(), Faker::string())); assertType('objec...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-get-post-categories.php
tests/data/return/wp-get-post-categories.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_get_post_categories; use function PHPStan\Testing\assertType; $postID = 123; // Default argument values (fields => ids) assertType('list<int>|WP_Error', wp_get_post_categories($postID)); assertType('list<int>|WP_Error', wp_get_...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/bool-from-yn.php
tests/data/return/bool-from-yn.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function bool_from_yn; use function PHPStan\Testing\assertType; assertType('true', bool_from_yn('y')); assertType('false', bool_from_yn('n')); assertType('false', bool_from_yn('thing')); assertType('bool', bool_from_yn(Faker::string()));
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/is-wp-error.php
tests/data/return/is-wp-error.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function is_wp_error; use function PHPStan\Testing\assertType; assertType('false', is_wp_error(Faker::string())); assertType('true', is_wp_error(Faker::wpError())); assertType('bool', is_wp_error(Faker::mixed()));
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/is-new-day.php
tests/data/return/is-new-day.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function is_new_day; use function PHPStan\Testing\assertType; assertType('0|1', is_new_day());
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false
php-stubs/wordpress-stubs
https://github.com/php-stubs/wordpress-stubs/blob/d6f513244441554f34e276925cb29cc0d3daf8d3/tests/data/return/wp-robots.php
tests/data/return/wp-robots.php
<?php declare(strict_types=1); namespace PhpStubs\WordPress\Core\Tests; use function wp_robots_max_image_preview_large; use function wp_robots_no_robots; use function wp_robots_noindex; use function wp_robots_noindex_embeds; use function wp_robots_noindex_search; use function wp_robots_sensitive_page; use function P...
php
MIT
d6f513244441554f34e276925cb29cc0d3daf8d3
2026-01-05T03:31:17.277721Z
false