Skip to content

ArielMAJ/php-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP challenge

About

This is a PHP challenge. It's a simple application that prints a cross or a X, depending on the user's input.

How to prepare your environment

Windows

An easy way to install things on Windows is using Chocolatey on PowerShell with administrative rights. It's a package manager for Windows, similar to brew on Mac and apt/apt-get on Linux. This section will suggest how to install the required tools using Chocolatey. Feel free to use any other method you prefer.

  1. Install Chocolatey;
  2. Open PowerShell with administrative rights by pressing Win + X and then pressing A;
  3. Make sure you have git installed;
    • Check your git version with git --version;
    • If it is not installed, run: choco install git.install;
  4. Install php;
    • Check your php version with php -v;
    • If it is not installed, run: choco install php;
  5. Install composer;
    • Check your composer version with composer --version;
    • If it is not installed, run: choco install composer;
  6. Change directory to somewhere where you want to clone this repository;
  7. Clone this repository;
    • git clone https://github.com/ArielMAJ/php-challenge.git;
  8. Change directory to the cloned repository's src (source) folder;
    • cd php-challenge/src;
  9. Install dependencies (this may take a while);
    • composer install --prefer-source;

Mac and Linux

If you are a Mac or Linux user, feel free to follow the windows step-by-step above using your package manager of choice. I'm assuming that if you use one of these operating systems, you know how to install these things.

How to run the application

  1. Make sure you're in the src folder;
    • cd src/ (if you're in this repository's root folder);
  2. Run the application;
    • php core/main.php;
  3. Follow the instructions on the screen, which are:
    • Press C then Enter to print a Cross;
    • Press X then Enter to print a X;
    • Press Ctrl + C to exit the application, at any point;

How to test the application

To run the unit tests:

  1. Make sure you're in the src folder;
    • cd src/ (if you're in this repository's root folder);
  2. Run the tests (make sure you did step 8 of the preparing you enviroment step-by-step);
    • ./vendor/bin/phpunit --testdox tests/;

Compatibility

This application was developed and tested on Windows 11, using PHP 8.2.4 and Composer 2.5.5. It should work on any other operating system, but it was not tested.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Feel free to contact me, open issues or a discussion if you have any questions or suggestions. I'm always open to feedback. 😄

Author's Front&Back-end Projects

About

My solution to a php challenge.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages