Hypervel\PHPStan\Rules
Namespaces
Classes
Reports Arr::get() and Arr::pull() keys that never exist, through PHPStan's own offset check.
Reports a binding whose concrete class name is an alias of its own abstract.
Upstream checks only Config::collection(); repository calls, including config()->collection(), are checked too.
Reports typed config getters, such as Config::integer(), whose value never has the getter's type, so the call always throws.
Reports a Carbon date change whose result is discarded, which leaves an immutable date unchanged.
Reads configuration property declarations and the class attributes that can replace them, for the rules recommending attributes over legacy model and queue properties.
Reports a transaction() callback that ends the transaction it runs in.
Reports schema columns whose types Hypervel's conventions replace.
This rule validates that the properties a model appends are computed properties, which serialization reads through a get accessor or a class cast.
Check the column arguments of the pagination methods and pluck(), and the columns a dynamic where names, against the model's properties.
Report relations a concrete model's default $with and $withCount eager loads do not define.
Share how the model rules read models, including the model a call on a model, builder or relation queries.
Catches environment reads outside of the config directory.
Report calls a model forwards to its query builder, which an explicit query() or newQuery() call makes clear.
Recommend model configuration attributes over the properties they replace, which remain supported.
Recommend protected #[Scope] methods over legacy scopeX() methods, which remain supported.
Upstream compares each key with the keys in the lang files. This rule asks the booted translator, so fallbacks, JSON, namespaces and boot-added lines count, and reports only keys whose group exists.
Catches inefficient instantiation of models using Model::make().
Reports PHP's native request, response and session APIs, which act on PHP's own SAPI state rather than the request and response a Swoole worker is handling.
Unlike upstream, scopes and accessors are recognized as the runtime finds them: a legacy scope by its name and a first parameter that takes the builder, and an accessor by its native Attribute return type. Only a private method is made protected automatically, because a public one can have callers in other files.
This rule checks for unnecessary heavy operations on the Collection class that could have instead been performed on the Builder class.
This rule checks for unnecessary calls Enumerable::toArray() that
could have used all() instead. The toArray() method recursively
converts all Arrayable items in the Enumerable to an array and if
none of the items are Arrayable, it is unnecessary map call.
Reports a service provider registering a model's observers with observe(), where the Laravel convention is #[ObservedBy] on the model.
Reports connection-bound Redis methods, such as client() or auth(), called through the pooled proxy or the manager.
Report relation names, such as those an eager load or relationship query names, that a model does not define.
Report relationship queries and eager loads that name a relation the model does not define.
Reports a #[BindWhen] condition whose code, including its nested callbacks, contains a read of the current request or user.
Reports a Socialite provider subclass using a property that holds only the provider's default.
Reports a config read whose value always has one type that a typed getter returns.
Reports a config value that is an uncast env() read with a bool, int or float default.
Reports calls that reach a method marked #[Unsupported], which always throws.
Reports the schema dumps that model property types could not use, once each, at the dump.
Declares that a file whose own PHPDoc uses a view-string depends on which views exist.
Declares that a call to a function whose signature uses a view-string depends on which views exist.