S
S
sham632017-10-21 11:42:54
Python
sham63, 2017-10-21 11:42:54

Issue with composer (on OpenServer)?

Gives errors when issuing commands
Deprecation Notice: The Composer\Package\LinkConstraint\MultiConstraint class is deprecated, use Composer\Semver\Constraint\MultiConstraint instead. in phar://C:/WebServer/OpenServer/domains/dndcrm/composer.phar/src/Composer/Package/LinkConstraint/MultiConstraint.php:17
Deprecation Notice: The Composer\Package\LinkConstraint\LinkConstraintInterface interface is deprecated, use Composer \Semver\Constraint\ConstraintInterface instead. in phar://C:/WebServer/OpenServer/domains/dndcrm/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
[ ErrorException]
Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::whatProvides() should be compatible with
Composer\Repository\ComposerRepository::whatProvides(Composer\DependencyResolver\Pool $pool, $name, $bypassFilters = false
)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kapustlo, 2019-07-25
@Kapustlo

Your problem is that you forget to change the type of the variable and you multiply the string "4" by 2, and not the number 4, and it turns out that the string is repeated twice, becoming "44" (by the way, sometimes a very cool thing, it allows you to solve succinctly defined tasks without using loops)

amont = "4" # Допустим, это мы получили из API

if condition:
    amont = float(amont) * 2

# А дальше, если вам нужно работать с "amont" как со строкой, то просто сделайте str(amont)

Well, if you are sure that you will always have an integer number, then you can, as Ivan Yakushenko wrote, do this:
But note that if a fractional number is passed, an error will be generated. Also keep in mind that the fractional part must be separated by "." so that float() can convert the string to a fractional number, otherwise the error will be thrown again.

M
Maxim Timofeev, 2017-10-21
@webinar

Apparently this plugin is not here:
https://packagist.org/packages/fxp/composer-asset-...
It is not in composer from openServer by default.
So install:

composer global require "fxp/composer-asset-plugin:^1.4.2"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question