class Destructable

Same name in other branches
  1. 10 core/modules/system/tests/modules/destructable_test/src/Destructable.php \Drupal\destructable_test\Destructable

Hierarchy

Expanded class hierarchy of Destructable

1 file declares its use of Destructable
CallsDestructableServiceController.php in core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php
1 string reference to 'Destructable'
DestructableServiceTest::testDestructableServiceExecutionOrder in core/tests/Drupal/FunctionalTests/HttpKernel/DestructableServiceTest.php

File

core/modules/system/tests/modules/destructable_test/src/Destructable.php, line 9

Namespace

Drupal\destructable_test
View source
final class Destructable implements DestructableInterface {
    
    /**
     * Semaphore filename.
     *
     * @var string
     */
    protected string $semaphore;
    
    /**
     * Set the destination for the semaphore file.
     *
     * @param string $semaphore
     *   Temporary file to set a semaphore flag.
     */
    public function setSemaphore(string $semaphore) : void {
        $this->semaphore = $semaphore;
    }
    
    /**
     * {@inheritdoc}
     */
    public function destruct() {
        sleep(3);
        file_put_contents($this->semaphore, 'ran');
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
Destructable::$semaphore protected property Semaphore filename.
Destructable::destruct public function Overrides DestructableInterface::destruct
Destructable::setSemaphore public function Set the destination for the semaphore file.

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