Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/royrakesh/skeleton-php
A skeleton for modern PHP development, providing a clean structure and essential tooling.
https://github.com/royrakesh/skeleton-php
composer composer-package php
Last synced: 3 days ago
JSON representation
A skeleton for modern PHP development, providing a clean structure and essential tooling.
- Host: GitHub
- URL: https://github.com/royrakesh/skeleton-php
- Owner: royrakesh
- License: mit
- Created: 2025-02-01T14:31:42.000Z (4 days ago)
- Default Branch: main
- Last Pushed: 2025-02-01T15:23:24.000Z (4 days ago)
- Last Synced: 2025-02-01T15:27:29.574Z (4 days ago)
- Topics: composer, composer-package, php
- Language: PHP
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Skeleton PHP
![PHP Skeleton](https://img.shields.io/badge/PHP-Skeleton-blue.svg)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/royrakesh/skeleton-php/php.yml?branch=main)A skeleton for modern PHP development, providing a clean structure and essential tooling.
## 🚀 Features
- PSR-4 autoloading
- Pest for testing
- Laravel Pint for code formatting
- PHPStan for static analysis
- Rector for code refactorin
- Compatible with php 8.2 , 8.3 and 8.4## 🛠 Usage
### Lint Code
```sh
composer lint
```### Run Unit Test
```sh
composer test:unit
```### Static Analysis
```sh
composer test:types
```### Test Code Format
```sh
composer test:lint
```### Run Everything
```sh
composer test
```## 🏗 Folder Structure
```
src/ # Main source code
tests/ # Unit and feature tests
```## ✨ Example Implementation
### Greeting Contract
```php
greetingService = new GreetingService();
}public function greet(string $name): string
{
return $this->greetingService->greet($name);
}
}
```### Pest Test for GreetingService
```php
greet('Rakesh'))->toBe('Hello, Rakesh!');
});
```### Pest Test for Greeting
```php
greet('Rakesh');expect($result)->toBe('Hello, Rakesh!');
});it('greets a user with an empty name', function () {
$greeting = new Greeting();$result = $greeting->greet('');
expect($result)->toBe('Hello, !');
});
```## 🔗 Credits
This package utilizes the following open-source tools:
- [PestPHP](https://pestphp.com/) - A modern PHP testing framework.
- [Laravel Pint](https://github.com/laravel/pint) - An opinionated PHP code formatter.
- [PHPStan](https://phpstan.org/) - Static analysis tool for PHP.
- [Rector](https://github.com/rectorphp/rector) - Automated code refactoring tool.## 📝 License
This project is licensed under the MIT License.## 👤 Author
**Rakesh Roy**
[Website](https://royrakesh.dev) | [Email](mailto:[email protected])