Classes, traits, and interfaces - 9.5.x - 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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
PhpassHashedPassword class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpassHashedPassword.php Secure hashing functions based on Portable PHP password hashing framework. 1 1 4
PhpBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/PhpBackend.php Defines a PHP cache implementation. 2
PhpBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/PhpBackendFactory.php 2
PhpBackendTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php Unit test of the PHP cache backend using the generic cache unit test base.
PhpDeprecation class core/tests/fixtures/deprecated_code.php This class triggers an E_DEPRECATED notice.
PhpMail class Drupal\Core\Mail\Plugin\Mail core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php Defines the default Drupal mail backend, using PHP's native mail() function. 2 2
PhpMailTest class Drupal\Tests\Core\Mail\Plugin\Mail core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php @coversDefaultClass \Drupal\Core\Mail\Plugin\Mail\PhpMail[[api-linebreak]] @group Mail
PhpRequirements final class Drupal\Core\Utility core/lib/Drupal/Core/Utility/PhpRequirements.php Provides an object for dynamically identifying the minimum supported PHP. 5
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.
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. 1 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 1
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. 1 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\Component\Transliteration core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
PhpTransliterationTest class Drupal\Tests\Core\Transliteration core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
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.
PhpUnitBridgeRequiresTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeRequiresTest.php Test how unit tests interact with deprecation errors.
PhpUnitBridgeTest class Drupal\FunctionalTests\Core\Test core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php Tests Drupal's integration with Symfony PHPUnit Bridge.
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.
PhpUnitCliTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php @group TestSuites @group Test
PhpUnitTestDummyClass class Drupal\phpunit_test core/modules/system/tests/modules/phpunit_test/src/PhpUnitTestDummyClass.php
PhpUnitTestRunner class Drupal\Core\Test core/lib/Drupal/Core/Test/PhpUnitTestRunner.php Run PHPUnit-based tests. 1
PhpUnitTestRunnerTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php @coversDefaultClass \Drupal\Core\Test\PhpUnitTestRunner[[api-linebreak]] @group Test
PhpUnitWarnings trait Drupal\Tests\Traits core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php Converts deprecation warnings added by PHPUnit to silenced deprecations. 11
PhpUnitWarningsTest class Drupal\Tests core/tests/Drupal/Tests/PhpUnitWarningsTest.php @coversDefaultClass \Drupal\Tests\Traits\PhpUnitWarnings[[api-linebreak]] @group legacy
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
PlaceholderGenerator class Drupal\Core\Render core/lib/Drupal/Core/Render/PlaceholderGenerator.php Turns a render array into a placeholder. 1 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
PlaceholderGeneratorTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php @coversDefaultClass \Drupal\Core\Render\PlaceholderGenerator[[api-linebreak]] @group Render
PlaceholderingRenderCache class Drupal\Core\Render core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php Adds automatic placeholdering to the RenderCache. 1 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
PlaceholderStrategyInterface interface Drupal\Core\Render\Placeholder core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyInterface.php Provides an interface for defining a placeholder strategy service. 3 2
PlainTextEditor class Drupal\quickedit\Plugin\InPlaceEditor core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php Defines the plain text in-place editor.
PlainTextOutput class Drupal\Component\Render core/lib/Drupal/Component/Render/PlainTextOutput.php Provides an output strategy for transforming HTML into simple plain text. 17
PlainTextOutputTest class Drupal\Tests\Component\Render core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php @coversDefaultClass \Drupal\Component\Render\PlainTextOutput[[api-linebreak]] @group Utility
Plugin class Drupal\Component\Annotation core/lib/Drupal/Component/Annotation/Plugin.php Defines a Plugin annotation object. 47 46
Plugin class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/Plugin.php Composer plugin for handling drupal scaffold.
PluginAlterTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php @group Render
PluginAwareInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginAwareInterface.php Provides an interface for objects that depend on a plugin. 4 6

Other projects


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