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
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. 1
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. 18
PlainTextOutputTest class Drupal\Tests\Component\Render core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php Tests Drupal\Component\Render\PlainTextOutput.
Plugin class Drupal\Component\Annotation core/lib/Drupal/Component/Annotation/Plugin.php Defines a Plugin annotation object. 40 39
Plugin class Drupal\Component\Plugin\Attribute core/lib/Drupal/Component/Plugin/Attribute/Plugin.php Defines a Plugin attribute object. 55 58
Plugin class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/Plugin.php Composer plugin for handling drupal scaffold.
Plugin final class Drupal\Composer\Plugin\RecipeUnpack composer/Plugin/RecipeUnpack/Plugin.php Composer plugin for handling dependency unpacking.
PluginAlterTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php Tests Plugin Alter.
PluginAwareInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginAwareInterface.php Provides an interface for objects that depend on a plugin. 4 6
PluginBase abstract class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginBase.php Base class for plugins supporting metadata inspection and translation. 40 38
PluginBase abstract class Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginBase.php Base class for plugins wishing to support metadata inspection. 15 33
PluginBase abstract class Drupal\views\Plugin\views core/modules/views/src/Plugin/views/PluginBase.php Base class for any views plugin types. 15 21
PluginBaseTest class Drupal\Tests\views\Unit core/modules/views/tests/src/Unit/PluginBaseTest.php Tests Drupal\views\Plugin\views\PluginBase.
PluginBaseTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php Tests the PluginBase class.
PluginBaseTest class Drupal\Tests\Component\Plugin core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php Tests Drupal\Component\Plugin\PluginBase.
PluginDefinition class Drupal\Component\Plugin\Definition core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php Provides object-based plugin definitions. 9 9
PluginDefinitionInterface interface Drupal\Component\Plugin\Definition core/lib/Drupal/Component/Plugin/Definition/PluginDefinitionInterface.php Defines a plugin definition. 6 8

Other projects


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