Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ jobs:

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon --error-format=checkstyle | cs2pr
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"mobiledetect/mobiledetectlib": "^4.8.03"
},
"require-dev": {
"cakedc/cakephp-phpstan": "^4.0",
"cakephp/bake": "^3.0.0",
"cakephp/cakephp-codesniffer": "^5.0",
"cakephp/debug_kit": "^5.0.0",
"dereuromark/cakephp-ide-helper": "dev-master",
"josegonzalez/dotenv": "^4.0",
"phpunit/phpunit": "^10.5.5 || ^11.1.3 || ^12.1"
},
Expand Down Expand Up @@ -58,6 +60,10 @@
],
"cs-check": "phpcs --colors -p",
"cs-fix": "phpcbf --colors -p",
"test": "phpunit --colors=always"
"test": "phpunit --colors=always",
"annotate": "bin/cake annotate all",
"illuminate": "bin/cake illuminate code",
"phpstan": "phpstan analyse",
"phpstan-baseline": "phpstan --generate-baseline"
}
}
207 changes: 199 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/.env.ddev
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export DATABASE_URL="mysql://db:db@db:3306/db"
# Uncomment these to define logging configuration via environment variables.
#export LOG_DEBUG_URL="file:///path/to/logs/?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
#export LOG_ERROR_URL="file:///path/to/logs/?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"
export DEBUG_KIT_SAFE_TLD="site"
export APP_FULL_BASE_URL="https://plugins.cakephp.org.ddev.site"
export DEBUG_KIT_SAFE_TLD="site"
7 changes: 7 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,11 @@
'Migrations' => [
'add_timestamps_use_datetime' => true,
],

'IdeHelper' => [
'tableBehaviors' => true,
'arrayAsGenerics' => true,
'objectAsGenerics' => true,
'assocsAsGenerics' => true,
],
];
1 change: 1 addition & 0 deletions config/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@
'Tags',
'ADmad/SocialAuth',
'Authentication',
'IdeHelper',
];
6 changes: 4 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
includes:
- vendor/cakedc/cakephp-phpstan/extension.neon

parameters:
level: 8
level: 5
treatPhpDocTypesAsCertain: false
checkGenericClassInNonGenericObjectType: false
bootstrapFiles:
- config/bootstrap.php
paths:
Expand Down
3 changes: 2 additions & 1 deletion src/Command/SyncPackagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public function execute(Arguments $args, ConsoleIo $io)
}

// Remove packages that were not touched
/** @var \Cake\ORM\ResultSet<array-key, \App\Model\Entity\Package> $toDeletePackages */
$toDeletePackages = $packagesTable->find()->where(['id NOT IN' => $touchedIds])->all();
foreach ($toDeletePackages as $package) {
if (!$packagesTable->delete($package)) {
Expand Down Expand Up @@ -241,7 +242,7 @@ private function hasExplicitCakePhpDependency(array $tags): bool
* @param array $meta The meta array to adjust
* @param string $packageConstraint The meta array which contains the current version strings
* @param string $tagPrefix The prefix which should be used for the tag
* @param array<string, array<int>> $versions The versions to check
* @param array<array-key, array<int>> $versions The versions to check
* @return array
*/
private function appendVersionTags(
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* will inherit them.
*
* @link https://book.cakephp.org/5/en/controllers.html#the-app-controller
* @property \Search\Controller\Component\SearchComponent $Search
* @property \Authentication\Controller\Component\AuthenticationComponent $Authentication
*/
class AppController extends Controller
{
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/ErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/
class ErrorController extends AppController
{
protected ?string $defaultTable = '';

/**
* Initialization hook method.
*
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/PackagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public function autocomplete(): Response
->withStringBody(json_encode([], JSON_THROW_ON_ERROR));
}

/** @var \Cake\ORM\ResultSet<array-key, \App\Model\Entity\Package> $packages */
$packages = $this->Packages
->find('autocomplete', search: $q)
->all();
Expand Down Expand Up @@ -174,8 +175,9 @@ protected function hasActiveFilterValue(mixed $value): bool
}

/**
* @param array<string, string> $tags
* @return array<string, string>
* @param array $tags
* @param string $prefix
* @return array
*/
protected function sortVersionTags(array $tags, string $prefix): array
{
Expand Down
Loading
Loading