Git Product home page Git Product logo

drupal-cfr's Introduction

drupal-cfr's People

Contributors

donquixote avatar

Watchers

 avatar  avatar

drupal-cfr's Issues

Clarify or rethink ArgDefToConfiguratorInterface

Look at

  • ArgDefToConfiguratorInterface
  • ArgDefToConfigurator_Callback
  • ArgDefToConfigurator_ConfiguratorObject
  • ArgDefToConfigurator_FixedValue
  • DefinitionToConfigurator_Mappers
  • ServiceFactoryUtil
  • ValueToCallbackInterface

Maybe this just needs better docs, or a better name.

Rethink definition vs configurator classes and interfaces

Possibly too many interfaces? Too fine-grained?

Look at

  • ConfiguratorMapInterface
  • DefinitionMapInterface
  • DefinitionsByIdInterface
  • DefinitionToConfiguratorInterface
  • DefinitionToLabelInterface
  • DefmapToCfrFamilyInterface
  • DefmapToCfrmapInterface
  • DefmapToContainerInterface
  • DefmapToLegendInterface
  • IdToDefinitionInterface
  • IdToLegendInterface
  • DefinitionsByTypeAndIdInterface

Also the realm and family containers:

  • CfrPluginRealmContainerInterface
  • CfrRealmContainerInterface
  • TypeToCfrFamilyInterface
  • TypeToConfiguratorInterface
  • TypeToContainerInterface
  • TypeToDefinitionsbyidInterface
  • TypeToDefmapInterface

Use "public" access modifier.

A lot of the methods don't have the "public" keyword.
It is technically not necessary, but it is standard in PSR-something and elsewhere. So let's just add it hmkay?

Flatten CfrFamilyContainer*

Look at:

  • CfrFamilyContainerInterface
  • CfrFamilyContainerBase
  • CfrFamilyContainer_FromDefmap

Propertie, public:

  • @Property \Drupal\cfrfamily\ConfiguratorMap\ConfiguratorMapInterface $configuratorMap
    -> DefmapToCfrmap_ViaContainer::defmapGetCfrmap()
  • @Property \Drupal\cfrfamily\CfrLegend\CfrLegendInterface $cfrLegend
    -> _cfrpreset_interface_page()

Properties, internal:

  • @Property \Drupal\cfrapi\ConfEmptyness\ConfEmptynessInterface $confEmptyness
    -> to construct Configurator_CompositeOptional in get_optionalConfigurator().

Properties, unused:

  • @Property \Drupal\cfrapi\Configurator\ConfiguratorInterface $configurator
  • @Property \Drupal\cfrapi\Configurator\Optional\OptionalConfiguratorInterface $optionalConfigurator
  • @Property \Drupal\cfrfamily\IdToConfigurator\IdToConfiguratorInterface $idToConfigurator

Properties, unused, no factory:

  • @Property \Drupal\cfrapi\Legend\LegendInterface $legend
    (was previously used to construct Configurator_IdConfAdvanced)

Evaluate ValueToValueInterface

Look at

  • ValueToValueInterface
  • Configurator_GroupReparentV2V
  • Configurator_ObjectSetterMethod
  • ValueToValue_Callback
  • ValueToValue_FieldEntityDisplay

Clarify or rethink ElementProcessorInterface

Implemented in ElementProcessor_ReparentChildren.
Used in Configurator_GroupReparent.

In fact this is used as a #process callback for form API. But this needs to be clarified more! And maybe belongs in a different module?

Add `ConfToForm::formValueGetConf()` ?

Add ConfToForm::formValueGetConf(). This will allow form values to be cleaned up or transformed before they go to the database.

namespace Drupal\cfrapi\ConfToForm;

interface ConfToFormInterface {

  /**
   * @param mixed $conf
   *   Configuration from a form, config file or storage.
   * @param string|null $label
   *   Label for the form element, specifying the purpose where it is used.
   *
   * @return array
   */
  public function confGetForm($conf, $label);

  /**
   * @param mixed $formValue
   *
   * @return mixed
   */
  public function formValueGetConf($formValue);

}

Complete API for plugin info.

E.g. like this

cfrplugin()->getInterfaces();
cfrplugin()->getCfrFamilies();
cfrplugin()->getDefinitions();
cfrplugin()->interfaceGetConfigurator($interface, $context = null);
cfrplugin()->interfaceGetOptionalConfigurator($interface, $context = null, $defaultValue = null);

cfrplugin()->interfaceGetCfrFamily($interface)->getConfigurator();
cfrplugin()->interfaceGetCfrFamily($interface)->getOptionalConfigurator();
cfrplugin()->interfaceGetCfrFamily($interface)->getLabels();
cfrplugin()->interfaceGetCfrFamily($interface)->getLegend();
cfrplugin()->interfaceGetCfrFamily($interface)->getPluginIds();  // Filtered or not?
cfrplugin()->interfaceGetCfrFamily($interface)->getDefinitions();  // Only in sub-interface
cfrplugin()->interfaceGetCfrFamily($interface)->idGetConfigurator($id);

cfrplugin()->interfaceGetCfrFamily($interface)->idGetPlugin($id)->getLabel();
cfrplugin()->interfaceGetCfrFamily($interface)->idGetPlugin($id)->getGroupLabel();
cfrplugin()->interfaceGetCfrFamily($interface)->idGetPlugin($id)->getDefinition();  // Only in sub-interface.
cfrplugin()->interfaceGetCfrFamily($interface)->idGetPlugin($id)->getConfigurator();
cfrplugin()->interfaceGetCfrFamily($interface)->idGetPlugin($id)->getCfrLegend();  // Only if exists.

Remove deprecated or unused configurator classes / interfaces

Candidates for removal:

  • ConfiguratorFilterInterface
  • Configurator_ObjectSetterMethod
  • ConfToIdOptionsInterface
  • OptionableConfToSummaryInterface

More:

  • BrokenOptionableConfigurator.
  • BrokenOptionalConfigurator.
  • Configurator_OptionableComposite
  • Configurator_IdConfAdvanced
  • TypeToConfigurator_ViaContainer

More unused:

  • Legend_FromDefmapAdvanced
  • Legend_FromDefmap
  • Legend_FromDefmapRaw
  • InlineConfiguratorInterface now unused after deleting the Legend_FromDefmap* classes.

More unused:

  • Configurator_CallbackMono
  • StructuredLegendInterface falsely used in a doc in Configurator_CallbackMono

More unused:

  • IdConfToSummaryInterface
  • IdToLegendInterface

Marked "deprecated", but still in use, follow-up in #2:

  • OptionableConfToFormInterface
  • OptionableConfiguratorInterface
  • OptionalConfigurator_FromOptionable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.