larastan

⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

MIT License

Downloads
45.5M
Stars
5.2K
Committers
152

Bot releases are hidden (Show)

larastan - 0.6.5

Published by canvural about 4 years ago

This release introduces a new rule that can check the arguments of methods that expects a model property name, and can warn you if the passed argument is not actually a property of the model. You can read the details about the rule here.

NOTE: This rule is currently in beta! If you want to improve it's analysis, you can check out the issue here and contribute!

Added

  • Add a new view-string PHPDoc type (#654)
  • Stubs for Eloquent builder value and orWhere methods

Fixed

  • Parameter type of the query builder's where, orWhere and addArrayOfWheres (#651).
  • Fix callback parameters for retry (#663).
  • Using Reflection to initiate a model in ModelPropertyExtension to avoid errors caused by using Model constructor. (#666)

Changed

  • Made improvements to database migrations scanning. (#670)
  • Improved running test suite commands and Windows compatibility (#682)
larastan - 0.6.4

Published by canvural about 4 years ago

Changed

  • Update orchestra/testbench version to allow Laravel 8 installations (#646)

Fixed

  • Return type of firstWhere method on model, builder and relations (#649)
larastan - 0.6.3

Published by canvural about 4 years ago

Added

  • Return type extension for validator helper (#641)

Fixed

  • Return type of associate, dissociate and getChild methods of BelongsTo relations (#633)
larastan - 0.6.2

Published by canvural about 4 years ago

Fixed

  • Fix false positive for NoUnnecessaryCollectionCallRule when statically calling hydrate on a Model class. (#609)
  • Fixed slightly incorrect stubs for accepted $values for whereBetween/orWhereBetween and whereRowValues/orWhereRowValues (#626)
  • Check if facade fake exists (852c131)
  • Correct query builder stub (d8d8b41)
  • Dont override return type when eloquent builder returns a query builder instance (b5f96b4)
  • Handle the case when a custom query builder does not have generic annotations (c54b517)
  • Soft delete trait methods should return generic Eloquent builder with model (023043b)

Added

larastan - 0.6.1

Published by canvural over 4 years ago

Added

  • Support for dynamic auth model loading from config. Thanks @0xb4lint (#602)
  • Support for Laravel 8

Fixed

  • Fix false positive when calling tap($this) (#601)
larastan - v0.6.0

Published by canvural over 4 years ago

Added

  • Document common errors for users to ignore (#564)
  • Add abort to earlyTerminatingFunctionCalls config option (#567)
  • Support for tap helper. (#575)
  • Bumped minimum PHPStan version to 0.12.28

Fixed

  • Avoid false-positive when calling static builder methods such as ::find() on Model classes where
    the concrete subclass is not yet known (#565)
  • Use correct argument order for Str::startsWith (#570)

Changed

  • Do not overwrite PHPStan's default for reportUnmatchedIgnoredErrors (#564)

Removed

  • Stop ignoring errors (#564)
larastan - v0.5.8

Published by canvural over 4 years ago

Added

  • Support for custom Eloquent collections. Thanks @timacdonald (#537) You can read the upgrade guide to see how you can use this.
  • Added issue and PR templates for new contributors. Thanks @spawnia (#560)

Fixed

  • Fixed some of the collection methods in stub files. Thanks @Daanra (#556)
  • Fixed a bug with Composer autoloading. Thanks @ondrejmirtes (#561)
larastan - v0.5.7

Published by canvural over 4 years ago

Fixed

  • Fixed incorrect stubs for model creation methods. (85716a5)
  • Fixed false positives on NoUnnecessaryCollectionCallRule rule. Thanks @Daanra (#546)

Added

  • Added more methods to collection stubs. Thanks @Daanra (#547)
larastan - v0.5.6

Published by canvural over 4 years ago

Fixed

  • Fixed relation methods with custom builders always returning custom builder. (#520)
  • Fixed reading boolean columns from migrations. (#514, #513, 692fcd1, d1f1861)
  • Annotations for model properties have higher order than migration files. (ec22906)
  • Improved support for Eloquent relationships. (#533)

Added

  • Eloquent relations are now also generic. (#518)
  • Support for Composer 2. Thanks @GrahamCampbell (#528)
  • Support for abort_unless, throw_if and throw_unless functions. Thanks @Daanra (#542)
  • Support for retry helper return type. Thanks @Daanra (#543)
  • A rule for detecting expensive calls on a Collection. Thanks @Daanra You can read more about the details of the rule and how to configure it here. (#538)
  • Support for value helper function return type. Thanks @Daanra (#545)
larastan - v0.5.5

Published by canvural over 4 years ago

Fixed

  • Assume id property exists only when it is not found. (#510)
  • Fixed an issue with generics in BuilderModelFindExtension. (#511)
larastan - v0.5.4

Published by canvural over 4 years ago

Added

  • Support for return type inference of find* methods on Builder class depending on passed arguments. (#503)
larastan - v0.5.3

Published by canvural over 4 years ago

Added

  • Support for Eloquent resources. Thanks @mr-feek (#470)
  • Treat Laravel ide-helper generated relationship properties as generic Collections. Thanks @mr-feek (#479)
  • Treat Laravel ide-helper generated builder typehints as generic Builders. (#497)
  • id property on any model class will be recognized as integer type. (#499)

Fixed

  • Corrected parameter type of builder dynamic wheres. Thanks @mr-feek (#482)
  • Added a check to see if migrations directory exists. Thanks @deleugpn (#498)
  • Added Carbon/Carbon to possible types for a date properties in models. Thanks @arxeiss (#500)
  • Fixed issue with scanning the migrations. (#501)
larastan - v0.5.2

Published by canvural over 4 years ago

Fixed

  • Model scopes returns the builder, if return type is void (#450)
  • Fix return type of calling query builder methods on custom builders (#453)
  • Fix return type of all on model. Thanks @BertvanHoekelen (#454)
  • Any query builder method should return the generic query builder (#457)
  • Don't throw exception when unknown column type is encountered while scanning the migrations (#451)
larastan - v0.5.1

Published by canvural over 4 years ago

This release is a result of 2 weeks of work. It adds some really cool new features. Also we had some first-time contributors contributing some cool changes in this release.

There are no breaking changes. But be sure to check out the upgrade guide for some small caveats.

Upgrade guide: UPGRADE.md

Added

  • Support for model accessors (#401)
  • Handle Builder method calls, model scope calls and dynamic where calls on relations. Thanks @BertvanHoekelen (#410, #419, #423)
  • Support for custom Eloquent builders (#432)
  • Infer Eloquent model property types. Thanks @muglug (#435)
  • Support for app and resolve helper functions return type. Thanks @troelsselch (#431)
  • Add generic stubs for Eloquent collection and Support collection. (#439)

Fixed

  • Better return type support for find* methods (#400)
  • Don't register abstract service providers. Thanks @CyberiaResurrection (#440)
larastan - v0.5.0

Published by szepeviktor over 4 years ago

Blogpost: nunomaduro.com/larastan-0-5-is-out
Upgrade guide: UPGRADE.md

Added

  • Support to PHPStan 0.12 #378
  • Support to Laravel 7 #377
  • Support for Facade fakes #347
  • Support for model relations accessed as properties #361
  • Support for custom Eloquent builders #364
  • Support for return types of spy, mock and partialMock methods of TestCase #362

Fixed

  • Fixed a bug about handling method calls that starts with find on model instances #360

Removed

  • The artisan code:analyse command. 391
larastan - v0.4.3

Published by canvural almost 5 years ago

Added

  • Support for abort_if. Fixes #116 (#330)

Fixed

  • Better return type inference in models and builders (#325, #336)
larastan - v0.4.2

Published by canvural about 5 years ago