Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Update property generation for typed properties #14

Closed

Commits on Dec 7, 2019

  1. Always add property after traits & constants

    I add this rule because when you create a new class and define a trait
    before creating a constructor (for example).
    When you create the constructor and you complete the attribute from it
    (transformation action) then the properties were added before the trait
    which was always a pain to correct manually.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    8c3f8ee View commit details
    Browse the repository at this point in the history
  2. Prepend a blank line when adding properties for the first time

    Append a blank line before the propertiess to add if they are added
    after something else than the class's opening brace or another property.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    eb7b2e9 View commit details
    Browse the repository at this point in the history
  3. Move the new line before property with phpdoc in the template

    Before we made a decision that if a property has a type it will have a
    phpdoc block because it was the only way to declare the type.
    
    I don't like this because this logic depends on the templates and don't
    have its place here anymore.
    So I removed it and added the blank line directly in the template if
    there is a phpdoc block.
    
    Plus it fix the issue when inserting multiple properties for the first
    time (no property in the class yet), then even if the properties have a
    type there were no blank line between the properties.
    
    Note: There is two cases where the blank line is a problem, when:
    - the property is inserted after the class's open brace
    - the is inserted after something else than the class's open brace or
    another property
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    db50fa7 View commit details
    Browse the repository at this point in the history
  4. Append a blank line after the properties

    Append a blank line but only when the first thing in the class is a
    method declaration.
    Otherwise there is already a blank line before the method declaration.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    ae64a77 View commit details
    Browse the repository at this point in the history
  5. Rename lastProperty into previousMember

    It makes more sense and goes along with `nextMember` that was already
    used.
    We were already checking that `lastProperty` was an instance of
    `PropertyDeclaration` which proove that the name was not suited.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    8ebfe3a View commit details
    Browse the repository at this point in the history
  6. Initialize nextMember right away

    Reduce a bit the code and simply the loop.
    `reset()` return `false` if the array is empty, that's why I default it
    to `null`.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    78bc9a2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5e89e90 View commit details
    Browse the repository at this point in the history
  8. Update the unit tests

    Moving the blank line before a property in the template have created a
    few issue, as mentionied in the commit in question.
    
    This commit updates the unit tests to take those "side effects" into
    account.
    camilledejoye committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    fe335d2 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2019

  1. Configuration menu
    Copy the full SHA
    5b105e8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    60f8881 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    798eda4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7580d42 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4d6785e View commit details
    Browse the repository at this point in the history
  6. Add TextFormatTest

    camilledejoye committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    a668a23 View commit details
    Browse the repository at this point in the history