for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Bcl\EasyPdfCloud;
use function mb_strlen;
class StringUtils
{
/**
* Returns length of multibyte string
*
* @param string $string
* @param string $encoding
* @return int
*/
public static function length(string $string, string $encoding = Constraints::UTF_8): int
return mb_strlen($string, $encoding);
}
* Checks if multibyte string is empty
* @return bool
public static function isEmpty(string $string, string $encoding = Constraints::UTF_8): bool
$encoding
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public static function isEmpty(string $string, /** @scrutinizer ignore-unused */ string $encoding = Constraints::UTF_8): bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return 0 === self::length($string, $encoding = Constraints::UTF_8);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.