Classes, traits, and interfaces - 11.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 1519

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
ComponentNegotiator final class Drupal\sdc core/modules/sdc/src/ComponentNegotiator.php Determines which component should be used. 1
ComponentNegotiatorTest final class Drupal\Tests\sdc\Kernel core/modules/sdc/tests/src/Kernel/ComponentNegotiatorTest.php Tests the component negotiator.
ComponentNegotiatorTest class Drupal\Tests\Core\Theme\Component core/tests/Drupal/Tests/Core/Theme/Component/ComponentNegotiatorTest.php Tests the component negotiator.
ComponentNegotiatorTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentNegotiatorTest.php Tests the component negotiator.
ComponentNodeVisitor class Drupal\Core\Template core/lib/Drupal/Core/Template/ComponentNodeVisitor.php Provides a ComponentNodeVisitor to change the generated parse-tree.
ComponentNodeVisitor final class Drupal\sdc\Twig core/modules/sdc/src/Twig/ComponentNodeVisitor.php Provides a ComponentNodeVisitor to change the generated parse-tree.
ComponentNodeVisitorTest final class Drupal\Tests\sdc\Kernel core/modules/sdc/tests/src/Kernel/ComponentNodeVisitorTest.php Tests the node visitor.
ComponentNodeVisitorTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentNodeVisitorTest.php Tests the node visitor.
ComponentNotFoundException class Drupal\Core\Render\Component\Exception core/lib/Drupal/Core/Render/Component/Exception/ComponentNotFoundException.php Raised when a component cannot be found. 7
ComponentNotFoundException final class Drupal\sdc\Exception core/modules/sdc/src/Exception/ComponentNotFoundException.php Raised when a component cannot be found. 4
ComponentPluginManager final class Drupal\sdc core/modules/sdc/src/ComponentPluginManager.php Defines a plugin manager to deal with sdc. 6 2
ComponentPluginManager class Drupal\Core\Theme core/lib/Drupal/Core/Theme/ComponentPluginManager.php Defines a plugin manager to deal with components. 9 2
ComponentPluginManagerCachedDiscoveryTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentPluginManagerCachedDiscoveryTest.php Tests discovery of components in a theme being installed or uninstalled.
ComponentPluginManagerTest class Drupal\Tests\Core\Theme\Component core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php Tests the component plugin manager.
ComponentPluginManagerTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentPluginManagerTest.php Tests the component plugin manager.
ComponentPluginManagerTest final class Drupal\Tests\sdc\Kernel core/modules/sdc/tests/src/Kernel/ComponentPluginManagerTest.php Tests the component plugin manager.
ComponentRendererTrait trait Drupal\Tests\sdc\Traits core/modules/sdc/tests/src/Traits/ComponentRendererTrait.php Defines a trait for rendering components. 1
ComponentRenderInvalidTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentRenderInvalidTest.php Tests invalid render options for components.
ComponentRenderInvalidTest final class Drupal\Tests\sdc\Kernel core/modules/sdc/tests/src/Kernel/ComponentRenderInvalidTest.php Tests invalid render options for components.
ComponentRenderTest final class Drupal\Tests\sdc\FunctionalJavascript core/modules/sdc/tests/src/FunctionalJavascript/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest final class Drupal\Tests\sdc\Kernel core/modules/sdc/tests/src/Kernel/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest final class Drupal\Tests\sdc\Functional core/modules/sdc/tests/src/Functional/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest class Drupal\FunctionalTests\Components core/tests/Drupal/FunctionalTests/Components/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest class Drupal\FunctionalJavascriptTests\Components core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php Tests the correct rendering of components.
ComponentRenderTest final class Drupal\KernelTests\Component core/tests/Drupal/KernelTests/Component/ComponentRenderTest.php Tests the correct rendering of components.
ComponentsIsolatedBuildTest class Drupal\BuildTests\Composer\Component core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php Try to install dependencies per component, using Composer.
ComponentsTaggedReleaseTest class Drupal\BuildTests\Composer\Component core/tests/Drupal/BuildTests/Composer/Component/ComponentsTaggedReleaseTest.php Demonstrate that the Component generator responds to release tagging.
ComponentsTwigExtension final class Drupal\Core\Template core/lib/Drupal/Core/Template/ComponentsTwigExtension.php The twig extension so Drupal can recognize the new code.
ComponentTestDoesNotExtendCoreTest final class Drupal\PHPStan\Rules core/tests/PHPStan/Rules/ComponentTestDoesNotExtendCoreTest.php Ensures that no component tests are extending a core test base class. 1
ComponentTestDoesNotExtendCoreTestTest class Drupal\PHPStan\Tests core/tests/PHPStan/tests/ComponentTestDoesNotExtendCoreTestTest.php Tests ComponentTestDoesNotExtendCoreTest rule.
ComponentTranslationTest class Drupal\KernelTests\Components core/tests/Drupal/KernelTests/Components/ComponentTranslationTest.php Tests the component can be translated.
ComponentValidator class Drupal\Core\Theme\Component core/lib/Drupal/Core/Theme/Component/ComponentValidator.php Validates a component based on its definition and the component schema. 3
ComponentValidator final class Drupal\sdc\Component core/modules/sdc/src/Component/ComponentValidator.php Validates a component based on its definition and the component schema. 3
ComponentValidatorTest final class Drupal\Tests\sdc\Unit core/modules/sdc/tests/src/Unit/ComponentValidatorTest.php Unit tests for the component validation.
ComponentValidatorTest class Drupal\Tests\Core\Theme\Component core/tests/Drupal/Tests/Core/Theme/Component/ComponentValidatorTest.php Unit tests for the component validation.
Composer class Drupal\Composer composer/Composer.php Provides static functions for composer script events. 9
Composer class Drupal\Core\Composer core/lib/Drupal/Core/Composer/Composer.php Provides static functions for composer script events.
ComposerBuildTestBase abstract class Drupal\BuildTests\Composer core/tests/Drupal/BuildTests/Composer/ComposerBuildTestBase.php Base class for Composer build tests. 3 3
ComposerHookTest class Drupal\Tests\Composer\Plugin\Scaffold\Functional core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php Tests Composer Hooks that run scaffold operations.
ComposerInspector class Drupal\package_manager core/modules/package_manager/src/ComposerInspector.php Defines a class to get information from Composer. 24
ComposerInspectorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/ComposerInspectorTest.php @coversDefaultClass \Drupal\package_manager\ComposerInspector[[api-linebreak]]
ComposerInstallersTrait trait Drupal\Tests\package_manager\Traits core/modules/package_manager/tests/src/Traits/ComposerInstallersTrait.php A utility for kernel tests that need to use 'composer/installers'. 3
ComposerIntegrationTest class Drupal\Tests core/tests/Drupal/Tests/ComposerIntegrationTest.php Tests Composer integration.
ComposerIntegrationTrait trait Drupal\Tests\Composer core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php Some utility functions for testing the Composer integration. 2
ComposerMinimumStabilityValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/ComposerMinimumStabilityValidator.php Checks that the packages to install meet the minimum stability.
ComposerMinimumStabilityValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/ComposerMinimumStabilityValidatorTest.php @covers \Drupal\package_manager\Validator\ComposerMinimumStabilityValidator[[api-linebreak]] @group package_manager @internal
ComposerNotReadyException final class Drupal\package_manager\Exception core/modules/package_manager/src/Exception/ComposerNotReadyException.php Exception thrown if we cannot reliably use Composer. 2
ComposerPatches class cweagans\Fake core/modules/package_manager/tests/fixtures/path_repos/cweagans--composer-patches/src/ComposerPatches.php Dummy composer plugin implementation.
ComposerPatchesValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/ComposerPatchesValidator.php Validates the configuration of the cweagans/composer-patches plugin.

Other projects


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