Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning of a string
<?php ltrim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php }
$typeHint = \ltrim($param['type_hint'], '?');
$typeHint = \ltrim($typeHint, '\\');
<?php $typeHint = \ltrim($param['type_hint'], '?');
$typeHint = \ltrim($typeHint, '\\');
if ($typeHint !== '') {
$typeHints[] = $typeHint;
<?php continue;
}
$name = \ltrim($name, '\\');
$nameLC = \strtolower($name);
if (isset($this->newExceptions[$nameLC]) === true) {
<?php return;
}
$returnTypeHint = \ltrim($returnTypeHint, '\\');
$returnTypeHintLc = \strtolower($returnTypeHint);
if (isset($this->newClasses[$returnTypeHintLc]) === false) {
<?php }
$type = \ltrim($properties['type'], '?'); // Trim off potential nullability.
$type = \strtolower($type);
$typeToken = $properties['type_token'];
<?php continue;
}
$name = \ltrim($name, '\\');
$nameLC = \strtolower($name);
if (isset($this->removedExceptions[$nameLC]) === true) {
<?php return;
}
$returnTypeHint = \ltrim($returnTypeHint, '\\');
$returnTypeHintLc = \strtolower($returnTypeHint);
if (isset($this->removedClasses[$returnTypeHintLc]) === false) {
<?php }
$typeHint = \ltrim($param['type_hint'], '?');
$typeHint = \strtolower($typeHint);
if ($supportsPHP4 === true) {
<?php return;
}
$returnType = \ltrim($properties['return_type'], '?'); // Trim off potential nullability.
$returnType = \strtolower($returnType);
$returnTypeToken = $properties['return_type_token'];
<?php }
foreach ($interfaces as $interface) {
$interface = \ltrim($interface, '\\');
$interfaceLc = \strtolower($interface);
if (isset($this->internalInterfaces[$interfaceLc]) === true) {
$error = 'The interface %s %s';
<?php }
foreach ($interfaces as $interface) {
$interface = \ltrim($interface, '\\');
$interfaceLc = \strtolower($interface);
if (isset($this->newInterfaces[$interfaceLc]) === true) {
<?php private function checkTypeHint($phpcsFile, $stackPtr, $typeHint)
{
$typeHint = \ltrim($typeHint, '?');
$typeHint = \ltrim($typeHint, '\\');
<?php $typeHint = \ltrim($typeHint, '?');
$typeHint = \ltrim($typeHint, '\\');
if ($typeHint === '') {
return;
<?php foreach ($exceptions as $exception) {
$name = \ltrim($exception['type'], '\\');
$nameLC = \strtolower($name);
if (isset($this->newInterfaces[$nameLC]) === true) {
<?php if (\ltrim($tokens[$stackPtr]['content']) !== $tokens[$stackPtr]['content']) {
$phpcsFile->addError($indentError, $stackPtr, $indentErrorCode);
}