Skip to content

v0.2.0-alpha

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 18:57
· 81 commits to main since this release

What's new in 0.2.0-alpha

  • Templates with Tab in PHP files: postfix after an expression (.if .notnull .null .isset .empty .foreach — $items → $item — .return .var .echo .dd .dump .throw .not .par) and live templates at the start of a statement (fore, forek, fori, pubf, prof, prif, pubsf, fun, ctor, thr, eco, ife, tryc); Code ▸ Surround With (⌘⌥T): if, if/else, foreach, while, try/catch, function
  • Intentions (⌥↵): Replace quotes, concatenation → interpolation, short / long array syntax, arrow function ↔ closure (with use), Make public / protected / private, ?T ↔ T|null, Invert 'if', Flip binary operator, Import class for a fully-qualified name, Remove unused variable (keeps a call on the right side)
  • Inspections: method / property not found in a class, wrong argument count (functions, methods, static calls), undefined function (PHP's own functions asked from the php binary), undefined variable, unused local variable, unused private method / property, unused import, missing return statement, unreachable code, duplicate array key. They stay quiet where PHP can't be checked (__call / __get, facades, mixins, traits, compact/extract). Underlined by severity, F2 / ⇧F2 jump between problems, ⌥↵ shows the message, Problems (⌘6) for the file and Code ▸ Inspect Code… for the project
  • Refactor: Introduce Variable (⌘⌥V) — the expression becomes a variable assigned before its statement, named after it ( for getUser()); Extract Method (⌘⌥M) — the selected statements move into a private method, read variables become parameters and the one used afterwards is returned; Inline Variable (⌘⌥N). New names are selected at every occurrence to rename in place
  • Navigate: Implementation(s) (⌘⌥B) — subclasses or their versions of the method; Super Method (⌘U) — the overridden/implemented method or the parent class; Test (⌘⇧T) — UserTest for User and back; Type Hierarchy (⌃H) — ancestors and subclasses
  • Quick Documentation (F1 / Ctrl+Q): the declaration's signature and doc comment under the caret; Parameter Info (⌘P / Ctrl+P, also after typing '('): the parameters of the call, the one being typed in bold — functions, methods and constructors (new)
  • Code ▸ Generate (⌘N / Alt+Insert in PHP files): Constructor, Getters, Setters, Getters and Setters (isX() for bools, fluent setters), Implement Methods (abstract and interface methods), Override Methods… (calls parent::), PHPDoc Comment, and Laravel Code Generation… for the existing generators
  • Refactor ▸ Rename (⇧F6) for classes, methods, properties, constants, functions and variables: every usage changes (open editors as one undo step, other files on disk, Local History snapshot first); a class in a file named after it renames the file. New Refactor menu
  • Find Usages (⌥F7, also ⌘B on a declaration): every reference to the class, method, property, constant, function or local variable at the caret — names that resolve to the same declaration — listed with a preview; Highlight Usages in File (⌘⇧F7, Esc clears)

Made with ❤️ in Azerbaijan · https://path.az