Completed
Push — master ( c3be30...b70f61 )
by Freek
04:55 queued 03:04
created

src/Exceptions/InvalidConfiguration.php (1 issue)

Suggest using single quotes for string literals when possible

Coding Style Comprehensibility Informational

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
2
3
namespace NotificationChannels\Authy\Exceptions;
4
5
use Exception;
6
7
class InvalidConfiguration extends Exception
8
{
9
    public static function missingCredentials()
10
    {
11
        return new static("You need to add credentials in the `authy` in `config/services.php`.");
0 ignored issues
show
Coding Style Comprehensibility introduced by freek
The string literal You need to add credenti... `config/services.php`. does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
12
    }
13
}
14