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

Update packages #296

Merged
merged 16 commits into from
Mar 31, 2024
Merged

Update packages #296

merged 16 commits into from
Mar 31, 2024

Conversation

spaze
Copy link
Owner

@spaze spaze commented Mar 30, 2024

This updates packages including the ones that have been locked to particular versions in #278, as a workaround has been added here.

Duplicates mapping config from the main app to the PHPStan Latte extension, again, and adds a check that the config is the same in all files. I'd need to add unformatPresenterClass() somewhere somehow if it wasn't the duplicated config. And while that's a copy/pasta, with the test it's acceptable. Partially rolls back #84

Introduces psalm-baseline.xml (which has later been dropped in #457)

spaze added 15 commits March 30, 2024 06:31
To stop Composer throwing this message:
> Composer could not detect the root package (spaze/michalspacek.cz) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
 - efabrica/phpstan-latte updated from 0.16.3 to 0.17.0 minor
   See changes: efabrica-team/phpstan-latte@0.16.3...0.17.0
   Release notes: https://github.com/efabrica-team/phpstan-latte/releases/tag/0.17.0

 - php-parallel-lint/php-parallel-lint updated from v1.3.2 to v1.4.0 minor
   See changes: php-parallel-lint/PHP-Parallel-Lint@v1.3.2...v1.4.0
   Release notes: https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/tag/v1.4.0

 - phpstan/phpstan updated from 1.10.64 to 1.10.66 patch
   See changes: phpstan/phpstan@1.10.64...1.10.66
   Release notes: https://github.com/phpstan/phpstan/releases/tag/1.10.66

 - roave/security-advisories updated from dev-latest@1054e91 to dev-latest@6900b81
   See changes: Roave/SecurityAdvisories@1054e91...6900b81
 - nette/http updated from v3.2.4 to v3.3.0 minor
   See changes: nette/http@v3.2.4...v3.3.0
   Release notes: https://github.com/nette/http/releases/tag/v3.3.0
…'s $expire param

Could be reverted if this PR is merged and released nette/http#237
> Declaration of MichalSpacekCz\Http\SessionSectionDeprecatedGetSet::get(string $name): void must be compatible with Nette\Http\SessionSection::get(string $name): mixed
Resolve Psalm's
> ERROR: PossiblyUndefinedMethod "Method ... does not exist"
 - nette/forms updated from v3.1.15 to v3.2.1 minor
   See changes: nette/forms@v3.1.15...v3.2.1
   Release notes: https://github.com/nette/forms/releases/tag/v3.2.1

 - nette/application updated from v3.1.14 to v3.2.1 minor
   See changes: nette/application@v3.1.14...v3.2.1
   Release notes: https://github.com/nette/application/releases/tag/v3.2.1
…ed `@internal` in parent

> ERROR: PropertyNotSetInConstructor - app/Form/UiForm.php:11:7 - Property MichalSpacekCz\Form\UiForm::$httpRequest is not defined in constructor of MichalSpacekCz\Form\UiForm or in any methods called in the constructor (see https://psalm.dev/074)
class UiForm extends Form
If not, Psalm then says the following but I have no idea why, the class method listed in the error doesn't expect what Psalm says it expects, the interface does, but that's not listed here:

> ERROR: InvalidArgument - app/EasterEgg/NetteCve202015227.php:84:62 - Argument 2 of Nette\Application\Routers\RouteList::addRoute expects array<array-key, mixed>, but 'Nette:micro' provided (see https://psalm.dev/004)
                $router->withModule('EasterEgg')->addRoute('/nette.micro', 'Nette:micro');

I have also moved the code to the EasterEgg namespace so it's all together, and added a test.
To let Psalm know that fetchAll() returns array of Rows, but then this started happening:

> ERROR: MethodSignatureMismatch - app/Test/Database/Database.php:109:31 - Argument 1 of MichalSpacekCz\Test\Database\Database::query has wrong type 'string', expecting 'string' as defined by Nette\Database\Explorer::query (see https://psalm.dev/042)
        public function query(string $sql, ...$params): ResultSet

So I had to add the other methods as well with `@psalm-param string $sql` in addition to `@param literal-string $sql`.
See vimeo/psalm#10870

But then all other errors, marked as "other issues" until now, are promoted to real errors so they have to be baselined. This could be reverted once the Psalm error is resolved somehow.
@spaze spaze self-assigned this Mar 30, 2024
…sion, again

Also adds a check that the config is the same in all files. I'd need to add `unformatPresenterClass()` somewhere somehow if it wasn't the duplicated config. And while that's a copy/pasta, with the test it's acceptable.

Partially rolls back #84, see efabrica-team/phpstan-latte#456 for a bit more details on what's going on.
@spaze spaze marked this pull request as ready for review March 31, 2024 02:26
@spaze spaze merged commit b5572a2 into main Mar 31, 2024
36 checks passed
@spaze spaze deleted the spaze/update-packages branch March 31, 2024 02:26
spaze added a commit that referenced this pull request Nov 11, 2024
Not needed when the two PHPStan extensions have been removed now.

Originally added in #296
spaze added a commit that referenced this pull request Nov 11, 2024
Not needed when the two PHPStan extensions have been removed now.

Originally added in #296
spaze added a commit that referenced this pull request Nov 11, 2024
Not needed when the two PHPStan extensions have been removed now.

Originally added in #296

Also removed `check-application-mapping (8.3)` check from the main branch rulesets.
spaze added a commit that referenced this pull request Nov 11, 2024
…#428)

Hopefully, I'll be able to bring them back rather sooner!

Deleted `check-application-mapping` script and related files too, originally added in #296, should also be added back when possible.

I have also deleted the following checks from main branch rulesets in GitHub, which should be added back eventually:
- `phpstan-latte-templates (8.3)`
- `check-application-mapping (8.3)`
spaze added a commit that referenced this pull request Jan 4, 2025
`composer validate` now throws a general warning:
"The version field is present, it is recommended to leave it out if the package is published on Packagist."

Although the package is not published on Packagist, but here we are. Composer was throwing a different error before, and that's why the version number was added.

Reverts commit a705191 #296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant