misd-service-development / phone-number-bundle

Integrates libphonenumber into your Symfony2-Symfony4 application
459 stars 143 forks source link

ClassNotFoundException #118

Closed Nexotap closed 7 years ago

Nexotap commented 7 years ago

While using the version 1.2 I get following error:

ClassNotFoundException in appDevDebugProjectContainer.php line 3434: Attempted to load class "PhoneNumberUtil" from namespace "libphonenumber". Did you forget a "use" statement for "libphonenumber\PhoneNumberUtil"?

Here the Stacktrace:

1. in appDevDebugProjectContainer.php line 3434
2. at appDevDebugProjectContainer->getLibphonenumber_PhoneNumberUtilService() in Container.php line 274
3. at Container->get('libphonenumber.phone_number_util') in appDevDebugProjectContainer.php line 3531
4. at appDevDebugProjectContainer->getMisdPhoneNumber_Templating_Helper_FormatService() in Container.php line 274
5. at Container->get('misd_phone_number.templating.helper.format') in appDevDebugProjectContainer.php line 8545
6. at appDevDebugProjectContainer->getTwigService() in Container.php line 274
7. at Container->get('twig') in appDevDebugProjectContainer.php line 8012
8. at appDevDebugProjectContainer->getTemplatingService() in Container.php line 274
9. at Container->get('templating') in appDevDebugProjectContainer.php line 3852
10. at appDevDebugProjectContainer->getNelmioApiDoc_Formatter_HtmlFormatterService() in Container.php line 274
11. at Container->get('nelmio_api_doc.formatter.html_formatter') in appDevDebugProjectContainer.php line 3800
12. at appDevDebugProjectContainer->getNelmioApiDoc_EventListener_RequestService() in Container.php line 274
13. at Container->get('nelmio_api_doc.event_listener.request') in classes.php line 2264
14. at ContainerAwareEventDispatcher->lazyLoad('kernel.request') in classes.php line 2233
15. at ContainerAwareEventDispatcher->getListeners('kernel.request') in TraceableEventDispatcher.php line 241
16. at TraceableEventDispatcher->preProcess('kernel.request') in TraceableEventDispatcher.php line 131
17. at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in HttpKernel.php line 129
18. at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 68
19. at HttpKernel->handle(object(Request), '1', true) in Kernel.php line 169
20. at Kernel->handle(object(Request)) in app_dev.php line 31

Can someone enlighten me, please?

xabbuh commented 7 years ago

Can you show the output of composer show?

Nexotap commented 7 years ago

Here you are. I hope it helps.

- behat/transliterator                     v1.1.0             String transliterator
- clue/stream-filter                       v1.3.0             A simple and modern approach to stream filtering in PHP
- cocur/slugify                            v2.3               Converts a string into a slug.
- doctrine/annotations                     v1.3.1             Docblock Annotations Parser
- doctrine/cache                           v1.6.1             Caching library offering an object-oriented API for many cache backends
- doctrine/collections                     v1.3.0             Collections Abstraction library
- doctrine/common                          v2.6.2             Common Library for Doctrine projects
- doctrine/data-fixtures                   v1.2.2             Data Fixtures for all Doctrine Object Managers
- doctrine/dbal                            v2.5.5             Database Abstraction Layer
- doctrine/doctrine-bundle                 1.6.4              Symfony DoctrineBundle
- doctrine/doctrine-cache-bundle           1.3.0              Symfony Bundle for Doctrine Cache
- doctrine/inflector                       v1.1.0             Common String Manipulations with regard to casing and singular/plural rules.
- doctrine/instantiator                    1.0.5              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
- doctrine/lexer                           v1.0.1             Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
- doctrine/orm                             v2.5.6             Object-Relational-Mapper for PHP
- doctrine/phpcr-bundle                    1.3.5              Symfony DoctrinePHPCRBundle
- doctrine/phpcr-odm                       1.4.0              Object-Document-Mapper for PHPCR
- friendsofsymfony/jsrouting-bundle        1.6.0              A pretty nice way to expose your Symfony2 routing to client applications.
- friendsofsymfony/rest-bundle             2.1.1              This Bundle provides various tools to rapidly develop RESTful API's with Symfony
- friendsofsymfony/user-bundle             dev-master 962a7f3 Symfony FOSUserBundle
- gedmo/doctrine-extensions                v2.4.26            Doctrine2 behavioral extensions
- giggsey/libphonenumber-for-php           8.0                PHP Port of Google's libphonenumber
- giggsey/locale                           1.1.1              Locale functions required by libphonenumber-for-php
- guzzlehttp/guzzle                        6.2.2              Guzzle is a PHP HTTP client library
- guzzlehttp/promises                      v1.3.1             Guzzle promises library
- guzzlehttp/psr7                          1.3.1              PSR-7 message implementation
- imagine/imagine                          v0.6.3             Image processing for PHP 5.3
- incenteev/composer-parameter-handler     v2.1.2             Composer script handling your ignored parameter file
- jackalope/jackalope                      1.2.7              Jackalope PHPCR library
- jackalope/jackalope-doctrine-dbal        1.2.8              Jackalope Transport library for Doctrine DBAL
- jdorn/sql-formatter                      v1.2.17            a PHP SQL highlighting library
- jeremykendall/php-domain-parser          3.0.0              Public Suffix List based URL parsing implemented in PHP.
- jms/aop-bundle                           1.2.0              Adds AOP capabilities to Symfony2
- jms/cg                                   1.2.0              Toolset for generating PHP code
- jms/di-extra-bundle                      1.8.1              Allows to configure dependency injection using annotations
- jms/metadata                             1.6.0              Class/method/property metadata management in PHP
- jms/parser-lib                           1.0.0              A library for easily creating recursive-descent parsers.
- jms/serializer                           1.4.2              Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.
- jms/serializer-bundle                    1.1.0              Allows you to easily serialize, and deserialize data of any complexity
- jms/translation-bundle                   1.3.1              Puts the Symfony Translation Component on steroids
- knplabs/gaufrette                        0.2.1              PHP5 library that provides a filesystem abstraction layer
- knplabs/knp-components                   1.3.4              Knplabs component library
- knplabs/knp-menu                         2.2.0              An object oriented menu library
- knplabs/knp-menu-bundle                  2.1.3              This bundle provides an integration of the KnpMenu library
- knplabs/knp-paginator-bundle             2.5.3              Paginator bundle for Symfony2 to automate pagination and simplify sorting and other features
- kriswallsmith/buzz                       v0.15              Lightweight HTTP client
- league/uri                               4.2.2              URI manipulation library
- michelf/php-markdown                     1.7.0              PHP Markdown
- misd/phone-number-bundle                 v1.2.0             Integrates libphonenumber into your Symfony2 application
- monolog/monolog                          1.22.0             Sends your logs to files, sockets, inboxes, databases and various web services
- nelmio/api-doc-bundle                    2.13.0             Generates documentation for your REST API from annotations
- nikic/php-parser                         v2.1.1             A PHP parser written in PHP
- paragonie/random_compat                  v2.0.4             PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
- payum/core                               1.3.8              Payum offers everything you need to work with payments. From simplest use cases to very advanced ones.
- payum/iso4217                            1.0.1              ISO 4217 PHP Library
- payum/offline                            1.3.7              The Payum extension. It provides Offline payment integration.
- payum/paypal-express-checkout-nvp        1.3.7              The Payum extension. It provides Paypal ExpressCheckout payment integration.
- payum/payum-bundle                       2.1.1              Rich payment solutions for symfony2. Paypal, payex, authorize.net, be2bill, omnipay, recurring payments, instant notifications and many more
- php-http/guzzle6-adapter                 v1.1.1             Guzzle 6 HTTP Adapter
- php-http/httplug                         v1.1.0             HTTPlug, the HTTP client abstraction for PHP
- php-http/message                         v1.4.1             HTTP Message related tools
- php-http/message-factory                 v1.0.2             Factory interfaces for PSR-7 HTTP Message
- php-http/promise                         v1.0.0             Promise used for asynchronous HTTP requests
- phpcollection/phpcollection              0.5.0              General-Purpose Collection Library for PHP
- phpcr/phpcr                              2.1.2              PHP Content Repository interfaces
- phpcr/phpcr-utils                        1.2.10             PHP Content Repository implementation independant utilities
- phpoption/phpoption                      1.5.0              Option Type for PHP
- psr/cache                                1.0.1              Common interface for caching libraries
- psr/http-message                         1.0.1              Common interface for HTTP messages
- psr/log                                  1.0.2              Common interface for logging libraries
- sensio/distribution-bundle               v5.0.16            Base bundle for Symfony Distributions
- sensio/framework-extra-bundle            v3.0.18            This bundle provides a way to configure your controllers with annotations
- sensio/generator-bundle                  v3.1.2             This bundle generates code for you
- sensiolabs/ansi-to-html                  v1.1.2             A library to convert a text with ANSI codes to HTML
- sensiolabs/security-checker              v4.0.0             A security checker for your composer.lock
- sonata-project/admin-bundle              3.10.3             The missing Symfony Admin Generator
- sonata-project/block-bundle              3.2.0              Symfony SonataBlockBundle
- sonata-project/cache                     1.0.7              Cache library
- sonata-project/classification-bundle     3.1.0              Symfony SonataClassificationBundle
- sonata-project/core-bundle               3.1.2              Symfony SonataCoreBundle
- sonata-project/datagrid-bundle           2.2                Symfony SonataDatagridBundle
- sonata-project/doctrine-extensions       1.0.2              Doctrine2 behavioral extensions
- sonata-project/doctrine-orm-admin-bundle 3.1.2              Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
- sonata-project/easy-extends-bundle       2.1.10             Symfony SonataEasyExtendsBundle
- sonata-project/exporter                  1.7.0              Lightweight Exporter library
- sonata-project/intl-bundle               2.2.4              Symfony SonataIntlBundle
- sonata-project/media-bundle              3.3.0              Symfony SonataMediaBundle
- sonata-project/notification-bundle       3.0.0              Symfony SonataNotificationBundle
- stof/doctrine-extensions-bundle          v1.2.2             Integration of the gedmo/doctrine-extensions with Symfony2
- swiftmailer/swiftmailer                  v5.4.5             Swiftmailer, free feature-rich PHP mailer
- symfony/monolog-bundle                   2.12.0             Symfony MonologBundle
- symfony/phpunit-bridge                   v3.2.1             Symfony PHPUnit Bridge
- symfony/polyfill-apcu                    v1.3.0             Symfony polyfill backporting apcu_* functions to lower PHP versions
- symfony/polyfill-intl-icu                v1.3.0             Symfony polyfill for intl's ICU-related data and classes
- symfony/polyfill-mbstring                v1.3.0             Symfony polyfill for the Mbstring extension
- symfony/polyfill-php56                   v1.3.0             Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
- symfony/polyfill-php70                   v1.3.0             Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
- symfony/polyfill-util                    v1.3.0             Symfony utilities for portability of PHP codes
- symfony/security-acl                     v3.0.0             Symfony Security Component - ACL (Access Control List)
- symfony/swiftmailer-bundle               v2.4.2             Symfony SwiftmailerBundle
- symfony/symfony                          v3.1.8             The Symfony PHP framework
- twig/extensions                          v1.4.1             Common additional features for Twig that do not directly belong in core
- twig/twig                                v1.30.0            Twig, the flexible, fast, and secure template language for PHP
- willdurand/jsonp-callback-validator      v1.1.0             JSONP callback validator.
- willdurand/negotiation                   v2.2.1             Content Negotiation tools for PHP provided as a standalone library.
- zendframework/zenddiagnostics            v1.0.9             A set of components for performing diagnostic tests in PHP applications
xabbuh commented 7 years ago

Looks like an autoloading issue that could be related to the switch from PSR-0 to PSR-4 the lib made in 8.0. You can try rebuild the autoloader using composer dump-autoload.

Nexotap commented 7 years ago

That solved the problem. Allthough I dont know much about the difference between PSR-0 and PSR-4, I was thinking, that it should be enough to just clear the cache. Seems not ;)

Thank you!