valksor/php-dev

Development tools and utilities for PHP projects including build automation, file watching, and custom PHP-CS-Fixer rules

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/valksor/php-dev

dev-master / 1.0.x-dev 2025-11-02 02:30 UTC

This package is auto-updated.

Last update: 2025-11-02 03:01:28 UTC


README

BSD-3-Clause codecov

A comprehensive PHP development toolkit that provides modern development tools, custom PHP-CS-Fixer fixers, build automation, and hot reloading capabilities for Symfony applications. This library enhances development workflow efficiency with integrated tooling for frontend builds, code quality, and real-time development features.

Features

  • Build Tools: Hot reloading, asset compilation, import map management, and development workflow automation
  • Custom PHP-CS-Fixer Fixers: Enhanced code quality enforcement with modern PHP 8.4+ best practices
  • Hot Reloading: Automatic browser reload on file changes using inotify
  • Asset Management: Integrated support for ESBuild, Tailwind CSS, and DaisyUI
  • Binary Management: Unified binary download and version management for build tools
  • Process Orchestration: Coordinated execution of multiple development services
  • SSE Integration: Seamless integration with Server-Sent Events for live updates

Requirements

  • PHP 8.4 or higher
  • inotify extension (for file watching)
  • PCNTL extension (for process management)
  • POSIX extension
  • friendsofphp/php-cs-fixer (3.81.0 or higher)
  • symfony/framework-bundle (7.2.0 or higher)
  • Valksor Bundle and related components

Installation

Install the package via Composer:

composer require valksor/php-dev

This meta-package automatically includes:

  • valksor/php-dev-build - Build tools and hot reloading
  • valksor/php-dev-cs-fixer-custom-fixers - Custom PHP-CS-Fixer fixers

Basic Usage

Quick Setup

  1. Register the bundle in your Symfony application:
// config/bundles.php
return [
    // ...
    Valksor\Bundle\ValksorBundle::class => ['all' => true],
    // ...
];
  1. Enable the build tools and configure:
# config/packages/valksor.yaml
valksor:
    build:
        enabled: true
        hot_reload:
            enabled: true
            watch_paths:
                - 'templates/'
                - 'src/'
                - 'assets/'

Start Development Environment

# Start all development tools (hot reload, asset compilation, etc.)
php bin/console valksor:watch

Configure PHP-CS-Fixer

// .php-cs-fixer.php
use PhpCsFixer\Config;
use ValksorDev\PhpCsFixerCustomFixers\Fixers;

$config = new Config();
$config
    ->setRules([
        '@PSR12' => true,
        'ValksorPhpCsFixerCustomFixers/declare_after_opening_tag' => true,
        'ValksorPhpCsFixerCustomFixers/promoted_constructor_property' => true,
        // Add more custom fixers as needed
    ]);

// Register custom fixers
$fixers = new Fixers();
foreach ($fixers as $fixer) {
    $config->registerCustomFixers([$fixer]);
}

return $config;

Documentation

Advanced Usage

Custom Configuration

valksor:
    build:
        enabled: true
        hot_reload:
            enabled: true
            watch_paths:
                - 'templates/'
                - 'src/Controller/'
                - 'assets/js/'
            exclude_patterns:
                - 'vendor/'
                - 'var/'
            debounce_ms: 100
            sse_port: 8080
        tailwind:
            enabled: true
            input: 'assets/css/app.css'
            output: 'public/build/app.css'
            minify: false
        binaries:
            download_dir: 'bin/build-tools/'
            esbuild_version: 'latest'
            tailwind_version: 'latest'

Development Workflow Integration

The toolkit integrates seamlessly with modern Symfony development workflows:

  • Real-time Development: Automatic browser reload on template, CSS, JavaScript, and PHP changes
  • Asset Compilation: Integrated Tailwind CSS compilation with DaisyUI components
  • Import Maps: Automatic JavaScript import map generation and synchronization
  • Code Quality: Enhanced PHP-CS-Fixer with modern PHP 8.4+ best practices

Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on:

  • Code style requirements (PSR-12)
  • Testing requirements for PRs
  • One feature per pull request
  • Development setup instructions

To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Security

If you discover any security-related issues, please email us at security@valksor.dev instead of using the issue tracker.

For security policy and vulnerability reporting guidelines, please see our Security Policy.

Support

Credits

License

This package is licensed under the BSD-3-Clause License.