@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function inflectPackageVars($vars) |
14 | 14 | { |
15 | - $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) { |
|
15 | + $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function($matches) { |
|
16 | 16 | return strtoupper($matches[1]); |
17 | 17 | }, $vars['name']); |
18 | 18 |
@@ -215,7 +215,7 @@ |
||
215 | 215 | $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; |
216 | 216 | } |
217 | 217 | |
218 | - return $pattern ? : '(\w+)'; |
|
218 | + return $pattern ?: '(\w+)'; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
@@ -26,9 +26,9 @@ |
||
26 | 26 | class BitrixInstaller extends BaseInstaller |
27 | 27 | { |
28 | 28 | protected $locations = array( |
29 | - 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
29 | + 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
30 | 30 | 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
31 | - 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
31 | + 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
32 | 32 | 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/', |
33 | 33 | 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/', |
34 | 34 | 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/', |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function inflectPackageVars($vars) |
19 | 19 | { |
20 | - $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
20 | + $vars['name'] = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
21 | 21 | return strtoupper($matches[0][1]); |
22 | 22 | }, $vars['name']); |
23 | 23 |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | protected function inflectModuleVars($vars) |
37 | 37 | { |
38 | - $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
39 | - $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- |
|
40 | - $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module |
|
41 | - $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
42 | - $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
38 | + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
39 | + $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- |
|
40 | + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module |
|
41 | + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
42 | + $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
43 | 43 | |
44 | 44 | return $vars; |
45 | 45 | } |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function inflectThemeVars($vars) |
54 | 54 | { |
55 | - $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
56 | - $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- |
|
57 | - $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme |
|
58 | - $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
59 | - $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
55 | + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
56 | + $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- |
|
57 | + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme |
|
58 | + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
59 | + $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
60 | 60 | |
61 | 61 | return $vars; |
62 | 62 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | private function correctPluginName($vars) |
39 | 39 | { |
40 | - $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
40 | + $camelCasedName = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
41 | 41 | return strtoupper($matches[0][1]); |
42 | 42 | }, $vars['name']); |
43 | 43 |
@@ -6,8 +6,8 @@ |
||
6 | 6 | } |
7 | 7 | } |
8 | 8 | if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) { |
9 | - die('You must set up the project dependencies, run the following commands:'.PHP_EOL. |
|
10 | - 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. |
|
11 | - 'php composer.phar install'.PHP_EOL); |
|
9 | + die('You must set up the project dependencies, run the following commands:' . PHP_EOL . |
|
10 | + 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . |
|
11 | + 'php composer.phar install' . PHP_EOL); |
|
12 | 12 | } |
13 | 13 | return $loader; |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // MUST have WordPress. |
10 | -if ( !defined( 'WPINC' ) ) { |
|
11 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
10 | +if (!defined('WPINC')) { |
|
11 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | class WPInv_Admin_Users { |
15 | 15 | private static $instance; |
16 | 16 | |
17 | 17 | public static function run() { |
18 | - if ( !isset( self::$instance ) && !( self::$instance instanceof WPInv_Admin_Users ) ) { |
|
18 | + if (!isset(self::$instance) && !(self::$instance instanceof WPInv_Admin_Users)) { |
|
19 | 19 | self::$instance = new WPInv_Admin_Users; |
20 | 20 | } |
21 | 21 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | public function __construct() { |
26 | - add_filter( 'manage_users_columns', array( $this, 'wpinv_add_user_column') ); |
|
27 | - add_filter( 'manage_users_custom_column', array( $this, 'wpinv_user_column_content') , 10, 3 ); |
|
26 | + add_filter('manage_users_columns', array($this, 'wpinv_add_user_column')); |
|
27 | + add_filter('manage_users_custom_column', array($this, 'wpinv_user_column_content'), 10, 3); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @return mixed |
36 | 36 | */ |
37 | - public function wpinv_add_user_column( $column ) { |
|
38 | - $column['wpinvoicing'] = __('Invoicing','invoicing'); |
|
37 | + public function wpinv_add_user_column($column) { |
|
38 | + $column['wpinvoicing'] = __('Invoicing', 'invoicing'); |
|
39 | 39 | return $column; |
40 | 40 | } |
41 | 41 | |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return string |
50 | 50 | */ |
51 | - function wpinv_user_column_content( $val, $column_name, $user_id ) { |
|
51 | + function wpinv_user_column_content($val, $column_name, $user_id) { |
|
52 | 52 | switch ($column_name) { |
53 | 53 | case 'wpinvoicing' : |
54 | - return $this->get_user_invoices( $user_id ); |
|
54 | + return $this->get_user_invoices($user_id); |
|
55 | 55 | break; |
56 | 56 | default: |
57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @return string |
67 | 67 | */ |
68 | - public function get_user_invoices($user_id){ |
|
68 | + public function get_user_invoices($user_id) { |
|
69 | 69 | $output = ''; |
70 | 70 | $wp_query_args = array( |
71 | 71 | 'post_type' => 'wpi_invoice', |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | |
78 | 78 | $wp_query_args = apply_filters('wpinv_get_user_invoices_args', $wp_query_args, $user_id); |
79 | 79 | |
80 | - $invoices = new WP_Query( $wp_query_args ); |
|
81 | - $count = absint( $invoices->found_posts ); |
|
80 | + $invoices = new WP_Query($wp_query_args); |
|
81 | + $count = absint($invoices->found_posts); |
|
82 | 82 | |
83 | - if(empty($count)){ |
|
84 | - $output .= __('No Invoice(s)','invoicing'); |
|
85 | - }else{ |
|
86 | - $link_url = admin_url( "edit.php?post_type=wpi_invoice&author=".absint($user_id) ); |
|
87 | - $link_text = sprintf( __('Invoices ( %d )', 'invoicing'), $count ); |
|
83 | + if (empty($count)) { |
|
84 | + $output .= __('No Invoice(s)', 'invoicing'); |
|
85 | + } else { |
|
86 | + $link_url = admin_url("edit.php?post_type=wpi_invoice&author=" . absint($user_id)); |
|
87 | + $link_text = sprintf(__('Invoices ( %d )', 'invoicing'), $count); |
|
88 | 88 | $output .= "<a href='$link_url' >$link_text</a>"; |
89 | 89 | } |
90 | 90 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
4 | -if(!class_exists('Ayecode_Addons')) { |
|
3 | +if (!defined('ABSPATH')) exit; |
|
4 | +if (!class_exists('Ayecode_Addons')) { |
|
5 | 5 | |
6 | 6 | abstract class Ayecode_Addons |
7 | 7 | { |