PHP code example of psbits / crafter

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

    

psbits / crafter example snippets


#[AsEventListener(identifier: 'my_extension/crafterConfiguration')]
public function __invoke(ModifyConfigurationEvent $event): void
{
    if (str_starts_with((string)$event->getExtensionKey(), 'client_')) {
        $event->addOverrides(['defaults' => ['copyrightHolder' => 'Client Ltd.']]);
    }
}

#[AsEventListener(identifier: 'my_extension/crafterFormat')]
public function __invoke(AfterGenerationEvent $event): void
{
    if (true === $event->isDryRun()) {
        return;
    }

    foreach ($event->getChangedPaths() as $path) {
        // run a formatter, add the file to the index, ...
    }
}
yaml
crafter:
  ci:
    matrix:
      - {lowest: true, php: '8.3', typo3: '13.4'}
      - {php: '8.5', typo3: '14.3'}
    publishToTer: true
yaml
crafter:
  paths:
    repository: 'Classes/Repository/{name}Repository.php'
  defaults:
    languages: ['en', 'de', 'fr']
  variables:
    supportUrl: 'https://phantasie-schmiede.de/support'
yaml
crafter:
  audit:
    categories: ['structure', 'model', 'controller', 'language', 'registration', 'orphan', 'toolchain']
    languages: ['de', 'fr']