PHP code example of stolt / skill-md

1. Go to this page and download the library: Download stolt/skill-md 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/ */

    

stolt / skill-md example snippets


 $skillMdData = [
    'name' => 'Code Review',
    'description' => 'Performs automated code reviews.',
    'body' => '# Some longer, skill describing Markdown content.',
    'version' => '1.0.0',
    'tags' => ['php', 'qa'],
];

$skillMd = SkillMd::fromArray($skillMdData);

$skillMd = new SkillMd(
    'Code Review',
    'Performs automated code reviews.',
    '# Some longer, skill describing Markdown content.',
    ['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);

$skillMdViaFactory = SkillMd::create(
    'Code Review',
    'Performs automated code reviews.',
    '# Some longer, skill describing Markdown content.',
    ['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);

$skillName = $skillMd->name();
$skillDescription = $skillMd->description();
$skillBody = $skillMd->body();
$skillVersion = $skillMd->version();
$skillTags = $skillMd->tags();
$skillLicense = $skillMd->get('license');

if ($skill->has('unsupported-field') === false) {
    echo 'This field is not supported.';
}

if ($skill->get('unsupported-field') === null) {
    echo 'This field is not supported and has no value.';
}

$skillMd = new SkillMd(
    'Code Review',
    'Performs automated code reviews.',
    '# Some longer, skill describing Markdown content',
    ['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);

$markdown = $skillMd->toMarkdown();