<commit_before>import { DependencyMetadata } from '../dependencyMetadata'
import { InAndWhenSyntax } from './inAndWhenSyntax'
import { ServicingStrategy } from '../servicing-strategies/servicingStrategy'
import { WhenSyntax } from './whenSyntax'
import { DeliveryStrategy } from '../delivery-strategies/deliveryStrategy'
import { ResolutionContext } from '../resolutionContext'
import { InstanceServicingStrategy } from '../servicing-strategies/instanceServicingStrategy'
import { BuilderFunctionServicingStrategy } from '../servicing-strategies/builderFunctionServicingStrategy'
import { ConstantServicingStrategy } from '../servicing-strategies/constantServicingStrategy'
import { PerCallDeliveryStrategy } from '../delivery-strategies/perCallDeliveryStrategy'
import { SingletonDeliveryStrategy } from '../delivery-strategies/singletonDeliveryStrategy'
import { PerResolutionDeliveryStrategy } from '../delivery-strategies/perResolutionDeliveryStrategy'
import { ContainerizedDeliveryStrategy } from '../delivery-strategies/containerizedDeliveryStrategy'
import ancestorsAreValidator from '../metadata-validators/ancestorsAreValidator'
import injectedExactlyIntoTypesValidator from '../metadata-validators/injectedExactlyIntoTypesValidator'
import injectedExactlyIntoAliasesValidator from '../metadata-validators/injectedExactlyIntoAliasesValidator'
import injectedIntoTypesValidator from '../metadata-validators/injectedIntoTypesValidator'
import injectedIntoAliasesValidator from '../metadata-validators/injectedIntoAliasesValidator'
import { WithAndAsAndInAndWhenSyntax } from './withAndAsAndInAndWhenSyntax'
import { AsAndInAndWhenSyntax } from './asAndInAndWhenSyntax'

/**
 * Represents a syntax that allow setup the dependecy resolution behavior.
 */
export class BehaviorSyntax implements WithAndAsAndInAndWhenSyntax {

    /**
     * Represents the dependency metadata to affect in a fluently way.
     */
  private _dependencyMetadata: DependencyMetadata

    /**
     * Creates a new behavior syntax that allow setup the dependecy resolution behavior.
     * @param dependencyMetadata Represents the dependency metadata to affect in a fluently way.
     */
  constructor (dependencyMetadata: DependencyMetadata) {

    if (!dependencyMetadata.validators) {
      dependencyMetadata.validators = []
    }

    this._dependencyMetadata = dependencyMetadata
  }

    /*********************************
     *  The Dependencies (With Syntax)
     *********************************/

    /**
     * Setup the aliases that will repsents the argument names with the given aliases.
     * @param aliases Represents the aliases that will repsents the argument names.
     * @return A syntax extension to setup the serving, delivery and conditions.
     */
  public with (aliases: string[]): AsAndInAndWhenSyntax {
    return this
  }

     /*********************************
     *  The servicing (As Syntax)
     *********************************/

    /**
     * Setup the current alias bind to be served as an instace.
     * @return A syntax extension to setup the delivery and conditions.
     */
  public asInstance (): InAndWhenSyntax {

    this._dependencyMetadata.servicingStrategy = new InstanceServicingStrategy()

    return this
  }

    /**
     * Setup the current alias bind to be served as the result of the referenced function..
     * @return A syntax extension to setup the delivery and conditions.
     */
  public asBuilderFunction (): InAndWhenSyntax {

    this._dependencyMetadata.servicingStrategy = new BuilderFunctionServicingStrategy()

    return this
  }

    /**<commit_msg>Implementing abstraction for dependency assignation on registration #18<commit_after>import { DependencyMetadata } from '../dependencyMetadata'
import { InAndWhenSyntax } from './inAndWhenSyntax'
import { ServicingStrategy } from '../servicing-strategies/servicingStrategy'
import { WhenSyntax } from './whenSyntax'
import { DeliveryStrategy } from '../delivery-strategies/deliveryStrategy'
import { ResolutionContext } from '../resolutionContext'
import { InstanceServicingStrategy } from '../servicing-strategies/instanceServicingStrategy'
import { BuilderFunctionServicingStrategy } from '../servicing-strategies/builderFunctionServicingStrategy'
import { ConstantServicingStrategy } from '../servicing-strategies/constantServicingStrategy'
import { PerCallDeliveryStrategy } from '../delivery-strategies/perCallDeliveryStrategy'
import { SingletonDeliveryStrategy } from '../delivery-strategies/singletonDeliveryStrategy'
import { PerResolutionDeliveryStrategy } from '../delivery-strategies/perResolutionDeliveryStrategy'
import { ContainerizedDeliveryStrategy } from '../delivery-strategies/containerizedDeliveryStrategy'
import ancestorsAreValidator from '../metadata-validators/ancestorsAreValidator'
import injectedExactlyIntoTypesValidator from '../metadata-validators/injectedExactlyIntoTypesValidator'
import injectedExactlyIntoAliasesValidator from '../metadata-validators/injectedExactlyIntoAliasesValidator'
import injectedIntoTypesValidator from '../metadata-validators/injectedIntoTypesValidator'
import injectedIntoAliasesValidator from '../metadata-validators/injectedIntoAliasesValidator'
import { WithAndAsAndInAndWhenSyntax } from './withAndAsAndInAndWhenSyntax'
import { AsAndInAndWhenSyntax } from './asAndInAndWhenSyntax'
import { Errors } from '..'

/**
 * Represents a syntax that allow setup the dependecy resolution behavior.
 */
export class BehaviorSyntax implements WithAndAsAndInAndWhenSyntax {

    /**
     * Represents the dependency metadata to affect in a fluently way.
     */
  private _dependencyMetadata: DependencyMetadata

    /**
     * Creates a new behavior syntax that allow setup the dependecy resolution behavior.
     * @param dependencyMetadata Represents the dependency metadata to affect in a fluently way.
     */
  constructor (dependencyMetadata: DependencyMetadata) {

    if (!dependencyMetadata.validators) {
      dependencyMetadata.validators = []
    }

    this._dependencyMetadata = dependencyMetadata
  }

    /*********************************
     *  The Dependencies (With Syntax)
     *********************************/

    /**
     * Setup the aliases that will repsents the argument names with the given aliases.
     * @param aliases Represents the aliases that will repsents the argument names.
     * @return A syntax extension to setup the serving, delivery and conditions.
     */
  public with (aliases: string[]): AsAndInAndWhenSyntax {
    if (!this._dependencyMetadata.isArgumentable) {
      throw new Errors.InvalidDataError('Can not add arguments names to a not argumentable dependency.')
    }

    this._dependencyMetadata.argumentsNames = aliases

    return this
  }

     /*********************************
     *  The servicing (As Syntax)
     *********************************/

    /**
     * Setup the current alias bind to be served as an instace.
     * @return A syntax extension to setup the delivery and conditions.
     */
  public asInstance (): InAndWhenSyntax {

    this._dependencyMetadata.servicingStrategy = new InstanceServicingStrategy()

    return this
  }

    /**
     * Setup the current alias bind to be served as the result of the referenced function..
     * @return A syntax extension to setup the delivery and conditions.
     */
  public asBuilderFunction (): InAndWhenSyntax {

    this._dependencyMetadata.servicingStrategy = new BuilderFunctionServicingStrategy()

    return this
  }

    /**
{'fraction_non_alphanumeric': 0.11143578164430867, 'fraction_numerical': 0.0002656395271616417, 'mean_word_length': 4.516483516483516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5434624', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1774, 'n_words': 530}