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 phpstan and psalm #829

Merged
merged 1 commit into from May 27, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -52,7 +52,7 @@
"cs-check": "phpcs --parallel=16 -p src/ tests/",
"cs-fix": "phpcbf --parallel=16 -p src/ tests/",
"stan": "phpstan analyse src/ && psalm.phar",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.5 psalm/phar:~4.22.0 && mv composer.backup composer.json",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.7 psalm/phar:~4.23.0 && mv composer.backup composer.json",
"test": "phpunit",
"test-coverage": "phpunit --coverage-clover=clover.xml"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Command/FixtureCommand.php
Expand Up @@ -23,7 +23,7 @@
use Cake\Console\ConsoleIo;
use Cake\Console\ConsoleOptionParser;
use Cake\Core\Configure;
use Cake\Database\Exception;
use Cake\Database\Exception\DatabaseException;
use Cake\Database\Schema\TableSchemaInterface;
use Cake\Datasource\ConnectionManager;
use Cake\Utility\Inflector;
Expand Down Expand Up @@ -160,7 +160,7 @@ protected function bake(string $model, string $useTable, Arguments $args, Consol

try {
$data = $this->readSchema($model, $useTable);
} catch (Exception $e) {
} catch (DatabaseException $e) {
$this->getTableLocator()->remove($model);
$useTable = Inflector::underscore($model);
$table = $useTable;
Expand Down
4 changes: 2 additions & 2 deletions src/Command/ModelCommand.php
Expand Up @@ -24,7 +24,7 @@
use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Database\Driver\Sqlserver;
use Cake\Database\Exception;
use Cake\Database\Exception\DatabaseException;
use Cake\Database\Schema\CachedCollection;
use Cake\Database\Schema\TableSchema;
use Cake\Database\Schema\TableSchemaInterface;
Expand Down Expand Up @@ -956,7 +956,7 @@ public function getCounterCache(Table $model): array

try {
$otherSchema = $otherModel->getSchema();
} catch (Exception $e) {
} catch (DatabaseException $e) {
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Command/TestCommand.php
Expand Up @@ -23,7 +23,7 @@
use Cake\Console\Shell;
use Cake\Controller\Controller;
use Cake\Core\Configure;
use Cake\Core\Exception\Exception;
use Cake\Core\Exception\CakeException;
use Cake\Core\Plugin;
use Cake\Filesystem\Filesystem;
use Cake\Http\Response;
Expand Down Expand Up @@ -399,12 +399,12 @@ public function getSubspacePath(string $type): string
*
* @param string $type The type of thing having a test generated.
* @return string
* @throws \Cake\Core\Exception\Exception When invalid object types are requested.
* @throws \Cake\Core\Exception\CakeException When invalid object types are requested.
*/
public function mapType(string $type): string
{
if (empty($this->classTypes[$type])) {
throw new Exception('Invalid object type: ' . $type);
throw new CakeException('Invalid object type: ' . $type);
}

return $this->classTypes[$type];
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/CommonOptionsTrait.php
Expand Up @@ -31,7 +31,7 @@
trait CommonOptionsTrait
{
/**
* @var string|null
* @var string
*/
public $plugin;

Expand Down
2 changes: 1 addition & 1 deletion src/View/BakeView.php
Expand Up @@ -69,7 +69,7 @@ public function initialize(): void
*
* @param string|null $template Name of view file to use, or a template string to render
* @param string|false|null $layout Layout to use. Not used, for consistency with other views only
* @throws \Cake\Core\Exception\Exception If there is an error in the view.
* @throws \Cake\Core\Exception\CakeException If there is an error in the view.
* @return string Rendered content.
*/
public function render(?string $template = null, $layout = null): string
Expand Down