Code Monkey home page Code Monkey logo

libphonenumber-for-php-lite's Issues

Adding ShortNumberInfo?

I have a blocker for migrating to libphonenumber-for-php-lite, which is a requirement for ShortNumberInfo.

The metadata for these files in libphonenumber is ~500KB (in comparison, PhoneNumberMetadata is ~1.1MB), and I think I can reduce that by removing empty data from the metadata (as well as the normal short arrays).

My question to the community is: should I? It'll increase the download size of the 'lite' library (current zip is ~300KB, this will go up slightly).

The alternative is creating another library just for the ShortNumberInfo, and have it require the lite package. But that comes with management overhead for me.

Incompatibility PHP8.1

Current behavior

  • PhoneNumberUtil::getInstance() create a exception when it's use without PhoneNumberUtil::resetInstance(); before , the message exception is "exception": "[object] (Error(code: 0): Typed static property libphonenumber\\PhoneNumberUtil::$instance must not be accessed before initialization at /var/task/vendor/giggsey/libphonenumber-for-php-lite/src/PhoneNumberUtil.php:387)

  • When I use PhoneNumberUtil::getInstance() function, I have a other message like that : PHP message: PHP Deprecated: Optional parameter $defaultRegionMetadata declared before required parameter $phoneNumber is implicitly treated as a required parameter in /var/task/vendor/giggsey/libphonenumber-for-php-lite/src/PhoneNumberUtil.php on line 1795

Excepted behavior

  • PhoneNumberUtil::getInstance() must be use without PhoneNumberUtil::resetInstance() first time
  • Parameter $defaultRegionMetadata should not be to have a default value

Improve metadata performance

Would the metadata loading be quicker & smaller if we serialised or var_exported the object itself?

Test:

  • speed
  • max memory
  • size of generated metadata

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.