Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active September 10, 2025 12:59
Show Gist options
  • Save iegik/20bfa6bc5a6bcc64a65324310759c824 to your computer and use it in GitHub Desktop.
Save iegik/20bfa6bc5a6bcc64a65324310759c824 to your computer and use it in GitHub Desktop.

PHP

Tools

  • pint - lint to PSR2 by default, able to lint with PSR12 composer require --dev laravel/peck
  • peck - fix typos composer require --dev peckphp/peck
  • phpstan - type checking composer require --dev phpstan/phpstan
  • rector - .. composer require --dev rector/rector
## Makefile:
PATH:="./vendor/bin:$(PATH)"
SHELL:=env PATH=$(PATH) /bin/bash
check:
	@pint ; rector . ; phpstan analyze *.php;

peck not working donno w

File structure

project-root/
├── public/
│   ├── index.php      # Entry point
│   └── assets/        # CSS, JS, images
├── src/               # Core application code
│   ├── Controller/
│   ├── Model/
│   ├── Service/           # Business logic and utility functions
│   └── polyfill.php        # compatibility to lower versions of php
├── config/
│   ├── app.php
│   └── database.php
├── tests/
│   └── Unit/
└── vendor/            # Composer dependencies

Note: On small projects there maybe all in one single root directory, but better to organize with subdirectories

build, vendor, public - usually used on different types of projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment