Completed
Push — master ( c48475...3a1116 )
by Askupa
02:12
created

bootstrap.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 20 and the first side effect is on line 14.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * WordPress Widget
4
 *
5
 * Develop WordPress widgets based on Amarkal UI.
6
 * This is a component within the Amarkal framework.
7
 *
8
 * @package   amarkal-widget
9
 * @depends   amarkal-ui
10
 * @author    Askupa Software <[email protected]>
11
 * @link      https://github.com/askupasoftware/amarkal-widget
12
 * @copyright 2017 Askupa Software
13
 */
14
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
15
16
/**
17
 * Prevent loading the library more than once
18
 */
19
if( defined( 'AMARKAL_WIDGET' ) ) return;
20
define( 'AMARKAL_WIDGET', true );
21
22
/**
23
 * Load required classes if not using composer
24
 */
25
if( !class_exists('Composer\\Autoload\\ClassLoader') )
26
{
27
    require_once 'AbstractWidget.php';
28
    require_once 'FormField.php';
29
}
30
31
/**
32
 * Print widget styles
33
 */
34
function amarkal_widget_style() 
35
{
36
    $cs = get_current_screen();
37
    if( 'widgets' === $cs->base )
38
    {
39
        echo '<style>';
40
        include 'widget.css';
41
        echo '</style>';
42
    }
43
}
44
add_action('admin_footer', 'amarkal_widget_style');