How to Install and Get Started With PHP Composer

preview_player
Показать описание
Install and run php composer globally

To install go to

Run the following script on your

Рекомендации по теме
Комментарии
Автор

I need to do this by using PHP and composer and this is the task, so what does this mean and how am I suppose to do it? Sorry I never programmed in PHP or used Composer before, Can u help?


*The task
[The aim is is implement the source code link to pass the pre written tests.

To run the tests run ./vendor/bin/phpunit and look at the output.

The toInt function should be able to translate any Roman Numerial to the correct integer.

For example VI should return 6 and XX should return 20

Cant get phpunit running ?
Included is an index file (index.php) This should run on any web server (eg MAMP, XAMP etc)]

*and this is what the source code looks like!

<?php
namespace PhpNwSykes;

class RomanNumeral
{
protected $symbols = [
1000 => 'M',
500 => 'D',
100 => 'C',
50 => 'L',
10 => 'X',
5 => 'V',
1 => 'I',
];

protected $numeral;

public function __construct(string $romanNumeral)
{
$this->numeral = $romanNumeral;
}

/**
* Converts a roman numeral such as 'X' to a number, 10
*
* @throws InvalidNumeral on failure (when a numeral is invalid)
*/
public function toInt():int
{
$total = 0;

return $total;
}
}

and this is the link to the actual exercise if you want to see for yourself! :0

@t

and this is the link to that actual source code! :0

@t

*Please feel free to copy and paste the links into your browser instead, for your safety if you want!

releNtless-euxc