Skip to content

Commit a21136a

Browse files
committed
Extract Blueprint validation and processing to BlueprintParser
1 parent 9b032ae commit a21136a

File tree

4 files changed

+487
-356
lines changed

4 files changed

+487
-356
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace WordPress\Blueprints;
4+
5+
use WordPress\Blueprints\VersionStrings\VersionConstraint;
6+
7+
class Blueprint {
8+
private $blueprint_string;
9+
private $blueprint_array;
10+
private $php_version_constraint;
11+
private $wp_version_constraint;
12+
private $recommended_wp_version;
13+
private $execution_plan;
14+
15+
public function __construct(
16+
string $blueprint_string,
17+
array $blueprint_array,
18+
?VersionConstraint $php_version_constraint,
19+
?VersionConstraint $wp_version_constraint,
20+
string $recommended_wp_version,
21+
array $execution_plan
22+
) {
23+
$this->blueprint_string = $blueprint_string;
24+
$this->blueprint_array = $blueprint_array;
25+
$this->php_version_constraint = $php_version_constraint;
26+
$this->wp_version_constraint = $wp_version_constraint;
27+
$this->recommended_wp_version = $recommended_wp_version;
28+
$this->execution_plan = $execution_plan;
29+
}
30+
31+
public function getBlueprintString(): string {
32+
return $this->blueprint_string;
33+
}
34+
35+
public function getBlueprintArray(): array {
36+
return $this->blueprint_array;
37+
}
38+
39+
public function getPhpVersionConstraint(): ?VersionConstraint {
40+
return $this->php_version_constraint;
41+
}
42+
43+
public function getWpVersionConstraint(): ?VersionConstraint {
44+
return $this->wp_version_constraint;
45+
}
46+
47+
public function getRecommendedWpVersion(): string {
48+
return $this->recommended_wp_version;
49+
}
50+
51+
public function getExecutionPlan(): array {
52+
return $this->execution_plan;
53+
}
54+
}

0 commit comments

Comments
 (0)