Cannot use League\Uri\Components\Exception as Exception because the name is already in use #92
Comments
jdme commented Jun 26, 2018
Summary
Current version of thephpleague/uri-components:>=1.7.0 is in conflict with thephpleague/uri-parser . I have a php compile error:
Cannot use League\Uri\Components\Exception as Exception because the name is already in use
Both packages are using same namespace League\Uri and thephpleague/uri-parser already have class Exception in this namespace.
Workaround
Use fixed version 1.6.0 instead while this issue isn’t fixed.
The text was updated successfully, but these errors were encountered:
nyamsprod commented Jun 27, 2018
Thanks for using this library. Could you please provide more info like the OS and PHP version you are using. Of note, these classes while having the same name do not belong in the same namespace one is in
League\Uri while the other is in League\Uri\Components so they should not collide unless I’m missing something.
jdme commented Jun 27, 2018
Could you please provide more info like the OS and PHP version you are using.
My system is macOS 10.12.6 and PHP 7.0.5
Of note, these classes while having the same name do not belong in the same namespace one is in
League\Uri while the other is in League\Uri\Components so they should not collide unless I’m missing something.
PHPUnit 6.0 does not work with PHP 7.0.0-7.0.12 #2470
Comments
nyoro712 commented Feb 4, 2017
PHPUnit does not work since I updated it to 6.0 from 5.7.9.
The error message is as below:
On PHPUnit 6.0.3
On PHPUnit 6.0.0, 6.0.1, and 6.0.2 (Maybe this message is the same as #2460 )
I’m using PHPUnit with XAMPP on Windows 7 SP1 (64bit), and XAMPP is installed in D:\xampp .
I met the error in the following steps:
- Access https://phar.phpunit.de/phpunit.phar by a web browser.
- A file phpunit-6.0.3.phar is downloaded automatically.
- Rename the file to phpunit .
- Move the file to D:\xampp\php .
- Run > phpunit —version on cmd.exe
- Error
The text was updated successfully, but these errors were encountered:
sebastianbergmann commented Feb 4, 2017
I can reproduce this with PHP 7.0.7 on Windows 10:
sebastianbergmann commented Feb 4, 2017
I cannot reproduce this with PHP 7.1.1 on Windows 10:
Filter which tests to run. —testsuite Filter which testsuite to run. —group . Only runs tests from the specified group(s). —exclude-group . Exclude tests from the specified group(s). —list-groups List available test groups. —list-suites List available test suites. —test-suffix . Only search for test in files with specified suffix(es). Default: Test.php,.phpt Test Execution Options: —dont-report-useless-tests Do not report tests that do not test anything. —strict-coverage Be strict about @covers annotation usage. —strict-global-state Be strict about changes to global state —disallow-test-output Be strict about output during tests. —disallow-resource-usage Be strict about resource usage during small tests. —enforce-time-limit Enforce time limit based on test size. —disallow-todo-tests Disallow @todo-annotated tests. —process-isolation Run each test in a separate PHP process. —globals-backup Backup and restore $GLOBALS for each test. —static-backup Backup and restore static attributes for each test. —colors= Use colors in output («never», «auto» or «always»). —columns Number of columns to use for progress output. —columns max Use maximum number of columns for progress output. —stderr Write to STDERR instead of STDOUT. —stop-on-error Stop execution upon first error. —stop-on-failure Stop execution upon first error or failure. —stop-on-warning Stop execution upon first warning. —stop-on-risky Stop execution upon first risky test. —stop-on-skipped Stop execution upon first skipped test. —stop-on-incomplete Stop execution upon first incomplete test. —fail-on-warning Treat tests with warnings as failures. —fail-on-risky Treat risky tests as failures. -v|—verbose Output more verbose information. —debug Display debugging information. —loader TestSuiteLoader implementation to use. —repeat Runs the test(s) repeatedly. —teamcity Report test execution progress in TeamCity format. —testdox Report test execution progress in TestDox format. —testdox-group Only include tests from the specified group(s). —testdox-exclude-group Exclude tests from the specified group(s). —printer
TestListener implementation to use. Configuration Options: —bootstrap A «bootstrap» PHP file that is run before the tests. -c|—configuration Read configuration from XML file. —no-configuration Ignore default configuration file (phpunit.xml). —no-coverage Ignore code coverage configuration. —no-extensions Do not load PHPUnit extensions. —include-path
Prepend PHP’s include_path with given path(s). -d key[=value] Sets a php.ini value. —generate-configuration Generate configuration file with suggested settings. Miscellaneous Options: -h|—help Prints this usage information. —version Prints the version and exits. —atleast-version Checks that version is greater than min and exits. —check-version Check whether PHPUnit is the latest version.»>
Looks like this is related to the PHP version rather than to the operating system.
Compile Error: Exception because the name is already in use #462
Comments
KotetsuNoAkai commented Mar 9, 2018
when i tried to make a pay in palpay express or offline, i have this error:
Compile Error: Cannot use League\Uri\Components\Exception as Exception because the name is already in use.
in vendor\league\uri-components\src\QueryParser.php (line 20)
public function processPaymentAction(Bookings $booking)
<
$storage = $this->get(‘payum’)->getStorage(Payment::class);
My composer.json:
<
«type»: «project»,
«license»: «proprietary»,
«require»: <
«php»: «^7.0.8»,
«ext-iconv»: ««,
«easycorp/easyadmin-bundle»: «^1.17»,
«egeloen/ckeditor-bundle»: «^6.0»,
«league/uri-components»: «@dev»,
«payum/paypal-express-checkout-nvp»: «^1.4»,
«payum/offline»: «^1.5»,
«payum/payum-bundle»: «^2.2»,
«php-http/guzzle6-adapter»: «^1.1»,
«sensio/framework-extra-bundle»: «^5.1»,
«stof/doctrine-extensions-bundle»: «^1.3»,
«symfony/apache-pack»: «^1.0»,
«symfony/asset»: «^3.4»,
«symfony/console»: «^3.4»,
«symfony/debug-pack»: ««,
«symfony/expression-language»: «^3.4»,
«symfony/flex»: «^1.0»,
«symfony/form»: «^3.4»,
«symfony/framework-bundle»: «^3.4»,
«symfony/lts»: «^3»,
«symfony/monolog-bundle»: «^3.1»,
«symfony/orm-pack»: ««,
«symfony/process»: «^3.4»,
«symfony/security-bundle»: «^3.4»,
«symfony/serializer-pack»: ««,
«symfony/swiftmailer-bundle»: «^3.1»,
«symfony/validator»: «^3.4»,
«symfony/web-link»: «^3.4»,
«symfony/webpack-encore-pack»: ««,
«symfony/yaml»: «^3.4»
>,
«require-dev»: <
«doctrine/doctrine-fixtures-bundle»: «^3.0»,
«symfony/browser-kit»: «^3.4»,
«symfony/css-selector»: «^3.4»,
«symfony/dotenv»: «^3.4»,
«symfony/maker-bundle»: «^1.0»,
«symfony/phpunit-bridge»: «^3.4»,
«symfony/profiler-pack»: «»
>,
«config»: <
«preferred-install»: <
««: «dist»
>,
«sort-packages»: true
>,
«autoload»: <
«psr-4»: <
«App\»: «src/»
>
>,
«autoload-dev»: <
«psr-4»: <
«App\Tests\»: «tests/»
>
>,
«replace»: <
«symfony/polyfill-iconv»: ««,
«symfony/polyfill-php70»: ««,
«symfony/polyfill-php56»: «»
>,
«scripts»: <
«auto-scripts»: <
«cache:clear»: «symfony-cmd»,
«assets:install —symlink —relative %PUBLIC_DIR%»: «symfony-cmd»
>,
«post-install-cmd»: [
«@auto-scripts»
],
«post-update-cmd»: [
«@auto-scripts»
]
>,
«conflict»: <
«symfony/symfony»: «*»
>,
«extra»: <
«symfony»: <
«id»: «01C80JWP1A032K4AM6DMBNNC57»,
«allow-contrib»: false
>
>
>
The text was updated successfully, but these errors were encountered:
Ошибка Cannot declare class
Цитата |
---|
Федор Михайлов написал: Может быть есть другие советы |
Цитата |
---|
Павел Петриенко написал: если судить по аналогии с файлами element.php & elementtable.php |
Цитата |
---|
Антон Егоров написал: Если это особенность обновления, то может быть это нужно задокументировать, с пометкой «после обновления удалите вручную такой-то файл». |
Здравствуйте. У меня возникла похожая проблема но с компонентом меню.
Несколько лет назад была сделана копия этого компонента для кастомизации в папку «/bitrix/components/user/menu/», которая и использовалась. При этом платформа периодически обновлялась. Однако несколько месяцев назад было решено подключить меню из папки «/bitrix/components/bitrix/menu/», что вызвало следующую ошибку:
Цитата |
---|
Olgert написал: Подскажите пожалуйста как исправить эту проблемму? |
Цитата |
---|
Olgert написал: Подскажите пожалуйста как исправить эту проблемму? |
Либо не использовать оба компонента одновременно, либо (что самое правильное и так нужно было сделать изначально) переименовать класс в кастомизированном компоненте.
Спасибо!
Действительно оказалось что на странице использовалось еще одно меню из папки «/bitrix/components/user/menu/». И когда я переподключил нужное меню из папки «bitrix» второе осталось подключенным из папки «user» и это вызвало ошибку. Спасибо буду знать.
З.Ы. Если что наш сайт не коммерческий и поддерживается полупрофессионалом.
В моем случае были ошибка «Cannot declare class Bitrix\Iblock\ElementTable, because the name is already in use», при этом страница открывалась в браузере, но выдавала ошибку 500. Данную ошибку вызывал типовой компонент «Просмотренные товары».
Cannot use File as File because the name is already in use #3184
Comments
alvaro-canepa commented Oct 19, 2017
Expected behavior
Access to backend, menu Settings > Mail Templates must show all normal setting
Actual behavior
Access to backend, menu Settings > Mail Templates show error exception
Cannot use File as File because the name is already in use
/home/cms/public_html/modules/system/models/MailTemplate.php line 4
The log doesn’t show any stack trace
Reproduce steps
This happen after update to build 426
October build
PHP Version
The text was updated successfully, but these errors were encountered:
LukeTowers commented Oct 19, 2017
Looks like this would be caused by the fact that there is a System\Models\File class in the same namespace (see https://stackoverflow.com/a/17747378/6652884) but I have no idea why it would only just now become an issue for you.
What build of October were you previously running?
What is your server environment like? i.e. what server software are you using?
Also, could you check if this also affects Mail Layout, Mail Partials, and Mail Brand Settings?
alvaro-canepa commented Oct 20, 2017
This affect Mail Layout, Mail Partials, and Mail Brand Settings too. And the same issue affect to MediaManager, but with Form class instead of File .
I have another OC (same server) with build 424 and I can access to Mail Templates, but if I send an email, I have this exception.
The server is an Ubuntu Linux 15.10
Apache 2.4.23
PHP 7.0.9
The environment is development, this installation is for devel and test plugins and themes.
Plugins installed: