Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Make a string uppercase
<?php strtoupper(string $string): string
<?php         $script = $input->getArgument('script');

        if (!in_array($script, $this->scriptEvents)) {

            if (defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {

                throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script));

            }

        }
<?php             case 'cafile':

            case 'capath':


                $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));



                $val = $this->getComposerEnv($env);

                if ($val !== false) {
<?php             case 'cache-read-only':

            case 'htaccess-protect':


                $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));



                $val = $this->getComposerEnv($env);

                if (false === $val) {
<?php             if (is_file($file) && Filesystem::isReadable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {

                if (isset($composer['scripts']) && is_array($composer['scripts'])) {

                    foreach ($composer['scripts'] as $script => $dummy) {

                        if (!defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {

                            if ($this->has($script)) {

                                $io->writeError('<warning>A script named '.$script.' would override a Composer command and has been skipped</warning>');

                            } else {
<?php             }

            $installer = $this->getInstaller($package->getType());



            $event = 'Composer\Installer\PackageEvents::PRE_PACKAGE_'.strtoupper($opType);

            if (defined($event) && $runScripts && $this->eventDispatcher) {

                $this->eventDispatcher->dispatchPackageEvent(constant($event), $devMode, $repo, $allOperations, $operation);

            }
<?php             });



            $postExecCallbacks[] = function () use ($opType, $runScripts, $dispatcher, $devMode, $repo, $allOperations, $operation) {

                $event = 'Composer\Installer\PackageEvents::POST_PACKAGE_'.strtoupper($opType);

                if (defined($event) && $runScripts && $dispatcher) {

                    $dispatcher->dispatchPackageEvent(constant($event), $devMode, $repo, $allOperations, $operation);

                }
<?php     public static function fingerprint($path)

    {

        $hash = strtoupper(hash('sha256', Preg::replace('{\s}', '', file_get_contents($path))));



        return implode(' ', array(

            substr($hash, 0, 8),
<?php         if (in_array(strtoupper(self::getEnv('MSYSTEM') ?: ''), array('MINGW32', 'MINGW64'), true)) {

            return true;

        }
<?php         $splitDriveLetter = function ($path) {

            return (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0]))

                ? [substr($path, 2), strtoupper($path[0])]

                : [$path, null];

        };