Global variable or function should never be used 14

More information: https://insight.symfony.com/what-we-analyse/php.use_global_variable_or_function

in src/helpers.php, line 4
  1. <?php
  2. if (!function_exists('ebr')) {
  3. function ebr($string)

    ebr() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  4. {
  5. $string = e(preg_replace('#<br\s*/?>#', "\n", $string));
  6. return nl2br($string);
  7. }
in src/helpers.php, line 13
  1. return nl2br($string);
  2. }
  3. }
  4. if (!function_exists('set_locale')) {
  5. function set_locale($category, $locale = false)

    set_locale() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return Clumsy\Utils\Facades\EnvironmentLocale::set($category, $locale);
  8. }
  9. }
in src/helpers.php, line 20
  1. return Clumsy\Utils\Facades\EnvironmentLocale::set($category, $locale);
  2. }
  3. }
  4. if (!function_exists('get_possible_locales')) {
  5. function get_possible_locales($locale)

    get_possible_locales() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return Clumsy\Utils\Facades\EnvironmentLocale::getPossibleLocales($locale);
  8. }
  9. }
in src/helpers.php, line 27
  1. return Clumsy\Utils\Facades\EnvironmentLocale::getPossibleLocales($locale);
  2. }
  3. }
  4. if (!function_exists('floatAsInt')) {
  5. function floatAsInt($number, $scale = 100)

    floatAsInt() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return (int) round(bcmul($number, $scale, 2));
  8. }
  9. }
in src/helpers.php, line 34
  1. return (int) round(bcmul($number, $scale, 2));
  2. }
  3. }
  4. if (!function_exists('inCents')) {
  5. function inCents($number)

    inCents() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return floatAsInt($number, 100);
  8. }
  9. }
in src/helpers.php, line 41
  1. return floatAsInt($number, 100);
  2. }
  3. }
  4. if (!function_exists('n')) {
  5. function n($number)

    n() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. if (class_exists('NumberFormatter')) {
  8. $formatter = new NumberFormatter(Clumsy\Utils\Facades\EnvironmentLocale::preferred(), NumberFormatter::DECIMAL);
  9. return $formatter->format($number);
in src/helpers.php, line 54
  1. return number_format($number);
  2. }
  3. }
  4. if (!function_exists('money')) {
  5. function money($number)

    money() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. if (class_exists('NumberFormatter')) {
  8. $formatter = new NumberFormatter(Clumsy\Utils\Facades\EnvironmentLocale::preferred(), NumberFormatter::CURRENCY);
  9. return $formatter->formatCurrency((int)$number, $formatter->getTextAttribute(NumberFormatter::CURRENCY_CODE));
in src/helpers.php, line 73
  1. return $p_cs_precedes ? $currency_symbol.$space.$n : $n.$space.$currency_symbol;
  2. }
  3. }
  4. if (!function_exists('pc')) {
  5. function pc($number)

    pc() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. if (class_exists('NumberFormatter')) {
  8. $formatter = new NumberFormatter(Clumsy\Utils\Facades\EnvironmentLocale::preferred(), NumberFormatter::PERCENT);
  9. return $formatter->format($number);
in src/helpers.php, line 86
  1. return n(bcmul($number, 100)).'%';
  2. }
  3. }
  4. if (!function_exists('display_date')) {
  5. function display_date($date, $format)

    display_date() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return Clumsy\Utils\Facades\Date::format($date, $format);
  8. }
  9. }
in src/helpers.php, line 100
  1. |--------------------------------------------------------------------------
  2. |
  3. */
  4. if (!function_exists('array_is_nested')) {
  5. function array_is_nested($array)

    array_is_nested() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. return (bool)is_array($array) && is_array(current($array));
  8. }
  9. }
in src/helpers.php, line 114
  1. |--------------------------------------------------------------------------
  2. |
  3. */
  4. if (!function_exists('parseLinks')) {
  5. function parseLinks($string)

    parseLinks() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. // Links
  8. $string = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/ui", "$1http://$2", $string);
  9. $string = preg_replace("/([\w]+:\/\/[\w-_?&;#~%=\.\/\@]+[\w\/])/ui", "<a target=\"_blank\" href=\"$1\">$1</a>", $string);
in src/helpers.php, line 128
  1. return $string;
  2. }
  3. }
  4. if (!function_exists('parseTweet')) {
  5. function parseTweet($string)

    parseTweet() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. $string = parseLinks($string);
  8. // Twitter users
  9. $string = preg_replace("/@(\w+)/", "<a target=\"_blank\" href=\"https://twitter.com/$1\">@$1</a>", $string);
in src/helpers.php, line 155
  1. | cycle through them all).
  2. |
  3. */
  4. if (!function_exists('groupedImage')) {
  5. function groupedImage($src, $group = null, $alt = null, array $attributes = [], $secure = null)

    groupedImage() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. app('clumsy.assets')->load('grouped-images-loader');
  8. $attributes = array_merge(
  9. [
in src/helpers.php, line 185
  1. | Note: actual loading must be done by a script -- this is HTML only
  2. |
  3. */
  4. if (!function_exists('lazyLoad')) {
  5. function lazyLoad($src, $alt = null, array $attributes = [])

    lazyLoad() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. {
  7. $attributes = app('html')->attributes(array_merge(
  8. array(
  9. 'data-src' => $src,
  10. 'alt' => $alt,

PHP configuration should not be changed dynamically

More information: https://insight.symfony.com/what-we-analyse/php.dynamically_change_configuration

  1. *
  2. * @return void
  3. */
  4. public function up()
  5. {
  6. ini_set('memory_limit', '-1');

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. set_time_limit(0);
  8. if (function_exists('bzdecompress')) {
  9. $tables = file_get_contents('https://raw.githubusercontent.com/tbuteler/postal-sql/master/pt/pt.sql.bz2');
  10. $tables = bzdecompress($tables);

Source code should not contain TODO comments 28

More information: https://insight.symfony.com/what-we-analyse/task_todo_comment

  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();
  1. /**
  2. * in case the datetimepicker has been applied to a non-input tag for inline UI,
  3. * and the user has not configured the plugin to display only time in altInput,
  4. * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
  5. *
  6. * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tomas Buteler
  7. */
  8. currDT = tp_inst.$altInput.val();
  9. }
  10. else {
  11. currDT = tp_inst.$input.val();

Object parameters should be type hinted 3

More information: https://insight.symfony.com/what-we-analyse/php.object_parameter_not_type_hinted

  1. trait TriggersMessage
  2. {
  3. public static function bootTriggersMessage()
  4. {
  5. self::created(function ($model) {

    The parameter model, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. if (!count($model->getRecipients('to')) || !$model->shouldSendMessage()) {
  7. return;
  8. }
  1. return property_exists($this, 'acknowledgeSubject') ? $this->acknowledgeSubject : null;
  2. }
  3. public function mailMessage()
  4. {
  5. Mail::send($this->messageView(), ['model' => $this], function ($message) {

    The parameter message, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. foreach (['to', 'cc', 'bcc'] as $method) {
  7. foreach ($this->getRecipients($method) as $address => $recipient) {
  8. if (!$address) {
  9. // Allow recipients to be non-associative array of addresses
  1. });
  2. }
  3. public function mailAcknowledge()
  4. {
  5. Mail::send($this->acknowledgeView(), ['model' => $this], function ($message) {

    The parameter message, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. $message->to($this->originatorEmail(), $this->originatorName());
  7. $message->subject($this->acknowledgeSubject());
  8. });
  9. }
  10. }

Unused method, property, variable or parameter 10

More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. namespace Clumsy\Utils\Validation;
  2. class CurrentPassword
  3. {
  4. public function validate($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. $guard = count($parameters) ? head($parameters) : null;
  7. if (!auth($guard)->check()) {
  8. return false;
  9. }
  1. namespace Clumsy\Utils\Validation;
  2. class EmailAdvanced
  3. {
  4. public function validate($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. // First we validate email, so when using email_advanced validation
  7. // method, there is no need to use the default email valiation
  8. if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
  9. return false;
  1. // method, there is no need to use the default email valiation
  2. if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
  3. return false;
  4. }
  5. list($localPart, $domain) = explode('@', $value);

    This localPart local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  6. // Check if domain is on our "disposable" list
  7. if (in_array($domain, static::disposable())) {
  8. return false;
  9. }
  1. use Illuminate\Support\Facades\DB;
  2. class Postal
  3. {
  4. public function validate($attribute, $value, $parameters)

    This parameters argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (strlen((string)$value) !== 5) {
  7. return false;
  8. }
  1. use Illuminate\Support\Facades\DB;
  2. class Postal
  3. {
  4. public function validate($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (strlen((string)$value) !== 5) {
  7. return false;
  8. }
  1. namespace Clumsy\Utils\Validation;
  2. class MultiplesOf
  3. {
  4. public function validate($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if ($value % head($parameters) != 0) {
  7. return false;
  8. }
  1. namespace Clumsy\Utils\Validation\PT;
  2. class Identities
  3. {
  4. public function nif($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (!is_numeric($value) || strlen($value) !== 9) {
  7. return false;
  8. }
  1. namespace Clumsy\Utils\Validation\PT;
  2. class Identities
  3. {
  4. public function nif($attribute, $value, $parameters)

    This parameters argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (!is_numeric($value) || strlen($value) !== 9) {
  7. return false;
  8. }
  1. use Illuminate\Support\Facades\DB;
  2. class Postal
  3. {
  4. public function validate($attribute, $value, $parameters)

    This attribute argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (!preg_match('/^[0-9]{4}\-[0-9]{3}$/', $value)) {
  7. return false;
  8. }
  1. use Illuminate\Support\Facades\DB;
  2. class Postal
  3. {
  4. public function validate($attribute, $value, $parameters)

    This parameters argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
  5. {
  6. if (!preg_match('/^[0-9]{4}\-[0-9]{3}$/', $value)) {
  7. return false;
  8. }

Text files should end with a valid new line character. 2

More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l

  1. - docker-php-ext-install bcmath
  2. - composer --version
  3. - phpunit --version
  4. - composer self-update
  5. - composer install --prefer-source --no-interaction
  6. - phpunit

    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler
in .travis.yml, line 15
  1. - composer install --prefer-source --no-interaction --dev
  2. script: phpunit
  3. after_script:
  4. - php vendor/bin/codacycoverage clover coverage.xml

    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tomas Buteler