class FileValidationTestSubscriber

Same name in other branches
  1. 10 core/modules/file/tests/modules/file_validator_test/src/EventSubscriber/FileValidationTestSubscriber.php \Drupal\file_validator_test\EventSubscriber\FileValidationTestSubscriber

Provides a validation listener for file validation tests.

Hierarchy

  • class \Drupal\file_validator_test\EventSubscriber\FileValidationTestSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of FileValidationTestSubscriber

1 string reference to 'FileValidationTestSubscriber'
file_validator_test.services.yml in core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml
core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml
1 service uses FileValidationTestSubscriber
file_validation_test_subscriber in core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml
Drupal\file_validator_test\EventSubscriber\FileValidationTestSubscriber

File

core/modules/file/tests/modules/file_validator_test/src/EventSubscriber/FileValidationTestSubscriber.php, line 13

Namespace

Drupal\file_validator_test\EventSubscriber
View source
class FileValidationTestSubscriber implements EventSubscriberInterface {
    
    /**
     * Handles the file validation event.
     *
     * @param \Drupal\file\Validation\FileValidationEvent $event
     *   The event.
     */
    public function onFileValidation(FileValidationEvent $event) : void {
        _file_test_log_call('validate', [
            $event->file
                ->id(),
        ]);
    }
    
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() : array {
        return [
            FileValidationEvent::class => 'onFileValidation',
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary
FileValidationTestSubscriber::getSubscribedEvents public static function
FileValidationTestSubscriber::onFileValidation public function Handles the file validation event.

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