Skip to content

Commit

Permalink
chore(): add deprecations (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
domtra authored Oct 19, 2020
1 parent ff82ebd commit 9cbc5ea
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/scripts/ExternalScriptLoader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let instance

class ExternalScriptLoader {
constructor () {
console.warn('ExternalScriptLoader is deprecated since version %%NEXT_VERSION%% with no alternative available.')
if (!instance) {
instance = this
}
Expand Down
4 changes: 4 additions & 0 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ module.exports = {
php: {
files: '!(node_modules|dist)/**/*.php',
from: '%%NEXT_VERSION%%'
},
js: {
files: '!(node_modules|dist)/**/*.js',
from: '%%NEXT_VERSION%%'
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function replaceVersion (config) {
for (const file of changedFilesPhp) {
log(`Updated ${file}`)
}
log(`Replacing ${config.replaceVersion.js.from} with ${config.replaceVersion.js.to} in all JS files.`)
const changedFilesJs = replace.sync(config.replaceVersion.js)
for (const file of changedFilesJs) {
log(`Updated ${file}`)
}

// replace WordPress theme version in style.css
log('Updating WordPress theme version.')
Expand Down
2 changes: 1 addition & 1 deletion lib/Defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static function renderComponent($output, $componentName, $componentData)
return $output;
}

// this action needs to be removed by the user if they want to overwrite this functionality
public static function loadFunctionsFile($componentName)
{
$componentManager = ComponentManager::getInstance();
Expand All @@ -34,6 +33,7 @@ public static function loadFunctionsFile($componentName)

protected static function renderFile($componentData, $filePath)
{
_deprecated_function(__METHOD__, '%%NEXT_VERSION%%');
if (!is_file($filePath)) {
trigger_error("Template not found: {$filePath}", E_USER_WARNING);
return '';
Expand Down
2 changes: 2 additions & 0 deletions lib/Utils/ArrayHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ArrayHelpers
*/
public static function isAssoc(array $array)
{
_deprecated_function(__METHOD__, '%%NEXT_VERSION%%');
// Keys of the array
$keys = array_keys($array);

Expand All @@ -34,6 +35,7 @@ public static function isAssoc(array $array)
*/
public static function indexedValuesToAssocKeys(array $array)
{
_deprecated_function(__METHOD__, '%%NEXT_VERSION%%');
$values = array_map(function ($value) {
return is_array($value) ? $value : [];
}, $array);
Expand Down

0 comments on commit 9cbc5ea

Please sign in to comment.