Skip to content

Commit

Permalink
Merge pull request #3037 from acrobat/use-phpstan-stable
Browse files Browse the repository at this point in the history
[AllBundles] Upgrade phpstan to stable release
  • Loading branch information
acrobat committed Nov 18, 2021
2 parents 21c113d + 1cb6aab commit e9e82ee
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: none

- name: Install Composer Dependencies
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -90,8 +90,8 @@
"symfony/phpunit-bridge": "^5.2",
"phpunit/phpunit": "^8.5|^9.5",
"friendsofphp/php-cs-fixer": "^2.13",
"phpstan/phpstan": "^0.12.18",
"phpstan/phpstan-doctrine": "^0.12.10"
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-doctrine": "^1.0"
},
"replace": {
"kunstmaan/admin-bundle": "self.version",
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Expand Up @@ -9,7 +9,7 @@ parameters:
- .build/stubs/RoleInterface.php
- .build/stubs/MailerInterface.php

excludes_analyse:
excludePaths:
- src/Kunstmaan/*/Tests/*
- src/Kunstmaan/*/vendor/*
- src/Kunstmaan/BehatBundle
Expand Down
Expand Up @@ -116,7 +116,7 @@ private function generateIdentifier(TabInterface $tab): string
public function addTab(TabInterface $tab, $position = null)
{
$identifier = $tab->getIdentifier();
if (!$identifier || empty($identifier)) {
if (empty($identifier)) {
$tab->setIdentifier($this->generateIdentifier($tab));
}

Expand Down
Expand Up @@ -94,22 +94,22 @@ protected function doExportAction(AbstractAdminListConfigurator $configurator, $
* Creates and processes the form to add a new Entity
*
* @param AbstractAdminListConfigurator $configurator The adminlist configurator
* @param string $type The type to add
* @param string|null $type The type to add
* @param Request|null $request
*
* @throws AccessDeniedHttpException
*
* @return Response
*/
protected function doAddAction(AbstractAdminListConfigurator $configurator, $type = null, Request $request)
protected function doAddAction(AbstractAdminListConfigurator $configurator, $type, Request $request)
{
if (!$configurator->canAdd()) {
throw $this->createAccessDeniedException('You do not have sufficient rights to access this page.');
}

/* @var EntityManager $em */
$em = $this->getEntityManager();
$entityName = isset($type) ? $type : $configurator->getRepositoryName();
$entityName = $type ?? $configurator->getRepositoryName();

$classMetaData = $em->getClassMetadata($entityName);
// Creates a new instance of the mapped class, without invoking the constructor.
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/DashboardBundle/Widget/DashboardWidget.php
Expand Up @@ -68,7 +68,7 @@ public function resolvedController()
$methodAnnotations = $annotationReader->getMethodAnnotations($reflectionMethod);
foreach ($methodAnnotations as $annotation) {
if ($annotation instanceof Route) {
if (empty($annotation)) {
if (null === $annotation->getName()) {
throw new \Exception('The name is not configured in the annotation');
}

Expand Down
Expand Up @@ -44,7 +44,7 @@ public function __construct(ObjectManager $objectManager, CurrentValueContainer
*/
public function transform($entity)
{
if (empty($entity)) {
if (null === $entity) {
return '';
}
if (!\is_object($entity)) {
Expand Down
Expand Up @@ -185,9 +185,9 @@ public function hasPageParts(HasPagePartsInterface $page, $context = 'main')
}

/**
* @param int $id The id
* @param string $context The context
* @param int $sequenceNumber The sequence number
* @param int $id The id
* @param string|null $context The context
* @param int $sequenceNumber The sequence number
*
* @return PagePartInterface
*/
Expand Down

0 comments on commit e9e82ee

Please sign in to comment.