Skip to main content

GravityKit\GravityMigrate\Schema\SharedInstance

One instance of a class, shared, with a way to put it back for a test.

Each using class gets its own instance: a static property declared in a trait belongs to the class that uses it rather than being shared across every class that uses the trait.

Since: %ver%

Source: src/Schema/SharedInstance.php:13

Details

  • Kind: trait
  • Namespace: GravityKit\GravityMigrate\Schema

Methods

MethodDescription
get_instance()Returns the instance, making it the first time it is asked for.
reset_instance()Forgets the instance.

Method Reference

get_instance()

public static function get_instance(): self

Returns the instance, making it the first time it is asked for.

Returns

  • static

Since: %ver%

Source: src/Schema/SharedInstance.php:31

reset_instance()

public static function reset_instance(): void

Forgets the instance.

A test that leaves an instance behind hands its accumulated state to whatever runs next.

Returns

  • void

Since: %ver%

Source: src/Schema/SharedInstance.php:48