Classes, traits, and interfaces - main - drupal

Primary tabs

Introduction to classes

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.

See also

Objected-oriented programming conventions

File

core/core.api.php, line 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
PhpPasswordArgon2idIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordArgon2idIntegrationTest.php Argon2id specific integration tests for the PHP password hashing service.
PhpPasswordBcryptIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordBcryptIntegrationTest.php Bcrypt specific integration tests for the PHP password hashing service.
PhpPasswordDefaultIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordDefaultIntegrationTest.php Integration tests for the PHP password hashing service.
PhpPasswordTest class Drupal\Tests\Core\Password core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php Unit tests for password hashing API.
PhpPasswordUnknownAlgorithmIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordUnknownAlgorithmIntegrationTest.php Integration tests for the PHP password hashing service.
PhpRequirements final class Drupal\Core\Utility core/lib/Drupal/Core/Utility/PhpRequirements.php Provides an object for dynamically identifying the minimum supported PHP. 6
PhpRequirementsTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/PhpRequirementsTest.php Tests the \Drupal\Core\Utility\PhpRequirements class.
PhpRequirementTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/PhpRequirementTest.php Tests the output of PHP requirements on the status report.
PhpScriptFilter class phpcs core/tests/phpcs/PhpScriptFilter.php Allows .sh files explicitly listed in phpcs.xml.dist to be scanned as PHP.
PhpSelection class Drupal\Core\Entity\Plugin\EntityReferenceSelection core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/PhpSelection.php Defines an alternative to the default Entity Reference Selection plugin.
PhpSerialize class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/PhpSerialize.php Default serialization for serialized PHP. 4 2
PhpStorageFactory class Drupal\Core\PhpStorage core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php Creates a php storage object. 5
PhpStorageFactoryTest class Drupal\Tests\system\Kernel\PhpStorage core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php Tests the PHP storage factory.
PhpStorageInterface interface Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php Stores and loads PHP code. 2 2
PhpStorageTestBase abstract class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php Base test for PHP storages. 3
PhpStreamWrapperInterface interface Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php Defines a generic PHP stream wrapper interface. 1
PhpTransliteration class Drupal\Core\Transliteration core/lib/Drupal/Core/Transliteration/PhpTransliteration.php Enhances PhpTransliteration with an alter hook. 2 2
PhpTransliteration class Drupal\Component\Transliteration core/lib/Drupal/Component/Transliteration/PhpTransliteration.php Implements transliteration without using the PECL extensions. 1 3
PhpTransliterationTest class Drupal\Tests\Core\Transliteration core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
PhpTransliterationTest class Drupal\Tests\Component\Transliteration core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
PhpTufValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/PhpTufValidator.php Validates that PHP-TUF is installed and correctly configured. 2
PhpTufValidatorInvalidConfigTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/PhpTufValidatorInvalidConfigTest.php Tests Drupal\package_manager\Validator\PhpTufValidator.
PhpTufValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/PhpTufValidatorTest.php Tests Drupal\package_manager\Validator\PhpTufValidator.
PhpUnitApiFindAllClassFilesTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/PhpUnitApiFindAllClassFilesTest.php Tests ::findAllClassFiles().
PhpUnitApiGetTestClassesTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/PhpUnitApiGetTestClassesTest.php Tests ::getTestClasses().
PhpUnitAutoloaderTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php Tests that classes are correctly loaded during PHPUnit initialization.
PhpUnitBridgeIsolatedTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php Test how unit tests interact with deprecation errors in process isolation.
PhpUnitBridgeTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php Test how unit tests interact with deprecation errors.
PhpUnitBridgeTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php Test how kernel tests interact with deprecation errors.
PhpUnitBridgeTest class Drupal\FunctionalTests\Core\Test core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php Tests Drupal's extension to manage code deprecation.
PhpUnitTestDiscovery class Drupal\Core\Test core/lib/Drupal/Core/Test/PhpUnitTestDiscovery.php Discovers available tests using the PHPUnit API. 3
PhpUnitTestDiscoveryTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/PhpUnitTestDiscoveryTest.php Tests equality of test discovery between run-tests.sh and PHPUnit CLI.
PhpUnitTestDiscoveryTracer class Drupal\Core\Test core/lib/Drupal/Core/Test/PhpUnitTestDiscoveryTracer.php Traces events dispatched by PHPUnit during the test discovery.
PhpUnitTestDummyClass class Drupal\phpunit_test core/modules/system/tests/modules/phpunit_test/src/PhpUnitTestDummyClass.php Dummy test class.
PhpUnitTestRunner class Drupal\Core\Test core/lib/Drupal/Core/Test/PhpUnitTestRunner.php Run PHPUnit-based tests. 2
PhpUnitTestRunnerTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php Tests Drupal\Core\Test\PhpUnitTestRunner.
PirateDayCacheabilityMetadataConfigOverride class Drupal\config_override_test core/modules/config/tests/config_override_test/src/PirateDayCacheabilityMetadataConfigOverride.php Test implementation of a config override that provides cacheability metadata. 2
PirateDayCacheContext class Drupal\config_override_test\Cache core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php Defines the PirateDayCacheContext service that allows to cache the booty. 2 2
PlaceBlock final class Drupal\block\Plugin\ConfigAction core/modules/block/src/Plugin/ConfigAction/PlaceBlock.php Places a block in either the admin or default theme. 1
PlaceBlockDeriver final class Drupal\block\Plugin\ConfigAction core/modules/block/src/Plugin/ConfigAction/PlaceBlockDeriver.php Defines a deriver for the `placeBlock` config action. 1
PlaceholderGenerator class Drupal\Core\Render core/lib/Drupal/Core/Render/PlaceholderGenerator.php Turns a render array into a placeholder. 3 2
PlaceholderGeneratorInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php Defines an interface for turning a render array into a placeholder. 1 3
PlaceholderGeneratorTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php Tests Drupal\Core\Render\PlaceholderGenerator.
PlaceholderingRenderCache class Drupal\Core\Render core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php Adds automatic placeholdering to the RenderCache. 1 3 2
PlaceholderInterface interface Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php Interface for a query that accepts placeholders. 3 2
PlaceholderMessageTest class Drupal\Tests\system\Functional\Render core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php Functional test verifying that messages set in placeholders always appear.
PlaceholdersTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTestBase.php Placeholders test class with implemented trusted callbacks.
PlaceholderStrategyInterface interface Drupal\Core\Render\Placeholder core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyInterface.php Provides an interface for defining a placeholder strategy service. 4 2
PlainTextOutput class Drupal\Component\Render core/lib/Drupal/Component/Render/PlainTextOutput.php Provides an output strategy for transforming HTML into simple plain text. 19
PlainTextOutputTest class Drupal\Tests\Component\Render core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php Tests Drupal\Component\Render\PlainTextOutput.

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.