Skip to content

Commit

Permalink
Update wpcs to 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 15, 2023
1 parent 04a5cd2 commit 1b3c5cd
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 28 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "t-hamano/richtext-extension",
"description": "WordPress plugin to add useful decoration features to the Gutenberg RichText editor toolbar.",
"description": "WordPress plugin to add useful decoration features to the Gutenberg RichText editor toolbar.",
"license": "GPL-2.0-or-later",
"authors": [
{
Expand All @@ -9,10 +9,10 @@
],
"require-dev": {
"squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "*"
"wp-coding-standards/wpcs": "^3.0"
},
"scripts": {
"phpcs": "phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"phpcs": "phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcsstandards/phpcsextra,vendor/phpcsstandards/phpcsutils",
"lint": "phpcs ./ --standard=./phpcs.ruleset.xml"
}
}
249 changes: 233 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions inc/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Config {
/**
* Default highlighter variation
*/
static $highlighter = array(
public static $highlighter = array(
array(
'color' => '#ffff66',
'thickness' => 40,
Expand Down Expand Up @@ -41,5 +41,5 @@ class Config {
/**
* Default font size variation
*/
static $font_size = array( 80, 90, 130, 160 );
public static $font_size = array( 80, 90, 130, 160 );
}
4 changes: 2 additions & 2 deletions inc/class-enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Enqueue {
/**
* Constructor
*/
function __construct() {
public function __construct() {
// Enqueue front-end scripts
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );

Expand Down Expand Up @@ -50,7 +50,7 @@ public function enqueue_editor_scripts() {

wp_add_inline_style( RTEX_NAMESPACE, $inline_css );

$asset = include( RTEX_PATH . '/build/index.asset.php' );
$asset = include RTEX_PATH . '/build/index.asset.php';
wp_enqueue_script( RTEX_NAMESPACE, RTEX_URL . '/build/index.js', $asset['dependencies'] );

wp_localize_script( RTEX_NAMESPACE, 'rtexConf', $this->create_editor_config() );
Expand Down
10 changes: 5 additions & 5 deletions inc/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function __construct() {
* Load classes
*/
private function load_classes() {
require_once( RTEX_PATH . '/inc/class-config.php' );
require_once( RTEX_PATH . '/inc/class-enqueue.php' );
require_once( RTEX_PATH . '/inc/class-options.php' );
require_once RTEX_PATH . '/inc/class-config.php';
require_once RTEX_PATH . '/inc/class-enqueue.php';
require_once RTEX_PATH . '/inc/class-options.php';
}

/**
Expand All @@ -46,15 +46,15 @@ public function add_action_links( $links ) {
public static function uninstall_richtext_extension() {
$options = array();

for ( $i = 0; $i <= 3; $i ++ ) {
for ( $i = 0; $i <= 3; $i++ ) {
$options[] = 'rtex_highlighter_active_' . $i;
$options[] = 'rtex_highlighter_title_' . $i;
$options[] = 'rtex_highlighter_color_' . $i;
$options[] = 'rtex_highlighter_thickness_' . $i;
$options[] = 'rtex_highlighter_opacity_' . $i;
}

for ( $i = 0; $i <= 3; $i ++ ) {
for ( $i = 0; $i <= 3; $i++ ) {
$options[] = 'rtex_font_size_active_' . $i;
$options[] = 'rtex_font_size_title_' . $i;
$options[] = 'rtex_font_size_size_' . $i;
Expand Down

0 comments on commit 1b3c5cd

Please sign in to comment.