/var/www/html_de/wp-content/plugins/woocommerce/packages/blueprint/src/Steps/SetSiteOptions.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php

namespace Automattic\WooCommerce\Blueprint\Steps;

/**
 * Set site options step.
 */
class SetSiteOptions extends Step {
    
/**
     * Site options.
     *
     * @var array site options
     */
    
private array $options;

    
/**
     * Constructor.
     *
     * @param array $options site options.
     */
    
public function __construct( array $options = array() ) {
        
$this->options $options;
    }

    
/**
     * Get the name of the step.
     *
     * @return string step name
     */
    
public static function get_step_name(): string {
        return 
'setSiteOptions';
    }

    
/**
     * Get the schema for the step.
     *
     * @param int $version schema version.
     *
     * @return array schema for the step
     */
    
public static function get_schemaint $version ): array {
        return array(
            
'type'       => 'object',
            
'properties' => array(
                
'step' => array(
                    
'type' => 'string',
                    
'enum' => array( static::get_step_name() ),
                ),

            ),
            
'required'   => array( 'step' ),
        );
    }

    
/**
     * Prepare the step for JSON serialization.
     *
     * @return array array representation of the step
     */
    
public function prepare_json_array(): array {
        return array(
            
'step'    => static::get_step_name(),
            
'options' => (object) $this->options,
        );
    }
}