Skip to content

Commit 7bc4fe2

Browse files
committed
chore: update repo meta
1 parent 8d433ed commit 7bc4fe2

File tree

4 files changed

+49
-111
lines changed

4 files changed

+49
-111
lines changed

.github/FUNDING.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# These are supported funding model platforms
23

3-
github: [canvural]
4+
github: calebdw

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) Can Vural <can9119@gmail.com>, Nuno Maduro <enunomaduro@gmail.com>,
3+
Copyright (c) Can Vural <can9119@gmail.com>, Nuno Maduro <enunomaduro@gmail.com>, Caleb White <cdwhite3@pm.me>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+39-107
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,72 @@
11
<p align="center">
2-
<img src="https://raw.githubusercontent.com/larastan/larastan/master/docs/logo.png" alt="Larastan Logo" width="300">
2+
<img src="https://raw.githubusercontent.com/calebdw/larastan/master/docs/logo.png" alt="Larastan Logo" width="300">
33
<br><br>
4-
<img src="https://raw.githubusercontent.com/larastan/larastan/master/docs/example.png" alt="Larastan Example" height="300">
4+
<img src="https://raw.githubusercontent.com/calebdw/larastan/master/docs/example.png" alt="Larastan Example" height="300">
55
</p>
66

77
<p align="center">
8-
<a href="https://github.com/larastan/larastan/actions"><img src="https://github.com/larastan/larastan/actions/workflows/tests.yml/badge.svg" alt="Build Status"></a>
9-
<a href="https://packagist.org/packages/larastan/larastan/stats"><img src="https://poser.pugx.org/larastan/larastan/d/total.svg" alt="Total Downloads"></a>
10-
<a href="https://packagist.org/packages/larastan/larastan"><img src="https://poser.pugx.org/larastan/larastan/v/stable.svg" alt="Latest Version"></a>
11-
<a href="https://github.com/larastan/larastan/blob/master/LICENSE.md"><img src="https://poser.pugx.org/larastan/larastan/license.svg" alt="License"></a>
8+
<a href="https://github.com/calebdw/larastan/actions"><img src="https://github.com/calebdw/larastan/actions/workflows/tests.yml/badge.svg" alt="Test Results"></a>
9+
<a href="https://packagist.org/packages/calebdw/larastan"><img src="https://img.shields.io/packagist/dt/calebdw/larastan.svg" alt="Total Downloads"></a>
10+
<a href="https://packagist.org/packages/calebdw/larastan"><img src="https://img.shields.io/packagist/v/calebdw/larastan.svg" alt="Latest Version"></a>
11+
<a href="https://github.com/calebdw/larastan/blob/master/LICENSE.md"><img src="https://img.shields.io/github/license/calebdw/larastan" alt="License"></a>
1212
</p>
1313

1414
------
1515

16-
## ⚗️ About Larastan
16+
## ⚗️ About This Fork
1717

18-
Larastan was created by [Can Vural](https://github.com/canvural) and [Nuno Maduro](https://github.com/nunomaduro), got artwork designed by [@Caneco](http://github.com/caneco), is maintained by [Can Vural](https://github.com/canvural) and [Viktor Szépe](https://github.com/szepeviktor), and is a [PHPStan](https://phpstan.org/) extension for Laravel. Larastan focuses on **finding errors in your code**. It catches whole classes of bugs even **before you write tests** for the code.
18+
Hello! 👋
1919

20-
- Adds static typing to Laravel to improve developer productivity and **code quality**
21-
- Supports most of [Laravel](https://laravel.com)'s **beautiful magic**
22-
- Discovers bugs in your code
20+
This is my fork of [larastan/larastan][larastan], which includes additional features and improvements that have been proposed but are not yet available in the upstream package.
21+
This fork is intended to provide the community with immediate access to these enhancements while maintaining compatibility with the upstream package.
2322

24-
> While by definition, "static analysis" doesn't load any of your application's code. Larastan boots your application's container, so it can resolve types that are only possible to compute at runtime. That's why we use the term "code analysis" instead of "static analysis".
23+
> For [Laravel Livewire][livewire] support, check out [larastan-livewire][larastan-livewire]!
2524
26-
### Supported Laravel versions
27-
| Laravel Version | Larastan Version |
28-
|------------------|------------------|
29-
| < 9 | 1.x |
30-
| \> 9.0 && <11.15 | 2.x |
31-
| 11.15+ | 3.0+ |
25+
## 🔄 Changes and Upstream PRs
3226

33-
## ✨ Getting Started In 3 Steps
27+
This fork includes the following changes and enhancements:
3428

35-
> **Requires:**
36-
- **[PHP 8.2+](https://php.net/releases/)**
37-
- **[Laravel 11.15+](https://github.com/laravel/laravel)**
29+
- [feat: support dynamic relation closures](https://github.com/larastan/larastan/pull/2048)
30+
- [feat: add support for config array shapes](https://github.com/larastan/larastan/pull/2004)
31+
- [feat: support multiple database connections](https://github.com/larastan/larastan/pull/1879)
32+
- [feat: support wildcards in migration/schema paths](https://github.com/larastan/larastan/pull/2031)
33+
- [fix: default date casting](https://github.com/larastan/larastan/pull/1842)
34+
- [fix: make TGet covariant on Attribute stub](https://github.com/larastan/larastan/pull/2014)
3835

39-
**1**: First, you may use [Composer](https://getcomposer.org) to install Larastan as a development dependency into your Laravel project:
36+
## ✨ Getting Started
4037

41-
```bash
42-
composer require --dev "larastan/larastan:^3.0"
43-
```
44-
45-
> Using Larastan for analysing Laravel packages? You may need to install `orchestra/testbench`.
46-
47-
**2**: Then, create a `phpstan.neon` or `phpstan.neon.dist` file in the root of your application. It might look like this:
48-
49-
```
50-
includes:
51-
- vendor/larastan/larastan/extension.neon
52-
- vendor/nesbot/carbon/extension.neon
53-
54-
parameters:
55-
56-
paths:
57-
- app/
58-
59-
# Level 10 is the highest level
60-
level: 5
61-
62-
# ignoreErrors:
63-
# - '#PHPDoc tag @var#'
64-
#
65-
# excludePaths:
66-
# - ./*/*/FileToBeExcluded.php
67-
```
68-
69-
For all available options, please take a look at the PHPStan documentation: **https://phpstan.org/config-reference**
70-
71-
**3**: Finally, you may start analyzing your code using the phpstan console command:
38+
To use this fork, you may use [Composer][composer] to install it as a development dependency into your Laravel project:
7239

7340
```bash
74-
./vendor/bin/phpstan analyse
75-
```
76-
77-
If you are getting the error `Allowed memory size exhausted`, then you can use the `--memory-limit` option fix the problem:
78-
79-
```bash
80-
./vendor/bin/phpstan analyse --memory-limit=2G
81-
```
82-
83-
## Ignoring errors
84-
85-
Ignoring a specific error can be done either with a php comment or in the configuration file:
86-
87-
```php
88-
// @phpstan-ignore-next-line
89-
$test->badMethod();
90-
91-
$test->badMethod(); // @phpstan-ignore-line
41+
composer require --dev "calebdw/larastan:^3.0"
9242
```
9343

94-
When ignoring errors in PHPStan's configuration file, they are ignored by writing a regex based on error messages:
44+
Or if you already have the upstream package installed, you can point your `composer.json` to this fork:
9545

96-
```yaml
97-
parameters:
98-
ignoreErrors:
99-
- '#Call to an undefined method .*badMethod\(\)#'
46+
```diff
47+
- "larastan/larastan": "^3.0"
48+
+ "calebdw/larastan": "^3.0"
10049
```
10150

102-
### Baseline file
103-
104-
In older codebases it might be hard to spend the time fixing all the code to pass a high PHPStan Level.
51+
If you have the [PHPStan extension installer](https://phpstan.org/user-guide/extension-library#installing-extensions) installed then nothing more is needed, otherwise you will need to manually include the extension in the `phpstan.neon(.dist)` configuration file:
10552

106-
To get around this a baseline file can be generated. The baseline file will create a configuration file with all of the current errors, so new code can be written following a higher standard than the old code. ([PHPStan Docs](https://phpstan.org/user-guide/baseline))
107-
108-
```bash
109-
./vendor/bin/phpstan analyse --generate-baseline
53+
```neon
54+
includes:
55+
- ./vendor/calebdw/larastan/extension.neon
11056
```
11157

112-
## Rules
113-
114-
A list of configurable rules specific to Laravel can be found [here](docs/rules.md).
115-
116-
117-
## Features
118-
119-
A list of Larastan features can be found [here](docs/features.md).
120-
121-
## Custom PHPDoc types
122-
123-
A list of PHPDoc types specific to Larastan can be found [here](docs/custom-types.md).
124-
125-
## Custom PHPStan config parameters
126-
127-
A list of custom config parameters that you can use in your PHPStan config file can be found [here](docs/custom-config-parameters.md).
128-
129-
## Errors To Ignore
130-
131-
Some parts of Laravel are currently too magical for Larastan/PHPStan to understand.
132-
We listed common [errors to ignore](docs/errors-to-ignore.md), add them as needed
58+
For more information on how to configure and use Larastan, please refer to the [official documentation][larastan].
13359

13460
## 👊🏻 Contributing
13561

13662
Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).
13763

138-
## 📖 License
64+
## 📄 License
65+
66+
This fork is open-sourced software licensed under the [MIT license](LICENSE.md).
13967

140-
Larastan is an open-sourced software licensed under the [MIT license](LICENSE.md).
68+
<!-- links -->
69+
[composer]: https://getcomposer.org
70+
[larastan]: https://github.com/larastan/larastan
71+
[larastan-livewire]: https://github.com/calebdw/larastan-livewire
72+
[livewire]: https://github.com/livewire/livewire

composer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "larastan/larastan",
2+
"name": "calebdw/larastan",
33
"type": "phpstan-extension",
44
"description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel",
5+
"homepage": "https://github.com/calebdw/larastan",
56
"keywords": ["laravel", "larastan", "phpstan", "php", "package", "static analysis", "code analysis", "code analyse"],
67
"license": "MIT",
78
"authors": [
@@ -12,6 +13,10 @@
1213
{
1314
"name": "Nuno Maduro",
1415
"email": "enunomaduro@gmail.com"
16+
},
17+
{
18+
"name": "Caleb White",
19+
"email": "cdwhite3@pm.me"
1520
}
1621
],
1722
"require": {
@@ -66,7 +71,7 @@
6671
},
6772
"extra": {
6873
"branch-alias": {
69-
"dev-master": "2.0-dev"
74+
"dev-master": "3.0-dev"
7075
},
7176
"phpstan": {
7277
"includes": [

0 commit comments

Comments
 (0)