PHP code example of coretsia / devtools-internal-toolkit

1. Go to this page and download the library: Download coretsia/devtools-internal-toolkit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

coretsia / devtools-internal-toolkit example snippets


Json::encodeStable(array $value): string

array_is_list(...)

Path::normalizeRelative(
    string $absOrRelPath,
    string $repoRoot,
): string

Slug::toStudly(string $slug): string
Slug::toSnake(string $slug): string



declare(strict_types=1);

use Coretsia\Devtools\InternalToolkit\Json;
use Coretsia\Devtools\InternalToolkit\Path;
use Coretsia\Devtools\InternalToolkit\Slug;

$slug = Slug::toSnake('InternalToolkit');

$path = Path::normalizeRelative(
    '/repo/packages/devtools/internal-toolkit',
    '/repo',
);

$json = Json::encodeStable([
    'path' => $path,
    'slug' => $slug,
]);
text
JSON_UNESCAPED_SLASHES
JSON_UNESCAPED_UNICODE
JSON_THROW_ON_ERROR
text
CORETSIA_JSON_FLOAT_FORBIDDEN
text
CORETSIA_INTERNAL_TOOLKIT_JSON_UNSUPPORTED_TYPE