-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUPH-93 | Add Support for Globally Defined Multiple Template Trees #46
Conversation
This is in preparation for per-primary-actor and per-file tree definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff! let me know if my anthropomorphic accounting does not match yours, consider my suggestion but no need to defend your choice, otherwise 🐐=)
thanks for the tests and the doc update!
return $this->FilePath; | ||
} | ||
|
||
private function buildActorTemplateFilePathCandidates(): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method: "I ask a Repository of Template Tree Maps for all Template Trees in storage as a Map. I add the relative file paths. I return an array that is allowed to be empty. I assume that Actors that invoke me ensure the array is valid for their useage"
@@ -32,20 +32,38 @@ public function build(): TemplateInterface | |||
protected function getFilePath(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method: "I ask for a possibly empty array of Template file path candidates. I find the first Template in the stack that I can validate exists on the FS and store it as a property on my associated object. If I cannot validate that any in the array exist on the FS I throw an exception. If I stored one on my associated object, I return it to the caller."
@@ -16,10 +17,32 @@ class Builder implements BuilderInterface | |||
public function build(): MapInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method: "I throw an exception if there are multiple Template Trees specified and they are not named. If there is a single unnamed Template Tree directory path I give it the name "default". I throw an exception if there are two or more Template Tree directory paths that have the same name specified. I return a Map of Template Trees that are keyed by their specified name (or the name "default" which I assign) each with a value that is the associated Template Tree directory path."
src/V1/TemplateTree/Map/Builder.php
Outdated
'Unnamed Template Trees are not compatible with Multiple Template Trees' | ||
); | ||
} | ||
$templateTreeDirectoryKey = 'default'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider exposing this as a constant in the interface that is most appropriate
# Testing Global Template Trees | ||
|
||
This is to test Multiple Template Trees specified at the Global (Environment) Level | ||
|
||
## Test Cases: | ||
|
||
|File |In Primary|In Secondary|Selected | | ||
|-----------------------------|----------|------------|---------| | ||
|PrimaryActorName.php |Yes |No |Primary | | ||
|PrimaryActorNameInterface.php|No |Yes |Secondary| | ||
|PrimaryActorName.service.yml |Yes |Yes |Primary | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice =)
putenv(build_env('TargetApplication_BuilderInterface', 'SourceDirectoryPath', "$PWD/src")); | ||
putenv(build_env('TargetApplication_BuilderInterface', 'FabricationDirectoryPath', "$PWD/fab")); | ||
putenv(build_env('TargetApplication_BuilderInterface', 'NamespacePrefix', "Neighborhoods\\BuphaloTest")); | ||
putenv( | ||
build_env( | ||
'TemplateTree_Map_Builder_FactoryInterface', | ||
'TemplateTreeDirectoryPaths', | ||
"primary:$PWD/templates/primary,secondary:$PWD/templates/secondary" | ||
) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweeeeet
No description provided.