Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- In Ruby, a call on a class written with its namespace, like `Billing::ChargeCard.call(…)` or `::Billing::ChargeCard.call(…)`, now links the caller to that class and to the class method it calls, as `ChargeCard.call(…)` already linked to the class. Before, a class used only through such calls looked like it had no callers. The name is looked up the way Ruby does it, from the namespaces around the call outward, so `Users::Create.call` reaches `Users::Create` and never a `Billing::Create`, a call inside `module Api; module V2` reaches `Api::V2`'s class before another version's, and a library's class like `ActiveRecord::Base` is never taken for a project class of the same last name. Re-index Ruby projects after upgrading. Thanks @james-jang for the report and @drakeo338 for the pull request. (#2503)
- In Ruby, a call to a method whose name ends in `!` or `?` now links when its receiver's class is known, like `writer.flush!` or `writer.ready?` after `writer = CacheWriter.new`, or `CacheWriter.create!(…)` on the class. A method called straight on a new object, like `CacheWriter.new(key).write_cache` or `Billing::Ledger.new.charge!`, now links to that class's method or to one it inherits. Before, all of these linked nothing. The class is looked up the way Ruby does it, from the namespaces around the call outward, and one from outside your project, like rack's `Request` used inside `Rack::Protection`, links nothing rather than a project class of the same name. Re-index Ruby projects after upgrading. Thanks @ricobl.
- In Ruby, a call on an instance variable, like `@writer.flush`, now links to the method of the class the variable holds when the class's `initialize` sets it to a new object of one class, like `@writer = CacheWriter.new`. Before, no call on an instance variable linked. A variable that `initialize` sets to anything else, or to objects of two classes, stays unlinked rather than guessed. Re-index Ruby projects after upgrading.
- In Ruby, a call now follows a class's real ancestors, in the order Ruby looks a method up: the modules it includes, the one included last first, found by Ruby's constant lookup. Before, a superclass written `ActiveRecord::Base` could mean any class named `Base` in the project, so `human.name` reached an unrelated `Node#name`. A call on a class now reaches the methods it `extend`s and the `ClassMethods` of the concerns it includes, like `Topic.find` or `Topic.create`; a call on a method of the same class that hands back a new object, like `cookies.signed`, reaches that object's class; and a `?` or `!` method of Ruby's core classes, like `bad_cookies.empty?`, no longer links to a project class by a shared word.
- In PHP, a class written through a namespace alias in a different case than its `use` statement, like `new field\FirstName()` after `use App\Fields as Field;`, now links to that class, since PHP reads namespace names without regard to case. Before, the name was read relative to the file's own namespace and stayed unlinked. Re-index PHP projects after upgrading. Thanks @danusha2345. (#2369)
- In PHP, a call on a variable now reaches the method its class really has. A declared type or a class the file can name is found through the file's namespace and `use` imports, group imports included, and its parents through the same names, past any attributes above the class and with a trait before the parent, so Drupal's `$entity->access()` no longer lands on a views plugin's `HandlerBase`, a `parent::__construct()` above a parent from outside the project no longer lands on an unrelated trait, and Laravel's `$this->events->dispatch()` reaches the events dispatcher rather than the bus. A Laravel facade now hands a static call to the class its `getFacadeAccessor()` names, and a local an Eloquent model's `create()` or `find()` gives is that model.
- In Drupal, an import of a class whose short name another class shares, like `use Drupal\commerce_price\Price`, no longer also links to that other class.
Expand Down
Loading