Skip to content
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

Merged
merged 5 commits into from
Feb 26, 2020

Conversation

jpmarcotte
Copy link
Contributor

No description provided.

@jpmarcotte jpmarcotte self-assigned this Jan 15, 2020
Copy link
Contributor

@rhift rhift left a 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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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."

'Unnamed Template Trees are not compatible with Multiple Template Trees'
);
}
$templateTreeDirectoryKey = 'default';
Copy link
Contributor

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

Comment on lines +1 to +11
# 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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice =)

Comment on lines +27 to +36
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"
)
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

Copy link
Contributor

@rhift rhift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweeeeet

@jpmarcotte jpmarcotte merged commit 80efa44 into master Feb 26, 2020
@jpmarcotte jpmarcotte deleted the BUPH-93-multiple-template-trees branch June 22, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants