Skip to content

edu-cat/php-trainee-template

Repository files navigation

Course Build

php-trainings

PHP Education program

Table of Contents

  1. Pre-requirements
  2. Workflow
  3. Special Notes
  4. See also

Pre-requirements

  1. It's highly recommended to use Ubuntu latest stable edition.
  2. Install php 8.1 following instructions for your OS.
  3. Install and enable at least php-xml extension.
  4. Install Composer tool.
    • If you are using GNU/Linux, run as the last Composer installation step:
    mv composer.phar /usr/local/bin/composer
    chmod a+x /usr/local/bin/composer
  5. Optional steps if you don't yet have public/private keys for your GitHub account:
    • Generate public/private keys for Github. You can use ssh-keygen command with parameters on GNU/Linux (press Enter for any prompt):
    ssh-keygen -t ecdsa -b 521 -C "course_key" -f ~/.ssh/github_php_course
    • Create ~/.ssh/config file with following instructions:
    # GitHub.com
    Host github.com
    UpdateHostKeys no
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/github_php_course
    
    • Copy ssh public key to your GitHub profile.
  6. Identify yourself for GitHub:
git config --global user.name "Your Name"
git config --global user.email "your_email"

Workflow

  1. Clone this repository to your machine.
  2. Subscribe to the repository to be able to receive any notification on it.
  3. Create separate branch and folders in src/ and tests/ for each task.
  4. When you are ready to show your solution (task and tests), create Pull Request (PR).
  5. If you have errors reported by GitHub Actions, check their details and fix issues.

Special Notes

  1. See Task1 source and test files as example.

  2. Use PSR-12 and PSR-4 for code styling, autoload, etc.

  3. Use English for comments, class, properties, methods, functions, etc.

  4. If you use files without class declaration, add your src file to includes.php file to be able to run tests.

  5. Before creating PR run following commands in your machine

    • composer style to check code style
    • composer analyse to perform static analyze
    • composer tests to run tests
  6. Create PR only after all above commands run with green (success) return status.

See also

  1. PHP Documentation
  2. PHP: The Right Way
  3. CutCode - PHP
  4. CutCode
  5. Laracasts
  6. SymfonyCasts
  7. Laravel Daily
  8. PHP Point
  9. Composer
  10. Git Book

About

Starter project template for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages