You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi im having a hard time figuring out why i get a not found.
I'm trying to add a Headcount.php unit within Amount unit type.
But i get this
Class 'PhpUnitConversion\Unit\Amount\HeadCount' not found
First parameter is the server path that's the correct path to my HeadCount.php
Second im not sure what to use
Third the class of the unit type I want to add it to
This is my HeadCount.php unit
namespace PhpUnitConversion\Unit\Amount;
use PhpUnitConversion\Unit\Amount;
class HeadCount extends Amount
{
const FACTOR = 1;
const SYMBOL = 'hc';
const LABEL = 'head count';
}
Initlization:
$hd = new \PhpUnitConversion\Unit\Amount\HeadCount(343);
I need to initilize it like above reason i have dynamic way of calling it
I dont think its possible to re-use the same namespace? It shouldnt be necessary at least.
Namespaces are linked to a folder on disk, the PhpUnitConversion\Unit\Amount namespace should be pointing to a folder in vendor but your HeadCount file isnt located in vendor right? Did you try using a custom namespace?
Hi im having a hard time figuring out why i get a not found.
I'm trying to add a Headcount.php unit within Amount unit type.
But i get this
Class 'PhpUnitConversion\Unit\Amount\HeadCount' not found
I'm using the UnitMap::add
First parameter is the server path that's the correct path to my HeadCount.php
Second im not sure what to use
Third the class of the unit type I want to add it to
This is my HeadCount.php unit
Initlization:
I need to initilize it like above reason i have dynamic way of calling it
Looking in Map.php source code the static load() adds it to self:$paths like this
"[["/var/www/vhost/biome/vendor/php-unit-conversion/php-unit-conversion/src/Unit/"
"PhpUnitConversion\Unit"
true
null]
["/var/www/vhost/biome/app/helpers/unitconversion/Fixtures/Amount/HeadCount.php"
"PhpUnitConversion\Unit"
true
"PhpUnitConversion\Unit\Amount"]]"
The text was updated successfully, but these errors were encountered: