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

Reduce "Cannot access property" errors detected by PHPStan #111

Merged
merged 1 commit into from
Nov 24, 2024
Merged
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
9 changes: 4 additions & 5 deletions src/Supporting/FileMakerRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*
* @package INTER-Mediator\FileMakerServer\RESTAPI
* @link https://github.com/msyk/FMDataAPI GitHub Repository
* @property string $<<field_name>> The field value named as the property name.

Check failure on line 15 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

PHPDoc tag @Property has invalid value (string $<<field_name>> The field value named as the property name.): Unexpected token "$<<field_name>>", expected variable at offset 383 on line 8

Check failure on line 15 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

PHPDoc tag @Property has invalid value (string $<<field_name>> The field value named as the property name.): Unexpected token "$<<field_name>>", expected variable at offset 383 on line 8
* @property FileMakerRelation $<<portal_name>> FileMakerRelation object associated with the property name.

Check failure on line 16 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

PHPDoc tag @Property has invalid value (FileMakerRelation $<<portal_name>> FileMakerRelation object associated with the property name. The table occurrence name of the portal can be the 'portal_name,' and also the object name of the portal.): Unexpected token "$<<portal_name>>", expected variable at offset 474 on line 9

Check failure on line 16 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

PHPDoc tag @Property has invalid value (FileMakerRelation $<<portal_name>> FileMakerRelation object associated with the property name. The table occurrence name of the portal can be the 'portal_name,' and also the object name of the portal.): Unexpected token "$<<portal_name>>", expected variable at offset 474 on line 9
* The table occurrence name of the portal can be the 'portal_name,' and also the object name of the portal.
* @version 32
* @author Masayuki Nii <[email protected]>
Expand Down Expand Up @@ -107,7 +107,7 @@
*/
public function getTargetTable(): null|string
{
return ($this->dataInfo) ? $this->dataInfo->table : null;
return $this->dataInfo->table ?? null;
}

/**
Expand All @@ -118,8 +118,7 @@
*/
public function getTotalCount(): null|int
{
return ($this->dataInfo && property_exists($this->dataInfo, 'totalRecordCount')) ?
$this->dataInfo->totalRecordCount : null;
return $this->dataInfo->totalRecordCount ?? null;
}

/**
Expand All @@ -131,7 +130,7 @@
*/
public function getFoundCount(): null|int
{
return ($this->dataInfo) ? $this->dataInfo->foundCount : null;
return $this->dataInfo->foundCount ?? null;
}

/**
Expand All @@ -143,7 +142,7 @@
*/
public function getReturnedCount(): null|int
{
return ($this->dataInfo) ? $this->dataInfo->returnedCount : null;
return $this->dataInfo->returnedCount ?? null;
}

/**
Expand Down Expand Up @@ -362,7 +361,7 @@
break;
case 'RECORD':
if (property_exists($this->data, 'portalData')) {
foreach ($this->data->portalData as $name => $val) {

Check failure on line 364 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

Cannot access property $portalData on array|object.

Check failure on line 364 in src/Supporting/FileMakerRelation.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

Cannot access property $portalData on array|object.
$list[] = $name;
}
}
Expand Down
Loading