Skip to content

Commit

Permalink
Replaced is_a() by a more specific instanceof check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Jun 4, 2023
1 parent ec73b36 commit 645d7ba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
namespace APP\controllers\grid\catalogEntry;

use APP\core\Application;
use APP\publicationFormat\PublicationFormat;
use PKP\controllers\api\file\linkAction\AddFileLinkAction;
use PKP\controllers\grid\DataObjectGridCellProvider;
use PKP\controllers\grid\files\fileList\linkAction\SelectFilesLinkAction;
Expand Down Expand Up @@ -97,8 +98,7 @@ public function getTemplateVarsFromRowColumn($row, $column)
{
$data = $row->getData();

if (is_a($data, 'Representation')) {
/** @var Representation $data */
if ($data instanceof PublicationFormat) {
switch ($column->getId()) {
case 'indent': return [];
case 'name':
Expand Down Expand Up @@ -151,7 +151,7 @@ public function getCellActions($request, $row, $column, $position = GridHandler:
{
$data = $row->getData();
$router = $request->getRouter();
if (is_a($data, 'Representation')) {
if ($data instanceof PublicationFormat) {
switch ($column->getId()) {
case 'isAvailable':
return [new LinkAction(
Expand Down

0 comments on commit 645d7ba

Please sign in to comment.