GithubHelp home page GithubHelp logo

tamtamchik / namecase Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 7.0 98 KB

PHP package that converts names into the correct case where it is possible.

Home Page: https://tamtamchika.net/namecase

License: MIT License

PHP 100.00%
composer-package framework-agnostic namecase php

namecase's Introduction

namecase's People

Contributors

jdhartley avatar magiclegend avatar nexxai avatar peter279k avatar sacret avatar tamtamchik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

namecase's Issues

PHP Notice on empty string parameter

If the string parameter supplied to nameCase is empty (""), PHP generates a notice with message "Uninitialized string offset: 0" that comes from here:

$firstLetterLower = $string[0] == mb_strtolower($string[0]);

It would be better to just check earlier that the string is empty and then return the empty string back instead of trying to access a character that does not exist.

Postnominal exceptions

I don't understand most of post nominals and their origin. But is it possible to add exceptions option to not use some of them?

Reason is in Czech and other Slavic languages "Most" can be valid surname - meaning bridge. It is very rare but there are some occasions. Would it be possible to add post nominal exceptions? I don't want to disable all of them.

Btw. some of them are duplicated like BSc or MR etc

"MBE" is missing in POST_NOMINALS

Hi I just happened to notice that "MBE" is missing in the POST_NOMINALS constant in src/Formatter.php (it would be on line 86).

"OBE", "CBE", "KBE" and "DBE" are all present, so I assume it's just an oversight.

support for html encoded strings

Currently if I pass & through, namecase changes it to &Amp; which breaks decoding. Please add an ignore for html encoded entities.
<, >, &amp, ' and "

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.