All information about the project is in the pdf file attached.

All information about the project is in the pdf file attached.


Project 3: PHP Parse Arguments
CINF301: Web Application Development
Assigned: Wednesday, February 27, 2019
Due: Wednesday, March 13, 2019 at midnight
Git Repos Created with README and Invitation Sent By: Friday, February 29, 2019
The assignment involves you writing a program that parses arguments on the command line using a namespace. Your program, testArgs.php, should exist directly in the src directory, while your ParseArgv.php
class should be in src/Models/Utilities. You also need to use Composer at this point, so use the
ClashesNamespaceComposer example to guide you. Running the program involves passing in a list of
arguments on the command line (in any order), of a certain form, for example:
php testArgs.php -v –grades=good -T 5 -l val1,val2,val3 –names=Mussaed,Yazeed,Mikhail
Your code must be able to handle the following types of arguments:
1. a single dash followed by a letter (no space separating them) followed by either no argument or
by a space and either a single argument or a comma-separated list of arguments that are either
integers or strings (e.g. -m 1,2,3 -Z freddie -f -a Isabel,is,31,inches,tall) Let me know
if you are unsure of the exact form of input you must handle.
2. a double dash followed by a string (one or more characters) followed by an equal sign followed by
a comma separated string of arguments or just one argument with no comma, for example
–geek=TRIP,greg,Mohammed,SAM –cool=plante –slick=abdul,hassan,Musab,Abdullah
Note that single and double-dash arguments can be interspersed, as shown in the initial example above.
The code must parse the command line arguments appropriately and output the information into three
groups: FLAGS, SINGLES, and DOUBLES. FLAGS are single dash parameters with no arguments. SINGLES
are single-dash parameters with one or more comma-separated arguments, and DOUBLES are double-dash
parameters with one or more comma-separated arguments. When printing the results, print the category
on one line, followed by all parameters and their arguments on separate lines, followed by the number of
arguments in the line. For the first example, output would look something like:
FLAGS
’v’
SINGLES
’T’ => 5 (1 argument)
’l’ => [0] ’val1’, [1] ’val2’, [2] ’val3’ (3 arguments)
DOUBLES
’grades’ => ’good’ (1 argument)
’names’ => [0] ’Mussaed’, [1] ’Yazeed’, [2] ’Mikhail’ (3 arguments)
The single quotes above are optional. You must also use MAGIC methods to access parsed and/or
unparsed arguments in your main testArgs.php code. To help you with the assignment, you should look
up common array functions in PHP and go over basic PHP commands on php.net or elsewhere. You may
also choose to use regular expressions to help with the assignment.
Your Git repository must be called EXACTLY cinf301-spr19-project-03, and you must create it and
invite me on Github by Friday, February 29, 2019 to avoid a 5% penalty.

Purchase answer to see full
attachment