Skip to content

Tags: Nutandc/laravel-ide-helper

Tags

v2.12.3

Toggle v2.12.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update CHANGELOG.md

v2.12.2

Toggle v2.12.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update CHANGELOG.md

v2.12.1

Toggle v2.12.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Prepare 2.12.1 patch release (barryvdh#1307)

### Fixed
- Properly handle `Castable`s without return type. [barryvdh#1306 / binotaliu](barryvdh#1306)

v2.12.0

Toggle v2.12.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request barryvdh#1304 from mfn/mfn-release

Prepare 2.12 release

v2.11.0

Toggle v2.11.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Improve performance for supporting Laravel 8.77+ cast attributes (bar…

…ryvdh#1292)

barryvdh#1289 calls `getReturnType` for every method on every model, which in
turn calls `getReturnTypeFromDocBlock` which has this code:
```php
$phpDocContext = (new ContextFactory())->createFromReflector($reflection);
```
Extracting the docblock is super slow, always has been. Now that we do
this for every method, this adds up a lot.

Performance on a private commercial project _before_ barryvdh#1289 was introduced:
```
$ time ./artisan ide-helper:models --write --reset >/dev/null

real	0m2.857s
user	0m1.835s
sys	0m0.129s
```
After barryvdh#1289 :
```
$ time ./artisan ide-helper:models --write --reset >/dev/null

real	0m54.147s
user	0m47.132s
sys	0m1.047s
```

However, in this case we **do not need** the phpdoc fallback (which is
legitimate and by design for many other cases), because also the Laravel
implementation only works by inspecting the _actual type_, see
https://github.com/laravel/framework/blob/e0c2620b57be6416820ea7ca8e46fd2f71d2fe35/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L570-L575
```php
$returnType = (new ReflectionMethod($this, $method))->getReturnType();

return static::$attributeMutatorCache[get_class($this)][$key] = $returnType &&
            $returnType instanceof ReflectionNamedType &&
            $returnType->getName() === Attribute::class &&
            is_callable($this->{$method}()->get);
```

This side-stepping the phpdoc parsing a) still works correctly and b)
brings us back to the previous performance characteristics:
```
time ./artisan ide-helper:models --write --reset >/dev/null

real	0m2.987s
user	0m1.915s
sys	0m0.120s
```

v2.10.0

Toggle v2.10.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
chore: prepare 2.10.0 release (barryvdh#1207)

* chore: prepare 2.10.0 release

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>

v2.9.3

Toggle v2.9.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Support both customized namespace factories as well as default resolv…

…able ones (barryvdh#1201)

v2.9.2

Toggle v2.9.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
chore: prepare 2.9.2 release (barryvdh#1197)

v2.9.1

Toggle v2.9.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
chore: add missing changelog entries (barryvdh#1176)

* chore: mention the fix from barryvdh#1005

* chore: mention barryvdh#1163

v2.9.0

Toggle v2.9.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
[2.9] Drop support for: Laravel 6, Laravel 7, PHP 7.2 and add doctrin…

…e/dbal ^3 (barryvdh#1114)

* composer.json: drop support for PHP 7.2/Laravel 6+7 and bump dependencies

* tests: remove framework version tests

They don't apply anymore, we're Laravel 8+ only from now on

* changelog: update for ending support for L6/7 and PHP7.2