• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Composer Script echo

phpcomposer-php


PHP Snippet 1:

<?php

declare(strict_types=1);

namespace MyApp\Composer;

use Composer\Script\Event;

class ScriptHandler
{
    public static function myScript(Event $event): void
    {
        // Your script here
    }
}

PHP Snippet 2:

public static function myScript(Event $event): void
{
    $event->getIO()->write('foo'):
}

PHP Snippet 3:

"scripts": {
    "post-update-cmd": [
        "MyApp\\Composer\\ScriptHandler::myScript"
    ]
}

Related Snippets

Laravel Displaying image from database

Whats the point of running Laravel with the command 'php artisan serve'?

CodeIgniter extend CI_URI undefined method

Convert every two values of an associative array into key-value pairs

Send POST data via raw JSON with Postman

Laravel PHP: multiple project run at the same time [closed]

Cannot pass null argument when using type hinting

PHP: set a (deep) array key from an array [closed]

httpd.conf on Windows: can't locate API model structure `php8_module`

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

php 7 php.ini upload_max_filesize not working

PHP error: "The zip extension and unzip command are both missing, skipping."

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

How can I pass the list to the component variable in Laravel?

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

About Contact Privacy policy Terms and conditions