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

Cache refactor #452

Open
wants to merge 13 commits into
base: release/10.0.0
Choose a base branch
from
Prev Previous commit
Next Next commit
updating cache and helpers
  • Loading branch information
iruzevic committed Feb 21, 2025
commit 4d9a339d6757309dbf17f2362b6fdc3564a447e3
2 changes: 1 addition & 1 deletion src/AdminMenus/AdminMenuCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ public function __invoke(array $args, array $assocArgs)
}

// Output final class to new file/folder and finish.
$class->outputWrite(Helpers::getProjectPaths('srcDestination', 'AdminMenus'), "{$className}.php", $assocArgs);
$class->outputWrite(Helpers::getProjectPaths('src', 'AdminMenus'), "{$className}.php", $assocArgs);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ public function __invoke(array $args, array $assocArgs)
}

// Output final class to new file/folder and finish.
$class->outputWrite(Helpers::getProjectPaths('srcDestination', 'AdminMenus'), "{$className}.php", $assocArgs);
$class->outputWrite(Helpers::getProjectPaths('src', 'AdminMenus'), "{$className}.php", $assocArgs);
}
}
2 changes: 1 addition & 1 deletion src/AdminMenus/AdminPatternsMenu/AdminPatternsMenuCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ public function __invoke(array $args, array $assocArgs)
}

// Output final class to new file/folder and finish.
$class->outputWrite(Helpers::getProjectPaths('srcDestination', 'AdminMenus'), "{$className}.php", $assocArgs);
$class->outputWrite(Helpers::getProjectPaths('src', 'AdminMenus'), "{$className}.php", $assocArgs);
}
}
2 changes: 1 addition & 1 deletion src/AdminMenus/AdminSubMenuCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ public function __invoke(array $args, array $assocArgs)
->searchReplaceString($this->getArgTemplate('capability'), $capability)
->searchReplaceString($this->getArgTemplate('menu_slug'), $menuSlug)
->searchReplaceString($this->getArgTemplate('view_component'), $viewComponent)
->outputWrite(Helpers::getProjectPaths('srcDestination', 'AdminMenus'), "{$className}.php", $assocArgs);
->outputWrite(Helpers::getProjectPaths('src', 'AdminMenus'), "{$className}.php", $assocArgs);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ public function __invoke(array $args, array $assocArgs)
}

// Output final class to new file/folder and finish.
$class->outputWrite(Helpers::getProjectPaths('srcDestination', 'AdminMenus'), "{$className}.php", $assocArgs);
$class->outputWrite(Helpers::getProjectPaths('src', 'AdminMenus'), "{$className}.php", $assocArgs);
}
}
2 changes: 1 addition & 1 deletion src/AnalyticsGdpr/AnalyticsGdprCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ public function __invoke(array $args, array $assocArgs)
$this->getExampleTemplate(__DIR__, $className)
->renameClassName($className)
->renameGlobals($assocArgs)
->outputWrite(Helpers::getProjectPaths('srcDestination', 'AnalyticsGdpr'), "{$className}.php", $assocArgs);
->outputWrite(Helpers::getProjectPaths('src', 'AnalyticsGdpr'), "{$className}.php", $assocArgs);
}
}
2 changes: 1 addition & 1 deletion src/BlockPatterns/BlockPatternCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function __invoke(array $args, array $assocArgs)
->searchReplaceString($this->getArgTemplate('name'), $name)
->searchReplaceString($this->getArgTemplate('content'), $content)
->searchReplaceString($this->getArgTemplate('description'), $description)
->outputWrite(Helpers::getProjectPaths('srcDestination', 'BlockPatterns'), "{$className}.php", $assocArgs);
->outputWrite(Helpers::getProjectPaths('src', 'BlockPatterns'), "{$className}.php", $assocArgs);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Blocks/BlocksCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ public function __invoke(array $args, array $assocArgs)
// Read the template contents, and replace the placeholders with provided variables.
$class->renameClassName($className)
->renameGlobals($assocArgs)
->outputWrite(Helpers::getProjectPaths('blocksDestination'), "{$className}.php", $assocArgs);
->outputWrite(Helpers::getProjectPaths('blocksRoot'), "{$className}.php", $assocArgs);
}
}
10 changes: 5 additions & 5 deletions src/Cache/AbstractManifestCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected function getCacheBuilder(): array
return [
self::TYPE_BLOCKS => [
self::SETTINGS_KEY => [
'path' => 'blocksDestination',
'path' => 'blocksRoot',
'multiple' => false,
'validation' => [
'$schema',
Expand Down Expand Up @@ -182,7 +182,7 @@ protected function getCacheBuilder(): array
],
],
self::BLOCKS_KEY => [
'path' => 'blocksDestinationCustom',
'path' => 'blocks',
'id' => 'blockName',
'multiple' => true,
'autoset' => [
Expand Down Expand Up @@ -212,7 +212,7 @@ protected function getCacheBuilder(): array
],
],
self::COMPONENTS_KEY => [
'path' => 'blocksDestinationComponents',
'path' => 'components',
'multiple' => true,
'id' => 'componentName',
'validation' => [
Expand All @@ -222,7 +222,7 @@ protected function getCacheBuilder(): array
],
],
self::VARIATIONS_KEY => [
'path' => 'blocksDestinationVariations',
'path' => 'variations',
'id' => 'name',
'multiple' => true,
'validation' => [
Expand All @@ -235,7 +235,7 @@ protected function getCacheBuilder(): array
],
],
self::WRAPPER_KEY => [
'path' => 'blocksDestinationWrapper',
'path' => 'wrapper',
'validation' => [
'$schema',
'title',
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/ManifestCacheCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ public function __invoke(array $args, array $assocArgs)
$this->getExampleTemplate(__DIR__, $className)
->renameClassName($className)
->renameGlobals($assocArgs)
->outputWrite(Helpers::getProjectPaths('srcDestination', 'Cache'), "{$className}.php", $assocArgs);
->outputWrite(Helpers::getProjectPaths('src', 'Cache'), "{$className}.php", $assocArgs);
}
}
Loading