diff --git a/src/Cache/AbstractManifestCache.php b/src/Cache/AbstractManifestCache.php index 0a7bc0dee..b9070b0e6 100644 --- a/src/Cache/AbstractManifestCache.php +++ b/src/Cache/AbstractManifestCache.php @@ -302,15 +302,15 @@ protected function getCacheBuilder(): array 'hasInnerBlocks' => 'boolean', ], 'validation' => [ - 'blockName', + '$schema', + 'title', + 'description', 'namespace', + 'blockName', 'blockFullName', 'keywords', 'icon', 'category', - 'description', - 'title', - '$schema', ], ], self::COMPONENTS_KEY => [ @@ -318,9 +318,9 @@ protected function getCacheBuilder(): array 'multiple' => true, 'id' => 'componentName', 'validation' => [ - 'componentName', '$schema', 'title', + 'componentName', ], ], self::VARIATIONS_KEY => [ @@ -328,19 +328,19 @@ protected function getCacheBuilder(): array 'id' => 'name', 'multiple' => true, 'validation' => [ - 'name', '$schema', - 'parentName', 'title', - 'icon', 'description', + 'icon', + 'name', + 'parentName', ], ], self::WRAPPER_KEY => [ 'path' => 'blocksDestinationWrapper', 'validation' => [ '$schema', - 'title' + 'title', ], ], ], diff --git a/src/CustomPostType/PostTypeExample.php b/src/CustomPostType/PostTypeExample.php index b52092dd6..6b8243b75 100644 --- a/src/CustomPostType/PostTypeExample.php +++ b/src/CustomPostType/PostTypeExample.php @@ -82,12 +82,12 @@ protected function getPostTypeArguments(): array 'name' => esc_html_x( '%label%', 'post type plural name', - 'infobip' + 'eightshift-libs' ), 'singular_name' => esc_html_x( '%plural_label%', 'post type singular name', - 'infobip' + 'eightshift-libs' ), ], // phpcs:enable diff --git a/src/CustomTaxonomy/TaxonomyExample.php b/src/CustomTaxonomy/TaxonomyExample.php index 5bca2ebc5..754b4edd6 100644 --- a/src/CustomTaxonomy/TaxonomyExample.php +++ b/src/CustomTaxonomy/TaxonomyExample.php @@ -71,12 +71,12 @@ protected function getTaxonomyArguments(): array 'name' => esc_html_x( '%label%', 'taxonomy plural name', - 'infobip' + 'eightshift-libs' ), 'singular_name' => esc_html_x( '%plural_label%', 'taxonomy singular name', - 'infobip' + 'eightshift-libs' ), ], // phpcs:enable diff --git a/src/Exception/InvalidBlock.php b/src/Exception/InvalidBlock.php index 734606dc1..9d4eae8cd 100644 --- a/src/Exception/InvalidBlock.php +++ b/src/Exception/InvalidBlock.php @@ -51,7 +51,7 @@ public static function missingItemException(string $name, string $type): Invalid return new InvalidBlock( \sprintf( /* translators: %1$s is going to be replaced with the component/block name, %2$s with type. */ - \esc_html__('You are trying to get %1$s %2$s. Please check if you have it in your project.', 'eightshift-libs'), + \esc_html__('Trying to get %1$s %2$s. Please check if it exists in the project.', 'eightshift-libs'), $name, $type ) diff --git a/src/Exception/InvalidManifest.php b/src/Exception/InvalidManifest.php index c95e5a9be..eb1e655e7 100644 --- a/src/Exception/InvalidManifest.php +++ b/src/Exception/InvalidManifest.php @@ -31,7 +31,7 @@ public static function missingManifestKeyException(string $key, string $path): I \sprintf( /* translators: %s is replaced by the missing key in the manifest.json */ \esc_html__( - '%1$s key does not exist in manifest.json on this %2$s path. Please check if provided key is correct.', + '%1$s key does not exist in manifest.json at %2$s. Please check if the provided key is correct.', 'eightshift-libs' ), $key, @@ -83,7 +83,7 @@ public static function missingManifestException(string $path): InvalidManifest } /** - * Throws error if manifest try to access on none allowed path. + * Throws error if trying to access manifest on non allowed path. * * @param string $path Missing manifest path. * @@ -95,7 +95,7 @@ public static function notAllowedManifestPathException(string $path): InvalidMan \sprintf( /* translators: %s is replaced by the path privided */ \esc_html__( - 'You are trying to get manifest.json outside of the Blocks folder. Please review your implementation. Path you are providing is: %s', + 'Trying to get manifest.json from outside of the Blocks folder. Please check your implementation. Path provided: %s', 'eightshift-libs' ), $path @@ -104,7 +104,7 @@ public static function notAllowedManifestPathException(string $path): InvalidMan } /** - * Throws error if manifest try to access on none allowed path item. + * Throws error if trying to access manifest on non allowed path item. * * @param string $path Missing manifest path. * @@ -116,7 +116,7 @@ public static function notAllowedManifestPathItemException(string $path): Invali \sprintf( /* translators: %s is replaced by the path privided */ \esc_html__( - 'You are tryng to get manifest.json from outside of the Blocks items folder. Allowed folders are: %1$s. Path you are providing is: %2$s', + 'Trying to load manifest.json from outside of allowed folders. Manifest can only be loaded from: %1$s. Provided path: %2$s', 'eightshift-libs' ), \implode(', ', [ diff --git a/src/Exception/InvalidPath.php b/src/Exception/InvalidPath.php index f177ea148..4d0aa3539 100644 --- a/src/Exception/InvalidPath.php +++ b/src/Exception/InvalidPath.php @@ -29,7 +29,7 @@ public static function missingDirectoryException(string $path): InvalidPath return new InvalidPath( \sprintf( /* translators: %s is going to be replaced with the missing directory path. */ - \esc_html__('Failed to read directory on this %s path. Please check again.', 'eightshift-libs'), + \esc_html__('Failed to read the directory at "%s". Please check the implementation and try again.', 'eightshift-libs'), $path, ) ); @@ -47,7 +47,7 @@ public static function missingFileException(string $path): InvalidPath return new InvalidPath( \sprintf( /* translators: %s is going to be replaced with the missing file path. */ - \esc_html__('Failed to open file on this %s path. Please check again.', 'eightshift-libs'), + \esc_html__('Failed to open the file at "%s". Please check the implementation and try again.', 'eightshift-libs'), $path, ) ); @@ -66,7 +66,7 @@ public static function missingFileWithExampleException(string $path, string $exa return new InvalidPath( \sprintf( /* translators: %1$s is going to be replaced with the missing file path. %2$s is going to be replaced with the expected file name. */ - \esc_html__('Failed to open file on this %1$s path. The file expecing should be called %2$s.', 'eightshift-libs'), + \esc_html__('Failed to open the file at "%1$s". Expected file: "%2$s".', 'eightshift-libs'), $path, $example ) @@ -86,7 +86,7 @@ public static function wrongOrNotAllowedParentPathException(string $pathName, st return new InvalidPath( \sprintf( /* translators: %1$s is going to be replaced with the missing file path name. %2$s is going to be replaced with the allowed path names. */ - \esc_html__('You are using wrong or not allowed parent path. You are using %1$s but we only allow %2$s. Please review your implementation.', 'eightshift-libs'), + \esc_html__('Parent path is incorrect or not allowed. Path used: "%1$s". Allowed path: "%2$s". Please check the implementation.', 'eightshift-libs'), $pathName, $allowed ) diff --git a/src/Helpers/ApiTrait.php b/src/Helpers/ApiTrait.php index 540045b12..6460350b8 100644 --- a/src/Helpers/ApiTrait.php +++ b/src/Helpers/ApiTrait.php @@ -20,7 +20,7 @@ trait ApiTrait /** * Return API success response array. * - * @param string $msg Msg for the user. + * @param string $msg Message for the user. * @param array $additional Additonal data to attach to response. * * @return array|int|string> @@ -66,7 +66,7 @@ public static function getApiWarningPublicOutput(string $msg, array $additional /** * Return API error response array. * - * @param string $msg Msg for the user. + * @param string $msg Message for the user. * @param array $additional Additonal data to attach to response. * * @return array|int|string> diff --git a/src/Helpers/DeprecatedTrait.php b/src/Helpers/DeprecatedTrait.php index cf99f70c9..e1b6d6a14 100644 --- a/src/Helpers/DeprecatedTrait.php +++ b/src/Helpers/DeprecatedTrait.php @@ -28,7 +28,7 @@ trait DeprecatedTrait * * @throws InvalidPath If the file is missing. * - * @deprecated 8.0.0 Use Components::render() instead. This method will be removed in the next major release. + * @deprecated 8.0.0 Use Helpers::render() instead. This method will be removed in the next major release. * * @return string Partial html. */ diff --git a/src/Helpers/Helpers.php b/src/Helpers/Helpers.php index 9f7915a47..6c3bcfcbc 100644 --- a/src/Helpers/Helpers.php +++ b/src/Helpers/Helpers.php @@ -245,7 +245,6 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s $internalPrefix = \dirname(__FILE__, 3); $path = self::joinPaths([...$testsDataPath]); } - break; case 'srcDestination': $path = $srcPath; @@ -254,7 +253,6 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s $internalPrefix = \dirname(__FILE__, 3); $path = self::joinPaths([$cliOutputPath, $srcPath]); } - break; case 'cliOutput': case 'root': @@ -264,7 +262,6 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s $internalPrefix = \dirname(__FILE__, 3); $path = $cliOutputPath; } - break; case 'wpContent': $internalPrefix = \dirname(__FILE__, 8); @@ -342,7 +339,6 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s case 'blocksSourceWrapper': $name = 'wrapper'; break; - case 'blocksGlobalAssetsDestination': $path = self::joinPaths([$assetsPath]); diff --git a/src/Helpers/ObjectHelperTrait.php b/src/Helpers/ObjectHelperTrait.php index 0c4664427..0098d856c 100644 --- a/src/Helpers/ObjectHelperTrait.php +++ b/src/Helpers/ObjectHelperTrait.php @@ -270,7 +270,7 @@ public static function parseManifest(string $manifest): array } /** - * Get current url with params. + * Get current URL with params. * * @return string */ @@ -286,7 +286,7 @@ public static function getCurrentUrl(): string /** * Clean url from query params. * - * @param string $url Url to clean. + * @param string $url URL to clean. * * @return string */