Skip to content

Commit

Permalink
Update Character.php (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored and mrook committed Jan 1, 2018
1 parent 34427ec commit 6b9b7c4
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions classes/phing/system/lang/Character.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,12 @@
*/
class Character
{

// this class might be extended with plenty of ordinal char constants
// and the like to support the multibyte aware datatype (char) in php
// in form of an object.
// anyway just a thought

/**
* @param $char
* @return bool
*/
public static function isLetter($char)
{
if (strlen($char) !== 1) {
$char = 0;
}

$char = (int) ord($char);

if ($char >= ord('A') && $char <= ord('Z')) {
return true;
}

if ($char >= ord('a') && $char <= ord('z')) {
return true;
}

return false;
return strlen($char) === 1 && ctype_alpha($char);
}
}

0 comments on commit 6b9b7c4

Please sign in to comment.