Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code analysis for Laravel 9 branch #64

Merged
merged 120 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
66f1d2a
Add Larastan, initial code analysis tweaks
bennothommo Dec 14, 2021
7c0817e
Merge branch 'wip/0.2' into wip/1.2-code-analysis
bennothommo Dec 17, 2021
0226ffe
Fix code blocks and signatures in Halcyon
bennothommo Dec 17, 2021
ccdf514
Fix default config namespaces not loading
bennothommo Dec 17, 2021
68f7ab3
Further fixes to docblocks and signatures
bennothommo Dec 17, 2021
c973318
Documenting magic methods and properties of Auth models
bennothommo Dec 17, 2021
c99be36
Initial work on strict typing and return types
bennothommo Dec 17, 2021
cc3b023
Apply suggestions from code review
bennothommo Dec 18, 2021
26f6b79
Merge remote-tracking branch 'origin/wip/1.2' into wip/1.2-code-analysis
bennothommo Dec 19, 2021
1968d06
Set strict types on Argon
bennothommo Dec 20, 2021
cb1b0b3
Fix comment on makeFilePath method in DbDatasource
bennothommo Dec 20, 2021
3fed80a
Use proper exception for insert, update docs
bennothommo Dec 20, 2021
78af61f
Fix code smell
bennothommo Dec 20, 2021
d7dd396
Model/Pivot constructor changes.
bennothommo Dec 20, 2021
6c96d97
Adjust users table migration
bennothommo Dec 20, 2021
b2f103b
Improve docblocks in Auth module
bennothommo Dec 20, 2021
4a4755a
Add database migration paths for PHPStan
bennothommo Dec 20, 2021
2956fc4
Extend Laravel Config repo in our own repo
bennothommo Dec 20, 2021
d628e26
Ignore Auth Manager in analysis
bennothommo Dec 20, 2021
cfd2e4a
Re-add ApplicationException use case
bennothommo Dec 20, 2021
233f8b6
Inherit docs
bennothommo Dec 20, 2021
773f02f
Fix return types in dispatcher
bennothommo Dec 20, 2021
3fc1902
Fix docblocks and signatures in Exception module
bennothommo Dec 20, 2021
a60425f
Fix tests
bennothommo Dec 20, 2021
df0061d
Adjust docs and signatures for Extendable trait
bennothommo Dec 20, 2021
1bd7fb2
Return null if no default datasource is set
bennothommo Dec 20, 2021
c7339d9
Fix signatures and docblocks of Filesystem module
bennothommo Dec 20, 2021
efd145f
Fix Foundation module docblocks and signatures
bennothommo Dec 20, 2021
38819df
WIP FormBuilder
bennothommo Dec 20, 2021
1a46e9e
WIP Html module analysis
bennothommo Dec 20, 2021
6f90d90
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 23, 2022
33328e4
Update Composer deps, small tweaks
bennothommo Feb 23, 2022
0a71452
Add class comment
bennothommo Feb 24, 2022
b1fd554
Fix Stan issues in Translator
bennothommo Feb 24, 2022
d174113
Fix Validation and Support PHPStan issues
bennothommo Feb 24, 2022
4cf0199
Fix Router PHPStan issues
bennothommo Feb 24, 2022
6521824
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 24, 2022
3fe31df
Add Event facade methods
bennothommo Feb 24, 2022
ff29e6a
Fix Parse PHPStan issues
bennothommo Feb 24, 2022
6ea0cf9
Fix Network PHPStan issues
bennothommo Feb 24, 2022
ee06185
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 24, 2022
0899bb8
Fix return type of fired events
bennothommo Feb 24, 2022
86e8aa9
Fix minor issue in MailManager
bennothommo Feb 24, 2022
f87d594
WIP Mailer fixes
bennothommo Feb 24, 2022
2ef3234
Fix HTML PHPStand issues
bennothommo Feb 24, 2022
b679f20
Fix unit tests - Mail ones are not passing now, but pass on main branch
bennothommo Feb 24, 2022
3b7d4f2
Implement changes from Luke's review
bennothommo Feb 25, 2022
2370eaa
Finalise Mail PHPStan fixes
bennothommo Feb 25, 2022
ba6617a
Merge remote-tracking branch 'origin/wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 25, 2022
4f1db25
Fix Command PHPStan issues
bennothommo Feb 25, 2022
0fd415d
Merge remote-tracking branch 'origin/wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 25, 2022
ab137a1
Tweak extendable trait
bennothommo Feb 25, 2022
7918a13
WIP fixes of Database PHPStan issues
bennothommo Feb 25, 2022
35b36b7
Defensive coding tweak
bennothommo Feb 26, 2022
5681961
Merge remote-tracking branch 'origin/wip/1.2' into wip/1.2-code-analysis
bennothommo Feb 28, 2022
6fb9ca9
Adjust Command logic path for input type parsing
bennothommo Feb 28, 2022
bfcc68f
Fix some issues picked up by PHPStan when global scan is used
bennothommo Feb 28, 2022
9891101
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Apr 14, 2022
e042c0c
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Apr 29, 2022
15ed858
Fix tests
bennothommo Apr 29, 2022
f9cc4fe
Synchronise docblocks
bennothommo May 3, 2022
3786591
Drop unnecessary overwrite in hasOne relation.
bennothommo May 3, 2022
f79eac4
Simplify "key:generate" command overwrite
bennothommo May 3, 2022
3697094
Tweak checks for URL generator values
bennothommo May 3, 2022
e3f2bac
Refactor database relations.
bennothommo May 3, 2022
cf251aa
Make Argon extend Illuminate's Carbon wrapper
bennothommo May 3, 2022
6805eb1
Numerous fixes to docblocks and signatures
bennothommo May 3, 2022
298fea5
Exclude some errors that are not helping
bennothommo May 3, 2022
206edcd
Final pass of code analysis tweaks
bennothommo May 5, 2022
82a7996
Fix sortable constant reference and test
bennothommo May 5, 2022
03e95b6
Convert private methods to protected in Section Parser
bennothommo May 5, 2022
51cec2f
Change return type in Argon
bennothommo May 11, 2022
44f6f38
Synchronise Pivot model with Laravel 9
bennothommo May 13, 2022
6a9022e
Add MorphPivot support
bennothommo May 13, 2022
650eab5
Update src/Database/Attach/File.php
bennothommo May 14, 2022
1ba308a
Update src/Console/Command.php
bennothommo May 22, 2022
5645a5b
Update src/Database/MorphPivot.php
bennothommo May 22, 2022
a200219
Add type hints to all File attachment methods
bennothommo May 22, 2022
02b5b98
Add type hints
bennothommo May 22, 2022
a780758
Make the Pivot use the AsPivot trait, add parent accessor
bennothommo May 22, 2022
e8f880f
Update src/Database/Behaviors/Purgeable.php
bennothommo May 22, 2022
bebff18
Update src/Database/Behaviors/Sortable.php
bennothommo May 22, 2022
6356bd2
Update src/Filesystem/Filesystem.php
LukeTowers May 22, 2022
faf29f9
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Jun 26, 2022
361e17e
Remove relation traits that have been moved to concerns
bennothommo Jun 26, 2022
d07a9e6
Update all facade use cases to use full facade class
bennothommo Jun 26, 2022
6d55a77
Add options docs for Zip class, fix BC break
bennothommo Jun 26, 2022
1ef7cfc
Re-add default value
bennothommo Jun 26, 2022
1154159
Remove overwritten definition for resolver
bennothommo Jun 26, 2022
1124812
Merge branch 'wip/1.2' into wip/1.2-code-analysis
bennothommo Jun 29, 2022
05698c8
Fix moved class names in aliases
bennothommo Jun 29, 2022
15b359b
Add MorphPivot test cases
bennothommo Jun 29, 2022
e374dce
Fix constructor for MorphToPivot
bennothommo Jun 29, 2022
c168945
Revert hour value change
bennothommo Jun 29, 2022
a8da8cd
Correct docblock return
bennothommo Jun 29, 2022
08b75fc
Match PHPCS config from main repo
bennothommo Jun 30, 2022
0ec2ac5
Use lang path in Translator registration
bennothommo Jun 30, 2022
892b890
Fix possible BC break, cleanup for PHPStan
bennothommo Jun 30, 2022
4301383
Code tidying
bennothommo Jun 30, 2022
cbec8d9
Try out @phpstan-property definitions to fix remaining issues
bennothommo Jun 30, 2022
a02f94e
Docs and commenting changes to fix a whole slew of issues
bennothommo Jul 1, 2022
79761b5
Generate baseline
bennothommo Jul 1, 2022
8ac383f
Allow pivot model to be provided to MorphTo relations
bennothommo Jul 1, 2022
af29492
Fix test, allow namespaced files in tests folder
bennothommo Jul 1, 2022
ee73adf
Move tests namespace into autoload-dev
bennothommo Jul 1, 2022
76835e6
Add automated PHPStan test, tweak PHPUnit test
bennothommo Jul 1, 2022
9f57231
Replace missing matrix vars
bennothommo Jul 1, 2022
6273bc6
Fix Markdown parser class name storage and use
bennothommo Jul 1, 2022
c096e92
Remove use of Eloquent facade in down migrations
bennothommo Jul 1, 2022
696d4a7
Convert all type hints to PHPDocs to maintain BC
bennothommo Jul 1, 2022
45765b5
Small tweak
bennothommo Jul 1, 2022
67a3b64
Ensure morph to supports deferred records and constraints
bennothommo Jul 1, 2022
8951f40
Remove fixed errors from baseline
bennothommo Jul 1, 2022
3558833
Allow CSRF token and session key to be null
bennothommo Jul 1, 2022
ba709ce
Fix return type
bennothommo Jul 1, 2022
cb93b80
Ignore lines in PHPStan - it can't seem to work out the relations here
bennothommo Jul 1, 2022
7a85594
Update src/Database/Relations/Concerns/DeferOneOrMany.php
bennothommo Jul 1, 2022
784ab77
Update src/Database/Relations/Concerns/DeferOneOrMany.php
bennothommo Jul 1, 2022
fe190c6
Remove return type missed in last pass
bennothommo Jul 2, 2022
422e58e
Change to Str call
bennothommo Jul 2, 2022
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
63 changes: 63 additions & 0 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Tests

on:
push:
branches:
- "wip/1.2"
pull_request:
branches:
- "wip/1.2"

jobs:
codeAnalysis:
runs-on: ubuntu-latest
name: Code Analysis
env:
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-storm-cache-v1.2
steps:
- name: Cancel previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout changes
uses: actions/checkout@v2

- name: Setup extension cache
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: '8.0'
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: ${{ env.extensions }}

- name: Setup dependency cache
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Analyse code
run: ./vendor/bin/phpstan analyse
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-storm-cache-v1.2
steps:
- name: Cancel previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout changes
uses: actions/checkout@v2

Expand All @@ -44,7 +49,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersion }}
tools: composer:v2
extensions: ${{ env.extensions }}

- name: Setup dependency cache
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"php-parallel-lint/php-parallel-lint": "^1.0",
"meyfa/phpunit-assert-gd": "^2.0.0|^3.0.0",
"dms/phpunit-arraysubset-asserts": "^0.1.0|^0.2.1",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.1.0"
},
"suggest": {
Expand Down Expand Up @@ -83,7 +84,10 @@
"classmap": [
"tests/TestCase.php",
"tests/DbTestCase.php"
]
],
"psr-4": {
"Winter\\Storm\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
Expand Down
10 changes: 7 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />

<!-- We're not enforcing a line length limit -->
<exclude name="Generic.Files.LineLength" />
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!--
Migrations and tests do not need a namespace defined
-->
<!-- Migrations and tests do not need a namespace defined -->
<exclude-pattern>*/src/Auth/Migrations/*\.php</exclude-pattern>
<exclude-pattern>*/src/Database/Migrations/*\.php</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
Expand All @@ -28,6 +29,9 @@
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>

<arg name="extensions" value="php" />
<arg name="colors" />

<file>src/</file>
<file>tests/</file>

Expand Down
Loading