├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
├── .gitignore
├── .php_cs
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── Test
├── BaseTestCase.php
├── Command
│ ├── Generate
│ │ └── ServiceCommandTest.php
│ ├── GenerateCommandTest.php
│ ├── GenerateEntityBundleCommandTest.php
│ ├── GeneratorAuthenticationProviderCommandTest.php
│ ├── GeneratorCommandCommandTest.php
│ ├── GeneratorConfigFormBaseCommandTest.php
│ ├── GeneratorControllerCommandTest.php
│ ├── GeneratorEntityCommandTest.php
│ ├── GeneratorEntityConfigCommandTest.php
│ ├── GeneratorEntityContentCommandTest.php
│ ├── GeneratorFormCommandTest.php
│ ├── GeneratorJsTestCommandTest.php
│ ├── GeneratorModuleCommandTest.php
│ ├── GeneratorPermissionCommandTest.php
│ ├── GeneratorPluginBlockCommandTest.php
│ ├── GeneratorPluginConditionCommandTest.php
│ ├── GeneratorPluginFieldCommandTest.php
│ ├── GeneratorPluginFieldFormatterCommandTest.php
│ ├── GeneratorPluginFieldTypeCommandTest.php
│ ├── GeneratorPluginFieldWidgetCommandTest.php
│ ├── GeneratorPluginImageEffectCommandTest.php
│ ├── GeneratorPluginImageFormatterCommandTest.php
│ ├── GeneratorPluginRestResourceCommandTest.php
│ ├── GeneratorPluginRulesActionCommandTest.php
│ ├── GeneratorPluginTypeAnnotationCommandTest.php
│ ├── GeneratorPluginTypeYamlCommandTest.php
│ └── GeneratorThemeCommandTest.php
├── DataProvider
│ ├── AuthenticationProviderDataProviderTrait.php
│ ├── CommandDataProviderTrait.php
│ ├── ConfigFormBaseDataProviderTrait.php
│ ├── ControllerDataProviderTrait.php
│ ├── EntityBundleDataProviderTrait.php
│ ├── EntityConfigDataProviderTrait.php
│ ├── EntityContentDataProviderTrait.php
│ ├── EntityDataProviderTrait.php
│ ├── FormDataProviderTrait.php
│ ├── JsTestDataProviderTrait.php
│ ├── ModuleDataProviderTrait.php
│ ├── PermissionDataProviderTrait.php
│ ├── PluginBlockDataProviderTrait.php
│ ├── PluginCKEditorButtonDataProviderTrait.php
│ ├── PluginConditionDataProviderTrait.php
│ ├── PluginFieldDataProviderTrait.php
│ ├── PluginFieldFormatterDataProviderTrait.php
│ ├── PluginFieldTypeDataProviderTrait.php
│ ├── PluginFieldWidgetDataProviderTrait.php
│ ├── PluginImageEffectDataProviderTrait.php
│ ├── PluginImageFormatterDataProviderTrait.php
│ ├── PluginRestResourceDataProviderTrait.php
│ ├── PluginRulesActionDataProviderTrait.php
│ ├── PluginTypeAnnotationDataProviderTrait.php
│ ├── PluginTypeYamlDataProviderTrait.php
│ ├── ProfileDataProviderTrait.php
│ ├── ServiceDataProviderTrait.php
│ └── ThemeDataProviderTrait.php
├── Generator
│ ├── AuthenticationProviderGeneratorTest.php
│ ├── CommandGeneratorTest.php
│ ├── ConfigFormBaseGeneratorTest.php
│ ├── ContentTypeGeneratorTest.php
│ ├── ControllerGeneratorTest.php
│ ├── EntityConfigGeneratorTest.php
│ ├── EntityContentGeneratorTest.php
│ ├── EntityGeneratorTest.php
│ ├── FormGeneratorTest.php
│ ├── GeneratorTest.php
│ ├── JsTestGeneratorTest.php
│ ├── ModuleGeneratorTest.php
│ ├── PermissionGeneratorTest.php
│ ├── PluginBlockGeneratorTest.php
│ ├── PluginCKEditorButtonGeneratorTest.php
│ ├── PluginConditionGeneratorTest.php
│ ├── PluginFieldFormatterGeneratorTest.php
│ ├── PluginFieldGeneratorTest.php
│ ├── PluginFieldTypeGeneratorTest.php
│ ├── PluginFieldWidgetGeneratorTest.php
│ ├── PluginImageEffectGeneratorTest.php
│ ├── PluginImageFormatterGeneratorTest.php
│ ├── PluginRestResourceGeneratorTest.php
│ ├── PluginRulesActionGeneratorTest.php
│ ├── PluginTypeAnnotationGeneratorTest.php
│ ├── PluginTypeYamlGeneratorTest.php
│ ├── ProfileGeneratorTest.php
│ ├── ServiceGeneratorTest.php
│ └── ThemeGeneratorTest.php
└── Helper
│ └── StringHelperTest.php
├── autoload.local.php.dist
├── autoload.php.dist
├── bin
├── drupal
├── drupal.bat
└── drupal.php
├── box.json
├── composer.json
├── config
└── services
│ ├── cache.yml
│ ├── config.yml
│ ├── create.yml
│ ├── cron.yml
│ ├── database.yml
│ ├── debug.yml
│ ├── entity.yml
│ ├── feature.yml
│ ├── field.yml
│ ├── generate.yml
│ ├── generator.yml
│ ├── image.yml
│ ├── locale.yml
│ ├── migrate.yml
│ ├── misc.yml
│ ├── module.yml
│ ├── multisite.yml
│ ├── node.yml
│ ├── queue.yml
│ ├── rest.yml
│ ├── role.yml
│ ├── router.yml
│ ├── simpletest.yml
│ ├── site.yml
│ ├── state.yml
│ ├── taxonomy.yml
│ ├── theme.yml
│ ├── update.yml
│ ├── user.yml
│ └── views.yml
├── phpqa.yml
├── phpunit.xml.dist
├── resources
├── dash.css
└── drupal-console.png
├── services.yml
├── src
├── Annotations
│ ├── DrupalCommand.php
│ └── DrupalCommandAnnotationReader.php
├── Application.php
├── Bootstrap
│ ├── Drupal.php
│ ├── DrupalCompilerPass.php
│ ├── DrupalKernel.php
│ ├── DrupalKernelTrait.php
│ ├── DrupalServiceModifier.php
│ ├── DrupalUpdateKernel.php
│ ├── FindCommandsCompilerPass.php
│ └── FindGeneratorsCompilerPass.php
├── Command
│ ├── Cache
│ │ ├── RebuildCommand.php
│ │ └── TagInvalidateCommand.php
│ ├── ComposerizeCommand.php
│ ├── Config
│ │ ├── DeleteCommand.php
│ │ ├── DiffCommand.php
│ │ ├── EditCommand.php
│ │ ├── ExportCommand.php
│ │ ├── ExportContentTypeCommand.php
│ │ ├── ExportEntityCommand.php
│ │ ├── ExportSingleCommand.php
│ │ ├── ExportViewCommand.php
│ │ ├── ImportCommand.php
│ │ ├── ImportSingleCommand.php
│ │ ├── OverrideCommand.php
│ │ ├── PrintConfigValidationTrait.php
│ │ └── ValidateCommand.php
│ ├── Create
│ │ ├── CommentsCommand.php
│ │ ├── NodesCommand.php
│ │ ├── RolesCommand.php
│ │ ├── TermsCommand.php
│ │ ├── UsersCommand.php
│ │ └── VocabulariesCommand.php
│ ├── Cron
│ │ ├── ExecuteCommand.php
│ │ └── ReleaseCommand.php
│ ├── Database
│ │ ├── AddCommand.php
│ │ ├── ClientCommand.php
│ │ ├── ConnectCommand.php
│ │ ├── DatabaseLogBase.php
│ │ ├── DropCommand.php
│ │ ├── DumpCommand.php
│ │ ├── LogClearCommand.php
│ │ ├── LogPollCommand.php
│ │ ├── QueryCommand.php
│ │ └── RestoreCommand.php
│ ├── Debug
│ │ ├── BreakpointsCommand.php
│ │ ├── CacheContextCommand.php
│ │ ├── ConfigCommand.php
│ │ ├── ConfigSettingsCommand.php
│ │ ├── ConfigValidateCommand.php
│ │ ├── ContainerCommand.php
│ │ ├── CronCommand.php
│ │ ├── DatabaseLogCommand.php
│ │ ├── DatabaseTableCommand.php
│ │ ├── DotenvCommand.php
│ │ ├── EntityCommand.php
│ │ ├── EventCommand.php
│ │ ├── FeaturesCommand.php
│ │ ├── HookCommand.php
│ │ ├── ImageStylesCommand.php
│ │ ├── LibrariesCommand.php
│ │ ├── MigrateCommand.php
│ │ ├── ModuleCommand.php
│ │ ├── MultisiteCommand.php
│ │ ├── PermissionCommand.php
│ │ ├── PluginCommand.php
│ │ ├── QueueCommand.php
│ │ ├── RestCommand.php
│ │ ├── RolesCommand.php
│ │ ├── RouterCommand.php
│ │ ├── StateCommand.php
│ │ ├── TestCommand.php
│ │ ├── ThemeCommand.php
│ │ ├── ThemeKeysCommand.php
│ │ ├── UpdateCommand.php
│ │ ├── UpdateComposerCommand.php
│ │ ├── UserCommand.php
│ │ ├── ViewsCommand.php
│ │ └── ViewsPluginsCommand.php
│ ├── DevelDumperCommand.php
│ ├── DockerInitCommand.php
│ ├── DotenvInitCommand.php
│ ├── Entity
│ │ └── DeleteCommand.php
│ ├── Features
│ │ └── ImportCommand.php
│ ├── Field
│ │ └── InfoCommand.php
│ ├── Generate
│ │ ├── AjaxCommand.php
│ │ ├── AuthenticationProviderCommand.php
│ │ ├── BlockTypeCommand.php
│ │ ├── BreakPointCommand.php
│ │ ├── CacheContextCommand.php
│ │ ├── CommandCommand.php
│ │ ├── ComposerCommand.php
│ │ ├── ConfigFormBaseCommand.php
│ │ ├── ControllerCommand.php
│ │ ├── EntityBundleCommand.php
│ │ ├── EntityCommand.php
│ │ ├── EntityConfigCommand.php
│ │ ├── EntityContentCommand.php
│ │ ├── EventSubscriberCommand.php
│ │ ├── FormAlterCommand.php
│ │ ├── FormBaseCommand.php
│ │ ├── FormCommand.php
│ │ ├── HelpCommand.php
│ │ ├── JsTestCommand.php
│ │ ├── ModuleCommand.php
│ │ ├── ModuleFileCommand.php
│ │ ├── PermissionCommand.php
│ │ ├── PluginBlockCommand.php
│ │ ├── PluginCKEditorButtonCommand.php
│ │ ├── PluginConditionCommand.php
│ │ ├── PluginDerivativeCommand.php
│ │ ├── PluginFieldCommand.php
│ │ ├── PluginFieldFormatterCommand.php
│ │ ├── PluginFieldTypeCommand.php
│ │ ├── PluginFieldWidgetCommand.php
│ │ ├── PluginImageEffectCommand.php
│ │ ├── PluginImageFormatterCommand.php
│ │ ├── PluginMailCommand.php
│ │ ├── PluginMigrateDataParserCommand.php
│ │ ├── PluginMigrateProcessCommand.php
│ │ ├── PluginMigrateSourceCommand.php
│ │ ├── PluginQueueWorkerCommand.php
│ │ ├── PluginRestResourceCommand.php
│ │ ├── PluginRulesActionCommand.php
│ │ ├── PluginRulesConditionCommand.php
│ │ ├── PluginRulesDataprocessorCommand.php
│ │ ├── PluginSkeletonCommand.php
│ │ ├── PluginTypeAnnotationCommand.php
│ │ ├── PluginTypeYamlCommand.php
│ │ ├── PluginValidationConstraintCommand.php
│ │ ├── PluginViewsFieldCommand.php
│ │ ├── PostUpdateCommand.php
│ │ ├── ProfileCommand.php
│ │ ├── RouteSubscriberCommand.php
│ │ ├── ServiceCommand.php
│ │ ├── ThemeCommand.php
│ │ ├── ThemeSettingCommand.php
│ │ ├── TwigExtensionCommand.php
│ │ └── UpdateCommand.php
│ ├── Image
│ │ └── StylesFlushCommand.php
│ ├── Locale
│ │ ├── LanguageAddCommand.php
│ │ ├── LanguageDeleteCommand.php
│ │ └── TranslationStatusCommand.php
│ ├── Migrate
│ │ ├── ExecuteCommand.php
│ │ ├── RollBackCommand.php
│ │ └── SetupCommand.php
│ ├── Module
│ │ ├── DownloadCommand.php
│ │ ├── InstallCommand.php
│ │ ├── InstallDependencyCommand.php
│ │ ├── PathCommand.php
│ │ ├── UninstallCommand.php
│ │ └── UpdateCommand.php
│ ├── Multisite
│ │ ├── NewCommand.php
│ │ └── UpdateCommand.php
│ ├── Node
│ │ └── AccessRebuildCommand.php
│ ├── Queue
│ │ └── RunCommand.php
│ ├── Rest
│ │ ├── DisableCommand.php
│ │ └── EnableCommand.php
│ ├── Role
│ │ ├── DeleteCommand.php
│ │ └── NewCommand.php
│ ├── Router
│ │ └── RebuildCommand.php
│ ├── ServerCommand.php
│ ├── Service
│ │ └── OverrideCommand.php
│ ├── Shared
│ │ ├── ArrayInputTrait.php
│ │ ├── ConfirmationTrait.php
│ │ ├── ConnectTrait.php
│ │ ├── CreateTrait.php
│ │ ├── DatabaseTrait.php
│ │ ├── EventsTrait.php
│ │ ├── ExportTrait.php
│ │ ├── ExtensionTrait.php
│ │ ├── FeatureTrait.php
│ │ ├── FormTrait.php
│ │ ├── LocaleTrait.php
│ │ ├── MenuTrait.php
│ │ ├── MigrationTrait.php
│ │ ├── ModuleTrait.php
│ │ ├── PermissionTrait.php
│ │ ├── ProjectDownloadTrait.php
│ │ ├── RestTrait.php
│ │ ├── ServicesTrait.php
│ │ ├── ThemeBreakpointTrait.php
│ │ ├── ThemeRegionTrait.php
│ │ ├── ThemeTrait.php
│ │ ├── TranslationTrait.php
│ │ └── UpdateTrait.php
│ ├── ShellCommand.php
│ ├── Site
│ │ ├── ImportLocalCommand.php
│ │ ├── InstallCommand.php
│ │ ├── MaintenanceCommand.php
│ │ ├── ModeCommand.php
│ │ ├── StatisticsCommand.php
│ │ └── StatusCommand.php
│ ├── SnippetCommand.php
│ ├── State
│ │ ├── DeleteCommand.php
│ │ └── OverrideCommand.php
│ ├── Taxonomy
│ │ └── DeleteTermCommand.php
│ ├── Test
│ │ └── RunCommand.php
│ ├── Theme
│ │ ├── DownloadCommand.php
│ │ ├── InstallCommand.php
│ │ ├── PathCommand.php
│ │ ├── ThemeBaseCommand.php
│ │ └── UninstallCommand.php
│ ├── Update
│ │ ├── EntitiesCommand.php
│ │ └── ExecuteCommand.php
│ ├── User
│ │ ├── CreateCommand.php
│ │ ├── DeleteCommand.php
│ │ ├── LoginCleanAttemptsCommand.php
│ │ ├── LoginUrlCommand.php
│ │ ├── PasswordHashCommand.php
│ │ ├── PasswordResetCommand.php
│ │ ├── RoleCommand.php
│ │ ├── UnblockCommand.php
│ │ └── UserBase.php
│ └── Views
│ │ ├── DisableCommand.php
│ │ └── EnableCommand.php
├── Extension
│ ├── Discovery.php
│ ├── Extension.php
│ └── Manager.php
├── Generator
│ ├── AjaxCommandGenerator.php
│ ├── AuthenticationProviderGenerator.php
│ ├── BlockTypeGenerator.php
│ ├── BreakPointGenerator.php
│ ├── CacheContextGenerator.php
│ ├── CommandGenerator.php
│ ├── ComposerGenerator.php
│ ├── ControllerGenerator.php
│ ├── DatabaseSettingsGenerator.php
│ ├── DockerInitGenerator.php
│ ├── DotenvInitGenerator.php
│ ├── EntityBundleGenerator.php
│ ├── EntityConfigGenerator.php
│ ├── EntityContentGenerator.php
│ ├── EventSubscriberGenerator.php
│ ├── FormAlterGenerator.php
│ ├── FormGenerator.php
│ ├── HelpGenerator.php
│ ├── JsTestGenerator.php
│ ├── ModuleFileGenerator.php
│ ├── ModuleGenerator.php
│ ├── PermissionGenerator.php
│ ├── PluginBlockGenerator.php
│ ├── PluginCKEditorButtonGenerator.php
│ ├── PluginConditionGenerator.php
│ ├── PluginDerivativeGenerator.php
│ ├── PluginFieldFormatterGenerator.php
│ ├── PluginFieldTypeGenerator.php
│ ├── PluginFieldWidgetGenerator.php
│ ├── PluginImageEffectGenerator.php
│ ├── PluginImageFormatterGenerator.php
│ ├── PluginMailGenerator.php
│ ├── PluginMigrateDataParserGenerator.php
│ ├── PluginMigrateProcessGenerator.php
│ ├── PluginMigrateSourceGenerator.php
│ ├── PluginQueueWorkerGenerator.php
│ ├── PluginRestResourceGenerator.php
│ ├── PluginRulesActionGenerator.php
│ ├── PluginRulesConditionGenerator.php
│ ├── PluginRulesDataprocessorGenerator.php
│ ├── PluginSkeletonGenerator.php
│ ├── PluginTypeAnnotationGenerator.php
│ ├── PluginTypeYamlGenerator.php
│ ├── PluginValidationConstraintGenerator.php
│ ├── PluginViewsFieldGenerator.php
│ ├── PostUpdateGenerator.php
│ ├── ProfileGenerator.php
│ ├── RouteSubscriberGenerator.php
│ ├── ServiceGenerator.php
│ ├── ThemeGenerator.php
│ ├── ThemeSettingGenerator.php
│ ├── TwigExtensionGenerator.php
│ └── UpdateGenerator.php
├── Override
│ └── ConfigSubscriber.php
├── Plugin
│ └── ScriptHandler.php
├── Utils
│ ├── AnnotationValidator.php
│ ├── Create
│ │ ├── Base.php
│ │ ├── CommentData.php
│ │ ├── NodeData.php
│ │ ├── RoleData.php
│ │ ├── TermData.php
│ │ ├── UserData.php
│ │ └── VocabularyData.php
│ ├── DrupalApi.php
│ ├── MigrateExecuteMessageCapture.php
│ ├── Site.php
│ ├── TranslatorManager.php
│ └── Validator.php
└── Zippy
│ ├── Adapter
│ └── TarGzGNUTarForWindowsAdapter.php
│ └── FileStrategy
│ └── TarGzFileForWindowsStrategy.php
├── templates
├── base
│ ├── class.php.twig
│ ├── file.php.twig
│ └── interface.php.twig
├── core
│ └── translation
│ │ └── stats.md.twig
├── database
│ ├── add-default.php.twig
│ └── add.php.twig
├── files
│ ├── .env.dist.twig
│ ├── .gitignore.dist
│ ├── docker-compose.yml.twig
│ └── settings.php.twig
├── module
│ ├── Tests
│ │ └── Controller
│ │ │ └── controller.php.twig
│ ├── composer.json.twig
│ ├── config
│ │ ├── install
│ │ │ └── field.default.yml.twig
│ │ └── schema
│ │ │ └── entity.schema.yml.twig
│ ├── entity-content-page.php.twig
│ ├── features.yml.twig
│ ├── help.php.twig
│ ├── info.yml.twig
│ ├── js
│ │ └── commands.php.twig
│ ├── links.action-entity-content.yml.twig
│ ├── links.action-entity.yml.twig
│ ├── links.menu-entity-config.yml.twig
│ ├── links.menu-entity-content.yml.twig
│ ├── links.menu.yml.twig
│ ├── links.task-entity-content.yml.twig
│ ├── module-block-twig-template-append.twig
│ ├── module-file.twig
│ ├── module-libraries.yml.twig
│ ├── module-twig-template-append.twig
│ ├── module.twig
│ ├── module.views.inc.twig
│ ├── permission-routing.yml.twig
│ ├── permission.yml.twig
│ ├── permissions-entity-content.yml.twig
│ ├── php_tag.php.twig
│ ├── plugin-annotation-services.yml.twig
│ ├── plugin-yaml-services.yml.twig
│ ├── plugin.yml.twig
│ ├── post-update.php.twig
│ ├── routing-controller.yml.twig
│ ├── routing-form.yml.twig
│ ├── schema.yml.twig
│ ├── services.yml.twig
│ ├── src
│ │ ├── Ajax
│ │ │ └── ajax-command.php.twig
│ │ ├── Annotation
│ │ │ └── plugin-type.php.twig
│ │ ├── Authentication
│ │ │ └── Provider
│ │ │ │ └── authentication-provider.php.twig
│ │ ├── Command
│ │ │ ├── command.php.twig
│ │ │ └── console
│ │ │ │ └── translations
│ │ │ │ └── en
│ │ │ │ └── command.yml.twig
│ │ ├── Controller
│ │ │ ├── controller.php.twig
│ │ │ └── entity-controller.php.twig
│ │ ├── Entity
│ │ │ ├── Bundle
│ │ │ │ ├── core.entity_form_display.node.default.yml.twig
│ │ │ │ ├── core.entity_view_display.node.default.yml.twig
│ │ │ │ ├── core.entity_view_display.node.teaser.yml.twig
│ │ │ │ ├── entity-bundle-field-info-alter.php.twig
│ │ │ │ ├── field.field.node.body.yml.twig
│ │ │ │ └── node.type.yml.twig
│ │ │ ├── Form
│ │ │ │ ├── entity-content-delete.php.twig
│ │ │ │ ├── entity-content-revision-delete.php.twig
│ │ │ │ ├── entity-content-revision-revert-translation.php.twig
│ │ │ │ ├── entity-content-revision-revert.php.twig
│ │ │ │ ├── entity-content.php.twig
│ │ │ │ └── entity-settings.php.twig
│ │ │ ├── entity-content-views-data.php.twig
│ │ │ ├── entity-content-with-bundle.theme.php.twig
│ │ │ ├── entity-content-with-bundle.theme_hook_suggestions.php.twig
│ │ │ ├── entity-content.php.twig
│ │ │ ├── entity-content.theme.php.twig
│ │ │ ├── entity.php.twig
│ │ │ ├── interface-entity-content.php.twig
│ │ │ └── interface-entity.php.twig
│ │ ├── Form
│ │ │ ├── entity-delete.php.twig
│ │ │ ├── entity.php.twig
│ │ │ ├── form-alter.php.twig
│ │ │ ├── form-config.php.twig
│ │ │ └── form.php.twig
│ │ ├── Generator
│ │ │ └── generator.php.twig
│ │ ├── Plugin
│ │ │ ├── Block
│ │ │ │ ├── block.php.twig
│ │ │ │ ├── block_derivative.php.twig
│ │ │ │ └── blocktype.php.twig
│ │ │ ├── CKEditorPlugin
│ │ │ │ ├── ckeditorbutton.php.twig
│ │ │ │ └── plugin.php.twig
│ │ │ ├── Condition
│ │ │ │ ├── condition.php.twig
│ │ │ │ └── rulescondition.php.twig
│ │ │ ├── Derivative
│ │ │ │ └── derivative_block_derivative.php.twig
│ │ │ ├── Field
│ │ │ │ ├── FieldFormatter
│ │ │ │ │ ├── fieldformatter.php.twig
│ │ │ │ │ └── imageformatter.php.twig
│ │ │ │ ├── FieldType
│ │ │ │ │ └── fieldtype.php.twig
│ │ │ │ └── FieldWidget
│ │ │ │ │ └── fieldwidget.php.twig
│ │ │ ├── ImageEffect
│ │ │ │ └── imageeffect.php.twig
│ │ │ ├── Mail
│ │ │ │ └── mail.php.twig
│ │ │ ├── QueueWorker
│ │ │ │ └── queue_worker.php.twig
│ │ │ ├── Rest
│ │ │ │ └── Resource
│ │ │ │ │ └── rest.php.twig
│ │ │ ├── RulesAction
│ │ │ │ └── rulesaction.php.twig
│ │ │ ├── RulesDataProcessor
│ │ │ │ └── rulesdataprocessor.php.twig
│ │ │ ├── Validation
│ │ │ │ └── Constraint
│ │ │ │ │ ├── constraint.php.twig
│ │ │ │ │ └── validator.php.twig
│ │ │ ├── Views
│ │ │ │ └── field
│ │ │ │ │ └── field.php.twig
│ │ │ ├── migrate
│ │ │ │ ├── process
│ │ │ │ │ └── process.php.twig
│ │ │ │ └── source
│ │ │ │ │ └── source.php.twig
│ │ │ ├── migrate_plus
│ │ │ │ └── data_parser
│ │ │ │ │ └── data_parser.php.twig
│ │ │ └── skeleton.php.twig
│ │ ├── Routing
│ │ │ └── route-subscriber.php.twig
│ │ ├── Tests
│ │ │ ├── js-test.php.twig
│ │ │ └── load-test.php.twig
│ │ ├── TwigExtension
│ │ │ └── twig-extension.php.twig
│ │ ├── accesscontrolhandler-entity-content.php.twig
│ │ ├── cache-context.php.twig
│ │ ├── entity-content-bundle-permissions.php.twig
│ │ ├── entity-content-route-provider.php.twig
│ │ ├── entity-listbuilder.php.twig
│ │ ├── entity-route-provider.php.twig
│ │ ├── entity-storage.php.twig
│ │ ├── entity-translation-handler.php.twig
│ │ ├── event-subscriber.php.twig
│ │ ├── interface-entity-storage.php.twig
│ │ ├── listbuilder-entity-content.php.twig
│ │ ├── plugin-type-annotation-base.php.twig
│ │ ├── plugin-type-annotation-interface.php.twig
│ │ ├── plugin-type-annotation-manager.php.twig
│ │ ├── service-interface.php.twig
│ │ ├── service.php.twig
│ │ ├── yaml-plugin-manager-interface.php.twig
│ │ └── yaml-plugin-manager.php.twig
│ ├── templates
│ │ ├── entity-html.twig
│ │ ├── entity-with-bundle-content-add-list-html.twig
│ │ └── plugin-block-html.twig
│ ├── twig-template-file.twig
│ └── update.php.twig
├── profile
│ ├── info.yml.twig
│ ├── install.twig
│ └── profile.twig
└── theme
│ ├── breakpoints.yml.twig
│ ├── info.yml.twig
│ ├── libraries.yml.twig
│ └── theme.twig
└── uninstall.services.yml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # [jmolivas]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: drupalconsole
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE:
--------------------------------------------------------------------------------
1 | ### Issue title
2 |
3 | The issue title should comply with the following structure:
4 |
5 | [ *ISSUE-GROUP* ] Short description
6 |
7 | The *ISSUE-GROUP* should be one of:
8 |
9 | * `command:name`
10 | * `console`
11 | * `helper`
12 | * `standard`
13 | * `template`
14 | * `translation`
15 | * `test`
16 | * `docs`
17 |
18 | ### Problem/Motivation
19 | A brief statement describing why the issue was filed.
20 |
21 | **Details to include:**
22 | - Why are we doing this? Above all, a summary should explain why a change is needed, in a few short sentences.
23 |
24 | ### How to reproduce
25 | Include steps related how to reproduce.
26 |
27 | **Details to include:**
28 | - Drupal version (you can obtain this by running `drupal site:status`).
29 | - Console version (you can obtain this by running `composer show | grep drupal/console`).
30 | - Console Launcher version (you can obtain this by running outside of a drupal site `drupal --version`).
31 | - Steps to reproduce
32 | - Include screen-shot or video whenever necessary.
33 |
34 | ### Solution
35 | A brief description of the proposed fix.
36 |
37 | **Details to include:**
38 | - A short summary of the approach proposed or used in the PR.
39 | - Approaches that have been tried and ruled out.
40 | - Links to relevant API documentation or other resources.
41 | - Known workarounds.
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # deprecation-detector
2 | /.rules
3 |
4 | # Composer
5 | composer.lock
6 | /vendor
7 | /bin/phpunit
8 | /bin/jsonlint
9 | /bin/phpcbf
10 | /bin/phpcs
11 | /bin/validate-json
12 | /bin/pdepend
13 | /bin/php-cs-fixer
14 | /bin/phpmd
15 | /bin/php-parse
16 | /bin/psysh
17 | PATCHES.txt
18 |
19 | # Develop
20 | autoload.local.php
21 |
22 | # Binaries
23 | /box.phar
24 | /console.phar
25 | /drupal.phar
26 | /drupal.phar.version
27 |
28 | # Test
29 | /phpunit.xml
30 |
31 | # Drupal
32 | /core
33 | /nbproject/
34 |
35 | # drupal/console-extend-plugin generated files
36 | extend.console.*.yml
37 | *-console.services.yml
38 |
39 | #PhpStorm
40 | .idea/*
41 |
--------------------------------------------------------------------------------
/.php_cs:
--------------------------------------------------------------------------------
1 | setRules(
5 | [
6 | '@PSR2' => true,
7 | 'array_syntax' => ['syntax' => 'short'],
8 | ]
9 | )
10 | ->setUsingCache(false);
11 |
--------------------------------------------------------------------------------
/Test/Command/GenerateCommandTest.php:
--------------------------------------------------------------------------------
1 | set('twig', new \Twig_Environment());
17 | return $container;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Test/Command/GeneratorAuthenticationProviderCommandTest.php:
--------------------------------------------------------------------------------
1 | getHelperSet());
30 | $command->setHelperSet($this->getHelperSet());
31 | $command->setGenerator($this->getGenerator());
32 |
33 | $commandTester = new CommandTester($command);
34 |
35 | $code = $commandTester->execute(
36 | [
37 | '--module' => $module,
38 | '--class' => $class
39 | ],
40 | ['interactive' => false]
41 | );
42 |
43 | $this->assertEquals(0, $code);
44 | }
45 |
46 | private function getGenerator()
47 | {
48 | return $this
49 | ->getMockBuilder('Drupal\Console\Generator\AuthenticationProviderGenerator')
50 | ->disableOriginalConstructor()
51 | ->setMethods(['generate'])
52 | ->getMock();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Test/Command/GeneratorJsTestCommandTest.php:
--------------------------------------------------------------------------------
1 | getHelperSet());
31 | $command->setHelperSet($this->getHelperSet());
32 | $command->setGenerator($this->getGenerator());
33 |
34 | $commandTester = new CommandTester($command);
35 |
36 | $code = $commandTester->execute(
37 | [
38 | '--module' => $module,
39 | '--class' => $class_name,
40 | ],
41 | ['interactive' => false]
42 | );
43 |
44 | $this->assertEquals(0, $code);
45 | }
46 |
47 | private function getGenerator()
48 | {
49 | return $this
50 | ->getMockBuilder('Drupal\Console\Generator\JsTestGenerator')
51 | ->disableOriginalConstructor()
52 | ->setMethods(['generate'])
53 | ->getMock();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Test/Command/GeneratorPermissionCommandTest.php:
--------------------------------------------------------------------------------
1 | getHelperSet());
30 | $command->setHelperSet($this->getHelperSet());
31 | $command->setGenerator($this->getGenerator());
32 |
33 | $commandTester = new CommandTester($command);
34 |
35 | $code = $commandTester->execute(
36 | [
37 | '--module' => $module,
38 | '--permissions' => $permissions,
39 | ],
40 | ['interactive' => false]
41 | );
42 |
43 | $this->assertEquals(0, $code);
44 | }
45 |
46 | private function getGenerator()
47 | {
48 | return $this
49 | ->getMockBuilder('Drupal\Console\Generator\PermissionGenerator')
50 | ->disableOriginalConstructor()
51 | ->setMethods(['generate'])
52 | ->getMock();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Test/DataProvider/AuthenticationProviderDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 0],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/CommandDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['command_' . rand(), 'command:default', 'CommandDefault', false],
20 | ['command_' . rand(), 'command:default', 'CommandDefault', true]
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Test/DataProvider/ConfigFormBaseDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Bar', null, null, 'ConfigFormBase', null, true, 'Foo', 'system.admin_config_development', 'foo'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/ControllerDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | $routes = [
19 | ['title' => 'Foo Controller', 'name' => 'custom.default_controller_hello', 'method' => 'index', 'path' => '/hello/{name}']
20 | ];
21 |
22 | return [
23 | ['foo', 'FooController', $routes, true, null, 'foo_controller'],
24 | ['foo', 'FooController', $routes, false, null, 'foo_controller'],
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Test/DataProvider/EntityBundleDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['foo', 'default_type', 'default']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/EntityConfigDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Bar', '', 'bar', 'admin/structure'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/EntityContentDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Bar', 'bar', 'admin/structure', 'true', true],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/EntityDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'Bar', 'foo' . rand(), 'bar', 'admin/structure'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/FormDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'id' . rand(), null, null, 'FormBase', '/form/path', true, 'foo', 'system.admin_config_development', 'foo']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/JsTestDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['foo', 'JsFooTest'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/ModuleDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', sprintf('%s_%s', 'foo', rand()), $this->dir, 'Description', '8.x', 'Custom', true, '', false, null],
20 | ['Foo', sprintf('%s_%s', 'foo', rand()), $this->dir, 'Description', '8.x', 'Custom', false, 'default', false, null],
21 | ['Foo', sprintf('%s_%s', 'foo', rand()), $this->dir, 'Description', '8.x', 'Custom', true, '', false, null],
22 | ['Foo', sprintf('%s_%s', 'foo', rand()), $this->dir, 'Description', '8.x', 'Custom', false, '', false, null],
23 | ];
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Test/DataProvider/PermissionDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'my permissions'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginBlockDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'bar', null, '', 'inputs'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginCKEditorButtonDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'bar', 'Baz', 'foo/js/pluggin/bar/images/icon.png'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginConditionDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'bar-id', 'foo-context-id', 'foo-context-label', false]
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginFieldDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'foo-bar', 'foo-bar', 'bar', 'Foo-Bar', 'foo-bar', 'foo-bar', 'bar', 'Foo-Bar', 'foo-bar', 'foo-bar', 'bar']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginFieldFormatterDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'bar', 'bar' . rand(), 'foo-bar']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginFieldTypeDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'foo-bar', 'foo-bar', 'bar', 'Foo-Bar']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginFieldWidgetDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'foo-bar', 'Foo-Bar']
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginImageEffectDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'bar', 'description'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginImageFormatterDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'foo', 'bar'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginRestResourceDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Foo', 'pluginID' . rand(), 'url', 'states'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginRulesActionDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Foo', 'pluginID' . rand(), 'category', 'context', 'bar'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginTypeAnnotationDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'MyPlugin', 'my_plugin', 'my.plugin'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/PluginTypeYamlDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'MyPlugin', 'my_plugin', 'my.plugin'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/ProfileDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | // Profile name, machine name, description, core version,
20 | // dependencies, distribution name.
21 | ['Foo', 'foo' . rand(), $this->dir . '/profiles', 'Description', '8.x', null, false],
22 | ['Foo', 'foo' . rand(), $this->dir . '/profiles', 'Description', '8.x', null, 'Bar'],
23 | ];
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Test/DataProvider/ServiceDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', 'foo' . rand(), 'Foo', false, [],'default'],
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/DataProvider/ThemeDataProviderTrait.php:
--------------------------------------------------------------------------------
1 | setUpTemporaryDirectory();
17 |
18 | return [
19 | ['Foo', rand(), $this->dir.'/themes/custom', 'bar', 'Other', '8.x', 'sd', 'global-styling', false, false]
20 | ];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Test/Generator/AuthenticationProviderGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
32 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
33 | $generator->setHelperSet($this->getHelperSet());
34 |
35 | $generator->generate(
36 | $module,
37 | $class_name,
38 | $provider_id
39 | );
40 |
41 | $files = [
42 | $generator->getSite()->getAuthenticationPath($module, 'Provider').'/'.$class_name.'.php',
43 | $generator->getSite()->getModulePath($module).'/'.$module.'.services.yml'
44 | ];
45 |
46 | foreach ($files as $file) {
47 | $this->assertTrue(
48 | file_exists($file),
49 | sprintf('%s does not exist', $file)
50 | );
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Test/Generator/CommandGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
33 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
34 | $generator->setHelperSet($this->getHelperSet());
35 |
36 | $generator->generate(
37 | $module,
38 | $name,
39 | $class,
40 | $containerAware
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Test/Generator/GeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
31 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
32 | $generator->setHelperSet($this->getHelperSet());
33 |
34 | $generator->generate(
35 | $module,
36 | $class_name
37 | );
38 |
39 | $files = [
40 | $generator->getSite()->getJsTestsPath($module) . "/$class_name.php",
41 | ];
42 |
43 | foreach ($files as $file) {
44 | $this->assertTrue(
45 | file_exists($file),
46 | sprintf('%s does not exist', $file)
47 | );
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Test/Generator/PermissionGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
31 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
32 | $generator->setHelperSet($this->getHelperSet());
33 |
34 | $generator->generate(
35 | $module,
36 | $permissions
37 | );
38 |
39 | $this->assertTrue(
40 | file_exists($generator->getSite()->getModulePath($module).'/'.$module.'.permissions.yml'),
41 | sprintf('%s does not exist', $module.'.permissions.yml')
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Test/Generator/PluginBlockGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
39 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
40 | $generator->setHelperSet($this->getHelperSet());
41 |
42 | $generator->generate(
43 | $module,
44 | $class_name,
45 | $label,
46 | $plugin_id,
47 | $services,
48 | $inputs
49 | );
50 |
51 | $this->assertTrue(
52 | file_exists($generator->getSite()->getPluginPath($module, 'Block').'/'.$class_name.'.php'),
53 | sprintf('%s does not exist', $class_name.'.php')
54 | );
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Test/Generator/PluginFieldFormatterGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
37 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
38 | $generator->setHelperSet($this->getHelperSet());
39 |
40 | $generator->generate(
41 | $module,
42 | $class_name,
43 | $label,
44 | $plugin_id,
45 | $field_type
46 | );
47 |
48 | $this->assertTrue(
49 | file_exists($generator->getSite()->getPluginPath($module, 'Field/FieldFormatter') . '/' . $class_name . '.php'),
50 | sprintf('%s does not exist', $class_name.'.php')
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Test/Generator/PluginFieldWidgetGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
37 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
38 | $generator->setHelperSet($this->getHelperSet());
39 |
40 | $generator->generate(
41 | $module,
42 | $class_name,
43 | $label,
44 | $plugin_id,
45 | $field_type
46 | );
47 |
48 | $this->assertTrue(
49 | file_exists($generator->getSite()->getPluginPath($module, 'Field/FieldWidget') . '/' . $class_name . '.php'),
50 | sprintf('%s does not exist', $class_name.'.php')
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Test/Generator/PluginImageEffectGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
36 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
37 | $generator->setHelperSet($this->getHelperSet());
38 |
39 | $generator->generate(
40 | $module,
41 | $class_name,
42 | $label,
43 | $plugin_id,
44 | $description
45 | );
46 |
47 | $this->assertTrue(
48 | file_exists($generator->getSite()->getPluginPath($module, 'ImageEffect').'/'.$class_name.'.php'),
49 | sprintf('%s does not exist', $class_name.'.php')
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Test/Generator/PluginImageFormatterGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
34 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
35 | $generator->setHelperSet($this->getHelperSet());
36 |
37 | $generator->generate(
38 | $module,
39 | $class_name,
40 | $label,
41 | $plugin_id
42 | );
43 |
44 | $this->assertTrue(
45 | file_exists($generator->getSite()->getPluginPath($module, 'Field/FieldFormatter') . '/' . $class_name . '.php'),
46 | sprintf('%s does not exist', $class_name.'.php')
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Test/Generator/PluginRestResourceGeneratorTest.php:
--------------------------------------------------------------------------------
1 | getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
38 | $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
39 | $generator->setHelperSet($this->getHelperSet());
40 |
41 | $generator->generate(
42 | $module,
43 | $class_name,
44 | $plugin_label,
45 | $plugin_id,
46 | $plugin_url,
47 | $plugin_states
48 | );
49 |
50 | $this->assertTrue(
51 | file_exists($generator->getSite()->getPluginPath($module, 'rest').'/resource/'.$class_name.'.php'),
52 | sprintf('%s does not exist', $class_name.'.php')
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Test/Helper/StringHelperTest.php:
--------------------------------------------------------------------------------
1 | stringHelper = new StringHelper();
14 | }
15 |
16 | /**
17 | * @dataProvider getDataNames
18 | */
19 | public function testCreateMachineName($input, $machine_name)
20 | {
21 | $this->assertEquals($this->stringHelper->createMachineName($input), $machine_name);
22 | }
23 |
24 | /**
25 | * @dataProvider getDataCamelCaseNames
26 | */
27 | public function testCamelCaseToMachineName($camel_case, $machine_name)
28 | {
29 | $this->assertEquals($this->stringHelper->camelCaseToMachineName($camel_case), $machine_name);
30 | }
31 |
32 | /**
33 | * Random strings and their equivalent machine-name
34 | */
35 | public function getDataNames()
36 | {
37 | return [
38 | ['Test Space between words', 'test_space_between_words'],
39 | ['test$special*characters!', 'test_special_characters'],
40 | ['URL', 'url'],
41 | ];
42 | }
43 |
44 | /**
45 | * Camel-case strings and their equivalent machine-name
46 | */
47 | public function getDataCamelCaseNames()
48 | {
49 | return [
50 | ['camelCase', 'camel_case'],
51 | ['greatestFunctionEverWritten', 'greatest_function_ever_written'],
52 | ['WakeUp', 'wake_up'],
53 | ];
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/autoload.local.php.dist:
--------------------------------------------------------------------------------
1 | setPsr4('Drupal\\Console\\Test\\', __DIR__ . '/Test');
6 |
7 | return $loader;
8 |
--------------------------------------------------------------------------------
/bin/drupal:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 |
2 |
3 |
' . t('{{ description|escape }}') . '
'; 23 | return $output; 24 | 25 | default: 26 | } 27 | } 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /templates/module/info.yml.twig: -------------------------------------------------------------------------------- 1 | name: '{{ module }}' 2 | type: {{ type }} 3 | description: '{{ description }}' 4 | core: {{ core }} 5 | package: '{{ package }}' 6 | {% if dependencies %} 7 | dependencies: 8 | {% for dependency in dependencies %} 9 | - {{ dependency }} 10 | {% endfor %} 11 | {% endif %} 12 | -------------------------------------------------------------------------------- /templates/module/js/commands.php.twig: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | */ 4 | 5 | (function ($, Drupal) { 6 | Drupal.AjaxCommands.prototype.{{ method }} = function (ajax, response, status) { 7 | console.log(response.message); 8 | } 9 | 10 | })(jQuery, Drupal); 11 | -------------------------------------------------------------------------------- /templates/module/links.action-entity-content.yml.twig: -------------------------------------------------------------------------------- 1 | entity.{{ entity_name }}.add_form: 2 | {# Note: a content entity with bundles will add via a dedicated controller. #} 3 | {% if not bundle_entity_type %} 4 | route_name: entity.{{ entity_name }}.add_form 5 | {% else %} 6 | route_name: entity.{{ entity_name }}.add_page 7 | {% endif %} 8 | title: 'Add {{ label }}' 9 | appears_on: 10 | - entity.{{ entity_name }}.collection 11 | -------------------------------------------------------------------------------- /templates/module/links.action-entity.yml.twig: -------------------------------------------------------------------------------- 1 | entity.{{ entity_name }}.add_form: 2 | route_name: entity.{{ entity_name }}.add_form 3 | title: 'Add {{ label }}' 4 | appears_on: 5 | - entity.{{ entity_name }}.collection 6 | -------------------------------------------------------------------------------- /templates/module/links.menu-entity-config.yml.twig: -------------------------------------------------------------------------------- 1 | {# Initial new line ensures that the new definitions starts on a new line #} 2 | 3 | # {{ label }} menu items definition 4 | entity.{{ entity_name }}.collection: 5 | title: '{{ label }}' 6 | route_name: entity.{{ entity_name }}.collection 7 | description: 'List {{ label }} (bundles)' 8 | parent: system.admin_structure 9 | weight: 99 10 | -------------------------------------------------------------------------------- /templates/module/links.menu-entity-content.yml.twig: -------------------------------------------------------------------------------- 1 | {# Initial new line ensures that the new definitions starts on a new line #} 2 | 3 | # {{ label }} menu items definition 4 | entity.{{ entity_name }}.collection: 5 | title: '{{ label }} list' 6 | route_name: entity.{{ entity_name }}.collection 7 | description: 'List {{ label }} entities' 8 | parent: system.admin_structure 9 | weight: 100 10 | 11 | {# Note: a content entity with bundles will have the settings configured on the bundle (config) entity. #} 12 | {% if not bundle_entity_type %} 13 | {{ entity_name }}.admin.structure.settings: 14 | title: '{{ label }} settings' 15 | description: 'Configure {{ label }} entities' 16 | route_name: {{ entity_name }}.settings 17 | parent: system.admin_structure 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /templates/module/links.menu.yml.twig: -------------------------------------------------------------------------------- 1 | {{ module_name }}.{{form_id}}: 2 | title: '{{ menu_link_title }}' 3 | route_name: {{ module_name }}.{{form_id}} 4 | description: '{{ menu_link_desc }}' 5 | parent: {{ menu_parent }} 6 | weight: 99 7 | -------------------------------------------------------------------------------- /templates/module/links.task-entity-content.yml.twig: -------------------------------------------------------------------------------- 1 | # {{ label }} routing definition 2 | {# Note: a content entity with bundles will have the settings configured on the bundle (config) entity. #} 3 | {% if not bundle_entity_type %} 4 | {{ entity_name }}.settings_tab: 5 | route_name: {{ entity_name }}.settings 6 | title: 'Settings' 7 | base_route: {{ entity_name }}.settings 8 | {% else %} 9 | entity.{{ entity_name }}_type.edit_form: 10 | route_name: entity.{{ entity_name }}_type.edit_form 11 | base_route: entity.{{ entity_name }}_type.edit_form 12 | title: 'Edit' 13 | weight: 0 14 | {% endif %} 15 | 16 | entity.{{ entity_name }}.canonical: 17 | route_name: entity.{{ entity_name }}.canonical 18 | base_route: entity.{{ entity_name }}.canonical 19 | title: 'View' 20 | 21 | entity.{{ entity_name }}.edit_form: 22 | route_name: entity.{{ entity_name }}.edit_form 23 | base_route: entity.{{ entity_name }}.canonical 24 | title: 'Edit' 25 | {% if revisionable %} 26 | 27 | entity.{{ entity_name }}.version_history: 28 | route_name: entity.{{ entity_name }}.version_history 29 | base_route: entity.{{ entity_name }}.canonical 30 | title: 'Revisions' 31 | {% endif %} 32 | 33 | entity.{{ entity_name }}.delete_form: 34 | route_name: entity.{{ entity_name }}.delete_form 35 | base_route: entity.{{ entity_name }}.canonical 36 | title: Delete 37 | weight: 10 38 | -------------------------------------------------------------------------------- /templates/module/module-block-twig-template-append.twig: -------------------------------------------------------------------------------- 1 | {% if file_exist == false %} 2 | [ 16 | 'variables' => [ 17 | 'content' => NULL 18 | ], 19 | 'render element' => 'children', 20 | ], 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /templates/module/module-file.twig: -------------------------------------------------------------------------------- 1 | {% include 'module/php_tag.php.twig' %} 2 | 3 | /** 4 | * @file 5 | * Contains {{machine_name}}.module. 6 | */ 7 | -------------------------------------------------------------------------------- /templates/module/module-libraries.yml.twig: -------------------------------------------------------------------------------- 1 | {{ module }}-library: 2 | js: 3 | js/{{ js_name }}.js: {} 4 | dependencies: 5 | - core/drupal.ajax 6 | -------------------------------------------------------------------------------- /templates/module/module-twig-template-append.twig: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Implements hook_theme(). 4 | */ 5 | function {{machine_name}}_theme() { 6 | return [ 7 | '{{machine_name}}' => [ 8 | 'render element' => 'children', 9 | ], 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /templates/module/module.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/file.php.twig" %} 2 | 3 | {% block file_path %}{{machine_name}}.module{% endblock %} 4 | 5 | {% block use_class %} 6 | use Drupal\Core\Routing\RouteMatchInterface; 7 | {% endblock %} 8 | 9 | {% block file_methods %} 10 | /** 11 | * Implements hook_help(). 12 | */ 13 | function {{machine_name}}_help($route_name, RouteMatchInterface $route_match) { 14 | switch ($route_name) { 15 | // Main module help for the {{ machine_name }} module. 16 | case 'help.page.{{ machine_name }}': 17 | $output = ''; 18 | $output .= '' . t('{{ description|escape }}') . '
'; 21 | {% endif %} 22 | return $output; 23 | 24 | default: 25 | } 26 | } 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /templates/module/module.views.inc.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/file.php.twig" %} 2 | 3 | {% block file_path %}{{ module }}\{{ module }}.views.inc.{% endblock %} 4 | 5 | {% block extra_info %} * Provide a custom views field data that isn't tied to any other module.{% endblock %} 6 | 7 | {% block file_methods %} 8 | /** 9 | * Implements hook_views_data(). 10 | */ 11 | function {{module}}_views_data() { 12 | 13 | $data['views']['table']['group'] = t('Custom Global'); 14 | $data['views']['table']['join'] = [ 15 | // #global is a special flag which allows a table to appear all the time. 16 | '#global' => [], 17 | ]; 18 | 19 | {% for field in fields %} 20 | $data['views']['{{ field.class_machine_name }}'] = [ 21 | 'title' => t('{{ field.title }}'), 22 | 'help' => t('{{ field.description }}'), 23 | 'field' => [ 24 | 'id' => '{{ field.class_machine_name }}', 25 | ], 26 | ]; 27 | {% endfor %} 28 | return $data; 29 | } 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /templates/module/permission-routing.yml.twig: -------------------------------------------------------------------------------- 1 | {% block routing_file %} 2 | {% endblock %} 3 | {% if permissions|length %} 4 | {% for permission in permissions %} 5 | {{ module_name }}.route: 6 | requirements: 7 | _permission: {{ permission.permission }}: 8 | {% endfor %} 9 | {% endif %} 10 | 11 | -------------------------------------------------------------------------------- /templates/module/permission.yml.twig: -------------------------------------------------------------------------------- 1 | {% if permissions|length %} 2 | {% for permission in permissions %} 3 | {{ permission.permission }}: 4 | title: '{{ permission.title }}' 5 | description: '{{ permission.description }}' 6 | {% if permission.restrict_access != 'none' %} 7 | restrict access: {{ permission.restrict_access }} 8 | {% endif %} 9 | {% endfor %} 10 | {% endif %} 11 | -------------------------------------------------------------------------------- /templates/module/permissions-entity-content.yml.twig: -------------------------------------------------------------------------------- 1 | add {{ label|lower }} entities: 2 | title: 'Create new {{ label }} entities' 3 | 4 | administer {{ label|lower }} entities: 5 | title: 'Administer {{ label }} entities' 6 | description: 'Allow to access the administration form to configure {{ label }} entities.' 7 | restrict access: true 8 | 9 | delete {{ label|lower }} entities: 10 | title: 'Delete {{ label }} entities' 11 | 12 | edit {{ label|lower }} entities: 13 | title: 'Edit {{ label }} entities' 14 | 15 | view published {{ label|lower }} entities: 16 | title: 'View published {{ label }} entities' 17 | 18 | view unpublished {{ label|lower }} entities: 19 | title: 'View unpublished {{ label }} entities' 20 | {% if revisionable %} 21 | 22 | view all {{ label|lower }} revisions: 23 | title: 'View all {{ label }} revisions' 24 | 25 | revert all {{ label|lower }} revisions: 26 | title: 'Revert all {{ label }} revisions' 27 | description: 'Role requires permission view {{ label }} revisions and edit rights for {{ label|lower }} entities in question or administer {{ label|lower }} entities.' 28 | 29 | delete all {{ label|lower }} revisions: 30 | title: 'Delete all revisions' 31 | description: 'Role requires permission to view {{ label }} revisions and delete rights for {{ label|lower }} entities in question or administer {{ label|lower }} entities.' 32 | {% endif %} 33 | 34 | {% if has_bundle_permissions %} 35 | permission_callbacks: 36 | - \Drupal\{{ module }}\{{ entity_class}}Permissions::generatePermissions 37 | {% endif %} 38 | -------------------------------------------------------------------------------- /templates/module/php_tag.php.twig: -------------------------------------------------------------------------------- 1 | addMessage('Module {{ module }} Post Update # {{ post_update_name }} () was executed successfully.'); 10 | } 11 | 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /templates/module/routing-controller.yml.twig: -------------------------------------------------------------------------------- 1 | {% if class_name is defined %} 2 | 3 | {% for route in routes %} 4 | {% if learning is defined and learning %} 5 | {{ yaml_comment('application.messages.learning.route') }} 6 | {% endif %} 7 | {{ route.name }}: 8 | path: '{{ route.path }}' 9 | defaults: 10 | _controller: '\Drupal\{{ module }}\Controller\{{ class_name }}::{{ route.method }}' 11 | _title: '{{route.title}}' 12 | requirements: 13 | _permission: 'access content' 14 | {% endfor %} 15 | {% endif %} 16 | -------------------------------------------------------------------------------- /templates/module/routing-form.yml.twig: -------------------------------------------------------------------------------- 1 | {% if class_name is defined %} 2 | {{ module_name }}.{{form_id}}: 3 | path: '{{ path }}' 4 | defaults: 5 | _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' 6 | _title: '{{ class_name }}' 7 | {% if config_form %} 8 | requirements: 9 | _permission: 'access administration pages' 10 | options: 11 | _admin_route: TRUE 12 | {% else %} 13 | requirements: 14 | _access: 'TRUE' 15 | {% endif %} 16 | {% endif %} 17 | -------------------------------------------------------------------------------- /templates/module/schema.yml.twig: -------------------------------------------------------------------------------- 1 | field.widget.settings.{{ plugin_id }}: 2 | type: mapping 3 | label: '{{ label }} widget settings' 4 | mapping: 5 | size: 6 | type: integer 7 | label: 'Size' 8 | placeholder: 9 | type: textfield 10 | label: 'Placeholder' 11 | -------------------------------------------------------------------------------- /templates/module/services.yml.twig: -------------------------------------------------------------------------------- 1 | {% if not file_exists %} 2 | services: 3 | {% endif %} 4 | {% if logger_channel is defined %} 5 | logger.channel.{{ module }}: 6 | parent: logger.channel_base 7 | arguments: ['{{ module }}'] 8 | {% endif %} 9 | {% if name is defined %} 10 | {{ name | lower }}: 11 | class: {{ class_path }} 12 | {% if services is defined %} 13 | arguments: [{{ servicesAsParametersKeys(services)|join(', ') }}] 14 | {% endif %} 15 | {% if tags is defined %} 16 | tags: 17 | - { {{ tagsAsArray(tags)|join(', ') }} } 18 | {% endif %} 19 | {% endif %} 20 | -------------------------------------------------------------------------------- /templates/module/src/Ajax/ajax-command.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{ module }}\Ajax\{{ class_name }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{ module }}\Ajax; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Ajax\CommandInterface; 13 | {% endblock %} 14 | {% block class_declaration %} 15 | /** 16 | * Class {{ class_name }}. 17 | */ 18 | class {{ class_name }} implements CommandInterface {% endblock %} 19 | 20 | {% block class_methods %} 21 | /** 22 | * Render custom ajax command. 23 | * 24 | * @return ajax 25 | * Command function. 26 | */ 27 | public function render() { 28 | return [ 29 | 'command' => '{{ method }}', 30 | 'message' => 'My Awesome Message', 31 | ]; 32 | } 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /templates/module/src/Annotation/plugin-type.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{ module }}\Annotation\{{ class_name }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{ module }}\Annotation; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Component\Annotation\Plugin; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Defines a {{ label }} item annotation object. 18 | * 19 | * @see \Drupal\{{ module }}\Plugin\{{ class_name }}Manager 20 | * @see plugin_api 21 | * 22 | * @Annotation 23 | */ 24 | class {{ class_name }} extends Plugin {% endblock %} 25 | {% block class_methods %} 26 | 27 | /** 28 | * The plugin ID. 29 | * 30 | * @var string 31 | */ 32 | public $id; 33 | 34 | /** 35 | * The label of the plugin. 36 | * 37 | * @var \Drupal\Core\Annotation\Translation 38 | * 39 | * @ingroup plugin_translatable 40 | */ 41 | public $label; 42 | {% endblock %} 43 | -------------------------------------------------------------------------------- /templates/module/src/Command/console/translations/en/command.yml.twig: -------------------------------------------------------------------------------- 1 | description: 'Drupal Console generated command.' 2 | options: {} 3 | arguments: {} 4 | messages: 5 | success: 'I am a new generated command.' 6 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/core.entity_form_display.node.default.yml.twig: -------------------------------------------------------------------------------- 1 | langcode: en 2 | status: true 3 | dependencies: 4 | config: 5 | - field.field.node.{{ bundle_name }}.body 6 | - node.type.{{ bundle_name }} 7 | module: 8 | - path 9 | - text 10 | id: node.{{ bundle_name }}.default 11 | targetEntityType: node 12 | bundle: {{ bundle_name }} 13 | mode: default 14 | content: 15 | body: 16 | type: text_textarea_with_summary 17 | weight: 31 18 | settings: 19 | rows: 9 20 | summary_rows: 3 21 | placeholder: '' 22 | third_party_settings: { } 23 | created: 24 | type: datetime_timestamp 25 | weight: 10 26 | settings: { } 27 | third_party_settings: { } 28 | path: 29 | type: path 30 | weight: 30 31 | settings: { } 32 | third_party_settings: { } 33 | promote: 34 | type: boolean_checkbox 35 | settings: 36 | display_label: true 37 | weight: 15 38 | third_party_settings: { } 39 | sticky: 40 | type: boolean_checkbox 41 | settings: 42 | display_label: true 43 | weight: 16 44 | third_party_settings: { } 45 | title: 46 | type: string_textfield 47 | weight: -5 48 | settings: 49 | size: 60 50 | placeholder: '' 51 | third_party_settings: { } 52 | uid: 53 | type: entity_reference_autocomplete 54 | weight: 5 55 | settings: 56 | match_operator: CONTAINS 57 | size: 60 58 | placeholder: '' 59 | third_party_settings: { } 60 | hidden: { } 61 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/core.entity_view_display.node.default.yml.twig: -------------------------------------------------------------------------------- 1 | langcode: en 2 | status: true 3 | dependencies: 4 | config: 5 | - field.field.node.{{ bundle_name }}.body 6 | - node.type.{{ bundle_name }} 7 | module: 8 | - text 9 | - user 10 | id: node.{{ bundle_name }}.default 11 | targetEntityType: node 12 | bundle: {{ bundle_name }} 13 | mode: default 14 | content: 15 | body: 16 | label: hidden 17 | type: text_default 18 | weight: 101 19 | settings: { } 20 | third_party_settings: { } 21 | links: 22 | weight: 100 23 | hidden: { } 24 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/core.entity_view_display.node.teaser.yml.twig: -------------------------------------------------------------------------------- 1 | langcode: en 2 | status: true 3 | dependencies: 4 | config: 5 | - core.entity_view_mode.node.teaser 6 | - field.field.node.{{ bundle_name }}.body 7 | - node.type.{{ bundle_name }} 8 | module: 9 | - text 10 | - user 11 | id: node.{{ bundle_name }}.teaser 12 | targetEntityType: node 13 | bundle: {{ bundle_name }} 14 | mode: teaser 15 | content: 16 | body: 17 | label: hidden 18 | type: text_summary_or_trimmed 19 | weight: 101 20 | settings: 21 | trim_length: 600 22 | third_party_settings: { } 23 | links: 24 | weight: 100 25 | hidden: { } 26 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/entity-bundle-field-info-alter.php.twig: -------------------------------------------------------------------------------- 1 | 2 | {% block use_class %} 3 | use Drupal\Core\Entity\EntityTypeInterface; 4 | {% endblock %} 5 | 6 | /** 7 | * Implements hook_entity_bundle_field_info_alter(). 8 | */ 9 | function {{module}}_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) { 10 | {% if bundle %} 11 | if ($bundle === '{{ bundle }}') { 12 | {% endif %} 13 | if (isset($fields['{{ field_id }}'])) { 14 | // Use the ID as defined in the annotation of the constraint definition. 15 | $fields['{{ field_id }}']->addConstraint('{{ plugin_id }}', []); 16 | } 17 | {% if bundle %} 18 | } 19 | {% endif %} 20 | } -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/field.field.node.body.yml.twig: -------------------------------------------------------------------------------- 1 | langcode: en 2 | status: true 3 | dependencies: 4 | config: 5 | - field.storage.node.body 6 | - node.type.{{ bundle_name }} 7 | module: 8 | - text 9 | id: node.{{ bundle_name }}.body 10 | field_name: body 11 | entity_type: node 12 | bundle: {{ bundle_name }} 13 | label: Body 14 | description: '' 15 | required: false 16 | translatable: true 17 | default_value: { } 18 | default_value_callback: '' 19 | settings: 20 | display_summary: true 21 | field_type: text_with_summary 22 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Bundle/node.type.yml.twig: -------------------------------------------------------------------------------- 1 | langcode: en 2 | status: true 3 | dependencies: 4 | module: 5 | - menu_ui 6 | third_party_settings: 7 | menu_ui: 8 | available_menus: 9 | - main 10 | parent: 'main:' 11 | name: '{{ bundle_title }}' 12 | type: {{ bundle_name }} 13 | description: 'Generated by Drupal Console' 14 | help: '' 15 | new_revision: false 16 | preview_mode: 1 17 | display_submitted: true 18 | -------------------------------------------------------------------------------- /templates/module/src/Entity/Form/entity-content-delete.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Form\{{ entity_class }}DeleteForm. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Form; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Entity\ContentEntityDeleteForm; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides a form for deleting {{ label }} entities. 18 | * 19 | * @ingroup {{module}} 20 | */ 21 | class {{ entity_class }}DeleteForm extends ContentEntityDeleteForm {% endblock %} 22 | -------------------------------------------------------------------------------- /templates/module/src/Entity/entity-content-views-data.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{ module }}\Entity\{{ entity_class }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{ module }}\Entity; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\views\EntityViewsData; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides Views data for {{ label }} entities. 18 | */ 19 | class {{ entity_class }}ViewsData extends EntityViewsData {% endblock %} 20 | {% block class_methods %} 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function getViewsData() { 25 | $data = parent::getViewsData(); 26 | 27 | // Additional information for Views integration, such as table joins, can be 28 | // put here. 29 | return $data; 30 | } 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /templates/module/src/Entity/entity-content-with-bundle.theme.php.twig: -------------------------------------------------------------------------------- 1 | {% block hook_theme %} 2 | 3 | /** 4 | * Implements hook_theme(). 5 | */ 6 | function {{ module }}_theme() { 7 | $theme = []; 8 | {% include '/module/src/Entity/entity-content.theme.php.twig' with {'entity_name': entity_name, } %} 9 | $theme['{{ entity_name }}_content_add_list'] = [ 10 | 'render element' => 'content', 11 | 'variables' => ['content' => NULL], 12 | 'file' => '{{ entity_name }}.page.inc', 13 | ]; 14 | return $theme; 15 | } 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /templates/module/src/Entity/entity-content-with-bundle.theme_hook_suggestions.php.twig: -------------------------------------------------------------------------------- 1 | {% block hook_theme_suggestions_hook %} 2 | 3 | /** 4 | * Implements hook_theme_suggestions_HOOK(). 5 | */ 6 | function {{ module }}_theme_suggestions_{{ entity_name }}(array $variables) { 7 | $suggestions = []; 8 | $entity = $variables['elements']['#{{ entity_name }}']; 9 | $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_'); 10 | 11 | $suggestions[] = '{{ entity_name }}__' . $sanitized_view_mode; 12 | $suggestions[] = '{{ entity_name }}__' . $entity->bundle(); 13 | $suggestions[] = '{{ entity_name }}__' . $entity->bundle() . '__' . $sanitized_view_mode; 14 | $suggestions[] = '{{ entity_name }}__' . $entity->id(); 15 | $suggestions[] = '{{ entity_name }}__' . $entity->id() . '__' . $sanitized_view_mode; 16 | return $suggestions; 17 | } 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /templates/module/src/Entity/entity-content.theme.php.twig: -------------------------------------------------------------------------------- 1 | {% block hook_theme %} 2 | $theme['{{ entity_name }}'] = [ 3 | 'render element' => 'elements', 4 | 'file' => '{{ entity_name }}.page.inc', 5 | 'template' => '{{ entity_name }}', 6 | ]; 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /templates/module/src/Entity/interface-entity.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Entity\{{ entity_class }}Interface. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Entity; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Config\Entity\ConfigEntityInterface; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides an interface for defining {{ label }} entities. 18 | */ 19 | interface {{ entity_class }}Interface extends ConfigEntityInterface {% endblock %} 20 | {% block class_methods %} 21 | // Add get/set methods for your configuration properties here.{% endblock %} 22 | -------------------------------------------------------------------------------- /templates/module/src/Form/entity-delete.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Form\{{ entity_class }}DeleteForm. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Form; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Entity\EntityConfirmFormBase; 13 | use Drupal\Core\Form\FormStateInterface; 14 | use Drupal\Core\Url; 15 | {% endblock %} 16 | 17 | {% block class_declaration %} 18 | /** 19 | * Builds the form to delete {{ label }} entities. 20 | */ 21 | class {{ entity_class }}DeleteForm extends EntityConfirmFormBase {% endblock %} 22 | {% block class_methods %} 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function getQuestion() { 27 | return $this->t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]); 28 | } 29 | 30 | /** 31 | * {@inheritdoc} 32 | */ 33 | public function getCancelUrl() { 34 | return new Url('entity.{{ entity_name }}.collection'); 35 | } 36 | 37 | /** 38 | * {@inheritdoc} 39 | */ 40 | public function getConfirmText() { 41 | return $this->t('Delete'); 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | public function submitForm(array &$form, FormStateInterface $form_state) { 48 | $this->entity->delete(); 49 | 50 | $this->messenger()->addMessage( 51 | $this->t('content @type: deleted @label.', [ 52 | '@type' => $this->entity->bundle(), 53 | '@label' => $this->entity->label(), 54 | ]) 55 | ); 56 | 57 | $form_state->setRedirectUrl($this->getCancelUrl()); 58 | } 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /templates/module/src/Generator/generator.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{extension}}\Generator\{{ class }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{extension}}\Generator; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Console\Core\Generator\Generator; 13 | use Drupal\Console\Core\Generator\GeneratorInterface; 14 | {% endblock %} 15 | 16 | {% block class_declaration %} 17 | /** 18 | * Class {{ class_name }}. 19 | * 20 | * @package Drupal\Console\Generator 21 | */ 22 | class {{ class_name }} extends Generator implements GeneratorInterface {% endblock %} 23 | 24 | {% block class_methods %} 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function generate(array $parameters) { 29 | // Example how to render a twig template using the renderFile method 30 | // $this->renderFile( 31 | // 'path/to/file.php.twig', 32 | // 'path/to/file.php', 33 | // $parameters 34 | // );. 35 | } 36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/Block/blocktype.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\Block\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\Block; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Block\BlockBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | 17 | /** 18 | * {@inheritdoc} 19 | */ 20 | public function build() { 21 | $build = []; 22 | $build['{{block_id}}']['#markup'] = 'Implement {{class_name}}.'; 23 | return $build; 24 | } 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/CKEditorPlugin/plugin.php.twig: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT EDIT THIS FILE. 3 | * See the following change record for more information, 4 | * https://www.drupal.org/node/2815083 5 | * @preserve 6 | **/ 7 | {% for button in buttons %} 8 | CKEDITOR.plugins.add('{{ plugin_id }}', { 9 | init: function( editor ) { 10 | if ( editor.ui.addButton ) { 11 | editor.ui.addButton( '{{ button.name }}', { 12 | label: 'default ckeditor button', 13 | id: '{{ button.name }}', 14 | command: '', 15 | toolbar: '{{ button.name }},10', 16 | } ); 17 | } 18 | } 19 | } ); 20 | {% endfor %} -------------------------------------------------------------------------------- /templates/module/src/Plugin/Condition/rulescondition.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\Condition\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\Condition; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\rules\Core\RulesConditionBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides a '{{class_name}}' condition. 18 | * 19 | * @Condition( 20 | * id = "{{plugin_id}}", 21 | * label = @Translation("{{label}}"), 22 | * category = @Translation("{{category}}"), 23 | {% if context %} 24 | * context = { 25 | {% for item in context %} 26 | * "{{ item.name }}" = @ContextDefinition("{{ item.type }}", 27 | * label = @Translation("{{ item.label }}"), 28 | * description = @Translation("{{ item.description }}") 29 | * ), 30 | {% endfor %} 31 | * } 32 | {% endif %} 33 | * ) 34 | */ 35 | class {{class_name}} extends RulesConditionBase {% endblock %} 36 | {% block class_methods %} 37 | /** 38 | * {@inheritdoc} 39 | */ 40 | public function doEvaluate($object = NULL) { 41 | // Insert code here. 42 | } 43 | {% endblock %} -------------------------------------------------------------------------------- /templates/module/src/Plugin/ImageEffect/imageeffect.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\ImageEffect\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\ImageEffect; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Image\ImageInterface; 13 | use Drupal\image\ImageEffectBase; 14 | {% endblock %} 15 | 16 | {% block class_declaration %} 17 | /** 18 | * Provides a '{{class_name}}' image effect. 19 | * 20 | * @ImageEffect( 21 | * id = "{{plugin_id}}", 22 | * label = @Translation("{{label}}"), 23 | * description = @Translation("{{description}}") 24 | * ) 25 | */ 26 | class {{ class_name }} extends ImageEffectBase {% endblock %} 27 | {% block class_methods %} 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function applyEffect(ImageInterface $image) { 32 | // Implement Image Effect. 33 | return imagefilter($image->getToolkit()->getResource()); 34 | } 35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/Mail/mail.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\Mail\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\Mail; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Mail\Plugin\Mail\PhpMail; 13 | {% if services is not empty %} 14 | use Drupal\Core\Plugin\ContainerFactoryPluginInterface; 15 | use Symfony\Component\DependencyInjection\ContainerInterface; 16 | {% endif %} 17 | {% endblock %} 18 | 19 | {% block use_class_services %} 20 | {% endblock %} 21 | 22 | {% block class_declaration %} 23 | /** 24 | * Provides a '{{class_name}}' mail plugin. 25 | * 26 | * @Mail( 27 | * id = "{{plugin_id}}", 28 | * label = @Translation("{{label}}") 29 | * ) 30 | */ 31 | class {{class_name}} extends PhpMail {% if services is not empty %}implements ContainerFactoryPluginInterface {% endif %} 32 | {% endblock %} 33 | 34 | {% block class_create %} 35 | {% if services is not empty %} 36 | /** 37 | * {@inheritdoc} 38 | */ 39 | public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { 40 | $instance = new static($configuration, $plugin_id, $plugin_definition); 41 | {{ serviceClassInjectionNoOverride(services) }} 42 | return $instance; 43 | } 44 | {% endif %} 45 | {% endblock %} 46 | 47 | {% block class_methods %} 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function format(array $message) { 53 | } 54 | 55 | /** 56 | * {@inheritdoc} 57 | */ 58 | public function mail(array $message) { 59 | } 60 | {% endblock %} 61 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/QueueWorker/queue_worker.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block namespace_class %} 4 | namespace Drupal\{{ module }}\Plugin\QueueWorker; 5 | {% endblock %} 6 | 7 | {% block use_class %} 8 | use Drupal\Core\Queue\QueueWorkerBase; 9 | {% endblock %} 10 | 11 | {% block class_declaration %} 12 | /** 13 | * Plugin implementation of the {{ plugin_id }} queueworker. 14 | * 15 | * @QueueWorker ( 16 | * id = "{{ plugin_id }}", 17 | * title = @Translation("{{ label }}"), 18 | * cron = {"time" = {{ cron_time }}} 19 | * ) 20 | */ 21 | class {{ class_name }} extends QueueWorkerBase {% endblock %} 22 | {% block class_methods %} 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function processItem($data) { 27 | // Process item operations. 28 | } 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/RulesAction/rulesaction.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\RulesAction\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\RulesAction; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\rules\Core\RulesActionBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides a '{{class_name}}' action. 18 | * 19 | * @RulesAction( 20 | * id = "{{plugin_id}}", 21 | * label = @Translation("{{label}}"), 22 | * category = @Translation("{{category}}"), 23 | {% if context %} 24 | * context = { 25 | {% for item in context %} 26 | * "{{ item.name }}" = @ContextDefinition("{{ item.type }}", 27 | * label = @Translation("{{ item.label }}"), 28 | * description = @Translation("{{ item.description }}") 29 | * ), 30 | {% endfor %} 31 | * } 32 | {% endif %} 33 | * ) 34 | */ 35 | class {{class_name}} extends RulesActionBase {% endblock %} 36 | {% block class_methods %} 37 | /** 38 | * {@inheritdoc} 39 | */ 40 | public function doExecute($object = NULL) { 41 | // Insert code here. 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | public function autoSaveContext() { 48 | // Insert code here. 49 | return []; 50 | } 51 | {% endblock %} 52 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/RulesDataProcessor/rulesdataprocessor.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | Drupal\{{module}}\Plugin\RulesDataProcessor\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\RulesDataProcessor; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Plugin\PluginBase; 13 | use Drupal\rules\Context\DataProcessorInterface; 14 | use Drupal\rules\Engine\ExecutionStateInterface; 15 | {% endblock %} 16 | 17 | {% block class_declaration %} 18 | /** 19 | * Provides a '{{class_name}}' action. 20 | * 21 | * @RulesDataProcessor( 22 | * id = "{{plugin_id}}", 23 | * label = @Translation("{{label}}") 24 | * ) 25 | */ 26 | class {{class_name}} extends PluginBase implements DataProcessorInterface {% endblock %} 27 | {% block class_methods %} 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function process($value, ExecutionStateInterface $rules_state) { 32 | // Insert code here. 33 | } 34 | {% endblock %} -------------------------------------------------------------------------------- /templates/module/src/Plugin/Validation/Constraint/constraint.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{ module }}\Plugin\Validation\Constraint\{{ class_name }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{ module }}\Plugin\Validation\Constraint; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Symfony\Component\Validator\Constraint; 13 | use Symfony\Component\Validator\ConstraintValidator; 14 | {% endblock %} 15 | 16 | {% block class_declaration %} 17 | /** 18 | * Plugin implementation of the '{{ plugin_id }}'. 19 | * 20 | * @Constraint( 21 | * id = "{{ plugin_id }}", 22 | * label = @Translation("{{ label }}", context = "Validation"), 23 | * ) 24 | */ 25 | class {{ class_name }} extends Constraint 26 | {% endblock %} 27 | 28 | {% block class_properties %} 29 | // The message that will be shown if the value is empty. 30 | public $isEmpty = '%value is empty'; 31 | 32 | // The message that will be shown if the value is not unique. 33 | public $notUnique = '%value is not unique'; 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/Validation/Constraint/validator.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{ module }}\Plugin\Validation\Constraint\{{ class_name }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{ module }}\Plugin\Validation\Constraint; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Symfony\Component\Validator\Constraint; 13 | use Symfony\Component\Validator\ConstraintValidator; 14 | {% endblock %} 15 | 16 | {% block class_declaration %} 17 | /** 18 | * Validates the UniqueInteger constraint. 19 | */ 20 | class {{ class_name }}Validator extends ConstraintValidator 21 | {% endblock %} 22 | 23 | {% block class_methods %} 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | public function validate($items, Constraint $constraint) { 28 | foreach ($items as $item) { 29 | // First check if the value is not empty. 30 | if (empty($item->value)) { 31 | // The value is empty, so a violation, aka error, is applied. 32 | // The type of violation applied comes from the constraint description 33 | // in step 1. 34 | $this->context->addViolation($constraint->isEmpty, ['%value' => $item->value]); 35 | } 36 | 37 | // Next check if the value is unique. 38 | if (!$this->isUnique($item->value)) { 39 | $this->context->addViolation($constraint->notUnique, ['%value' => $item->value]); 40 | } 41 | } 42 | } 43 | 44 | private function isUnique($value) { 45 | // Here is where the check for a unique value would happen. 46 | } 47 | {% endblock %} 48 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/migrate/process/process.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\migrate\process\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\migrate\process; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\migrate\ProcessPluginBase; 13 | use Drupal\migrate\MigrateExecutableInterface; 14 | use Drupal\migrate\Row; 15 | {% endblock %} 16 | 17 | {% block class_declaration %} 18 | /** 19 | * Provides a '{{class_name}}' migrate process plugin. 20 | * 21 | * @MigrateProcessPlugin( 22 | * id = "{{plugin_id}}" 23 | * ) 24 | */ 25 | class {{class_name}} extends ProcessPluginBase {% endblock %} 26 | {% block class_methods %} 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { 31 | // Plugin logic goes here. 32 | } 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/migrate/source/source.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\migrate\source\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\migrate\source; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\migrate\Plugin\migrate\source\SqlBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides a '{{class_name}}' migrate source. 18 | * 19 | * @MigrateSource( 20 | * id = "{{plugin_id}}", 21 | * source_module = "{{module}}" 22 | * ) 23 | */ 24 | class {{class_name}} extends SqlBase {% endblock %} 25 | {% block class_methods %} 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | public function query() { 30 | return $this->select('{{table}}', '{{alias}}') 31 | ->fields('{{alias}}') 32 | {% if group_by %} 33 | ->groupBy('{{alias}}.{{group_by}}') 34 | {% endif %}; 35 | } 36 | 37 | /** 38 | * {@inheritdoc} 39 | */ 40 | public function fields() { 41 | $fields = [ 42 | {% for field in fields %} 43 | '{{field.id}}' => $this->t('{{field.description}}'), 44 | {% endfor %} 45 | ]; 46 | return $fields; 47 | } 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function getIds() { 53 | return []; 54 | } 55 | {% endblock %} 56 | -------------------------------------------------------------------------------- /templates/module/src/Plugin/migrate_plus/data_parser/data_parser.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Plugin\migrate_plus\data_parser\{{class_name}}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Plugin\migrate_plus\data_parser; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\migrate_plus\DataParserPluginBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * Provides a '{{class_name}}' data parser plugin. 18 | * 19 | * @DataParser( 20 | * id = "{{plugin_id}}" 21 | * title = @Translation("{{plugin_title}}") 22 | * ) 23 | */ 24 | class {{class_name}} extends DataParserPluginBase {% endblock %} 25 | {% block class_methods %} 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | protected function openSourceUrl($url) { 30 | // Plugin logic goes here. 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | protected function fetchNextRow() { 37 | // Plugin logic goes here. 38 | } 39 | {% endblock %} 40 | -------------------------------------------------------------------------------- /templates/module/src/Routing/route-subscriber.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\{{module}}\Routing\{{ class }}. 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\{{module}}\Routing; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\Core\Routing\RouteSubscriberBase; 13 | use Symfony\Component\Routing\RouteCollection; 14 | {% endblock %} 15 | 16 | {% block class_declaration %} 17 | /** 18 | * Class {{ class }}. 19 | * 20 | * Listens to the dynamic route events. 21 | */ 22 | class {{ class }} extends RouteSubscriberBase {% endblock %} 23 | {% block class_methods %} 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | protected function alterRoutes(RouteCollection $collection) { 28 | }{% endblock %} 29 | -------------------------------------------------------------------------------- /templates/module/src/Tests/js-test.php.twig: -------------------------------------------------------------------------------- 1 | {% extends "base/class.php.twig" %} 2 | 3 | {% block file_path %} 4 | \Drupal\Tests\{{ module }}\FunctionalJavascript\{{ class }} 5 | {% endblock %} 6 | 7 | {% block namespace_class %} 8 | namespace Drupal\Tests\{{ module }}\FunctionalJavascript; 9 | {% endblock %} 10 | 11 | {% block use_class %} 12 | use Drupal\FunctionalJavascriptTests\JavascriptTestBase; 13 | {% endblock %} 14 | 15 | {% block class_declaration %} 16 | /** 17 | * JavaScript tests. 18 | * 19 | * @ingroup {{ module }} 20 | * 21 | * @group {{ module }} 22 | */ 23 | class {{ class }} extends JavaScriptTestBase {% endblock %} 24 | {% block class_methods %} 25 | /** 26 | * Modules to enable. 27 | * 28 | * @var array 29 | */ 30 | public static $modules = ['{{ module }}']; 31 | 32 | /** 33 | * A user with permission to administer site configuration. 34 | * 35 | * @var \Drupal\user\UserInterface 36 | */ 37 | protected $user; 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | protected function setUp() { 43 | parent::setUp(); 44 | $this->user = $this->drupalCreateUser(['administer site configuration']); 45 | $this->drupalLogin($this->user); 46 | } 47 | 48 | /** 49 | * Tests that the home page loads with a 200 response. 50 | */ 51 | public function testFrontpage() { 52 | $this->drupalGet(Url::fromRoute('{{value}}
' }} 17 | {{ '{% endfor %}' }} 18 |