Completed
Pull Request — master (#1105)
by Tim
42:55
created

warning()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * functions/application/warning.php
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2018 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io/appserver
18
 * @link      http://www.appserver.io
19
 */
20
21
use Psr\Log\LogLevel;
22
use AppserverIo\Appserver\Core\Utilities\LoggerUtils;
23
24
// make sure the function has not already been registered
25
if (!function_exists('warning')) {
26
    /**
27
     * Exceptional occurrences that are not errors.
28
     *
29
     * Example: Use of deprecated APIs, poor use of an API, undesirable things
30
     * that are not necessarily wrong.
31
     *
32
     * @param string $message The message to log
33
     * @param array  $context The context for log
34
     *
35
     * @return void
36
     */
37
    function warning($message, array $context = array())
38
    {
39
        LoggerUtils::log(LogLevel::WARNING, $message, $context);
40
    }
41
}
42