Skip to content

About

Learning PHP: Syntax, OOP, Design Patterns, New Features

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

Repository files navigation

PHP Practice

A simple repository for practicing PHP fundamentals, object-oriented programming, design patterns, Composer, PSR-4 autoloading, and static analysis with PHPStan.

Requirements

  • PHP
  • Composer

Setup

Install dependencies:

composer install

Generate the Composer autoloader:

composer dump-autoload

Configuration Files

The repository includes pre-configured settings for static analysis and code quality:

  • phpstan.neon (PHPStan config)
  • phpcs.xml (PHP_CodeSniffer ruleset)

Running PHP Files

Run any PHP file directly using the PHP CLI:

php src/oop/abstraction/run.php

Autoloading

Classes inside src/ are autoloaded using Composer PSR-4:

src/
└── oop/
    └── encapsulation/
        └── BankAccount.php

PHPStan (Static Analysis)

Run static analysis:

composer analyse

PHP_CodeSniffer (Code Quality)

Checking coding standards:

composer cs

Automatically fix violations:

composer cs:fix

This repository is primarily for learning, experimentation, and improving PHP fundamentals.

About

Learning PHP: Syntax, OOP, Design Patterns, New Features

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages